Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #19 - Bulk action - Missing message notification when user use bulk action but not choose item #110

Merged
merged 4 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/containers/CategoriesPage/Component/ListCategories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Table from 'components/Table';
import Spinner from 'components/Spinner';
import SelectComponent from 'components/Select';
import history from 'routes/history';
import { notify } from 'components/Toast';

const ListCategories = observer((props) => {
const { t } = props;
Expand Down Expand Up @@ -213,8 +214,12 @@ const ListCategories = observer((props) => {
};

const deleteCategories = () => {
viewModel.isLoading();
viewModel.deleteCategories(listSelected);
if (listSelected.length < 1) {
notify(t('txt_row_select_error'), 'error');
} else {
viewModel.isLoading();
viewModel.deleteCategories(listSelected);
}
};

return (
Expand Down
9 changes: 7 additions & 2 deletions src/containers/FieldsPage/Component/ListFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Spinner from 'components/Spinner';
import history from 'routes/history';
import { Tab, Tabs } from 'react-bootstrap';
import SelectComponent from 'components/Select';
import { notify } from 'components/Toast';

const ListFields = observer((props) => {
const { t } = props;
Expand Down Expand Up @@ -124,8 +125,12 @@ const ListFields = observer((props) => {
};

const deleteFields = () => {
viewModel.isLoading();
viewModel.deleteFields(listSelected);
if (listSelected.length < 1) {
notify(t('txt_row_select_error'), 'error');
} else {
viewModel.isLoading();
viewModel.deleteFields(listSelected);
}
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Table from 'components/Table';
import '../index.scss';
import ActionsBar from 'components/ActionsBar';
import history from 'routes/history';
import { notify } from 'components/Toast';

const ListProductPrice = observer((props) => {
const { t } = props;
Expand Down Expand Up @@ -57,8 +58,12 @@ const ListProductPrice = observer((props) => {
};

const deleteProductPrices = () => {
viewModel.isLoading();
viewModel.deleteProductPrices(listSelected);
if (listSelected.length < 1) {
notify(t('txt_row_select_error'), 'error');
} else {
viewModel.isLoading();
viewModel.deleteProductPrices(listSelected);
}
};

const columnsTable = [
Expand Down
8 changes: 6 additions & 2 deletions src/containers/ProductsPage/Component/ListProducts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ const ListProducts = observer((props) => {
};

const deleteProducts = () => {
viewModel.isLoading();
viewModel.deleteProducts(listSelected);
if (listSelected.length < 1) {
notify(t('txt_row_select_error'), 'error');
} else {
viewModel.isLoading();
viewModel.deleteProducts(listSelected);
}
};

return (
Expand Down