Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o action-redesign/anthropic
  • Loading branch information
albinAppsmith committed Aug 22, 2024
2 parents ae94734 + f91073e commit 2da09e4
Show file tree
Hide file tree
Showing 105 changed files with 1,344 additions and 1,403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,21 @@ describe(
);

const zone1Selector = anvilLocators.anvilWidgetNameSelector("Zone1");
const section1Selector =
anvilLocators.anvilWidgetNameSelector("Section1");

anvilLayout.sections.mouseDownSpaceDistributionHandle("Section1", 1);
// outline color of zone while distributing space should be transparent
cy.get(zone1Selector).should(
"have.css",
"outline-color",
"rgba(0, 0, 0, 0)",
);
anvilLayout.sections.mouseUpSpaceDistributionHandle("Section1", 1);
// select zone1
agHelper.GetNClick(zone1Selector);
// go to style tab
propPane.MoveToTab("Style");
// toggle visual separation off on property pane
propPane.TogglePropertyState("Visual Separation", "Off");
anvilLayout.sections.mouseDownSpaceDistributionHandle("Section1", 1);
// outline color of background less zone while distributing space should not be transparent
cy.get(zone1Selector).should(
// outline color of section while distributing space should not be transparent
cy.get(section1Selector).should(
"not.have.css",
"outline-color",
"rgba(0, 0, 0, 0)",
"transparent",
);
});
},
Expand Down
2 changes: 2 additions & 0 deletions app/client/cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare namespace Cypress {
interface Chainable<Subject> {
latestDeployPreview(): Chainable<void>;

SignupFromAPI(uname: string, password: string);

dragTo(subject: any, targetEl: any);
Expand Down
11 changes: 0 additions & 11 deletions app/client/src/actions/datasourceActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,6 @@ export const addMockDatasourceToWorkspace = (
};
};

export const initDatasourcePane = (
pluginType: string,
urlId?: string,
): ReduxAction<{ pluginType: string; id?: string }> => {
return {
type: ReduxActionTypes.INIT_DATASOURCE_PANE,
payload: { id: urlId, pluginType },
};
};

export const storeAsDatasource = () => {
return {
type: ReduxActionTypes.STORE_AS_DATASOURCE_INIT,
Expand Down Expand Up @@ -529,5 +519,4 @@ export const setDatasourcePreviewSelectedTableName = (

export default {
fetchDatasources,
initDatasourcePane,
};
42 changes: 34 additions & 8 deletions app/client/src/actions/pageActions.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import type { WidgetType } from "constants/WidgetConstants";
import type {
AnyReduxAction,
EvaluationReduxAction,
ReduxAction,
UpdateCanvasPayload,
AnyReduxAction,
ClonePageSuccessPayload,
} from "ee/constants/ReduxActionConstants";
import {
ReduxActionTypes,
ReduxActionErrorTypes,
ReduxActionTypes,
WidgetReduxActionTypes,
ReplayReduxActionTypes,
} from "ee/constants/ReduxActionConstants";
import type { DynamicPath } from "utils/DynamicBindingUtils";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { WidgetOperation } from "widgets/BaseWidget";
import type { WidgetOperation, WidgetProps } from "widgets/BaseWidget";
import type {
FetchPageResponse,
PageLayout,
Expand All @@ -28,6 +25,12 @@ import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidg
import type { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import type { Replayable } from "entities/Replay/ReplayEntity/ReplayEditor";
import * as Sentry from "@sentry/react";
import type { DSLWidget } from "../WidgetProvider/constants";
import type {
LayoutOnLoadActionErrors,
PageAction,
} from "../constants/AppsmithActionConstants/ActionConstants";
import { ReplayOperation } from "entities/Replay/ReplayEntity/ReplayOperations";

export interface FetchPageListPayload {
applicationId: string;
Expand Down Expand Up @@ -127,6 +130,19 @@ export const updateCurrentPage = (
payload: { id, slug, permissions },
});

export interface UpdateCanvasPayload {
pageWidgetId: string;
widgets: { [widgetId: string]: WidgetProps };
currentLayoutId: string;
currentPageId: string;
currentPageName: string;
currentApplicationId: string;
dsl: Partial<DSLWidget>;
pageActions: PageAction[][];
updatedWidgetIds?: string[];
layoutOnLoadActionErrors?: LayoutOnLoadActionErrors[];
}

export const initCanvasLayout = (
payload: UpdateCanvasPayload,
): ReduxAction<UpdateCanvasPayload> => {
Expand Down Expand Up @@ -245,6 +261,16 @@ export const clonePageInit = (
};
};

export interface ClonePageSuccessPayload {
pageName: string;
description?: string;
pageId: string;
basePageId: string;
layoutId: string;
isDefault: boolean;
slug: string;
}

export const clonePageSuccess = ({
basePageId,
layoutId,
Expand Down Expand Up @@ -524,7 +550,7 @@ export function undoAction() {
return {
type: ReduxActionTypes.UNDO_REDO_OPERATION,
payload: {
operation: ReplayReduxActionTypes.UNDO,
operation: ReplayOperation.UNDO,
},
};
}
Expand All @@ -533,7 +559,7 @@ export function redoAction() {
return {
type: ReduxActionTypes.UNDO_REDO_OPERATION,
payload: {
operation: ReplayReduxActionTypes.REDO,
operation: ReplayOperation.REDO,
},
};
}
Expand Down
13 changes: 13 additions & 0 deletions app/client/src/actions/propertyPaneActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@ export const createNewQueryFromActionCreator = (
payload,
};
};

export interface ShowPropertyPanePayload {
widgetId?: string;
callForDragOrResize?: boolean;
force: boolean;
}

export const showPropertyPane = (payload: ShowPropertyPanePayload) => {
return {
type: ReduxActionTypes.SHOW_PROPERTY_PANE,
payload,
};
};
10 changes: 6 additions & 4 deletions app/client/src/actions/reflowActions.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import type { ReduxAction } from "ee/constants/ReduxActionConstants";
import { ReflowReduxActionTypes } from "ee/constants/ReduxActionConstants";
import {
type ReduxAction,
ReduxActionTypes,
} from "ee/constants/ReduxActionConstants";
import type { ReflowedSpaceMap } from "reflow/reflowTypes";

export const reflowMoveAction = (
payload: ReflowedSpaceMap,
): ReduxAction<ReflowedSpaceMap> => {
return {
type: ReflowReduxActionTypes.REFLOW_MOVE,
type: ReduxActionTypes.REFLOW_MOVE,
payload: payload,
};
};

export const stopReflowAction = () => {
return {
type: ReflowReduxActionTypes.STOP_REFLOW,
type: ReduxActionTypes.STOP_REFLOW,
};
};
20 changes: 1 addition & 19 deletions app/client/src/actions/userActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import {
ReduxActionErrorTypes,
ReduxActionTypes,
} from "ee/constants/ReduxActionConstants";
import { CurrentUserDetailsRequestPayload } from "constants/userConstants";
import type {
TokenPasswordUpdateRequest,
UpdateUserRequest,
VerifyTokenRequest,
} from "ee/api/UserApi";
import type { UpdateUserRequest, VerifyTokenRequest } from "ee/api/UserApi";
import type { FeatureFlags } from "ee/entities/FeatureFlag";
import type {
ProductAlert,
Expand All @@ -34,10 +29,6 @@ export const logoutUserError = (error: any) => ({
error,
},
});
export const setCurrentUserDetails = () => ({
type: ReduxActionTypes.SET_CURRENT_USER_INIT,
payload: CurrentUserDetailsRequestPayload,
});

export const verifyInviteSuccess = () => ({
type: ReduxActionTypes.VERIFY_INVITE_SUCCESS,
Expand All @@ -55,15 +46,6 @@ export const verifyInviteError = (error: any) => ({
payload: { error },
});

export const invitedUserSignup = (
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload: TokenPasswordUpdateRequest & { resolve: any; reject: any },
) => ({
type: ReduxActionTypes.INVITED_USER_SIGNUP_INIT,
payload,
});

export const invitedUserSignupSuccess = () => ({
type: ReduxActionTypes.INVITED_USER_SIGNUP_SUCCESS,
});
Expand Down
15 changes: 0 additions & 15 deletions app/client/src/actions/utilActions.ts

This file was deleted.

9 changes: 3 additions & 6 deletions app/client/src/actions/websocketActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ReduxActionTypes,
ReduxSagaChannels,
} from "ee/constants/ReduxActionConstants";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { reconnectWebsocketEvent } from "constants/WebsocketConstants";

export const setIsAppLevelWebsocketConnected = (payload: boolean) => ({
Expand All @@ -19,7 +16,7 @@ export const appLevelWebsocketWriteEvent = (payload: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload?: any;
}) => ({
type: ReduxSagaChannels.WEBSOCKET_APP_LEVEL_WRITE_CHANNEL,
type: ReduxActionTypes.WEBSOCKET_APP_LEVEL_WRITE_CHANNEL,
payload,
});
export const pageLevelWebsocketWriteEvent = (payload: {
Expand All @@ -28,7 +25,7 @@ export const pageLevelWebsocketWriteEvent = (payload: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload?: any;
}) => ({
type: ReduxSagaChannels.WEBSOCKET_PAGE_LEVEL_WRITE_CHANNEL,
type: ReduxActionTypes.WEBSOCKET_PAGE_LEVEL_WRITE_CHANNEL,
payload,
});

Expand Down
4 changes: 2 additions & 2 deletions app/client/src/actions/widgetActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export const showModal = (id: string, shouldSelectModal = true) => {
};
};

export const closePropertyPane = () => {
export const closePropertyPane = (force = false) => {
return {
type: ReduxActionTypes.HIDE_PROPERTY_PANE,
payload: {
force: false,
force,
},
};
};
Expand Down
36 changes: 1 addition & 35 deletions app/client/src/actions/widgetSidebarActions.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,6 @@
import {
ReduxActionTypes,
ReduxActionErrorTypes,
} from "ee/constants/ReduxActionConstants";
import type { WidgetCardProps } from "widgets/BaseWidget";

export const fetchWidgetCards = () => {
return {
type: ReduxActionTypes.FETCH_WIDGET_CARDS,
};
};

// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const errorFetchingWidgetCards = (error: any) => {
return {
type: ReduxActionErrorTypes.FETCH_WIDGET_CARDS_ERROR,
error,
};
};

export const successFetchingWidgetCards = (cards: {
[id: string]: WidgetCardProps[];
}) => {
return {
type: ReduxActionTypes.FETCH_WIDGET_CARDS_SUCCESS,
cards,
};
};
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";

export const forceOpenWidgetPanel = (flag: boolean) => ({
type: ReduxActionTypes.SET_FORCE_WIDGET_PANEL_OPEN,
payload: flag,
});

export default {
fetchWidgetCards,
errorFetchingWidgetCards,
successFetchingWidgetCards,
};
19 changes: 0 additions & 19 deletions app/client/src/api/WidgetSidebarApi.tsx

This file was deleted.

6 changes: 2 additions & 4 deletions app/client/src/ce/RouteBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import {
import { APP_MODE } from "entities/App";
import urlBuilder from "ee/entities/URLRedirect/URLAssembly";
import type { URLBuilderParams } from "ee/entities/URLRedirect/URLAssembly";
import type {
ApplicationPayload,
Page,
} from "ee/constants/ReduxActionConstants";
import type { Page } from "entities/Page";
import type { ApplicationPayload } from "entities/Application";

export const fillPathname = (
pathname: string,
Expand Down
8 changes: 3 additions & 5 deletions app/client/src/ce/RouteParamsMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type {
ApplicationPayload,
Page,
ReduxAction,
} from "ee/constants/ReduxActionConstants";
import type { ApplicationPayload } from "entities/Application";
import type { Page } from "entities/Page";
import type { ReduxAction } from "ee/constants/ReduxActionConstants";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import type { UpdatePageResponse } from "api/PageApi";
import type {
Expand Down
Loading

0 comments on commit 2da09e4

Please sign in to comment.