From 61c90ce8d4fad15fdbe571dbfffac5201046a481 Mon Sep 17 00:00:00 2001 From: albinAppsmith <87797149+albinAppsmith@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:31:54 +0530 Subject: [PATCH 1/6] fix: Added rowGap and colGap as PropsToBeCssPrefixPrepended in Box component (#38096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description rowGap and colGap was not accepting standard `spaces` values in Flex and Grid component. This PR fix that issue. Fixes #38097 ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 16b48def7322d12c7cbd4ab34049c6d1ea58b0b1 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Wed, 11 Dec 2024 10:01:27 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Introduced new CSS properties `rowGap` and `columnGap` for enhanced grid layout management within the design system. --- app/client/packages/design-system/ads/src/Box/Box.constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/client/packages/design-system/ads/src/Box/Box.constants.ts b/app/client/packages/design-system/ads/src/Box/Box.constants.ts index 2f270b1beedb..d7e13fd1342c 100644 --- a/app/client/packages/design-system/ads/src/Box/Box.constants.ts +++ b/app/client/packages/design-system/ads/src/Box/Box.constants.ts @@ -27,4 +27,6 @@ export const PropsToBeCssPrefixPrepended = [ "px", "py", "gap", + "rowGap", + "columnGap", ]; From 0a046edfa2b59794fbd002edb2355a03c6599d35 Mon Sep 17 00:00:00 2001 From: Vemparala Surya Vamsi <121419957+vsvamsi1@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:07:08 +0530 Subject: [PATCH 2/6] chore: change the klona strategy of setting of values to eval Tree (#38033) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Changed the klona strategy of evalActionBindings and parsed values within evaluateTree to use klonaJSON instead of klona. Seeing a 10-20% reduction in webworker scripting and a 4 second drop in LCP within a windows machine. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: > Commit: dbe08f90ef23d24131f27b7731c953a584fdd61f > Workflow: `PR Automation test suite` > Tags: `@tag.All` > Spec: `` >
Wed, 11 Dec 2024 11:10:47 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Enhanced error handling during data evaluation, providing better context for debugging. - Improved logic for evaluating dynamic properties within the data tree. - **Bug Fixes** - Addressed issues with data cloning methods to ensure more reliable data handling. - **Refactor** - Updated method signatures for improved clarity and consistency across the evaluation processes. --- .../workers/Evaluation/__tests__/evaluation.test.ts | 8 ++++---- .../src/workers/common/DataTreeEvaluator/index.ts | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/client/src/workers/Evaluation/__tests__/evaluation.test.ts b/app/client/src/workers/Evaluation/__tests__/evaluation.test.ts index ad1a2936e742..258a39c8fbf2 100644 --- a/app/client/src/workers/Evaluation/__tests__/evaluation.test.ts +++ b/app/client/src/workers/Evaluation/__tests__/evaluation.test.ts @@ -593,8 +593,8 @@ describe("DataTreeEvaluator", () => { ); evaluator.evalAndValidateFirstTree(); // Hard check to not regress on the number of clone operations. Try to improve this number. - expect(klonaFullSpy).toBeCalledTimes(40); - expect(klonaJsonSpy).toBeCalledTimes(3); + expect(klonaFullSpy).toBeCalledTimes(15); + expect(klonaJsonSpy).toBeCalledTimes(28); }); it("Evaluates a binding in first run", () => { @@ -1115,7 +1115,7 @@ describe("DataTreeEvaluator", () => { unEvalUpdates, ); // Hard check to not regress on the number of clone operations. Try to improve this number. - expect(klonaFullSpy).toBeCalledTimes(6); - expect(klonaJsonSpy).toBeCalledTimes(2); + expect(klonaFullSpy).toBeCalledTimes(4); + expect(klonaJsonSpy).toBeCalledTimes(4); }); }); diff --git a/app/client/src/workers/common/DataTreeEvaluator/index.ts b/app/client/src/workers/common/DataTreeEvaluator/index.ts index 095d9bd25798..f14873229a2d 100644 --- a/app/client/src/workers/common/DataTreeEvaluator/index.ts +++ b/app/client/src/workers/common/DataTreeEvaluator/index.ts @@ -1207,7 +1207,7 @@ export default class DataTreeEvaluator { ); set(contextTree, fullPropertyPath, parsedValue); - set(safeTree, fullPropertyPath, klona(parsedValue)); + set(safeTree, fullPropertyPath, klonaJSON(parsedValue)); staleMetaIds = staleMetaIds.concat( getStaleMetaStateIds({ @@ -1253,7 +1253,7 @@ export default class DataTreeEvaluator { if (!requiresEval) continue; set(contextTree, fullPropertyPath, evalPropertyValue); - set(safeTree, fullPropertyPath, klona(evalPropertyValue)); + set(safeTree, fullPropertyPath, klonaJSON(evalPropertyValue)); break; } case ENTITY_TYPE.JSACTION: { @@ -1290,7 +1290,7 @@ export default class DataTreeEvaluator { * Their evaluated values need to be reset only when the variable is modified by the user. * When uneval value of a js variable hasn't changed, it means that the previously evaluated values are in both trees already */ if (!skipVariableValueAssignment) { - const valueForSafeTree = klona(evalValue); + const valueForSafeTree = klonaJSON(evalValue); set(contextTree, fullPropertyPath, evalValue); set(safeTree, fullPropertyPath, valueForSafeTree); @@ -1305,7 +1305,7 @@ export default class DataTreeEvaluator { } default: set(contextTree, fullPropertyPath, evalPropertyValue); - set(safeTree, fullPropertyPath, klona(evalPropertyValue)); + set(safeTree, fullPropertyPath, klonaJSON(evalPropertyValue)); } } } catch (error) { @@ -1793,7 +1793,7 @@ export default class DataTreeEvaluator { bindings: string[], executionParams?: Record | string, ) { - const dataTree = klona(this.evalTree); + const dataTree = klonaJSON(this.evalTree); // We might get execution params as an object or as a string. // If the user has added a proper object (valid case) it will be an object // If they have not added any execution params or not an object From 507ed6fba2c0581e92b50fbb15900b3dae95f53a Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Wed, 11 Dec 2024 18:40:16 +0530 Subject: [PATCH 3/6] fixing the client build failure on prod --- .../components/DatasourceTab/Datasource.tsx | 5 +++++ .../DatasourceTab/DatasourceInfo.tsx | 4 ++++ .../DatasourceTab/DatasourceSelector/index.tsx | 18 +++++++++--------- .../DatasourceTab/DatasourceTables.tsx | 4 ++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/Datasource.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/Datasource.tsx index 0771efb25e93..1162f39978a0 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/Datasource.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/Datasource.tsx @@ -25,6 +25,7 @@ import { BOTTOMBAR_HEIGHT } from "./constants"; import { useEditorType } from "ee/hooks"; import { useParentEntityInfo } from "ee/hooks/datasourceEditorHooks"; import DatasourceInfo from "./DatasourceInfo"; +import { getPlugin } from "ee/selectors/entitiesSelector"; interface Props { datasourceId: string; @@ -45,6 +46,8 @@ const Datasource = (props: Props) => { getPluginIdFromDatasourceId(state, props.datasourceId), ); + const plugin = useSelector((state) => getPlugin(state, pluginId || "")); + const editorType = useEditorType(location.pathname); const { parentEntityId } = useParentEntityInfo(editorType); @@ -143,6 +146,7 @@ const Datasource = (props: Props) => { { datasourceId={props.datasourceId} datasourceName={props.datasourceName} datasourceStructure={datasourceStructure} + plugin={plugin} selectedTable={selectedTable} setSelectedTable={setSelectedTable} /> diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx index e671e70d4afc..acfa33571870 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx @@ -10,16 +10,19 @@ import { getQueryParams } from "utils/URLUtils"; import history from "utils/history"; import { useEditorType } from "ee/hooks"; import { useParentEntityInfo } from "ee/hooks/datasourceEditorHooks"; +import type { Plugin } from "api/PluginApi"; interface Props { datasourceId: string; datasourceName: string; showEditButton: boolean; + plugin?: Plugin; } const DatasourceInfo = ({ datasourceId, datasourceName, + plugin, showEditButton, }: Props) => { const editorType = useEditorType(location.pathname); @@ -50,6 +53,7 @@ const DatasourceInfo = ({ {showEditButton && ( diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceSelector/index.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceSelector/index.tsx index 6f3ef2f510f1..252643232aaf 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceSelector/index.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceSelector/index.tsx @@ -1,6 +1,5 @@ import React from "react"; -import { UIComponentTypes } from "api/PluginApi"; -import { usePluginActionContext } from "PluginActionEditor/PluginActionContext"; +import { UIComponentTypes, type Plugin } from "api/PluginApi"; import ApiDatasourceSelector from "./ApiDatasourceSelector"; import QueryDatasourceSelector from "./QueryDatasourceSelector"; import { @@ -16,16 +15,17 @@ const API_FORM_COMPONENTS = [ export interface DatasourceProps { datasourceId: string; datasourceName: string; + plugin?: Plugin; } const DatasourceSelector = (props: DatasourceProps) => { - const { plugin } = usePluginActionContext(); - - return API_FORM_COMPONENTS.includes(plugin.uiComponent) ? ( - - ) : ( - - ); + return props.plugin ? ( + API_FORM_COMPONENTS.includes(props.plugin.uiComponent) ? ( + + ) : ( + + ) + ) : null; }; export default DatasourceSelector; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceTables.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceTables.tsx index 1664ff7667aa..ef23751816ef 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceTables.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceTables.tsx @@ -9,12 +9,14 @@ import { refreshDatasourceStructure } from "actions/datasourceActions"; import { useDispatch } from "react-redux"; import { SchemaTableContainer } from "./styles"; import DatasourceInfo from "./DatasourceInfo"; +import type { Plugin } from "api/PluginApi"; interface Props { datasourceId: string; datasourceName: string; currentActionId: string; datasourceStructure: DatasourceStructure; + plugin?: Plugin; setSelectedTable: (table: string) => void; selectedTable: string | undefined; } @@ -24,6 +26,7 @@ const DatasourceTables = ({ datasourceId, datasourceName, datasourceStructure, + plugin, selectedTable, setSelectedTable, }: Props) => { @@ -56,6 +59,7 @@ const DatasourceTables = ({