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.syncFormFromCompany = this.syncFormFromCompany.bind(this);
|
||||||
this.handleCreateTerminal = this.handleCreateTerminal.bind(this);
|
this.handleCreateTerminal = this.handleCreateTerminal.bind(this);
|
||||||
this.handleDeleteTerminal = this.handleDeleteTerminal.bind(this);
|
this.handleDeleteTerminal = this.handleDeleteTerminal.bind(this);
|
||||||
this.handleEnableAllCategories = this.handleEnableAllCategories.bind(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
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) {
|
async handleSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const { onClose } = this.props;
|
const { onClose } = this.props;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
|
||||||
import { ActionTile } from '../tiles';
|
import { ActionTile } from '../tiles';
|
||||||
import { createArticle as createArticleThunk } from '../../store/categorySlice';
|
import { createArticle as createArticleThunk } from '../../store/categorySlice';
|
||||||
import ArticleNameDialog from './ArticleNameDialog';
|
import ArticleNameDialog from './ArticleNameDialog';
|
||||||
@@ -25,7 +24,6 @@ class NewArticleTile extends Component {
|
|||||||
async handleSubmit({ name }) {
|
async handleSubmit({ name }) {
|
||||||
const { parentId } = this.props;
|
const { parentId } = this.props;
|
||||||
const article = await this.props.createArticle({ parentId, name }).unwrap();
|
const article = await this.props.createArticle({ parentId, name }).unwrap();
|
||||||
enqueueSnackbar('Artikel angelegt.', { variant: 'success' });
|
|
||||||
if (article) {
|
if (article) {
|
||||||
this.props.onOpenArticle?.(article);
|
this.props.onOpenArticle?.(article);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
|
||||||
import { ActionTile } from '../tiles';
|
import { ActionTile } from '../tiles';
|
||||||
import { createCategory as createCategoryThunk } from '../../store/categorySlice';
|
import { createCategory as createCategoryThunk } from '../../store/categorySlice';
|
||||||
import CategoryNameDialog from './CategoryNameDialog';
|
import CategoryNameDialog from './CategoryNameDialog';
|
||||||
@@ -25,7 +24,6 @@ class NewCategoryTile extends Component {
|
|||||||
async handleSubmit({ name }) {
|
async handleSubmit({ name }) {
|
||||||
const { parentId } = this.props;
|
const { parentId } = this.props;
|
||||||
await this.props.createCategory({ parentId, name }).unwrap();
|
await this.props.createCategory({ parentId, name }).unwrap();
|
||||||
enqueueSnackbar('Kategorie angelegt.', { variant: 'success' });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user