mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: style read-only drawers.
fix: empty state in resources tables.
This commit is contained in:
@@ -7,4 +7,10 @@ export const setInvoicesTableState = (queries) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const resetInvoicesTableState= () => {
|
||||
return {
|
||||
type: t.INVOICES_TABLE_STATE_RESET,
|
||||
};
|
||||
}
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
|
||||
@@ -6,12 +6,15 @@ import {
|
||||
} 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:invoices';
|
||||
@@ -23,7 +26,7 @@ const CONFIG = {
|
||||
};
|
||||
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('INVOICES'),
|
||||
...createTableStateReducers('INVOICES', defaultTableQuery),
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { isEqual } from 'lodash';
|
||||
import { paginationLocationQuery } from 'store/selectors';
|
||||
import { createDeepEqualSelector } from 'utils';
|
||||
import { defaultTableQuery } from './invoices.reducer';
|
||||
|
||||
const invoicesTableStateSelector = (state) => state.salesInvoices.tableState;
|
||||
|
||||
@@ -17,3 +19,14 @@ export const getInvoicesTableStateFactory = () =>
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieve invoices table state.
|
||||
*/
|
||||
export const isInvoicesTableStateChangedFactory = () =>
|
||||
createDeepEqualSelector(
|
||||
invoicesTableStateSelector,
|
||||
(tableState) => {
|
||||
return !isEqual(tableState, defaultTableQuery);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
export default {
|
||||
INVOICES_TABLE_STATE_SET: 'INVOICES/TABLE_STATE_SET',
|
||||
INVOICES_TABLE_STATE_RESET: 'INVOICES/TABLE_STATE_RESET',
|
||||
};
|
||||
Reference in New Issue
Block a user