Add list input highlight on save if no list selected
[MAILOET-2455]
This commit is contained in:
committed by
Jack Kitterhing
parent
338e2480d2
commit
836974fbe2
@@ -4,6 +4,7 @@ export default (state) => {
|
|||||||
// remove all form saving related notices
|
// remove all form saving related notices
|
||||||
const notices = state.notices.filter((notice) => !['save-form', 'missing-lists'].includes(notice.id));
|
const notices = state.notices.filter((notice) => !['save-form', 'missing-lists'].includes(notice.id));
|
||||||
const hasMissingLists = state.formErrors.includes('missing-lists');
|
const hasMissingLists = state.formErrors.includes('missing-lists');
|
||||||
|
const sidebarOpenedPanels = [...state.sidebar.openedPanels];
|
||||||
if (hasMissingLists) {
|
if (hasMissingLists) {
|
||||||
notices.push({
|
notices.push({
|
||||||
id: 'missing-lists',
|
id: 'missing-lists',
|
||||||
@@ -11,10 +12,19 @@ export default (state) => {
|
|||||||
isDismissible: true,
|
isDismissible: true,
|
||||||
status: 'error',
|
status: 'error',
|
||||||
});
|
});
|
||||||
|
if (!sidebarOpenedPanels.includes('basic-settings')) {
|
||||||
|
sidebarOpenedPanels.push('basic-settings');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
isFormSaving: !hasMissingLists,
|
isFormSaving: !hasMissingLists,
|
||||||
|
sidebar: {
|
||||||
|
...state.sidebar,
|
||||||
|
activeTab: hasMissingLists ? 'form' : state.sidebar.activeTab,
|
||||||
|
openedPanels: sidebarOpenedPanels,
|
||||||
|
},
|
||||||
notices,
|
notices,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user