Remove unnecessary notistacks and dead terminal enable/disable code
- Remove 'Artikel angelegt.' snackbar from NewArticleTile - Remove 'Kategorie angelegt.' snackbar from NewCategoryTile - Remove dead handleEnableAllCategories method and binding from CompanySettingsDialog
This commit is contained in:
@@ -65,7 +65,6 @@ class CompanySettingsDialog extends Component {
|
||||
this.syncFormFromCompany = this.syncFormFromCompany.bind(this);
|
||||
this.handleCreateTerminal = this.handleCreateTerminal.bind(this);
|
||||
this.handleDeleteTerminal = this.handleDeleteTerminal.bind(this);
|
||||
this.handleEnableAllCategories = this.handleEnableAllCategories.bind(this);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
@@ -131,21 +130,6 @@ class CompanySettingsDialog extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async handleEnableAllCategories(terminal) {
|
||||
try {
|
||||
const hasCategories = terminal.categoryIds && terminal.categoryIds.length > 0;
|
||||
if (hasCategories) {
|
||||
await this.props.disableAllTerminalCategories({ terminalId: terminal.id }).unwrap();
|
||||
enqueueSnackbar('Alle Kategorien für Terminal deaktiviert.', { variant: 'success' });
|
||||
} else {
|
||||
await this.props.enableAllTerminalCategories({ terminalId: terminal.id }).unwrap();
|
||||
enqueueSnackbar('Alle Kategorien für Terminal aktiviert.', { variant: 'success' });
|
||||
}
|
||||
} catch (err) {
|
||||
notifyError(err);
|
||||
}
|
||||
}
|
||||
|
||||
async handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
const { onClose } = this.props;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { ActionTile } from '../tiles';
|
||||
import { createArticle as createArticleThunk } from '../../store/categorySlice';
|
||||
import ArticleNameDialog from './ArticleNameDialog';
|
||||
@@ -25,7 +24,6 @@ class NewArticleTile extends Component {
|
||||
async handleSubmit({ name }) {
|
||||
const { parentId } = this.props;
|
||||
const article = await this.props.createArticle({ parentId, name }).unwrap();
|
||||
enqueueSnackbar('Artikel angelegt.', { variant: 'success' });
|
||||
if (article) {
|
||||
this.props.onOpenArticle?.(article);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { ActionTile } from '../tiles';
|
||||
import { createCategory as createCategoryThunk } from '../../store/categorySlice';
|
||||
import CategoryNameDialog from './CategoryNameDialog';
|
||||
@@ -25,7 +24,6 @@ class NewCategoryTile extends Component {
|
||||
async handleSubmit({ name }) {
|
||||
const { parentId } = this.props;
|
||||
await this.props.createCategory({ parentId, name }).unwrap();
|
||||
enqueueSnackbar('Kategorie angelegt.', { variant: 'success' });
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user