fix: push js object after creation (#11123)
This commit is contained in:
parent
c1f89e5830
commit
92a8df8f04
|
|
@ -35,9 +35,11 @@ export const ExplorerJSCollectionEntity = memo(
|
||||||
getJSCollection(state, props.id),
|
getJSCollection(state, props.id),
|
||||||
) as JSCollection;
|
) as JSCollection;
|
||||||
const navigateToJSCollection = useCallback(() => {
|
const navigateToJSCollection = useCallback(() => {
|
||||||
|
if (jsAction.id) {
|
||||||
history.push(
|
history.push(
|
||||||
JS_COLLECTION_ID_URL(applicationId, pageId, jsAction.id, {}),
|
JS_COLLECTION_ID_URL(applicationId, pageId, jsAction.id, {}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}, [pageId]);
|
}, [pageId]);
|
||||||
const contextMenu = (
|
const contextMenu = (
|
||||||
<JSCollectionEntityContextMenu
|
<JSCollectionEntityContextMenu
|
||||||
|
|
|
||||||
|
|
@ -40,29 +40,16 @@ const jsActionsReducer = createReducer(initialState, {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR]: () => initialState,
|
[ReduxActionErrorTypes.FETCH_JS_ACTIONS_ERROR]: () => initialState,
|
||||||
[ReduxActionTypes.CREATE_JS_ACTION_INIT]: (
|
[ReduxActionTypes.CREATE_JS_ACTION_SUCCESS]: (
|
||||||
state: JSCollectionDataState,
|
state: JSCollectionDataState,
|
||||||
action: ReduxAction<JSCollection>,
|
action: ReduxAction<JSCollection>,
|
||||||
): JSCollectionDataState =>
|
): JSCollectionDataState =>
|
||||||
state.concat([
|
state.concat([
|
||||||
{
|
{
|
||||||
config: { ...action.payload, id: action.payload.name },
|
config: { ...action.payload },
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
[ReduxActionTypes.CREATE_JS_ACTION_SUCCESS]: (
|
|
||||||
state: JSCollectionDataState,
|
|
||||||
action: ReduxAction<JSCollection>,
|
|
||||||
): JSCollectionDataState =>
|
|
||||||
state.map((a) => {
|
|
||||||
if (
|
|
||||||
a.config.pageId === action.payload.pageId &&
|
|
||||||
a.config.id === action.payload.name
|
|
||||||
) {
|
|
||||||
return { ...a, config: action.payload };
|
|
||||||
}
|
|
||||||
return a;
|
|
||||||
}),
|
|
||||||
[ReduxActionErrorTypes.CREATE_JS_ACTION_ERROR]: (
|
[ReduxActionErrorTypes.CREATE_JS_ACTION_ERROR]: (
|
||||||
state: JSCollectionDataState,
|
state: JSCollectionDataState,
|
||||||
action: ReduxAction<JSCollection>,
|
action: ReduxAction<JSCollection>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user