2023-11-09 11:40:36 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
|
|
|
import {
|
|
|
|
|
ReduxActionErrorTypes,
|
|
|
|
|
ReduxActionTypes,
|
|
|
|
|
} from "@appsmith/constants/ReduxActionConstants";
|
|
|
|
|
import type { DependentFeatureFlags } from "@appsmith/selectors/engineSelectors";
|
|
|
|
|
import { fetchDatasources } from "actions/datasourceActions";
|
|
|
|
|
import { fetchPageDSLs } from "actions/pageActions";
|
|
|
|
|
import { fetchPlugins } from "actions/pluginActions";
|
|
|
|
|
|
2023-12-21 04:52:54 +00:00
|
|
|
export const CreateNewActionKey = {
|
|
|
|
|
PAGE: "pageId",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export const ActionContextType = {
|
|
|
|
|
PAGE: "PAGE",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export const ACTION_PARENT_ENTITY_TYPE = {
|
|
|
|
|
PAGE: "PAGE",
|
|
|
|
|
} as const;
|
2023-12-13 17:43:43 +00:00
|
|
|
|
2023-11-09 11:40:36 +00:00
|
|
|
export const getPageDependencyActions = (
|
|
|
|
|
currentWorkspaceId: string = "",
|
|
|
|
|
featureFlags: DependentFeatureFlags = {},
|
|
|
|
|
) => {
|
|
|
|
|
const initActions = [fetchPlugins(), fetchDatasources(), fetchPageDSLs()];
|
|
|
|
|
|
|
|
|
|
const successActions = [
|
|
|
|
|
ReduxActionTypes.FETCH_PLUGINS_SUCCESS,
|
|
|
|
|
ReduxActionTypes.FETCH_DATASOURCES_SUCCESS,
|
|
|
|
|
ReduxActionTypes.FETCH_PAGE_DSLS_SUCCESS,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const errorActions = [
|
|
|
|
|
ReduxActionErrorTypes.FETCH_PLUGINS_ERROR,
|
|
|
|
|
ReduxActionErrorTypes.FETCH_DATASOURCES_ERROR,
|
|
|
|
|
ReduxActionErrorTypes.POPULATE_PAGEDSLS_ERROR,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
initActions,
|
|
|
|
|
successActions,
|
|
|
|
|
errorActions,
|
|
|
|
|
};
|
|
|
|
|
};
|