Skip to content

chore: UI Module instances support broken references in widgets entity explorer #40390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This component is used to display the orphan UIModuleInstances in the EntityListTree.
* An orphan UIModuleInstance is a UIModuleInstance that has an instance of a module
* but the module instance's widget is not present in the canvas.
*
* This function is extended in EE
* @returns
*/

function OrphanUIModuleInstancesEntityList() {
return null;
}

export default OrphanUIModuleInstancesEntityList;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "ce/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList";
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getSelectedWidgets } from "selectors/ui";
import { useWidgetTreeState } from "./hooks/useWidgetTreeExpandedState";
import { enhanceItemsTree } from "./utils/enhanceTree";
import { WidgetTreeItem } from "./WidgetTreeItem";

import OrphanUIModuleInstancesEntityList from "ee/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList";
export const UIEntityListTree = () => {
const widgets = useSelector(selectWidgetsForCurrentPage);
const selectedWidgets = useSelector(getSelectedWidgets);
Expand All @@ -19,13 +19,17 @@ export const UIEntityListTree = () => {
isSelected: selectedWidgets.includes(widget.widgetId),
isExpanded: expandedWidgets.includes(widget.widgetId),
type: widget.type,
hasError: widget.hasError,
}));

return (
<EntityListTree
ItemComponent={WidgetTreeItem}
items={items}
onItemExpand={handleExpand}
/>
<>
<EntityListTree
ItemComponent={WidgetTreeItem}
items={items}
onItemExpand={handleExpand}
/>
<OrphanUIModuleInstancesEntityList />
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const WidgetTreeItem = ({ item }: { item: EntityListTreeItem }) => {

return (
<EntityItem
hasError={item.hasError}
id={item.id}
isSelected={item.isSelected}
nameEditorConfig={nameEditorConfig}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface CanvasStructure {
widgetId: string;
type: WidgetType;
children?: CanvasStructure[];
hasError?: boolean;
}

export interface DSL extends WidgetProps {
Expand Down
Loading