feat: style read-only drawers.

fix: empty state in resources tables.
This commit is contained in:
a.bouhuolia
2021-08-24 14:57:19 +02:00
parent f5fd2aa324
commit af34986aac
143 changed files with 1530 additions and 915 deletions

View File

@@ -4,12 +4,15 @@ import storage from 'redux-persist/lib/storage';
import { createTableStateReducers } from 'store/tableState.reducer';
import t from 'store/types';
export const defaultTableQuery = {
pageSize: 12,
pageIndex: 0,
filterRoles: [],
viewSlug: null,
}
const initialState = {
tableState: {
pageSize: 12,
pageIndex: 0,
filterRoles: [],
},
tableState: defaultTableQuery,
};
const STORAGE_KEY = 'bigcapital:manualJournals';
@@ -21,7 +24,7 @@ const CONFIG = {
};
const reducerInstance = createReducer(initialState, {
...createTableStateReducers('MANUAL_JOURNALS'),
...createTableStateReducers('MANUAL_JOURNALS', defaultTableQuery),
[t.RESET]: () => {
purgeStoredState(CONFIG);

View File

@@ -1,5 +1,8 @@
import { isEqual } from 'lodash';
import { paginationLocationQuery } from 'store/selectors';
import { createDeepEqualSelector } from 'utils';
import { defaultTableQuery } from './manualJournals.reducers';
const manualJournalsTableState = (state) => state.manualJournals.tableState;
@@ -15,3 +18,8 @@ export const getManualJournalsTableStateFactory = () =>
};
},
);
export const manualJournalTableStateChangedFactory = () =>
createDeepEqualSelector(manualJournalsTableState, (tableState) => {
return !isEqual(tableState, defaultTableQuery);
});

View File

@@ -1,3 +1,4 @@
export default {
MANUAL_JOURNALS_TABLE_STATE_SET: 'MANUAL_JOURNALS/TABLE_STATE_SET',
MANUAL_JOURNALS_TABLE_STATE_RESET: 'MANUAL_JOURNALS/TABLE_STATE_RESET',
};