Skip to content
Merged
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions app/client/src/selectors/editorSelectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import { DataTreeWidget, ENTITY_TYPE } from "entities/DataTree/dataTreeFactory";
import { getActions } from "selectors/entitiesSelector";

import { getCanvasWidgets } from "./entitiesSelector";
import { WidgetTypes } from "../constants/WidgetConstants";
import {
MAIN_CONTAINER_WIDGET_ID,
WidgetTypes,
} from "../constants/WidgetConstants";

const getWidgetConfigs = (state: AppState) => state.entities.widgetConfig;
const getWidgetSideBar = (state: AppState) => state.ui.widgetSidebar;
Expand Down Expand Up @@ -157,7 +160,7 @@ export const getCanvasWidgetDsl = createSelector(
const evaluatedWidget = _.find(evaluatedDataTree, {
widgetId: widgetKey,
}) as DataTreeWidget;
if (evaluatedWidget) {
if (evaluatedWidget || widgetKey === MAIN_CONTAINER_WIDGET_ID) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of manipulating this if statement. Always add this widget by default before looping through other evaluated widgets

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do that we have to add if else statement to not add loading state for maincontainer or filter maincontainer from canvasWidgets before iterating. thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have to have this check in either case, then let's just go with this approach. @hetunandu Let us know if there is reason for the approach you suggested.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should then add it by default and filter it from the list before looping.

widgets[widgetKey] = createCanvasWidget(canvasWidget, evaluatedWidget);
} else {
widgets[widgetKey] = createLoadingWidget(canvasWidget);
Expand Down