fix bugs in items form.

This commit is contained in:
Ahmed Bouhuolia
2020-04-15 01:29:46 +02:00
parent 26faaddfed
commit cac6620ffe
20 changed files with 378 additions and 129 deletions

View File

@@ -24,6 +24,7 @@ export const mapStateToProps = (state, props) => {
state.items.items, viewPages, state.items.currentPage),
bulkSelected: state.items.bulkActions,
itemsTableLoading: state.items.loading,
};
};
@@ -37,6 +38,14 @@ export const mapDispatchToProps = (dispatch) => ({
removeBulkActionItem: (id) => dispatch({
type: t.ITEM_BULK_ACTION_REMOVE, itemId: id,
}),
setItemsTableQuery: (key, value) => dispatch({
type: t.ITEMS_TABLE_QUERY_SET, key, value,
}),
addItemsTableQueries: (queries) =>
dispatch({
type: t.ITEMS_TABLE_QUERIES_ADD, queries,
}),
});
export default connect(mapStateToProps, mapDispatchToProps);

View File

@@ -12,6 +12,7 @@ export const mapStateToProps = (state, props) => {
const dialogPayload = getDialogPayload(state, 'item-form');
return {
categories: state.itemCategories.categories,
categoriesList: Object.values(state.itemCategories.categories),
name: 'item-form',
payload: { action: 'new', id: null },
editItemCategory:
@@ -21,6 +22,7 @@ export const mapStateToProps = (state, props) => {
getCategoryId: id => getCategoryId(state, id)
};
};
export const mapDispatchToProps = dispatch => ({
requestSubmitItemCategory: form => dispatch(submitItemCategory({ form })),
requestFetchItemCategories: () => dispatch(fetchItemCategories()),