diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.stories.tsx b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.stories.tsx index 9357efca7c..546725b1d0 100644 --- a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.stories.tsx +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.stories.tsx @@ -34,18 +34,21 @@ const Tree: EntityListTreeProps["items"] = [ isExpanded: true, isSelected: false, name: "Parent 1", + type: "LIST_WIDGET", children: [ { id: "1.1", isExpanded: false, isSelected: true, name: "Child 1.1", + type: "CONTAINER_WIDGET", children: [ { id: "1.1.1", isExpanded: false, isSelected: false, name: "Child 1.1.1", + type: "IMAGE_WIDGET", }, { id: "1.1.2", @@ -53,6 +56,7 @@ const Tree: EntityListTreeProps["items"] = [ isExpanded: false, isSelected: false, name: "Child 1.1.2", + type: "TEXT_WIDGET", }, ], }, @@ -61,6 +65,7 @@ const Tree: EntityListTreeProps["items"] = [ isExpanded: false, isSelected: false, name: "Child 1.2", + type: "TABLE_WIDGET", }, ], }, @@ -69,6 +74,7 @@ const Tree: EntityListTreeProps["items"] = [ isExpanded: false, isSelected: false, name: "Parent 2", + type: "BUTTON_WIDGET", }, ]; diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.test.tsx b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.test.tsx index c92c46da96..271f80cc4b 100644 --- a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.test.tsx +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.test.tsx @@ -21,6 +21,7 @@ const defaultProps: EntityListTreeProps = { isSelected: false, isDisabled: false, name: "Parent 1", + type: "CONTAINER_WIDGET", children: [ { id: "1-1", @@ -29,6 +30,7 @@ const defaultProps: EntityListTreeProps = { isDisabled: false, name: "Child 1.1", children: [], + type: "TABLE_WIDGET", }, ], }, @@ -61,6 +63,7 @@ describe("EntityListTree", () => { isDisabled: false, name: "No Children Parent", children: [], + type: "TABLE_WIDGET", }, ], }; @@ -84,6 +87,7 @@ describe("EntityListTree", () => { isSelected: false, isDisabled: false, name: "Parent 1", + type: "CONTAINER_WIDGET", children: [ { id: "1-1", @@ -92,6 +96,7 @@ describe("EntityListTree", () => { isDisabled: false, name: "Child 1.1", children: [], + type: "TABLE_WIDGET", }, ], }, diff --git a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts index e89accd7aa..ba050877e2 100644 --- a/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts +++ b/app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts @@ -5,6 +5,7 @@ export interface EntityListTreeItem { isDisabled?: boolean; id: string; name: string; + type: string; } export interface EntityListTreeProps { diff --git a/app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx b/app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx index 9b8ad7fa14..b8be69bab3 100644 --- a/app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx +++ b/app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx @@ -18,6 +18,7 @@ export const UIEntityListTree = () => { name: widget.widgetName, isSelected: selectedWidgets.includes(widget.widgetId), isExpanded: expandedWidgets.includes(widget.widgetId), + type: widget.type, })); return ( diff --git a/app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx b/app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx index 251e559a45..2e5b976c5d 100644 --- a/app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx +++ b/app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx @@ -68,8 +68,8 @@ export const WidgetTreeItem = ({ item }: { item: EntityListTreeItem }) => { ); const startIcon = useMemo( - () => , - [widget?.type], + () => , + [item.type], ); const onClick = useCallback(