re-structure to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 01:02:31 +02:00
parent 8242ec64ba
commit 7a0a13f9d5
10400 changed files with 46966 additions and 17223 deletions

View File

@@ -0,0 +1,12 @@
// @ts-nocheck
import t from '@/store/types';
/**
* Sets the inventory adjustments table state.
*/
export const setInventoryAdjustmentsTableState = (queries) => {
return {
type: t.INVENTORY_ADJUSTMENTS_TABLE_STATE_SET,
payload: { queries },
};
};

View File

@@ -0,0 +1,33 @@
// @ts-nocheck
import { createReducer } from '@reduxjs/toolkit';
import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import { createTableStateReducers } from '@/store/tableState.reducer';
import t from '@/store/types';
const initialState = {
tableState: {
pageSize: 20,
pageIndex: 0,
sortBy: [],
},
selectedRows: [],
};
const STORAGE_KEY = 'bigcapital:inventoryAdjustments';
const CONFIG = {
key: STORAGE_KEY,
whitelist: ['tableState'],
storage,
};
const reducerInstance = createReducer(initialState, {
...createTableStateReducers('INVENTORY_ADJUSTMENTS'),
[t.RESET]: () => {
purgeStoredState(CONFIG);
},
});
export default persistReducer(CONFIG, reducerInstance);

View File

@@ -0,0 +1,23 @@
// @ts-nocheck
import { createSelector } from '@reduxjs/toolkit';
import {
paginationLocationQuery,
} from '@/store/selectors';
const inventoryAdjustmentTableState = (state) =>
state.inventoryAdjustments.tableState;
/**
* Retrieve the inventory adjustments table state.
*/
export const getInventroyAdjsTableStateFactory = () =>
createSelector(
paginationLocationQuery,
inventoryAdjustmentTableState,
(locationQuery, tableQuery) => {
return {
...locationQuery,
...tableQuery,
};
},
);

View File

@@ -0,0 +1,5 @@
// @ts-nocheck
export default {
INVENTORY_ADJUSTMENTS_TABLE_STATE_SET: 'INVENTORY_ADJUSTMENTS/TABLE_STATE_SET',
};