From 316ef84a8a0d3da1329134cccc2e501a6d8b8517 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Fri, 15 Sep 2023 18:24:39 +0530 Subject: [PATCH] fix: property pane if tabledata section doesn't exist, clear widget id (#27260) --- .../walkthroughRenderer.tsx | 20 +++++++++++-------- .../Editor/PropertyPane/PropertySection.tsx | 14 ++++++++++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx b/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx index c720b07b60..c1285500d4 100644 --- a/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx +++ b/app/client/src/components/featureWalkthrough/walkthroughRenderer.tsx @@ -216,14 +216,18 @@ const WalkthroughRenderer = ({ 0 ${targetBounds.bh}, ${multipleHighlightsIds.reduce((acc, id) => { const boundingRect = boundingRects[id]; - acc = `${acc} ${boundingRect.tx} ${boundingRect.bh}, - ${boundingRect.tx} ${boundingRect.ty}, - ${boundingRect.tx + boundingRect.tw} ${boundingRect.ty}, - ${boundingRect.tx + boundingRect.tw} ${ - boundingRect.ty + boundingRect.th - }, - ${boundingRect.tx} ${boundingRect.ty + boundingRect.th}, - ${boundingRect.tx} ${boundingRect.bh},`; + if (boundingRect) { + acc = `${acc} ${boundingRect.tx} ${boundingRect.bh}, + ${boundingRect.tx} ${boundingRect.ty}, + ${boundingRect.tx + boundingRect.tw} ${boundingRect.ty}, + ${boundingRect.tx + boundingRect.tw} ${ + boundingRect.ty + boundingRect.th + }, + ${boundingRect.tx} ${ + boundingRect.ty + boundingRect.th + }, + ${boundingRect.tx} ${boundingRect.bh},`; + } return acc; }, "")} ${targetBounds.bw} ${targetBounds.bh}, diff --git a/app/client/src/pages/Editor/PropertyPane/PropertySection.tsx b/app/client/src/pages/Editor/PropertyPane/PropertySection.tsx index 78d26716fa..fa31e46272 100644 --- a/app/client/src/pages/Editor/PropertyPane/PropertySection.tsx +++ b/app/client/src/pages/Editor/PropertyPane/PropertySection.tsx @@ -19,6 +19,7 @@ import { setPropertySectionState } from "actions/propertyPaneActions"; import { getIsOneClickBindingOptionsVisibility } from "selectors/oneClickBindingSelectors"; import localStorage from "utils/localStorage"; import { WIDGET_ID_SHOW_WALKTHROUGH } from "constants/WidgetConstants"; +import { PROPERTY_PANE_ID } from "components/editorComponents/PropertyPaneSidebar"; const TagContainer = styled.div``; @@ -149,10 +150,17 @@ export const PropertySection = memo((props: PropertySectionProps) => { ); if (widgetId) { - if (className === "data") { - setIsOpen(true); + const isWidgetIdTableDataExist = document.querySelector( + `#${PROPERTY_PANE_ID} [id='${btoa(widgetId + ".tableData")}']`, + ); + if (isWidgetIdTableDataExist) { + if (className === "data") { + setIsOpen(true); + } else { + setIsOpen(false); + } } else { - setIsOpen(false); + await localStorage.removeItem(WIDGET_ID_SHOW_WALKTHROUGH); } } };