diff --git a/.gitignore b/.gitignore index 4d29575..74fa004 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.commitmessage diff --git a/src/App.js b/src/App.js index f49eb4a..efc5a5d 100644 --- a/src/App.js +++ b/src/App.js @@ -2,14 +2,6 @@ import React, { useState, useEffect, useCallback, useMemo } from 'react'; import { BrowserRouter as Router, Routes, Route, Navigate, Link, useLocation } from 'react-router-dom'; import './App.css'; -const emptyEntry = { - id: '', - label: '', - active: false, - checkProfileId: true, - onlyNotify: false -}; - const TOKEN_STORAGE_KEY = 'pickupConfigToken'; function App() { @@ -20,8 +12,6 @@ function App() { const [loading, setLoading] = useState(false); const [status, setStatus] = useState(''); const [error, setError] = useState(''); - const [newEntry, setNewEntry] = useState(emptyEntry); - const [showNewEntryForm, setShowNewEntryForm] = useState(false); const [availableCollapsed, setAvailableCollapsed] = useState(true); const [adminSettings, setAdminSettings] = useState(null); const [adminSettingsLoading, setAdminSettingsLoading] = useState(false); @@ -115,8 +105,6 @@ function App() { setStores([]); setStatus(''); setError(''); - setShowNewEntryForm(false); - setNewEntry(emptyEntry); setAdminSettings(null); setAdminSettingsLoading(false); setAvailableCollapsed(true); @@ -588,26 +576,6 @@ function App() { } }; - const addEntry = () => { - if (!newEntry.id || !newEntry.label) { - setError('ID und Bezeichnung müssen ausgefüllt werden!'); - return; - } - - const normalized = { - ...newEntry, - id: String(newEntry.id), - hidden: false - }; - - const updatedConfig = [...config.filter((item) => item.id !== normalized.id), normalized]; - setConfig(updatedConfig); - setNewEntry(emptyEntry); - setShowNewEntryForm(false); - setStatus('Neuer Eintrag hinzugefügt!'); - setTimeout(() => setStatus(''), 3000); - }; - const deleteEntry = (entryId) => { if (window.confirm('Soll dieser Eintrag dauerhaft gelöscht werden?')) { const updatedConfig = config.filter((item) => item.id !== entryId); @@ -681,14 +649,6 @@ function App() { ); }; - const handleNewEntryChange = (event) => { - const { name, value, type, checked } = event.target; - setNewEntry({ - ...newEntry, - [name]: type === 'checkbox' ? checked : value - }); - }; - const configMap = useMemo(() => { const map = new Map(); config.forEach((item) => { @@ -1165,128 +1125,7 @@ function App() { - {showNewEntryForm ? ( -