feat(training): delete group button (admin only) on Training page

- Backend DELETE /api/groups/<gid> (admin, own-org enforced via _get_owned_group);
  cascades removal of the group's sessions. GroupStore.delete added.
- Training.vue: each group card gets a trash (Trash2 line icon) delete button shown only
  to admins (auth.isAdmin); confirm dialog; @click.stop so it doesn't navigate. Card
  restructured so the delete button is not inside the clickable router-link.
- test_user_journey: trainee cannot delete (403), admin deletes, group gone (404).
All suites pass. Rebuilt dist.
This commit is contained in:
Macky
2026-08-09 10:20:10 +07:00
parent 0b92430aab
commit 5b167b4546
30 changed files with 114 additions and 43 deletions

View File

@@ -0,0 +1 @@
.grid[data-v-b1b30fec]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.train-card[data-v-b1b30fec]{display:flex;flex-direction:column;height:100%}.badge.ready[data-v-b1b30fec]{background:#dcfce7;color:#166534}.badge.draft[data-v-b1b30fec]{background:#fef9c3;color:#854d0e}button.soft[data-v-b1b30fec]{background:#f1f3f9;border-color:transparent}.badge.facebook[data-v-b1b30fec]{background:#e0f2fe;color:#0369a1}.badge.line[data-v-b1b30fec]{background:#dcfce7;color:#15803d}.del-btn[data-v-b1b30fec]{background:transparent;border:1px solid var(--border);border-radius:8px;min-height:32px;width:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);cursor:pointer}.del-btn[data-v-b1b30fec]:hover{background:#fee2e2;border-color:#fecaca;color:var(--red)}