fix: marking old async functions as async in the backed for settings (#10723)
This commit is contained in:
parent
92a8df8f04
commit
44597c5e57
|
|
@ -17,7 +17,7 @@ export const FIRST_EVAL_REDUX_ACTIONS = [
|
||||||
export const EVALUATE_REDUX_ACTIONS = [
|
export const EVALUATE_REDUX_ACTIONS = [
|
||||||
...FIRST_EVAL_REDUX_ACTIONS,
|
...FIRST_EVAL_REDUX_ACTIONS,
|
||||||
// Actions
|
// Actions
|
||||||
ReduxActionTypes.FETCH_ACTIONS_SUCCESS,
|
ReduxActionTypes.FETCH_PLUGIN_AND_JS_ACTIONS_SUCCESS,
|
||||||
ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS,
|
ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS,
|
||||||
ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
ReduxActionTypes.FETCH_ACTIONS_VIEW_MODE_SUCCESS,
|
||||||
ReduxActionErrorTypes.FETCH_ACTIONS_ERROR,
|
ReduxActionErrorTypes.FETCH_ACTIONS_ERROR,
|
||||||
|
|
@ -35,7 +35,6 @@ export const EVALUATE_REDUX_ACTIONS = [
|
||||||
ReduxActionErrorTypes.EXECUTE_PLUGIN_ACTION_ERROR,
|
ReduxActionErrorTypes.EXECUTE_PLUGIN_ACTION_ERROR,
|
||||||
ReduxActionTypes.CLEAR_ACTION_RESPONSE,
|
ReduxActionTypes.CLEAR_ACTION_RESPONSE,
|
||||||
// JS Actions
|
// JS Actions
|
||||||
ReduxActionTypes.FETCH_JS_ACTIONS_SUCCESS,
|
|
||||||
ReduxActionTypes.CREATE_JS_ACTION_SUCCESS,
|
ReduxActionTypes.CREATE_JS_ACTION_SUCCESS,
|
||||||
ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR,
|
ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR,
|
||||||
ReduxActionTypes.DELETE_JS_ACTION_SUCCESS,
|
ReduxActionTypes.DELETE_JS_ACTION_SUCCESS,
|
||||||
|
|
|
||||||
|
|
@ -645,6 +645,7 @@ export const ReduxActionTypes = {
|
||||||
/* This action constants is for identifying the status of the updates of the entities */
|
/* This action constants is for identifying the status of the updates of the entities */
|
||||||
ENTITY_UPDATE_STARTED: "ENTITY_UPDATE_STARTED",
|
ENTITY_UPDATE_STARTED: "ENTITY_UPDATE_STARTED",
|
||||||
ENTITY_UPDATE_SUCCESS: "ENTITY_UPDATE_SUCCESS",
|
ENTITY_UPDATE_SUCCESS: "ENTITY_UPDATE_SUCCESS",
|
||||||
|
FETCH_PLUGIN_AND_JS_ACTIONS_SUCCESS: "FETCH_PLUGIN_AND_JS_ACTIONS_SUCCESS",
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ReduxActionType = typeof ReduxActionTypes[keyof typeof ReduxActionTypes];
|
export type ReduxActionType = typeof ReduxActionTypes[keyof typeof ReduxActionTypes];
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,6 @@ function* initializeEditorSaga(
|
||||||
}),
|
}),
|
||||||
fetchPageList({ applicationId }, APP_MODE.EDIT),
|
fetchPageList({ applicationId }, APP_MODE.EDIT),
|
||||||
];
|
];
|
||||||
|
|
||||||
const successEffects = [
|
const successEffects = [
|
||||||
ReduxActionTypes.FETCH_APPLICATION_SUCCESS,
|
ReduxActionTypes.FETCH_APPLICATION_SUCCESS,
|
||||||
ReduxActionTypes.FETCH_PAGE_LIST_SUCCESS,
|
ReduxActionTypes.FETCH_PAGE_LIST_SUCCESS,
|
||||||
|
|
@ -136,12 +135,6 @@ function* initializeEditorSaga(
|
||||||
ReduxActionErrorTypes.FETCH_APPLICATION_ERROR,
|
ReduxActionErrorTypes.FETCH_APPLICATION_ERROR,
|
||||||
ReduxActionErrorTypes.FETCH_PAGE_LIST_ERROR,
|
ReduxActionErrorTypes.FETCH_PAGE_LIST_ERROR,
|
||||||
];
|
];
|
||||||
const jsActionsCall = yield failFastApiCalls(
|
|
||||||
[fetchJSCollections({ applicationId })],
|
|
||||||
[ReduxActionTypes.FETCH_JS_ACTIONS_SUCCESS],
|
|
||||||
[ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR],
|
|
||||||
);
|
|
||||||
if (!jsActionsCall) return;
|
|
||||||
if (pageId) {
|
if (pageId) {
|
||||||
initCalls.push(fetchPage(pageId, true) as any);
|
initCalls.push(fetchPage(pageId, true) as any);
|
||||||
successEffects.push(ReduxActionTypes.FETCH_PAGE_SUCCESS);
|
successEffects.push(ReduxActionTypes.FETCH_PAGE_SUCCESS);
|
||||||
|
|
@ -156,6 +149,34 @@ function* initializeEditorSaga(
|
||||||
|
|
||||||
if (!applicationAndLayoutCalls) return;
|
if (!applicationAndLayoutCalls) return;
|
||||||
|
|
||||||
|
const initActionsCalls = [
|
||||||
|
fetchActions({ applicationId }, []),
|
||||||
|
fetchJSCollections({ applicationId }),
|
||||||
|
];
|
||||||
|
|
||||||
|
const successActionEffects = [
|
||||||
|
ReduxActionTypes.FETCH_JS_ACTIONS_SUCCESS,
|
||||||
|
ReduxActionTypes.FETCH_ACTIONS_SUCCESS,
|
||||||
|
];
|
||||||
|
const failureActionEffects = [
|
||||||
|
ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR,
|
||||||
|
ReduxActionErrorTypes.FETCH_ACTIONS_ERROR,
|
||||||
|
];
|
||||||
|
const allActionCalls = yield failFastApiCalls(
|
||||||
|
initActionsCalls,
|
||||||
|
successActionEffects,
|
||||||
|
failureActionEffects,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!allActionCalls) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
yield put({
|
||||||
|
type: ReduxActionTypes.FETCH_PLUGIN_AND_JS_ACTIONS_SUCCESS,
|
||||||
|
});
|
||||||
|
yield put(executePageLoadActions());
|
||||||
|
}
|
||||||
|
|
||||||
let fetchPageCallResult;
|
let fetchPageCallResult;
|
||||||
const defaultPageId = yield select(getDefaultPageId);
|
const defaultPageId = yield select(getDefaultPageId);
|
||||||
const toLoadPageId = pageId || defaultPageId;
|
const toLoadPageId = pageId || defaultPageId;
|
||||||
|
|
@ -193,13 +214,6 @@ function* initializeEditorSaga(
|
||||||
);
|
);
|
||||||
if (!pluginFormCall) return;
|
if (!pluginFormCall) return;
|
||||||
|
|
||||||
const actionsCall = yield failFastApiCalls(
|
|
||||||
[fetchActions({ applicationId }, [executePageLoadActions()])],
|
|
||||||
[ReduxActionTypes.FETCH_ACTIONS_SUCCESS],
|
|
||||||
[ReduxActionErrorTypes.FETCH_ACTIONS_ERROR],
|
|
||||||
);
|
|
||||||
if (!actionsCall) return;
|
|
||||||
|
|
||||||
const currentApplication = yield select(getCurrentApplication);
|
const currentApplication = yield select(getCurrentApplication);
|
||||||
const appName = currentApplication ? currentApplication.name : "";
|
const appName = currentApplication ? currentApplication.name : "";
|
||||||
const appId = currentApplication ? currentApplication.id : "";
|
const appId = currentApplication ? currentApplication.id : "";
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,10 @@ export const getDifferenceInJSCollection = (
|
||||||
const action = parsedBody.actions[i];
|
const action = parsedBody.actions[i];
|
||||||
const preExisted = jsAction.actions.find((js) => js.name === action.name);
|
const preExisted = jsAction.actions.find((js) => js.name === action.name);
|
||||||
if (preExisted) {
|
if (preExisted) {
|
||||||
if (preExisted.actionConfiguration.body !== action.body) {
|
if (
|
||||||
|
preExisted.actionConfiguration.body !== action.body ||
|
||||||
|
preExisted.actionConfiguration.isAsync !== action.isAsync
|
||||||
|
) {
|
||||||
toBeUpdatedActions.push({
|
toBeUpdatedActions.push({
|
||||||
...preExisted,
|
...preExisted,
|
||||||
actionConfiguration: {
|
actionConfiguration: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user