mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: style read-only drawers.
fix: empty state in resources tables.
This commit is contained in:
@@ -7,4 +7,9 @@ export const setBillsTableState = (queries) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
export const resetBillsTableState = () => {
|
||||
return {
|
||||
type: t.BILLS_TABLE_STATE_RESET,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -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:bills';
|
||||
@@ -21,14 +24,11 @@ const CONFIG = {
|
||||
};
|
||||
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('BILLS'),
|
||||
...createTableStateReducers('BILLS', defaultTableQuery),
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export default persistReducer(
|
||||
CONFIG,
|
||||
reducerInstance,
|
||||
);
|
||||
export default persistReducer(CONFIG, reducerInstance);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import { paginationLocationQuery } from 'store/selectors';
|
||||
import { createDeepEqualSelector } from 'utils';
|
||||
import { defaultTableQuery } from './bills.reducer';
|
||||
|
||||
const billsTableStateSelector = (state) => state.bills.tableState;
|
||||
|
||||
@@ -15,3 +18,8 @@ export const getBillsTableStateFactory = () =>
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
export const billsTableStateChangedFactory = () =>
|
||||
createDeepEqualSelector(billsTableStateSelector, (tableState) => {
|
||||
return !isEqual(tableState, defaultTableQuery);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
export default {
|
||||
BILLS_TABLE_STATE_SET: 'BILLS/TABLE_STATE_SET',
|
||||
BILLS_TABLE_STATE_RESET: 'BILLS/TABLE_STATE_RESET',
|
||||
};
|
||||
Reference in New Issue
Block a user