mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: bulk transcations delete
This commit is contained in:
@@ -14,3 +14,9 @@ export const resetBillsTableState = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setBillsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'BILLS/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:bills';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('BILLS', defaultTableQuery),
|
||||
|
||||
[`BILLS/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -14,4 +14,9 @@ export const resetCreditNoteTableState = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
export const setCreditNotesSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'CREDIT_NOTES/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:credit_notes';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('CREDIT_NOTES', defaultTableQuery),
|
||||
|
||||
[`CREDIT_NOTES/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -13,3 +13,10 @@ export const resetEstimatesTableState = () => {
|
||||
type: t.ESTIMATES_TABLE_STATE_RESET,
|
||||
};
|
||||
}
|
||||
|
||||
export const setEstimatesSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'ESTIMATES/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:estimates';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('ESTIMATES', defaultTableQuery),
|
||||
|
||||
[`ESTIMATES/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -14,4 +14,9 @@ export const resetInvoicesTableState= () => {
|
||||
};
|
||||
}
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
export const setInvoicesSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'INVOICES/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:invoices';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('INVOICES', defaultTableQuery),
|
||||
|
||||
[`INVOICES/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -13,3 +13,10 @@ export const resetPaymentReceivesTableState = () => {
|
||||
type: t.PAYMENT_RECEIVES_TABLE_STATE_RESET
|
||||
};
|
||||
}
|
||||
|
||||
export const setPaymentReceivesSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'PAYMENT_RECEIVES/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:paymentReceives';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('PAYMENT_RECEIVES', defaultTableQuery),
|
||||
|
||||
[`PAYMENT_RECEIVES/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:vendor_credits';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('VENDOR_CREDITS', defaultTableQuery),
|
||||
|
||||
[`VENDOR_CREDITS/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -14,4 +14,9 @@ export const resetVendorCreditTableState = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
export const setVendorCreditsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'VENDOR_CREDITS/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -15,4 +15,14 @@ export const resetAccountsTableState = () => {
|
||||
return {
|
||||
type: t.ACCOUNTS_TABLE_STATE_RESET,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the selected rows for accounts table.
|
||||
*/
|
||||
export const setAccountsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'ACCOUNTS/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
@@ -13,6 +13,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:accounts';
|
||||
@@ -26,6 +27,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('ACCOUNTS', defaultTableQuery),
|
||||
|
||||
[`ACCOUNTS/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -18,3 +18,9 @@ export const resetExpensesTableState = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setExpensesSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'EXPENSES/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@ export const defaultTableQuery = {
|
||||
// Initial state.
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:expenses';
|
||||
@@ -29,6 +30,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('EXPENSES', defaultTableQuery),
|
||||
|
||||
[`EXPENSES/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -15,4 +15,9 @@ export const resetItemsTableState = () => {
|
||||
};
|
||||
}
|
||||
|
||||
export const setSelectedRowsItems = () => {};
|
||||
export const setItemsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'ITEMS/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -29,6 +29,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('ITEMS', defaultTableQuery),
|
||||
|
||||
[`ITEMS/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
@@ -7,3 +7,10 @@ export const setManualJournalsTableState = (queries) => {
|
||||
payload: { queries },
|
||||
};
|
||||
};
|
||||
|
||||
export const setManualJournalsSelectedRows = (selectedRows) => {
|
||||
return {
|
||||
type: 'MANUAL_JOURNALS/SET_SELECTED_ROWS',
|
||||
payload: selectedRows,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export const defaultTableQuery = {
|
||||
|
||||
const initialState = {
|
||||
tableState: defaultTableQuery,
|
||||
selectedRows: [],
|
||||
};
|
||||
|
||||
const STORAGE_KEY = 'bigcapital:manualJournals';
|
||||
@@ -27,6 +28,10 @@ const CONFIG = {
|
||||
const reducerInstance = createReducer(initialState, {
|
||||
...createTableStateReducers('MANUAL_JOURNALS', defaultTableQuery),
|
||||
|
||||
[`MANUAL_JOURNALS/SET_SELECTED_ROWS`]: (state, action) => {
|
||||
state.selectedRows = action.payload;
|
||||
},
|
||||
|
||||
[t.RESET]: () => {
|
||||
purgeStoredState(CONFIG);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user