From f30e4d06ebee9e1103631246c915ecfd1bba8280 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:52:30 +0530 Subject: [PATCH 01/13] Legend not showing up in Chart fix (#2479) --- frontend/src/Editor/Components/Chart.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/Editor/Components/Chart.jsx b/frontend/src/Editor/Components/Chart.jsx index 3491b4d051..d9080679b4 100644 --- a/frontend/src/Editor/Components/Chart.jsx +++ b/frontend/src/Editor/Components/Chart.jsx @@ -103,11 +103,13 @@ export const Chart = function Chart({ color: fontColor, }, }, + showlegend: chartLayout.showlegend ?? false, legend: { text: chartTitle, font: { color: fontColor, }, + ...chartLayout.legend, }, xaxis: { showgrid: showGridLines, From 0be0e2cb82cc2735b33e395811509ba273a3e42b Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:53:17 +0530 Subject: [PATCH 02/13] Listview selected row lagging 1 step behind (#2480) --- frontend/src/AppBuilder/Widgets/Listview.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/Widgets/Listview.jsx b/frontend/src/AppBuilder/Widgets/Listview.jsx index 5f5ddac261..301171677f 100644 --- a/frontend/src/AppBuilder/Widgets/Listview.jsx +++ b/frontend/src/AppBuilder/Widgets/Listview.jsx @@ -252,7 +252,7 @@ export const Listview = function Listview({ style={{ position: 'relative', height: `${rowHeight}px`, width: `${100 / positiveColumns}%` }} key={index} // data-cy={`${String(component.name).toLowerCase()}-row-${index}`} - onClick={(event) => { + onClickCapture={(event) => { onRecordOrRowClicked(index); }} > From 44ff38cc109d77ab26c48a083dfaf651a1f3032a Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:53:44 +0530 Subject: [PATCH 03/13] Dark mode auto alignment issue fix (#2481) --- frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx | 2 +- .../src/AppBuilder/AppCanvas/AutoComputeMobileLayoutAlert.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx index 1c218596b1..d580016912 100644 --- a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx +++ b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx @@ -87,7 +87,7 @@ export const AppCanvas = ({ moduleId, appId, isViewerSidebarPinned }) => { }} className={`app-${appId}`} > - + {creationMode === 'GIT' && } {creationMode !== 'GIT' && } diff --git a/frontend/src/AppBuilder/AppCanvas/AutoComputeMobileLayoutAlert.jsx b/frontend/src/AppBuilder/AppCanvas/AutoComputeMobileLayoutAlert.jsx index 4290c2e8db..a36209e525 100644 --- a/frontend/src/AppBuilder/AppCanvas/AutoComputeMobileLayoutAlert.jsx +++ b/frontend/src/AppBuilder/AppCanvas/AutoComputeMobileLayoutAlert.jsx @@ -10,7 +10,7 @@ import useConfirm from '@/AppBuilder/QueryManager/QueryEditors/TooljetDatabase/C import { diff } from 'deep-object-diff'; import { isEmpty } from 'lodash'; -export default function AutoComputeMobileLayoutAlert({ currentLayout }) { +export default function AutoComputeMobileLayoutAlert({ currentLayout, darkMode }) { const currentPageComponents = useStore((state) => state.getCurrentPageComponents(), shallow); const isAutoMobileLayout = useStore((state) => state.getIsAutoMobileLayout(), shallow); const turnOffAutoComputeLayout = useStore((state) => state.turnOffAutoComputeLayout, shallow); @@ -67,7 +67,7 @@ export default function AutoComputeMobileLayoutAlert({ currentLayout }) { } return ( <> - +
Date: Fri, 25 Oct 2024 12:39:14 +0530 Subject: [PATCH 04/13] Fixed delete confirmation popping up while clicking backspace on canvas (#2504) --- frontend/src/AppBuilder/AppCanvas/HotkeyProvider.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/AppCanvas/HotkeyProvider.jsx b/frontend/src/AppBuilder/AppCanvas/HotkeyProvider.jsx index f45850d220..101ce149da 100644 --- a/frontend/src/AppBuilder/AppCanvas/HotkeyProvider.jsx +++ b/frontend/src/AppBuilder/AppCanvas/HotkeyProvider.jsx @@ -45,6 +45,13 @@ export const HotkeyProvider = ({ children, mode, currentLayout, canvasMaxWidth } } }; + const deleteComponents = () => { + const selectedComponents = getSelectedComponents(); + if (selectedComponents.length > 0) { + setWidgetDeleteConfirmation(true); + } + }; + useEffect(() => { const handleClick = (e) => { const modalContainer = document.getElementById('modal-container'); @@ -91,7 +98,7 @@ export const HotkeyProvider = ({ children, mode, currentLayout, canvasMaxWidth } handleEscapeKeyPress(); // clears the selected components break; case 'Backspace': - setWidgetDeleteConfirmation(true); // Delete opration -> First asks for a Confirmation + deleteComponents(); // Delete opration -> First asks for a Confirmation break; case 'KeyD': copyComponents({ isCloning: true }); // Clone/Duplicate operation From c55157afcd89bfad36cec79c5ebced0e5078ceb3 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:39:42 +0530 Subject: [PATCH 05/13] Fixed cut & paste causing duplicate container children mapping (#2508) --- frontend/src/AppBuilder/_stores/slices/componentsSlice.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/_stores/slices/componentsSlice.js b/frontend/src/AppBuilder/_stores/slices/componentsSlice.js index 19b278421a..bd50c02335 100644 --- a/frontend/src/AppBuilder/_stores/slices/componentsSlice.js +++ b/frontend/src/AppBuilder/_stores/slices/componentsSlice.js @@ -741,7 +741,9 @@ export const createComponentsSlice = (set, get) => ({ if (!state.containerChildrenMapping[parentId]) { state.containerChildrenMapping[parentId] = []; } - state.containerChildrenMapping[parentId].push(newComponent.id); + if (!state.containerChildrenMapping[parentId].includes(newComponent.id)) { + state.containerChildrenMapping[parentId].push(newComponent.id); + } const page = state.modules[moduleId].pages[state.currentPageIndex]; page.components[newComponent.id] = newComponent; }, skipUndoRedo), From f45463d889b571a25dc53edcf80b4a8f427837d3 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:40:17 +0530 Subject: [PATCH 06/13] Multi reference autocomplete fix (#2500) --- .../src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js b/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js index 3a4f2cf38e..e1d597c957 100644 --- a/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js +++ b/frontend/src/AppBuilder/CodeEditor/autocompleteExtensionConfig.js @@ -124,9 +124,7 @@ export const generateHints = (hints, totalReferences = 1, input, searchText) => const multiReferenceInSingleIndentifier = totalReferences == 1 && searchText !== currentWord; if (multiReferenceInSingleIndentifier) { - const splitAtSearchString = doc.toString().split(searchText)[0]; - const newFrom = splitAtSearchString.length; - + const newFrom = to - searchText.length; pickedCompletionConfig.from = newFrom; } else if (totalReferences > 1 && completion.type !== 'js_methods') { const splitIndex = from; From 1c83d010267ff2580c3c744e0ccb2fec8a523674 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:40:57 +0530 Subject: [PATCH 07/13] Fixed events missing on duplicating queries (#2499) --- .../src/AppBuilder/AppCanvas/appCanvasUtils.js | 2 +- .../AppBuilder/_stores/slices/dataQuerySlice.js | 16 ++++++++++++++++ .../src/AppBuilder/_stores/slices/eventsSlice.js | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/AppBuilder/AppCanvas/appCanvasUtils.js b/frontend/src/AppBuilder/AppCanvas/appCanvasUtils.js index 69809f0bff..fd706e7cb1 100644 --- a/frontend/src/AppBuilder/AppCanvas/appCanvasUtils.js +++ b/frontend/src/AppBuilder/AppCanvas/appCanvasUtils.js @@ -262,7 +262,7 @@ export const copyComponents = ({ isCut = false, isCloning = false }) => { for (let selectedComponent of filteredSelectedComponents) { if (addedComponentId.has(selectedComponent.id)) continue; - const events = useStore.getState().eventsSlice.geEventsByComponentsId(selectedComponent.id); + const events = useStore.getState().eventsSlice.getEventsByComponentsId(selectedComponent.id); const component = { component: allComponents[selectedComponent.id]?.component, layouts: allComponents[selectedComponent.id]?.layouts, diff --git a/frontend/src/AppBuilder/_stores/slices/dataQuerySlice.js b/frontend/src/AppBuilder/_stores/slices/dataQuerySlice.js index 4da379f443..802fd4f0f1 100644 --- a/frontend/src/AppBuilder/_stores/slices/dataQuerySlice.js +++ b/frontend/src/AppBuilder/_stores/slices/dataQuerySlice.js @@ -223,6 +223,8 @@ export const createDataQuerySlice = (set, get) => ({ set((state) => { state.dataQuery.creatingQueryInProcessId = uuidv4(); }); + const { eventsSlice } = get(); + const { getEventsByComponentsId, createAppVersionEventHandlers } = eventsSlice; const dataQueries = get().dataQuery.queries.modules[moduleId]; const queryToClone = { ...dataQueries.find((query) => query.id === id) }; let newName = queryToClone.name + '_copy'; @@ -266,6 +268,20 @@ export const createDataQuerySlice = (set, get) => ({ rawData: [], id: data.id, }); + + const events = getEventsByComponentsId(queryToClone.id); + + events.forEach((event) => { + const newEvent = { + event: { + ...event.event, + }, + eventType: event.target, + attachedTo: data.id, + index: event.index, + }; + createAppVersionEventHandlers(newEvent, moduleId); + }); }) .catch((error) => { console.error('error', error); diff --git a/frontend/src/AppBuilder/_stores/slices/eventsSlice.js b/frontend/src/AppBuilder/_stores/slices/eventsSlice.js index 336bc06953..02ee8fc29c 100644 --- a/frontend/src/AppBuilder/_stores/slices/eventsSlice.js +++ b/frontend/src/AppBuilder/_stores/slices/eventsSlice.js @@ -948,7 +948,7 @@ export const createEventsSlice = (set, get) => ({ }; }, // Selectors - geEventsByComponentsId: (componentId, moduleId = 'canvas') => { + getEventsByComponentsId: (componentId, moduleId = 'canvas') => { const { eventsSlice } = get(); return eventsSlice.module[moduleId]?.events?.filter((event) => event.sourceId === componentId); }, From 910a2b5917349bdf9a846bcaf44342f5253e2cc3 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:41:48 +0530 Subject: [PATCH 08/13] Listview selected row storing incorrect values fix (#2495) --- frontend/src/AppBuilder/Widgets/Listview.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/AppBuilder/Widgets/Listview.jsx b/frontend/src/AppBuilder/Widgets/Listview.jsx index 301171677f..5ec5abbb17 100644 --- a/frontend/src/AppBuilder/Widgets/Listview.jsx +++ b/frontend/src/AppBuilder/Widgets/Listview.jsx @@ -143,6 +143,8 @@ export const Listview = function Listview({ if (selectedRowIndex != undefined) { exposedVariables.selectedRecordId = selectedRowIndex; exposedVariables.selectedRecord = childrenData[selectedRowIndex]; + exposedVariables.selectedRowId = selectedRowIndex; + exposedVariables.selectedRow = childrenData[selectedRowIndex]; } setExposedVariables(exposedVariables); // eslint-disable-next-line react-hooks/exhaustive-deps From b93e843a5ebb80f54af02e3a6cf373963f7fa742 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:42:38 +0530 Subject: [PATCH 09/13] Components getting selected while resizing query panel fix (#2494) --- frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx b/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx index f10477bd6b..b07d4f73e1 100644 --- a/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx +++ b/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx @@ -76,9 +76,13 @@ export const QueryPanel = ({ darkMode }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [windowSize.height, isExpanded, isWindowResizing]); - const onMouseDown = useCallback(() => { - if (isTopOfQueryPanel) setIsDraggingQueryPane(true); - }, [isTopOfQueryPanel]); + const onMouseDown = useCallback( + (e) => { + e.preventDefault(); + if (isTopOfQueryPanel) setIsDraggingQueryPane(true); + }, + [isTopOfQueryPanel] + ); const onMouseUp = useCallback((e) => { setIsDraggingQueryPane(false); From 4668b02fa5432a06ac5289f16d32346e903d9b63 Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:43:25 +0530 Subject: [PATCH 10/13] MultiselectV2 & Dropdown options not saving fix (#2493) --- server/src/helpers/components.helper.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/helpers/components.helper.ts b/server/src/helpers/components.helper.ts index 9d7855d0df..a9aea3403e 100644 --- a/server/src/helpers/components.helper.ts +++ b/server/src/helpers/components.helper.ts @@ -36,7 +36,10 @@ export const buildComponentMetaDefinition = (components = {}) => { componentMeta.definition.properties, currentComponentData?.component?.definition?.properties, (objValue, srcValue) => { - if (currentComponentData?.component?.component === 'Table' && isArray(objValue)) { + if ( + ['Table', 'DropdownV2', 'MultiselectV2'].includes(currentComponentData?.component?.component) && + isArray(objValue) + ) { return srcValue; } } From 8ce5cfc01b860c4e90eed58365f54a4ae5c1216c Mon Sep 17 00:00:00 2001 From: Shaurya Sharma <79473274+shaurya-sharma064@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:44:41 +0530 Subject: [PATCH 11/13] Fixed query params not working (#2517) --- frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx b/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx index b07d4f73e1..827efe6d33 100644 --- a/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx +++ b/frontend/src/AppBuilder/QueryPanel/QueryPanel.jsx @@ -78,8 +78,10 @@ export const QueryPanel = ({ darkMode }) => { const onMouseDown = useCallback( (e) => { - e.preventDefault(); - if (isTopOfQueryPanel) setIsDraggingQueryPane(true); + if (isTopOfQueryPanel) { + e.preventDefault(); + setIsDraggingQueryPane(true); + } }, [isTopOfQueryPanel] ); From 623acabda7feff7486f54933f84696c522be0d13 Mon Sep 17 00:00:00 2001 From: Kartik Gupta Date: Mon, 28 Oct 2024 12:30:51 +0530 Subject: [PATCH 12/13] config handle positioning fix when visibility is hidden and query manager preview refreshing bug --- .../src/AppBuilder/AppCanvas/ConfigHandle/ConfigHandle.jsx | 4 +++- frontend/src/AppBuilder/AppCanvas/WidgetWrapper.jsx | 1 + .../AppBuilder/QueryManager/Components/QueryManagerBody.jsx | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/AppBuilder/AppCanvas/ConfigHandle/ConfigHandle.jsx b/frontend/src/AppBuilder/AppCanvas/ConfigHandle/ConfigHandle.jsx index d4c552607f..891a23b464 100644 --- a/frontend/src/AppBuilder/AppCanvas/ConfigHandle/ConfigHandle.jsx +++ b/frontend/src/AppBuilder/AppCanvas/ConfigHandle/ConfigHandle.jsx @@ -15,6 +15,7 @@ export const ConfigHandle = ({ customClassName = '', showHandle, componentType, + visibility, }) => { const shouldFreeze = useStore((state) => state.getShouldFreeze()); const componentName = useStore((state) => state.getComponentDefinition(id)?.component?.name || '', shallow); @@ -23,11 +24,12 @@ export const ConfigHandle = ({ shallow ); const deleteComponents = useStore((state) => state.deleteComponents, shallow); + let height = visibility === false ? 10 : widgetHeight; return (
)} Date: Mon, 28 Oct 2024 14:31:46 +0530 Subject: [PATCH 13/13] Minor css alignment fix --- frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx | 1 + frontend/src/Editor/Components/MultiselectV2/MultiselectV2.jsx | 1 + frontend/src/_ui/Label.jsx | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx b/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx index 9b1c5981e0..a4b318eadf 100644 --- a/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx +++ b/frontend/src/Editor/Components/DropdownV2/DropdownV2.jsx @@ -440,6 +440,7 @@ export const DropdownV2 = ({ auto={labelAutoWidth} isMandatory={isMandatory} _width={_width} + top={'1px'} />