Skip to content

Commit b1ec758

Browse files
authored
chore: UI Module instances support broken references in widgets entity explorer (#40390)
## Description - Create orphan UI Module instances component for displaying UI modules not present on canvas - Add error indication for widgets in the tree view - Update widget tree data structure to support error state Changes for appsmithorg/appsmith-ee#7274 ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14682236408> > Commit: b65ec15 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14682236408&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Sat, 26 Apr 2025 15:49:15 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced display of orphan module instances in the entity list tree, allowing users to view modules not currently present on the canvas. - **Enhancements** - Entity list items now indicate error status, improving visibility of issues within widgets. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 76b1ff1 commit b1ec758

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* This component is used to display the orphan UIModuleInstances in the EntityListTree.
3+
* An orphan UIModuleInstance is a UIModuleInstance that has an instance of a module
4+
* but the module instance's widget is not present in the canvas.
5+
*
6+
* This function is extended in EE
7+
* @returns
8+
*/
9+
10+
function OrphanUIModuleInstancesEntityList() {
11+
return null;
12+
}
13+
14+
export default OrphanUIModuleInstancesEntityList;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from "ce/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList";

app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getSelectedWidgets } from "selectors/ui";
66
import { useWidgetTreeState } from "./hooks/useWidgetTreeExpandedState";
77
import { enhanceItemsTree } from "./utils/enhanceTree";
88
import { WidgetTreeItem } from "./WidgetTreeItem";
9-
9+
import OrphanUIModuleInstancesEntityList from "ee/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList";
1010
export const UIEntityListTree = () => {
1111
const widgets = useSelector(selectWidgetsForCurrentPage);
1212
const selectedWidgets = useSelector(getSelectedWidgets);
@@ -19,13 +19,17 @@ export const UIEntityListTree = () => {
1919
isSelected: selectedWidgets.includes(widget.widgetId),
2020
isExpanded: expandedWidgets.includes(widget.widgetId),
2121
type: widget.type,
22+
hasError: widget.hasError,
2223
}));
2324

2425
return (
25-
<EntityListTree
26-
ItemComponent={WidgetTreeItem}
27-
items={items}
28-
onItemExpand={handleExpand}
29-
/>
26+
<>
27+
<EntityListTree
28+
ItemComponent={WidgetTreeItem}
29+
items={items}
30+
onItemExpand={handleExpand}
31+
/>
32+
<OrphanUIModuleInstancesEntityList />
33+
</>
3034
);
3135
};

app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const WidgetTreeItem = ({ item }: { item: EntityListTreeItem }) => {
9393

9494
return (
9595
<EntityItem
96+
hasError={item.hasError}
9697
id={item.id}
9798
isSelected={item.isSelected}
9899
nameEditorConfig={nameEditorConfig}

app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface CanvasStructure {
1313
widgetId: string;
1414
type: WidgetType;
1515
children?: CanvasStructure[];
16+
hasError?: boolean;
1617
}
1718

1819
export interface DSL extends WidgetProps {

0 commit comments

Comments
 (0)