Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3ea2117
initial commit
ashit-rath May 26, 2022
ff2fc91
props hoc
ashit-rath May 27, 2022
2d657db
merged latest release
ashit-rath May 30, 2022
383aaab
changes
ashit-rath May 30, 2022
af2f352
removed ignores and withWidgetProps
ashit-rath Jun 1, 2022
779353f
added extra props to canvasStructure
ashit-rath Jun 6, 2022
c74f9df
widget props changes
ashit-rath Jun 7, 2022
3dc0652
list widget changes
ashit-rath Jun 8, 2022
4d9cec6
reintroduced widget props hook and other refactors
ashit-rath Jun 13, 2022
8027618
remove warnings
ashit-rath Jun 13, 2022
0acccaa
added deepequal for childWidgets selector
ashit-rath Jun 14, 2022
6f9b374
fix global hotkeys and tabs widget jest test
ashit-rath Jun 16, 2022
aa99be8
Merge branch 'release' into task/widget-rerendering
ashit-rath Jun 16, 2022
28fb4fc
fix main container test fix
ashit-rath Jun 17, 2022
1daa9fb
fixed view mode width
ashit-rath Jun 17, 2022
f08fc55
fix form widget values
ashit-rath Jun 20, 2022
f196fb9
minor fix
ashit-rath Jun 20, 2022
49dd097
Merge branch 'release' into task/widget-rerendering
ashit-rath Jun 21, 2022
c0ce368
fix skeleton
ashit-rath Jun 21, 2022
749af42
form widget validity fix
ashit-rath Jun 21, 2022
52a3e8e
jest test fix
ashit-rath Jun 21, 2022
02e9b84
fixed tests: GlobalHotkeys, Tabs, CanvasSelectectionArena and fixed m…
ashit-rath Jun 22, 2022
d39c970
merged latest release
ashit-rath Jun 22, 2022
cbcfbbc
minor fix
ashit-rath Jun 22, 2022
e18af5f
minor comments
ashit-rath Jun 23, 2022
5449dde
reverted commented code
ashit-rath Jun 24, 2022
59350e3
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jun 29, 2022
5f054df
simplified structure, selective redux state updates and other inconsi…
Jul 5, 2022
d8c4c3a
merged from release and resolve conflicts
Jul 5, 2022
66cf39e
fix junit test cases
Jul 5, 2022
846b983
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 6, 2022
0473bb6
stop form widget from force rendering children
Jul 7, 2022
7fd84ab
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 7, 2022
2faae27
fix test case
Jul 7, 2022
e2c5289
random commit to re run tests
Jul 7, 2022
687d5b6
update isFormValid prop only if it exists
Jul 11, 2022
8137cff
merge from release and resolve conflict
Jul 12, 2022
1013243
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 12, 2022
f335d1f
detangling circular dependency
Jul 12, 2022
07e5830
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 13, 2022
ae25600
fixing cypress tests
Jul 13, 2022
59df76d
cleaned up code
Jul 17, 2022
6a81f3f
merge from release and resolving merge conflicts
Jul 17, 2022
3c01086
clean up man cnavas props and fix jest cases
Jul 17, 2022
869cdea
fix rendering order of child widgets for canvas
Jul 17, 2022
5745cdf
fix dropdown reset spec
Jul 17, 2022
01cb9a9
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 18, 2022
b58f824
adding comments
Jul 18, 2022
2153111
cleaning up unwanted code
Jul 18, 2022
3d82b0a
fix multiselect widget on deploy
Jul 18, 2022
37ba650
adressing review comments
Jul 27, 2022
a7b2b5a
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Jul 27, 2022
5ea91c8
pull from release and resolve conflict
Jul 29, 2022
992d1ec
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Aug 1, 2022
6fefb83
addressing minor review comment changes
Aug 1, 2022
453e40a
destructuring modal widget child and fix test case
Aug 1, 2022
6659231
pull from release, resolve conflicts and removing comments related code
Aug 3, 2022
b85ec10
fix communityIssues cypress spec
Aug 3, 2022
5f115bf
rewrite isVisible logic to match previous behaviour
Aug 4, 2022
4a03a64
pull from release and resolve conflicts
Aug 4, 2022
d72182f
merging widget props with component props before checking isVisible
Aug 4, 2022
20267bc
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Aug 7, 2022
9361f31
adressing review comments for modal widget's isVisible
Aug 7, 2022
60a9e24
merge from release and resolve conflicts
Aug 11, 2022
42604b4
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Aug 12, 2022
e5d0eb7
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Aug 16, 2022
ddd5477
Merge branch 'release' of github.com:appsmithorg/appsmith into task/w…
Aug 17, 2022
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
30 changes: 15 additions & 15 deletions app/client/cypress/fixtures/newFormDsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@
"parentRowSpace": 38,
"leftColumn": 10,
"rightColumn": 14,
"topRow": 11,
"bottomRow": 12,
"topRow": 17,
"bottomRow": 18,
"parentId": "e3tq9qwta6",
"widgetId": "ca22py6vlv"
},
Expand Down Expand Up @@ -346,18 +346,18 @@
"parentColumnSpace": 6.6856445312499995,
"leftColumn": 2,
"options": [
{
"label": "Blue",
"value": "BLUE"
},
{
"label": "Green",
"value": "GREEN"
},
{
"label": "Red",
"value": "RED"
}
{
"label": "Blue",
"value": "BLUE"
},
{
"label": "Green",
"value": "GREEN"
},
{
"label": "Red",
"value": "RED"
}
],
"isDisabled": false,
"key": "vrhzyvir7s",
Expand All @@ -382,4 +382,4 @@
}
]
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we add a new line?

Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ describe("AForce - Community Issues page validations", function() {
table.SelectTableRow(0);
agHelper.AssertElementVisible(locator._widgetInDeployed("tabswidget"));
agHelper
.GetNClick(locator._inputWidgetv1InDeployed)
.GetNClick(locator._inputWidgetv1InDeployed, 0, true, 0)
.type("-updating title");
agHelper
.GetNClick(locator._textAreainputWidgetv1InDeployed)
.GetNClick(locator._textAreainputWidgetv1InDeployed, 0, true, 0)
.type("-updating desc");
agHelper
.GetNClick(locator._inputWidgetv1InDeployed, 1)
Expand Down Expand Up @@ -377,7 +377,7 @@ describe("AForce - Community Issues page validations", function() {
agHelper.Sleep();
cy.get(table._trashIcon)
.closest("div")
.click();
.click({ force: true });
agHelper.Sleep(3000); //allowing time to delete!
agHelper.AssertElementAbsence(locator._widgetInDeployed("tabswidget"));
table.WaitForTableEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ describe("Undo/Redo functionality", function() {
cy.get(commonlocators.toastmsg)
.eq(1)
.contains("UNDO");
cy.deleteWidget(widgetsPage.textWidget);
});

it("checks undo/redo for color picker", function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const explorer = require("../../../../../locators/explorerlocators.json");
const { modifierKey } = require("../../../../../support/Constants");

const firstButton = ".t--buttongroup-widget > div > button > div";
const menuButton =
Expand Down Expand Up @@ -36,7 +37,7 @@ describe("Button Group Widget Functionality", function() {
cy.get(firstButton).contains("Add");

// Undo
cy.get("body").type("{ctrl+z}");
cy.get("body").type(`{${modifierKey}+z}`);

// Check if the button is back
cy.get(".t--buttongroup-widget")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe("Binding the list widget with text widget", function() {
.click({ force: true })
.type("#$%1234", { delay: 300 })
.type("{enter}");
cy.wait(500);
cy.get(".t--widget-name").contains("___1234");
cy.verifyUpdatedWidgetName("12345");
cy.get(".t--delete-widget").click({ force: true });
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/support/Constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl";
1 change: 1 addition & 0 deletions app/client/cypress/support/widgetCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ Cypress.Commands.add("verifyUpdatedWidgetName", (text) => {
.click({ force: true })
.type(text, { delay: 300 })
.type("{enter}");
cy.wait(500);
cy.get(".t--widget-name").contains(text);
});

Expand Down
12 changes: 9 additions & 3 deletions app/client/src/actions/pageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export interface CreatePageActionPayload {
blockNavigation?: boolean;
}

export type updateLayoutOptions = {
isRetry?: boolean;
shouldReplay?: boolean;
updatedWidgetIds?: string[];
};

export const fetchPage = (
pageId: string,
isFirstLoad = false,
Expand Down Expand Up @@ -130,12 +136,12 @@ export const deletePageSuccess = () => {

export const updateAndSaveLayout = (
widgets: CanvasWidgetsReduxState,
isRetry?: boolean,
shouldReplay?: boolean,
options: updateLayoutOptions = {},
) => {
const { isRetry, shouldReplay, updatedWidgetIds } = options;
return {
type: ReduxActionTypes.UPDATE_LAYOUT,
payload: { widgets, isRetry, shouldReplay },
payload: { widgets, isRetry, shouldReplay, updatedWidgetIds },
};
};

Expand Down
1 change: 1 addition & 0 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ export interface UpdateCanvasPayload {
currentPageName: string;
currentApplicationId: string;
pageActions: PageAction[][];
updatedWidgetIds?: string[];
}

export interface ShowPropertyPanePayload {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { usePositionedContainerZIndex } from "utils/hooks/usePositionedContainer
import { useSelector } from "react-redux";
import { snipingModeSelector } from "selectors/editorSelectors";
import WidgetFactory from "utils/WidgetFactory";
import { isEqual, memoize } from "lodash";
import { memoize } from "lodash";
import { getReflowSelector } from "selectors/widgetReflowSelectors";
import { AppState } from "reducers";
import { POSITIONED_WIDGET } from "constants/componentClassNameConstants";
Expand Down Expand Up @@ -59,7 +59,7 @@ export function PositionedContainer(props: PositionedContainerProps) {

const reflowSelector = getReflowSelector(props.widgetId);

const reflowedPosition = useSelector(reflowSelector, isEqual);
const reflowedPosition = useSelector(reflowSelector);
const dragDetails = useSelector(
(state: AppState) => state.ui.widgetDragResize.dragDetails,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ import {
snipingModeSelector,
} from "selectors/editorSelectors";
import { useWidgetSelection } from "utils/hooks/useWidgetSelection";
import { getCanvasWidgets } from "selectors/entitiesSelector";
import { focusWidget } from "actions/widgetActions";
import { getParentToOpenIfAny } from "utils/hooks/useClickToSelectWidget";
import { GridDefaults } from "constants/WidgetConstants";
import { DropTargetContext } from "./DropTargetComponent";
import { XYCord } from "pages/common/CanvasArenas/hooks/useCanvasDragging";
import { getParentToOpenSelector } from "selectors/widgetSelectors";

export type ResizableComponentProps = WidgetProps & {
paddingOffset: number;
Expand All @@ -53,7 +52,6 @@ export const ResizableComponent = memo(function ResizableComponent(
) {
// Fetch information from the context
const { updateWidget } = useContext(EditorContext);
const canvasWidgets = useSelector(getCanvasWidgets);

const isSnipingMode = useSelector(snipingModeSelector);
const isPreviewMode = useSelector(previewModeSelector);
Expand All @@ -78,9 +76,8 @@ export const ResizableComponent = memo(function ResizableComponent(
const isResizing = useSelector(
(state: AppState) => state.ui.widgetDragResize.isResizing,
);
const parentWidgetToSelect = getParentToOpenIfAny(
props.widgetId,
canvasWidgets,
const parentWidgetToSelect = useSelector(
getParentToOpenSelector(props.widgetId),
);

const isWidgetFocused =
Expand Down
4 changes: 4 additions & 0 deletions app/client/src/constants/AppConstants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import localStorage from "utils/localStorage";
import { GridDefaults } from "./WidgetConstants";

export const CANVAS_DEFAULT_HEIGHT_PX = 1292;
export const CANVAS_DEFAULT_MIN_HEIGHT_PX = 380;
export const CANVAS_DEFAULT_GRID_HEIGHT_PX = 1;
export const CANVAS_DEFAULT_GRID_WIDTH_PX = 1;
export const CANVAS_DEFAULT_MIN_ROWS = Math.ceil(
CANVAS_DEFAULT_MIN_HEIGHT_PX / GridDefaults.DEFAULT_GRID_ROW_HEIGHT,
);
export const CANVAS_BACKGROUND_COLOR = "#FFFFFF";
export const DEFAULT_ENTITY_EXPLORER_WIDTH = 256;
export const DEFAULT_PROPERTY_PANE_WIDTH = 256;
Expand Down
9 changes: 9 additions & 0 deletions app/client/src/constants/WidgetConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ export const WIDGET_STATIC_PROPS = {
noContainerOffset: false,
};

export const WIDGET_DSL_STRUCTURE_PROPS = {
children: true,
type: true,
widgetId: true,
parentId: true,
topRow: true,
bottomRow: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

bottomRow and topRow can update frequently when dealing with dynamic height. Are we sure we want to keep this in the DSLStructure?
cc @SatishGandham

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, how about making this an enum instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately those are still needed for canvas, bottomRow is used in canvas like widgets to determine the height for scrolling.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rahulramesha , How are widgets getting these props? Are they subscribing to them individually?

};

export type TextSize = keyof typeof TextSizes;

export const DEFAULT_FONT_SIZE = THEMEING_TEXT_SIZES.base;
15 changes: 8 additions & 7 deletions app/client/src/pages/AppViewer/AppPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";
import WidgetFactory from "utils/WidgetFactory";
import AnalyticsUtil from "utils/AnalyticsUtil";
import { useDynamicAppLayout } from "utils/hooks/useDynamicAppLayout";
import { DSLWidget } from "widgets/constants";
import { CanvasWidgetStructure } from "widgets/constants";
import { RenderModes } from "constants/WidgetConstants";

const PageView = styled.div<{ width: number }>`
Expand All @@ -14,10 +14,11 @@ const PageView = styled.div<{ width: number }>`
`;

type AppPageProps = {
dsl: DSLWidget;
pageName?: string;
pageId?: string;
appName?: string;
canvasWidth: number;
pageId?: string;
pageName?: string;
widgetsStructure: CanvasWidgetStructure;
};

export function AppPage(props: AppPageProps) {
Expand All @@ -33,9 +34,9 @@ export function AppPage(props: AppPageProps) {
}, [props.pageId, props.pageName]);

return (
<PageView className="t--app-viewer-page" width={props.dsl.rightColumn}>
{props.dsl.widgetId &&
WidgetFactory.createWidget(props.dsl, RenderModes.PAGE)}
<PageView className="t--app-viewer-page" width={props.canvasWidth}>
{props.widgetsStructure.widgetId &&
WidgetFactory.createWidget(props.widgetsStructure, RenderModes.PAGE)}
</PageView>
);
}
Expand Down
16 changes: 9 additions & 7 deletions app/client/src/pages/AppViewer/AppViewerPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ import { theme } from "constants/DefaultTheme";
import { Icon, NonIdealState, Spinner } from "@blueprintjs/core";
import Centered from "components/designSystems/appsmith/CenteredWrapper";
import AppPage from "./AppPage";
import {
getCanvasWidgetDsl,
getCurrentPageName,
} from "selectors/editorSelectors";
import { getCanvasWidth, getCurrentPageName } from "selectors/editorSelectors";
import RequestConfirmationModal from "pages/Editor/RequestConfirmationModal";
import { getCurrentApplication } from "selectors/applicationSelectors";
import {
isPermitted,
PERMISSION_TYPE,
} from "../Applications/permissionHelpers";
import { builderURL } from "RouteBuilder";
import { getCanvasWidgetsStructure } from "selectors/entitiesSelector";
import { isEqual } from "lodash";

const Section = styled.section`
height: 100%;
Expand All @@ -33,7 +32,8 @@ type AppViewerPageContainerProps = RouteComponentProps<AppViewerRouteParams>;

function AppViewerPageContainer(props: AppViewerPageContainerProps) {
const currentPageName = useSelector(getCurrentPageName);
const widgets = useSelector(getCanvasWidgetDsl);
const widgetsStructure = useSelector(getCanvasWidgetsStructure, isEqual);
const canvasWidth = useSelector(getCanvasWidth);
const isFetchingPage = useSelector(getIsFetchingPage);
const currentApplication = useSelector(getCurrentApplication);
const { match } = props;
Expand Down Expand Up @@ -86,15 +86,17 @@ function AppViewerPageContainer(props: AppViewerPageContainerProps) {

if (isFetchingPage) return pageLoading;

if (!(widgets.children && widgets.children.length > 0)) return pageNotFound;
if (!(widgetsStructure.children && widgetsStructure.children.length > 0))
return pageNotFound;

return (
<Section>
<AppPage
appName={currentApplication?.name}
dsl={widgets}
canvasWidth={canvasWidth}
pageId={match.params.pageId}
pageName={currentPageName}
widgetsStructure={widgetsStructure}
/>
<RequestConfirmationModal />
</Section>
Expand Down
16 changes: 10 additions & 6 deletions app/client/src/pages/Editor/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import log from "loglevel";
import * as Sentry from "@sentry/react";
import styled from "styled-components";
import store, { useSelector } from "store";
import { DSLWidget } from "widgets/constants";
import { CanvasWidgetStructure } from "widgets/constants";
import WidgetFactory from "utils/WidgetFactory";
import React, { memo, useCallback, useEffect } from "react";

Expand All @@ -22,8 +22,9 @@ import { getPageLevelSocketRoomId } from "sagas/WebsocketSagas/utils";
import { previewModeSelector } from "selectors/editorSelectors";

interface CanvasProps {
dsl: DSLWidget;
widgetsStructure: CanvasWidgetStructure;
pageId: string;
canvasWidth: number;
}

type PointerEventDataType = {
Expand Down Expand Up @@ -72,7 +73,7 @@ const useShareMousePointerEvent = () => {

// TODO(abhinav): get the render mode from context
const Canvas = memo((props: CanvasProps) => {
const { pageId } = props;
const { canvasWidth, pageId } = props;
const isPreviewMode = useSelector(previewModeSelector);
const selectedTheme = useSelector(getSelectedAppTheme);

Expand Down Expand Up @@ -118,11 +119,14 @@ const Canvas = memo((props: CanvasProps) => {
!!data && delayedShareMousePointer(data);
}}
style={{
width: props.dsl.rightColumn,
width: canvasWidth,
}}
>
{props.dsl.widgetId &&
WidgetFactory.createWidget(props.dsl, RenderModes.CANVAS)}
{props.widgetsStructure.widgetId &&
WidgetFactory.createWidget(
props.widgetsStructure,
RenderModes.CANVAS,
)}
{isMultiplayerEnabledForUser && (
<CanvasMultiPointerArena pageId={pageId} />
)}
Expand Down
Loading