mirror of
https://github.com/strapi/strapi.git
synced 2025-11-17 18:51:22 +00:00
listview dropdown filter fix
This commit is contained in:
parent
83048b38d8
commit
4551c2f383
@ -121,6 +121,7 @@ function ListView({
|
|||||||
// Helpers
|
// Helpers
|
||||||
const getMetaDatas = (path = []) =>
|
const getMetaDatas = (path = []) =>
|
||||||
get(layouts, [...contentTypePath, 'metadatas', ...path], {});
|
get(layouts, [...contentTypePath, 'metadatas', ...path], {});
|
||||||
|
|
||||||
const getListLayout = () =>
|
const getListLayout = () =>
|
||||||
get(layouts, [...contentTypePath, 'layouts', 'list'], []);
|
get(layouts, [...contentTypePath, 'layouts', 'list'], []);
|
||||||
|
|
||||||
@ -190,7 +191,11 @@ function ListView({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
onChangeListLabels({
|
onChangeListLabels({
|
||||||
target: { name: `${slug}.${name}`, value: !value },
|
target: {
|
||||||
|
name,
|
||||||
|
slug,
|
||||||
|
value: !value,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -53,10 +53,11 @@ export function getLayoutSucceeded(layout, uid) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onChangeListLabels({ target: { name, value } }) {
|
export function onChangeListLabels({ target: { name, slug, value } }) {
|
||||||
return {
|
return {
|
||||||
type: ON_CHANGE_LIST_LABELS,
|
type: ON_CHANGE_LIST_LABELS,
|
||||||
keys: name.split('.'),
|
name,
|
||||||
|
slug,
|
||||||
value,
|
value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,18 +42,17 @@ function mainReducer(state = initialState, action) {
|
|||||||
.updateIn(['layouts', action.uid], () => fromJS(action.layout))
|
.updateIn(['layouts', action.uid], () => fromJS(action.layout))
|
||||||
.updateIn(['initialLayouts', action.uid], () => fromJS(action.layout));
|
.updateIn(['initialLayouts', action.uid], () => fromJS(action.layout));
|
||||||
case ON_CHANGE_LIST_LABELS: {
|
case ON_CHANGE_LIST_LABELS: {
|
||||||
const {
|
const { name, slug, value } = action;
|
||||||
keys: [slug, label],
|
|
||||||
value,
|
|
||||||
} = action;
|
|
||||||
|
|
||||||
return state.updateIn(['layouts', slug, 'layouts', 'list'], list => {
|
return state.updateIn(
|
||||||
|
['layouts', slug, 'contentType', 'layouts', 'list'],
|
||||||
|
list => {
|
||||||
if (value) {
|
if (value) {
|
||||||
return list.push(label);
|
return list.push(name);
|
||||||
}
|
}
|
||||||
|
return list.filter(l => l !== name);
|
||||||
return list.filter(l => l !== label);
|
}
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
case RESET_LIST_LABELS:
|
case RESET_LIST_LABELS:
|
||||||
return state.updateIn(['layouts', action.slug], () =>
|
return state.updateIn(['layouts', action.slug], () =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user