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
|
||||
const notices = state.notices.filter((notice) => !['save-form', 'missing-lists'].includes(notice.id));
|
||||
const hasMissingLists = state.formErrors.includes('missing-lists');
|
||||
const sidebarOpenedPanels = [...state.sidebar.openedPanels];
|
||||
if (hasMissingLists) {
|
||||
notices.push({
|
||||
id: 'missing-lists',
|
||||
@@ -11,10 +12,19 @@ export default (state) => {
|
||||
isDismissible: true,
|
||||
status: 'error',
|
||||
});
|
||||
if (!sidebarOpenedPanels.includes('basic-settings')) {
|
||||
sidebarOpenedPanels.push('basic-settings');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
isFormSaving: !hasMissingLists,
|
||||
sidebar: {
|
||||
...state.sidebar,
|
||||
activeTab: hasMissingLists ? 'form' : state.sidebar.activeTab,
|
||||
openedPanels: sidebarOpenedPanels,
|
||||
},
|
||||
notices,
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user