2023-03-29 17:07:06 +00:00
|
|
|
import type { FetchApplicationResponse } from "@appsmith/api/ApplicationApi";
|
2022-04-12 10:50:01 +00:00
|
|
|
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
|
2022-03-25 10:43:26 +00:00
|
|
|
import store from "store";
|
|
|
|
|
|
|
|
|
|
export const fetchPagesMockResponse = {
|
|
|
|
|
responseMeta: {
|
|
|
|
|
status: 200,
|
|
|
|
|
success: true,
|
|
|
|
|
},
|
|
|
|
|
data: {
|
2022-06-15 15:37:41 +00:00
|
|
|
workspaceId: "605c433c91dea93f0eaf91b5",
|
2022-03-25 10:43:26 +00:00
|
|
|
pages: [
|
|
|
|
|
{
|
|
|
|
|
pageId: "605c435a91dea93f0eaf91ba",
|
|
|
|
|
name: "Page1",
|
|
|
|
|
isDefault: true,
|
|
|
|
|
slug: "page-1",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const fetchApplicationMockResponse: FetchApplicationResponse = {
|
|
|
|
|
responseMeta: {
|
|
|
|
|
status: 200,
|
|
|
|
|
success: true,
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
application: {
|
|
|
|
|
id: "605c435a91dea93f0eaf91b8",
|
|
|
|
|
name: "My Application",
|
|
|
|
|
slug: "my-application",
|
2022-06-15 15:37:41 +00:00
|
|
|
workspaceId: "",
|
2022-03-25 10:43:26 +00:00
|
|
|
evaluationVersion: 1,
|
|
|
|
|
appIsExample: false,
|
|
|
|
|
gitApplicationMetadata: undefined,
|
|
|
|
|
applicationVersion: 2,
|
|
|
|
|
},
|
|
|
|
|
pages: [
|
|
|
|
|
{
|
|
|
|
|
id: "605c435a91dea93f0eaf91ba",
|
|
|
|
|
name: "Page1",
|
|
|
|
|
isDefault: true,
|
|
|
|
|
slug: "page-1",
|
|
|
|
|
},
|
2022-04-04 15:25:03 +00:00
|
|
|
{
|
|
|
|
|
id: "605c435a91dea93f0eaf91bc",
|
|
|
|
|
name: "Page2",
|
|
|
|
|
isDefault: false,
|
|
|
|
|
slug: "page-2",
|
|
|
|
|
},
|
2022-03-25 10:43:26 +00:00
|
|
|
],
|
2022-06-15 15:37:41 +00:00
|
|
|
workspaceId: "",
|
2022-03-25 10:43:26 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setMockPageList = () => {
|
|
|
|
|
store.dispatch({
|
|
|
|
|
type: ReduxActionTypes.FETCH_PAGE_LIST_SUCCESS,
|
|
|
|
|
payload: {
|
|
|
|
|
applicationId: "605c435a91dea93f0eaf91b8",
|
|
|
|
|
pages: fetchPagesMockResponse.data.pages,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setMockApplication = () => {
|
|
|
|
|
store.dispatch({
|
|
|
|
|
type: ReduxActionTypes.FETCH_APPLICATION_SUCCESS,
|
|
|
|
|
payload: {
|
|
|
|
|
...fetchApplicationMockResponse.data.application,
|
|
|
|
|
pages: fetchApplicationMockResponse.data.pages,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
2022-04-04 15:25:03 +00:00
|
|
|
|
|
|
|
|
export const updatedApplicationPayload = {
|
|
|
|
|
id: "605c435a91dea93f0eaf91b8",
|
|
|
|
|
name: "Renamed application",
|
|
|
|
|
slug: "renamed-application",
|
2022-06-15 15:37:41 +00:00
|
|
|
workspaceId: "",
|
2022-04-04 15:25:03 +00:00
|
|
|
evaluationVersion: 1,
|
|
|
|
|
appIsExample: false,
|
|
|
|
|
gitApplicationMetadata: undefined,
|
|
|
|
|
applicationVersion: 2,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const updatedPagePayload = {
|
|
|
|
|
id: "605c435a91dea93f0eaf91bc",
|
|
|
|
|
name: "My Page 2",
|
|
|
|
|
isDefault: false,
|
|
|
|
|
slug: "my-page-2",
|
|
|
|
|
};
|