Skip to content

Commit

Permalink
Merge branch 'appsmithorg:release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeral-Zhang authored Oct 16, 2024
2 parents eab6f41 + 6a1441f commit 552dbf1
Show file tree
Hide file tree
Showing 43 changed files with 1,469 additions and 385 deletions.
11 changes: 9 additions & 2 deletions app/client/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
function parseConfig() {
return "";
}

const LOG_LEVELS = ["debug", "error"];
const CONFIG_LOG_LEVEL_INDEX = 1;

module.exports = {
setupFiles: ["jest-canvas-mock", "<rootDir>/test/__mocks__/reactMarkdown.tsx"],
setupFiles: [
"jest-canvas-mock",
"<rootDir>/test/__mocks__/reactMarkdown.tsx",
],
roots: ["<rootDir>/src"],
transform: {
"^.+\\.(png|js|ts|tsx)$": "ts-jest",
Expand Down Expand Up @@ -98,7 +102,10 @@ module.exports = {
fusioncharts: {
licenseKey: parseConfig("__APPSMITH_FUSIONCHARTS_LICENSE_KEY__"),
},
enableMixpanel: parseConfig("__APPSMITH_SEGMENT_KEY__"),
mixpanel: {
enabled: parseConfig("__APPSMITH_SEGMENT_KEY__"),
apiKey: parseConfig("__APPSMITH_MIXPANEL_KEY__"),
},
algolia: {
apiId: parseConfig("__APPSMITH_ALGOLIA_API_ID__"),
apiKey: parseConfig("__APPSMITH_ALGOLIA_API_KEY__"),
Expand Down
2 changes: 2 additions & 0 deletions app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"memoize-one": "^6.0.0",
"micro-memoize": "^4.0.10",
"microdiff": "^1.4.0",
"mixpanel-browser": "^2.55.1",
"moment": "2.29.4",
"moment-timezone": "^0.5.35",
"nanoid": "^2.0.4",
Expand Down Expand Up @@ -261,6 +262,7 @@
"@types/jest": "^27.4.1",
"@types/jshint": "^2.12.0",
"@types/lodash": "^4.14.120",
"@types/mixpanel-browser": "^2.50.1",
"@types/moment-timezone": "^0.5.10",
"@types/nanoid": "^2.0.0",
"@types/node": "^10.12.18",
Expand Down
5 changes: 4 additions & 1 deletion app/client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@
fusioncharts: {
licenseKey: parseConfig('{{env "APPSMITH_FUSIONCHARTS_LICENSE_KEY"}}'),
},
enableMixpanel: parseConfig('{{env "APPSMITH_SEGMENT_KEY"}}'),
mixpanel: {
enabled: parseConfig('{{env "APPSMITH_SEGMENT_KEY"}}'),
apiKey: parseConfig('{{env "APPSMITH_MIXPANEL_KEY"}}'),
},
algolia: {
apiId: parseConfig('{{env "APPSMITH_ALGOLIA_API_ID"}}'),
apiKey: parseConfig('{{env "APPSMITH_ALGOLIA_API_KEY"}}'),
Expand Down
34 changes: 0 additions & 34 deletions app/client/src/Heartbeat.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { useCallback } from "react";
import { MenuItem } from "@appsmith/ads";
import { createMessage, DOCUMENTATION } from "ee/constants/messages";
import { DocsLink, openDoc } from "constants/DocumentationLinks";
import { usePluginActionContext } from "../../../PluginActionContext";

export const DocsMenuItem = () => {
const { plugin } = usePluginActionContext();
const onDocsClick = useCallback(() => {
openDoc(DocsLink.QUERY, plugin.documentationLink, plugin.name);
}, [plugin]);

if (!plugin.documentationLink) {
return null;
}

return (
<MenuItem
className="t--datasource-documentation-link"
onSelect={onDocsClick}
startIcon="book-line"
>
{createMessage(DOCUMENTATION)}
</MenuItem>
);
};
2 changes: 2 additions & 0 deletions app/client/src/PluginActionEditor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export type {
export { default as PluginActionNameEditor } from "./components/PluginActionNameEditor";

export type { PluginActionEditorState } from "./store/pluginEditorReducer";

export { DocsMenuItem } from "./components/PluginActionToolbar/components/DocsMenuItem";
17 changes: 16 additions & 1 deletion app/client/src/UITelemetry/generateWebWorkerTraces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface WebworkerSpanData {
//to regular otlp telemetry data and subsequently exported to our telemetry collector
export const newWebWorkerSpanData = (
spanName: string,
attributes: SpanAttributes,
attributes: SpanAttributes = {},
): WebworkerSpanData => {
return {
attributes,
Expand All @@ -28,6 +28,21 @@ const addEndTimeForWebWorkerSpanData = (span: WebworkerSpanData) => {
span.endTime = Date.now();
};

export const profileAsyncFn = async <T>(
spanName: string,
fn: () => Promise<T>,
allSpans: Record<string, WebworkerSpanData | SpanAttributes>,
attributes: SpanAttributes = {},
) => {
const span = newWebWorkerSpanData(spanName, attributes);
const res: T = await fn();

addEndTimeForWebWorkerSpanData(span);
allSpans[spanName] = span;

return res;
};

export const profileFn = <T>(
spanName: string,
attributes: SpanAttributes = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function usePluginActionResponseTabs() {
actionName={action.name}
actionSource={actionSource}
currentActionConfig={action}
isRunDisabled={blockExecution}
isRunning={isRunning}
onRunClick={onRunClick}
runErrorMessage={""} // TODO
Expand Down
26 changes: 18 additions & 8 deletions app/client/src/ce/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export interface INJECTED_CONFIGS {
fusioncharts: {
licenseKey: string;
};
enableMixpanel: boolean;
mixpanel: {
enabled: boolean;
apiKey: string;
};
cloudHosting: boolean;
algolia: {
apiId: string;
Expand Down Expand Up @@ -77,9 +80,12 @@ export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => {
fusioncharts: {
licenseKey: process.env.REACT_APP_FUSIONCHARTS_LICENSE_KEY || "",
},
enableMixpanel: process.env.REACT_APP_SEGMENT_KEY
? process.env.REACT_APP_SEGMENT_KEY.length > 0
: false,
mixpanel: {
enabled: process.env.REACT_APP_SEGMENT_KEY
? process.env.REACT_APP_SEGMENT_KEY.length > 0
: false,
apiKey: process.env.REACT_APP_MIXPANEL_KEY || "",
},
algolia: {
apiId: process.env.REACT_APP_ALGOLIA_API_ID || "",
apiKey: process.env.REACT_APP_ALGOLIA_API_KEY || "",
Expand Down Expand Up @@ -161,6 +167,10 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
ENV_CONFIG.segment.apiKey,
APPSMITH_FEATURE_CONFIGS?.segment.apiKey,
);
const mixpanel = getConfig(
ENV_CONFIG.mixpanel.apiKey,
APPSMITH_FEATURE_CONFIGS?.mixpanel.apiKey,
);
const newRelicAccountId = getConfig(
ENV_CONFIG.newRelic.accountId,
APPSMITH_FEATURE_CONFIGS?.newRelic.accountId,
Expand Down Expand Up @@ -278,10 +288,10 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
enabled: googleRecaptchaSiteKey.enabled,
apiKey: googleRecaptchaSiteKey.value,
},
enableMixpanel:
ENV_CONFIG.enableMixpanel ||
APPSMITH_FEATURE_CONFIGS?.enableMixpanel ||
false,
mixpanel: {
enabled: segment.enabled,
apiKey: mixpanel.value,
},
cloudHosting:
ENV_CONFIG.cloudHosting ||
APPSMITH_FEATURE_CONFIGS?.cloudHosting ||
Expand Down
5 changes: 4 additions & 1 deletion app/client/src/ce/configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export interface AppsmithUIConfigs {
snippetIndex: string;
};

enableMixpanel: boolean;
mixpanel: {
enabled: boolean;
apiKey: string;
};

cloudHosting: boolean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { PluginActionToolbar } from "PluginActionEditor";
import AppPluginActionMenu from "./PluginActionMoreActions";
import { ToolbarMenu } from "./ToolbarMenu";

const AppPluginActionToolbar = () => {
return <PluginActionToolbar menuContent={<AppPluginActionMenu />} />;
return <PluginActionToolbar menuContent={<ToolbarMenu />} />;
};

export default AppPluginActionToolbar;
Loading

0 comments on commit 552dbf1

Please sign in to comment.