diff --git a/src/App.js b/src/App.js index bc63650..ba638e5 100644 --- a/src/App.js +++ b/src/App.js @@ -21,7 +21,6 @@ import DirtyNavigationDialog from './components/DirtyNavigationDialog'; import ConfirmationDialog from './components/ConfirmationDialog'; import StoreSyncOverlay from './components/StoreSyncOverlay'; import RangePickerModal from './components/RangePickerModal'; -import PickupConfigEditor from './PickupConfigEditor'; function App() { const [credentials, setCredentials] = useState({ email: '', password: '' }); @@ -695,25 +694,6 @@ function App() { ); - const legacyEditorContent = session?.isAdmin ? ( - fetchConfig()} - onSaveConfig={saveConfig} - /> - ) : ( - - ); - return ( <> @@ -722,7 +702,6 @@ function App() { - } /> diff --git a/src/PickupConfigEditor.js b/src/PickupConfigEditor.js deleted file mode 100644 index 9089d3f..0000000 --- a/src/PickupConfigEditor.js +++ /dev/null @@ -1,116 +0,0 @@ -import PickupConfigTable from './components/PickupConfigTable'; - -const PickupConfigEditor = ({ - config, - loading, - status, - error, - weekdays, - onToggleActive, - onToggleProfileCheck, - onToggleOnlyNotify, - onWeekdayChange, - onRangePickerRequest, - onResetConfig, - onSaveConfig -}) => { - const resolvedWeekdays = - weekdays || ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']; - - const resolveEntryId = (entryId, index) => { - if (entryId) { - return entryId; - } - if (typeof index === 'number' && config[index]?.id) { - return config[index].id; - } - return null; - }; - - const handleToggleActive = (entryId, index) => { - const resolvedId = resolveEntryId(entryId, index); - if (resolvedId && onToggleActive) { - onToggleActive(resolvedId); - } - }; - - const handleToggleProfileCheck = (entryId, index) => { - const resolvedId = resolveEntryId(entryId, index); - if (resolvedId && onToggleProfileCheck) { - onToggleProfileCheck(resolvedId); - } - }; - - const handleToggleOnlyNotify = (entryId, index) => { - const resolvedId = resolveEntryId(entryId, index); - if (resolvedId && onToggleOnlyNotify) { - onToggleOnlyNotify(resolvedId); - } - }; - - const handleWeekdayChange = (entryId, value, index) => { - const resolvedId = resolveEntryId(entryId, index); - if (resolvedId && onWeekdayChange) { - onWeekdayChange(resolvedId, value); - } - }; - - const handleRangePickerRequest = (entryId, index) => { - const resolvedId = resolveEntryId(entryId, index); - if (resolvedId && onRangePickerRequest) { - onRangePickerRequest(resolvedId); - } - }; - - if (loading && !config.length) { - return Lade Konfiguration...; - } - - return ( - - Tabellarischer Editor - - {error && ( - {error} - )} - - {status && ( - {status} - )} - - - - - - Zurücksetzen - - - Konfiguration speichern - - - - - Aktuelle JSON-Konfiguration: - {JSON.stringify(config, null, 2)} - - - ); -}; - -export default PickupConfigEditor; diff --git a/src/components/NavigationTabs.js b/src/components/NavigationTabs.js index 19e908e..e603e58 100644 --- a/src/components/NavigationTabs.js +++ b/src/components/NavigationTabs.js @@ -10,7 +10,6 @@ const NavigationTabs = ({ isAdmin, onProtectedNavigate }) => { const tabs = [ { to: '/', label: 'Konfiguration' }, - { to: '/legacy', label: 'Tabelleneditor' }, { to: '/admin', label: 'Admin' } ]; diff --git a/src/components/PickupConfigTable.js b/src/components/PickupConfigTable.js deleted file mode 100644 index cfd3ebe..0000000 --- a/src/components/PickupConfigTable.js +++ /dev/null @@ -1,108 +0,0 @@ -import { formatRangeLabel } from '../utils/dateUtils'; - -const PickupConfigTable = ({ - config, - weekdays, - onToggleActive, - onToggleProfileCheck, - onToggleOnlyNotify, - onWeekdayChange, - onRangePickerRequest -}) => { - return ( - - - - - Aktiv - Geschäft - Profil prüfen - Nur benachrichtigen - Wochentag - Datum / Zeitraum - - - - {config.map((item, index) => { - const itemId = item?.id; - const normalizedRange = item.desiredDateRange - ? { ...item.desiredDateRange } - : item.desiredDate - ? { start: item.desiredDate, end: item.desiredDate } - : null; - const rangeStart = normalizedRange?.start || ''; - const rangeEnd = normalizedRange?.end || ''; - const hasDateRange = Boolean(rangeStart || rangeEnd); - const rowKey = item.id ? `${item.id}-${index}` : `row-${index}`; - return ( - - - onToggleActive(itemId, index)} - className="h-5 w-5" - /> - - - {item.label} - - - onToggleProfileCheck(itemId, index)} - className="h-5 w-5" - /> - - - onToggleOnlyNotify(itemId, index)} - className="h-5 w-5" - /> - - - onWeekdayChange(itemId, e.target.value, index)} - className="border rounded p-1 w-full" - disabled={hasDateRange} - > - Kein Wochentag - {weekdays.map((day) => ( - - {day} - - ))} - - - - { - if (item.desiredWeekday) { - return; - } - onRangePickerRequest(itemId, index); - }} - disabled={Boolean(item.desiredWeekday)} - className={`w-full border rounded p-2 text-left transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${ - item.desiredWeekday ? 'bg-gray-100 text-gray-400 cursor-not-allowed' : 'bg-white hover:border-blue-400' - }`} - > - {formatRangeLabel(rangeStart, rangeEnd)} - Klicke zum Auswählen - - - - ); - })} - - - - ); -}; - -export default PickupConfigTable;
{JSON.stringify(config, null, 2)}