mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
Merge remote-tracking branch 'origin/fix_connectors'
This commit is contained in:
@@ -13,10 +13,9 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import ItemCategoriesDataTable from 'containers/Items/ItemCategoriesTable';
|
||||
import ItemsCategoryActionsBar from 'containers/Items/ItemsCategoryActionsBar';
|
||||
|
||||
import withDialog from 'connectors/Dialog.connector';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
@@ -35,6 +34,7 @@ const ItemCategoryList = ({
|
||||
openDialog,
|
||||
}) => {
|
||||
const { id } = useParams();
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const [selectedRows, setSelectedRows] = useState([]);
|
||||
const [filter, setFilter] = useState({});
|
||||
@@ -42,8 +42,6 @@ const ItemCategoryList = ({
|
||||
const [bulkDelete, setBulkDelete] = useState(false);
|
||||
const [tableLoading, setTableLoading] = useState(false);
|
||||
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
useEffect(() => {
|
||||
id
|
||||
? changePageTitle(formatMessage({ id: 'edit_category_details' }))
|
||||
@@ -185,7 +183,7 @@ const ItemCategoryList = ({
|
||||
>
|
||||
<p>
|
||||
<FormattedHTMLMessage
|
||||
id={'once_delete_these_items_you_will_not_able_restore_them'}
|
||||
id={'once_delete_these_item_categories_you_will_not_able_restore_them'}
|
||||
/>
|
||||
</p>
|
||||
</Alert>
|
||||
@@ -196,5 +194,5 @@ const ItemCategoryList = ({
|
||||
export default compose(
|
||||
withItemCategoriesActions,
|
||||
withDashboardActions,
|
||||
withDialog,
|
||||
withDialogActions,
|
||||
)(ItemCategoryList);
|
||||
|
||||
@@ -13,15 +13,19 @@ import {
|
||||
Classes,
|
||||
Intent,
|
||||
} from '@blueprintjs/core';
|
||||
import { compose } from 'utils';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import Icon from 'components/Icon';
|
||||
import FilterDropdown from 'components/FilterDropdown';
|
||||
import withDialog from 'connectors/Dialog.connector';
|
||||
import { If } from 'components';
|
||||
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||
import withItems from 'containers/Items/withItems';
|
||||
import { If } from 'components';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
|
||||
const ItemsActionsBar = ({
|
||||
openDialog,
|
||||
@@ -137,7 +141,7 @@ const ItemsActionsBar = ({
|
||||
};
|
||||
|
||||
export default compose(
|
||||
withDialog,
|
||||
withDialogActions,
|
||||
withItems(({ itemsViews }) => ({
|
||||
itemsViews,
|
||||
})),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useMemo,useState } from 'react';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import {
|
||||
NavbarGroup,
|
||||
NavbarDivider,
|
||||
@@ -12,14 +12,14 @@ import {
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import { connect } from 'react-redux';
|
||||
import { If } from 'components';
|
||||
import Icon from 'components/Icon';
|
||||
|
||||
import Icon from 'components/Icon';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import FilterDropdown from 'components/FilterDropdown';
|
||||
import { If } from 'components';
|
||||
|
||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||
import withDialog from 'connectors/Dialog.connector';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
@@ -27,29 +27,29 @@ import { compose } from 'utils';
|
||||
const ItemsCategoryActionsBar = ({
|
||||
// #withResourceDetail
|
||||
resourceFields,
|
||||
|
||||
|
||||
// #withDialog
|
||||
openDialog,
|
||||
|
||||
// #ownProps
|
||||
selectedRows=[],
|
||||
selectedRows = [],
|
||||
onFilterChanged,
|
||||
onBulkDelete
|
||||
onBulkDelete,
|
||||
}) => {
|
||||
|
||||
const [filterCount, setFilterCount] = useState(0);
|
||||
|
||||
const onClickNewCategory = useCallback(() => {
|
||||
openDialog('item-category-form', {});
|
||||
}, [openDialog]);
|
||||
|
||||
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [selectedRows]);
|
||||
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [
|
||||
selectedRows,
|
||||
]);
|
||||
|
||||
// const handleDeleteCategory = useCallback((category) => {
|
||||
// onDeleteCategory(selectedRows);
|
||||
// }, [selectedRows, onDeleteCategory]);
|
||||
|
||||
|
||||
const filterDropdown = FilterDropdown({
|
||||
fields: resourceFields,
|
||||
onFilterChange: (filterConditions) => {
|
||||
@@ -58,17 +58,17 @@ const ItemsCategoryActionsBar = ({
|
||||
},
|
||||
});
|
||||
|
||||
const handelBulkDelete =useCallback(()=>{
|
||||
onBulkDelete && onBulkDelete(selectedRows.map(r=>r.id));
|
||||
},[onBulkDelete,selectedRows])
|
||||
const handelBulkDelete = useCallback(() => {
|
||||
onBulkDelete && onBulkDelete(selectedRows.map((r) => r.id));
|
||||
}, [onBulkDelete, selectedRows]);
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon='plus' />}
|
||||
text={<T id={'new_category'}/>}
|
||||
icon={<Icon icon="plus" />}
|
||||
text={<T id={'new_category'} />}
|
||||
onClick={onClickNewCategory}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
@@ -119,9 +119,9 @@ const withItemsCategoriesActionsBar = connect(mapStateToProps);
|
||||
|
||||
export default compose(
|
||||
withItemsCategoriesActionsBar,
|
||||
withDialog,
|
||||
withDialogActions,
|
||||
withDashboardActions,
|
||||
withResourceDetail(({ resourceFields }) => ({
|
||||
resourceFields,
|
||||
}))
|
||||
})),
|
||||
)(ItemsCategoryActionsBar);
|
||||
|
||||
Reference in New Issue
Block a user