From bd338b86dfefb19573d1ff6e697e9fb67c741f6a Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 8 Oct 2025 11:46:07 +0200 Subject: [PATCH] =?UTF-8?q?Implementiert=20InfoDialog=20und=20ConfirmDialo?= =?UTF-8?q?g=20in=20mehreren=20Komponenten,=20um=20die=20Benutzerinterakti?= =?UTF-8?q?on=20zu=20verbessern.=20F=C3=BCgt=20Dialogzust=C3=A4nde=20und?= =?UTF-8?q?=20Hilfsmethoden=20hinzu,=20die=20eine=20konsistente=20Handhabu?= =?UTF-8?q?ng=20von=20Informationen=20und=20Best=C3=A4tigungen=20erm=C3=B6?= =?UTF-8?q?glichen.=20Diese=20=C3=84nderungen=20erh=C3=B6hen=20die=20Benut?= =?UTF-8?q?zerfreundlichkeit=20und=20verbessern=20die=20visuelle=20R=C3=BC?= =?UTF-8?q?ckmeldung=20in=20der=20Anwendung.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 75 ++- frontend/src/components/BaseDialog.vue | 379 ++++++++++++++ frontend/src/components/ConfirmDialog.vue | 209 ++++++++ frontend/src/components/DIALOG_TEMPLATES.md | 414 ++++++++++++++++ frontend/src/components/DialogExamples.vue | 469 ++++++++++++++++++ frontend/src/components/ImageDialog.vue | 125 +++++ frontend/src/components/ImageViewerDialog.vue | 259 ++++++++++ frontend/src/components/InfoDialog.vue | 229 +++++++++ frontend/src/components/SeasonSelector.vue | 25 +- frontend/src/composables/useDialog.js | 169 +++++++ frontend/src/views/Activate.vue | 59 ++- frontend/src/views/ClubView.vue | 73 ++- frontend/src/views/CreateClub.vue | 71 +++ frontend/src/views/DiaryView.vue | 171 +++++-- frontend/src/views/Login.vue | 71 +++ frontend/src/views/MembersView.vue | 148 +++++- frontend/src/views/MyTischtennisAccount.vue | 75 ++- frontend/src/views/OfficialTournaments.vue | 146 +++++- frontend/src/views/PendingApprovalsView.vue | 77 ++- frontend/src/views/PredefinedActivities.vue | 83 +++- frontend/src/views/Register.vue | 75 ++- frontend/src/views/ScheduleView.vue | 87 +++- frontend/src/views/TeamManagementView.vue | 39 +- frontend/src/views/TournamentsView.vue | 427 +++++++++++++++- 24 files changed, 3834 insertions(+), 121 deletions(-) create mode 100644 frontend/src/components/BaseDialog.vue create mode 100644 frontend/src/components/ConfirmDialog.vue create mode 100644 frontend/src/components/DIALOG_TEMPLATES.md create mode 100644 frontend/src/components/DialogExamples.vue create mode 100644 frontend/src/components/ImageDialog.vue create mode 100644 frontend/src/components/ImageViewerDialog.vue create mode 100644 frontend/src/components/InfoDialog.vue create mode 100644 frontend/src/composables/useDialog.js diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 237966a..e9766ce 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -120,6 +120,27 @@ + + + + + + + + + + diff --git a/frontend/src/components/ConfirmDialog.vue b/frontend/src/components/ConfirmDialog.vue new file mode 100644 index 0000000..0298d6c --- /dev/null +++ b/frontend/src/components/ConfirmDialog.vue @@ -0,0 +1,209 @@ + + + + + + diff --git a/frontend/src/components/DIALOG_TEMPLATES.md b/frontend/src/components/DIALOG_TEMPLATES.md new file mode 100644 index 0000000..b600ea8 --- /dev/null +++ b/frontend/src/components/DIALOG_TEMPLATES.md @@ -0,0 +1,414 @@ +# Dialog-Templates Dokumentation + +## Übersicht + +Das Dialog-System bietet wiederverwendbare Templates für modale und nicht-modale Dialoge. + +## Komponenten + +### 1. BaseDialog.vue + +Die Basis-Komponente für alle Dialoge. Unterstützt sowohl modale als auch nicht-modale Dialoge. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding für Sichtbarkeit | +| `isModal` | Boolean | `true` | Modaler Dialog (mit Overlay) oder nicht-modal | +| `title` | String | - | Dialog-Titel (erforderlich) | +| `size` | String | `'medium'` | Größe: `'small'`, `'medium'`, `'large'`, `'fullscreen'` | +| `position` | Object | `{ x: 100, y: 100 }` | Position für nicht-modale Dialoge | +| `zIndex` | Number | `1000` | z-Index des Dialogs | +| `closable` | Boolean | `true` | Schließen-Button anzeigen | +| `minimizable` | Boolean | `false` | Minimieren-Button anzeigen | +| `draggable` | Boolean | `true` | Dialog verschiebbar (nur nicht-modal) | +| `closeOnOverlay` | Boolean | `true` | Bei Klick auf Overlay schließen (nur modal) | + +#### Events + +| Event | Parameter | Beschreibung | +|-------|-----------|--------------| +| `update:modelValue` | Boolean | Wird beim Öffnen/Schließen gefeuert | +| `close` | - | Wird beim Schließen gefeuert | +| `minimize` | - | Wird beim Minimieren gefeuert | +| `focus` | - | Wird bei Klick auf nicht-modalen Dialog gefeuert | +| `update:position` | Object | Neue Position nach Verschieben | + +#### Slots + +| Slot | Beschreibung | +|------|--------------| +| `default` | Dialog-Inhalt | +| `header-actions` | Zusätzliche Aktionen im Header | +| `footer` | Dialog-Footer (optional) | + +#### Beispiel: Modaler Dialog + +```vue + + + +``` + +#### Beispiel: Nicht-modaler Dialog + +```vue + + + +``` + +## 2. ConfirmDialog.vue + +Spezialisierter Dialog für Bestätigungen. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bestätigung'` | Dialog-Titel | +| `message` | String | - | Hauptnachricht (erforderlich) | +| `details` | String | `''` | Zusätzliche Details | +| `type` | String | `'info'` | Typ: `'info'`, `'warning'`, `'danger'`, `'success'` | +| `confirmText` | String | `'OK'` | Text für Bestätigen-Button | +| `cancelText` | String | `'Abbrechen'` | Text für Abbrechen-Button | +| `showCancel` | Boolean | `true` | Abbrechen-Button anzeigen | + +#### Events + +| Event | Beschreibung | +|-------|--------------| +| `confirm` | Wird bei Bestätigung gefeuert | +| `cancel` | Wird bei Abbruch gefeuert | + +#### Beispiel + +```vue + + + +``` + +## 3. ImageDialog.vue + +Einfacher Dialog zur Anzeige von Bildern. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bild'` | Dialog-Titel | +| `imageUrl` | String | `''` | URL des anzuzeigenden Bildes | + +#### Events + +| Event | Beschreibung | +|-------|--------------| +| `close` | Wird beim Schließen gefeuert | + +#### Beispiel + +```vue + + + +``` + +## 4. ImageViewerDialog.vue + +Erweiterter Bild-Dialog mit Aktionen (Drehen, Zoom). + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bild'` | Dialog-Titel | +| `imageUrl` | String | `''` | URL des anzuzeigenden Bildes | +| `memberId` | Number/String | `null` | ID des zugehörigen Members (optional) | +| `showActions` | Boolean | `true` | Aktions-Buttons anzeigen | +| `allowRotate` | Boolean | `true` | Drehen-Buttons anzeigen | +| `allowZoom` | Boolean | `false` | Zoom-Button anzeigen | + +#### Events + +| Event | Parameter | Beschreibung | +|-------|-----------|--------------| +| `close` | - | Wird beim Schließen gefeuert | +| `rotate` | Object | Wird beim Drehen gefeuert: `{ direction, memberId, rotation }` | + +#### Beispiel + +```vue + + + +``` + +## 5. Composables + +### useDialog() + +Einfaches Composable für Dialog-Verwaltung. + +```javascript +import { useDialog } from '@/composables/useDialog.js'; + +const { isOpen, open, close, toggle } = useDialog(); + +// Dialog öffnen +open(); + +// Dialog schließen +close(); + +// Dialog umschalten +toggle(); +``` + +## useConfirm() + +Promise-basiertes Composable für Bestätigungsdialoge. + +```javascript +import { useConfirm } from '@/composables/useDialog.js'; + +const { isOpen, config, confirm, handleConfirm, handleCancel } = useConfirm(); + +// Im Template: + + +// In Methoden: +async function deleteItem() { + const confirmed = await confirm({ + title: 'Löschen bestätigen', + message: 'Wirklich löschen?', + type: 'danger' + }); + + if (confirmed) { + // Löschvorgang durchführen + } +} +``` + +## Dialog-Größen + +| Größe | Breite | Beschreibung | +|-------|--------|--------------| +| `small` | 400px | Kleine Dialoge (z.B. Bestätigungen) | +| `medium` | 600px | Standard-Dialoge | +| `large` | 900px | Große Dialoge mit viel Inhalt | +| `fullscreen` | 90vw x 90vh | Fast Fullscreen | + +## Best Practices + +### Modale Dialoge verwenden für: +- Wichtige Benutzer-Entscheidungen +- Formulare, die Fokus erfordern +- Warnungen und Fehler +- Prozesse, die nicht unterbrochen werden sollten + +### Nicht-modale Dialoge verwenden für: +- Zusätzliche Informationen +- Tools und Paletten +- Mehrere gleichzeitige Arbeitsschritte +- Drag & Drop-Workflows + +### Tipps + +1. **Minimieren-Funktion**: Nur bei nicht-modalen Dialogen sinnvoll +2. **closeOnOverlay**: Bei wichtigen Formularen auf `false` setzen +3. **z-Index**: Bei mehreren nicht-modalen Dialogen unterschiedliche z-Indices verwenden +4. **Footer-Slot**: Für Aktions-Buttons verwenden +5. **header-actions**: Für kontextspezifische Header-Aktionen + +## Styling + +Die Dialoge verwenden CSS-Variablen für konsistentes Styling: + +- `--primary-color`: Primärfarbe für Header und Buttons +- `--primary-hover`: Hover-Farbe +- `--border-color`: Rahmenfarbe +- `--text-color`: Textfarbe +- `--text-muted`: Gedämpfte Textfarbe + +## Migration bestehender Dialoge + +### Alt (individueller Dialog): +```vue + +``` + +### Neu (BaseDialog): +```vue + + Inhalt + +``` + +## Beispiele ansehen + +Die Datei `DialogExamples.vue` enthält vollständige Beispiele für alle Dialog-Typen. + +Route hinzufügen in `router.js`: +```javascript +import DialogExamples from './components/DialogExamples.vue'; + +{ path: '/dialog-examples', component: DialogExamples } +``` + diff --git a/frontend/src/components/DialogExamples.vue b/frontend/src/components/DialogExamples.vue new file mode 100644 index 0000000..11e4fbe --- /dev/null +++ b/frontend/src/components/DialogExamples.vue @@ -0,0 +1,469 @@ + + + + + + diff --git a/frontend/src/components/ImageDialog.vue b/frontend/src/components/ImageDialog.vue new file mode 100644 index 0000000..a3137ba --- /dev/null +++ b/frontend/src/components/ImageDialog.vue @@ -0,0 +1,125 @@ + + + + + + diff --git a/frontend/src/components/ImageViewerDialog.vue b/frontend/src/components/ImageViewerDialog.vue new file mode 100644 index 0000000..ab0fa26 --- /dev/null +++ b/frontend/src/components/ImageViewerDialog.vue @@ -0,0 +1,259 @@ + + + + + + diff --git a/frontend/src/components/InfoDialog.vue b/frontend/src/components/InfoDialog.vue new file mode 100644 index 0000000..1cc9e78 --- /dev/null +++ b/frontend/src/components/InfoDialog.vue @@ -0,0 +1,229 @@ + + + + + + diff --git a/frontend/src/components/SeasonSelector.vue b/frontend/src/components/SeasonSelector.vue index f806c61..100b6e0 100644 --- a/frontend/src/components/SeasonSelector.vue +++ b/frontend/src/components/SeasonSelector.vue @@ -40,6 +40,27 @@ + + + + + + +