mirror of
https://github.com/strapi/strapi.git
synced 2025-11-09 14:51:29 +00:00
Fix PR review
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
3750b507ab
commit
9d4b71ffbc
@ -20,22 +20,27 @@ const reducer = (state = initialState, action) =>
|
|||||||
produce(state, draftState => {
|
produce(state, draftState => {
|
||||||
const layoutPathEdit = ['modifiedData', 'layouts', 'edit'];
|
const layoutPathEdit = ['modifiedData', 'layouts', 'edit'];
|
||||||
const layoutPathRelations = ['modifiedData', 'layouts', 'editRelations'];
|
const layoutPathRelations = ['modifiedData', 'layouts', 'editRelations'];
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'ADD_RELATION': {
|
case 'ADD_RELATION': {
|
||||||
const layoutFieldList = get(state, layoutPathRelations, []);
|
const editRelationLayoutValue = get(state, layoutPathRelations, []);
|
||||||
set(draftState, layoutPathRelations, [...layoutFieldList, action.name]);
|
set(draftState, layoutPathRelations, [...editRelationLayoutValue, action.name]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'MOVE_RELATION': {
|
case 'MOVE_RELATION': {
|
||||||
const layoutFieldList = get(state, layoutPathRelations, []);
|
const editRelationLayoutValue = get(state, layoutPathRelations, []);
|
||||||
const { fromIndex, toIndex } = action;
|
const { fromIndex, toIndex } = action;
|
||||||
set(draftState, layoutPathRelations, arrayMoveItem(layoutFieldList, fromIndex, toIndex));
|
set(
|
||||||
|
draftState,
|
||||||
|
layoutPathRelations,
|
||||||
|
arrayMoveItem(editRelationLayoutValue, fromIndex, toIndex)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'MOVE_ROW': {
|
case 'MOVE_ROW': {
|
||||||
const layoutFieldRowList = get(state, layoutPathEdit, []);
|
const editFieldLayoutValue = get(state, layoutPathEdit, []);
|
||||||
const { fromIndex, toIndex } = action;
|
const { fromIndex, toIndex } = action;
|
||||||
set(draftState, layoutPathEdit, arrayMoveItem(layoutFieldRowList, fromIndex, toIndex));
|
set(draftState, layoutPathEdit, arrayMoveItem(editFieldLayoutValue, fromIndex, toIndex));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'ON_ADD_FIELD': {
|
case 'ON_ADD_FIELD': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user