feat: journal number setting dialog.

This commit is contained in:
Ahmed Bouhuolia
2020-10-21 01:01:06 +02:00
parent c14116a0fd
commit fb1ecd529f
22 changed files with 304 additions and 150 deletions

View File

@@ -14,7 +14,8 @@ const initialState = {
},
paginationMeta: {
total: 0,
}
},
nextJournalNumberChanged: false,
};
const defaultJournal = {
@@ -114,6 +115,11 @@ const reducer = createReducer(initialState, {
paginationMeta,
},
};
},
[t.MANUAL_JOURNAL_NUMBER_CHANGED]: (state, action) => {
const { isChanged } = action.payload;
state.nextJournalNumberChanged = isChanged;
}
});

View File

@@ -12,4 +12,6 @@ export default {
MANUAL_JOURNAL_PUBLISH: 'MANUAL_JOURNAL_PUBLISH',
MANUAL_JOURNALS_BULK_DELETE: 'MANUAL_JOURNALS_BULK_DELETE',
MANUAL_JOURNALS_PAGINATION_SET: 'MANUAL_JOURNALS_PAGINATION_SET',
MANUAL_JOURNAL_NUMBER_CHANGED: 'MANUAL_JOURNAL_NUMBER_CHANGED'
};

View File

@@ -12,7 +12,16 @@ const initialState = {
export default createReducer(initialState, {
[t.SETTING_SET]: (state, action) => {
const { options } = action;
state.data.organization = optionsArrayToMap(options);
const _data = {
...state.data,
};
options.forEach((option) => {
const { key, group, value } = option;
if (!_data[group]) {
_data[group] = {};
}
_data[group][key] = value;
});
state.data = _data;
},
});