Skip to content

Commit a0fede7

Browse files
committed
feat(groups): implement group management for webhooks
1 parent 0729d91 commit a0fede7

File tree

9 files changed

+875
-84
lines changed

9 files changed

+875
-84
lines changed

_locales/de/messages.json

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@
5757
}
5858
}
5959
},
60-
"popupErrorCustomPayloadJsonParseError": {
61-
"message": "Fehler beim Parsen des benutzerdefinierten Payloads. Fehler: $error$",
62-
"description": "Fehler beim JSON Parsen.",
63-
"placeholders": {
64-
"error": {
65-
"content": "$1",
66-
"example": "Unexpected token in JSON at position 10"
67-
}
68-
}
60+
"popupNoGroup": {
61+
"message": "Keine Gruppe",
62+
"description": "Bezeichnung für Webhooks ohne Gruppe im Popup."
6963
},
7064
"optionsTitle": {
7165
"message": "Webhook Konfiguration",
@@ -195,6 +189,54 @@
195189
"message": "Webhooks importieren",
196190
"description": "Button-Text zum Import von Webhooks aus einer Datei."
197191
},
192+
"optionsGroupLabel": {
193+
"message": "Gruppe:",
194+
"description": "Label für die Webhook-Gruppenauswahl."
195+
},
196+
"optionsNoGroup": {
197+
"message": "Keine Gruppe",
198+
"description": "Option für Webhooks ohne Gruppe."
199+
},
200+
"optionsManageGroupsButton": {
201+
"message": "Gruppen verwalten",
202+
"description": "Schaltfläche zum Öffnen des Gruppenverwaltungsdialogs."
203+
},
204+
"optionsManageGroupsHeader": {
205+
"message": "Gruppen verwalten",
206+
"description": "Überschrift für den Gruppenverwaltungsdialog."
207+
},
208+
"optionsNewGroupNameLabel": {
209+
"message": "Neuer Gruppenname:",
210+
"description": "Beschriftung für das neue Gruppennamen-Eingabefeld."
211+
},
212+
"optionsNewGroupNamePlaceholder": {
213+
"message": "Neuen Gruppennamen eingeben",
214+
"description": "Platzhalter für das neue Gruppennamen-Eingabefeld."
215+
},
216+
"optionsAddGroupButton": {
217+
"message": "Gruppe hinzufügen",
218+
"description": "Schaltfläche zum Hinzufügen einer neuen Gruppe."
219+
},
220+
"optionsExistingGroupsHeader": {
221+
"message": "Vorhandene Gruppen:",
222+
"description": "Überschrift für die Liste vorhandener Gruppen."
223+
},
224+
"optionsEditGroupButton": {
225+
"message": "Bearbeiten",
226+
"description": "Schaltfläche zum Bearbeiten eines Gruppennamens."
227+
},
228+
"optionsSaveGroupButton": {
229+
"message": "Speichern",
230+
"description": "Schaltfläche zum Speichern eines Gruppennamens."
231+
},
232+
"optionsDeleteGroupButton": {
233+
"message": "Löschen",
234+
"description": "Schaltfläche zum Löschen einer Gruppe."
235+
},
236+
"optionsCloseManageGroupsButton": {
237+
"message": "Schließen",
238+
"description": "Schaltfläche zum Schließen des Gruppenverwaltungsdialogs."
239+
},
198240
"optionsImportInfo": {
199241
"message": "Beim Import werden vorhandene Webhooks ersetzt.",
200242
"description": "Hinweistext neben dem Import-Button."

_locales/en/messages.json

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@
5757
}
5858
}
5959
},
60-
"popupErrorCustomPayloadJsonParseError": {
61-
"message": "JSON Parse Error in Custom Payload! error: $error$",
62-
"description": "Error when JSON parsing fails.",
63-
"placeholders": {
64-
"error": {
65-
"content": "$1",
66-
"example": "Unexpected token in JSON at position 10"
67-
}
68-
}
60+
"popupNoGroup": {
61+
"message": "No Group",
62+
"description": "Label for webhooks without a group in the popup."
6963
},
7064
"optionsTitle": {
7165
"message": "Webhook Configuration",
@@ -195,6 +189,54 @@
195189
"message": "Import Webhooks",
196190
"description": "Button text to import webhooks from a file."
197191
},
192+
"optionsGroupLabel": {
193+
"message": "Group:",
194+
"description": "Label for the webhook group selection."
195+
},
196+
"optionsNoGroup": {
197+
"message": "No Group",
198+
"description": "Option for webhooks without a group."
199+
},
200+
"optionsManageGroupsButton": {
201+
"message": "Manage Groups",
202+
"description": "Button to open the group management modal."
203+
},
204+
"optionsManageGroupsHeader": {
205+
"message": "Manage Groups",
206+
"description": "Header for the group management modal."
207+
},
208+
"optionsNewGroupNameLabel": {
209+
"message": "New Group Name:",
210+
"description": "Label for the new group name input."
211+
},
212+
"optionsNewGroupNamePlaceholder": {
213+
"message": "Enter new group name",
214+
"description": "Placeholder for the new group name input."
215+
},
216+
"optionsAddGroupButton": {
217+
"message": "Add Group",
218+
"description": "Button to add a new group."
219+
},
220+
"optionsExistingGroupsHeader": {
221+
"message": "Existing Groups:",
222+
"description": "Header for the existing groups list."
223+
},
224+
"optionsEditGroupButton": {
225+
"message": "Edit",
226+
"description": "Button to edit a group name."
227+
},
228+
"optionsSaveGroupButton": {
229+
"message": "Save",
230+
"description": "Button to save a group name."
231+
},
232+
"optionsDeleteGroupButton": {
233+
"message": "Delete",
234+
"description": "Button to delete a group."
235+
},
236+
"optionsCloseManageGroupsButton": {
237+
"message": "Close",
238+
"description": "Button to close the group management modal."
239+
},
198240
"optionsImportInfo": {
199241
"message": "Importing replaces all existing webhooks.",
200242
"description": "Information text shown next to the import button."

options/options.css

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,22 @@ button:hover {
9797
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
9898
}
9999

100+
#new-group-name {
101+
margin-top: 8px;
102+
width: calc(100% - 110px);
103+
display: inline-block;
104+
}
105+
106+
#add-new-group-btn {
107+
margin-left: 10px;
108+
padding: 12px 16px;
109+
background-color: #8b5cf6;
110+
}
111+
112+
#add-new-group-btn:hover {
113+
background-color: #7c3aed;
114+
}
115+
100116
/* Collapsible section styles */
101117
.collapsible-header {
102118
display: flex;
@@ -173,6 +189,19 @@ button:hover {
173189
border-bottom: none;
174190
}
175191

192+
#webhook-list li.group-header {
193+
background-color: #f0f4f8;
194+
font-weight: bold;
195+
color: #1e40af;
196+
padding: 10px 16px;
197+
border-bottom: 2px solid #c7d2fe;
198+
font-size: 1.1em;
199+
}
200+
201+
#webhook-list li.webhook-item {
202+
margin-left: 20px;
203+
}
204+
176205
.drag-handle {
177206
cursor: grab;
178207
user-select: none;
@@ -320,3 +349,164 @@ button:hover {
320349
margin: 0;
321350
color: #4b5563;
322351
}
352+
353+
/* Group controls */
354+
.group-controls {
355+
display: flex;
356+
gap: 10px;
357+
align-items: center;
358+
}
359+
360+
#create-group-btn {
361+
background-color: #8b5cf6;
362+
padding: 12px 16px;
363+
}
364+
365+
#create-group-btn:hover {
366+
background-color: #7c3aed;
367+
}
368+
369+
/* Manage Groups button */
370+
#manage-groups-btn {
371+
background-color: #10b981;
372+
margin-bottom: 20px;
373+
}
374+
375+
#manage-groups-btn:hover {
376+
background-color: #059669;
377+
}
378+
379+
/* Modal styles */
380+
.modal {
381+
position: fixed;
382+
z-index: 1000;
383+
left: 0;
384+
top: 0;
385+
width: 100%;
386+
height: 100%;
387+
background-color: rgba(0, 0, 0, 0.5);
388+
display: flex;
389+
align-items: center;
390+
justify-content: center;
391+
}
392+
393+
.modal-content {
394+
background-color: #fff;
395+
padding: 20px;
396+
border-radius: 8px;
397+
width: 90%;
398+
max-width: 500px;
399+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
400+
position: relative;
401+
}
402+
403+
.close, .close-manage-groups {
404+
position: absolute;
405+
right: 15px;
406+
top: 15px;
407+
font-size: 28px;
408+
font-weight: bold;
409+
cursor: pointer;
410+
color: #6b7280;
411+
}
412+
413+
.close:hover, .close-manage-groups:hover {
414+
color: #1f2937;
415+
}
416+
417+
.modal-actions {
418+
display: flex;
419+
justify-content: flex-end;
420+
gap: 10px;
421+
margin-top: 20px;
422+
}
423+
424+
/* Group management styles */
425+
#new-group-name {
426+
width: calc(100% - 110px);
427+
display: inline-block;
428+
margin-right: 10px;
429+
}
430+
431+
#add-group-btn {
432+
padding: 12px 16px;
433+
background-color: #8b5cf6;
434+
}
435+
436+
#add-group-btn:hover {
437+
background-color: #7c3aed;
438+
}
439+
440+
#groups-list {
441+
list-style-type: none;
442+
padding: 0;
443+
margin: 10px 0;
444+
}
445+
446+
.group-item {
447+
display: flex;
448+
justify-content: space-between;
449+
align-items: center;
450+
padding: 10px;
451+
border-bottom: 1px solid #e5e7eb;
452+
user-select: none;
453+
}
454+
455+
.group-item.dragging {
456+
opacity: 0.5;
457+
background-color: #f3f4f6;
458+
}
459+
460+
.group-item.drag-over {
461+
border-top: 2px solid #3b82f6;
462+
}
463+
464+
.drag-handle {
465+
cursor: grab;
466+
user-select: none;
467+
font-size: 1.2em;
468+
color: #6b7280;
469+
padding-right: 10px;
470+
}
471+
472+
.drag-handle:active {
473+
cursor: grabbing;
474+
}
475+
476+
.group-item input {
477+
flex: 1;
478+
margin-right: 10px;
479+
}
480+
481+
.group-actions {
482+
display: flex;
483+
gap: 5px;
484+
}
485+
486+
.group-actions button {
487+
padding: 6px 12px;
488+
font-size: 0.9em;
489+
}
490+
491+
.edit-group-name {
492+
background-color: #f3f4f6;
493+
border: 1px solid #d1d5db;
494+
border-radius: 4px;
495+
padding: 6px;
496+
}
497+
498+
.save-group-name {
499+
background-color: #10b981;
500+
}
501+
502+
.save-group-name:hover {
503+
background-color: #059669;
504+
}
505+
506+
.delete-group {
507+
background-color: #ef4444;
508+
}
509+
510+
.delete-group:hover {
511+
background-color: #dc2626;
512+
}

0 commit comments

Comments
 (0)