From 30ccda010fa44fa03bf82e1172a5b4e61722a09b Mon Sep 17 00:00:00 2001 From: seb Date: Mon, 3 Aug 2026 08:06:28 +0200 Subject: [PATCH] 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 --- src/components/CompanySettingsDialog.jsx | 16 ---------------- src/components/article/NewArticleTile.jsx | 2 -- src/components/category/NewCategoryTile.jsx | 2 -- 3 files changed, 20 deletions(-) diff --git a/src/components/CompanySettingsDialog.jsx b/src/components/CompanySettingsDialog.jsx index 178a977..c0c7f88 100644 --- a/src/components/CompanySettingsDialog.jsx +++ b/src/components/CompanySettingsDialog.jsx @@ -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; diff --git a/src/components/article/NewArticleTile.jsx b/src/components/article/NewArticleTile.jsx index 15f3db9..c963c57 100644 --- a/src/components/article/NewArticleTile.jsx +++ b/src/components/article/NewArticleTile.jsx @@ -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); } diff --git a/src/components/category/NewCategoryTile.jsx b/src/components/category/NewCategoryTile.jsx index e00e009..36163f7 100644 --- a/src/components/category/NewCategoryTile.jsx +++ b/src/components/category/NewCategoryTile.jsx @@ -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() {