fix(admin): clear unsaved-changes guard before redirect on groups/new and users/new #567

Merged
marcel merged 4 commits from feat/issue-527-unsaved-warning-new-pages into main 2026-05-14 14:05:17 +02:00
2 changed files with 16 additions and 4 deletions
Showing only changes of commit 6fffc06c28 - Show all commits

View File

@@ -82,7 +82,10 @@ describe('Admin new group page unsaved-changes guard', () => {
await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument();
type SubmitFn = () => Promise<
(opts: { result: { type: string }; update: () => Promise<void> }) => Promise<void>
(opts: {
result: { type: string; [key: string]: unknown };
update: () => Promise<void>;
}) => Promise<void>
>;
const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)();
await innerFn({
@@ -109,7 +112,10 @@ describe('Admin new group page unsaved-changes guard', () => {
await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument();
type SubmitFn = () => Promise<
(opts: { result: { type: string }; update: () => Promise<void> }) => Promise<void>
(opts: {
result: { type: string; [key: string]: unknown };
update: () => Promise<void>;
}) => Promise<void>
>;
const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)();
await innerFn({

View File

@@ -142,7 +142,10 @@ describe('Admin new user page unsaved-changes guard', () => {
await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument();
type SubmitFn = () => Promise<
(opts: { result: { type: string }; update: () => Promise<void> }) => Promise<void>
(opts: {
result: { type: string; [key: string]: unknown };
update: () => Promise<void>;
}) => Promise<void>
>;
const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)();
await innerFn({
@@ -169,7 +172,10 @@ describe('Admin new user page unsaved-changes guard', () => {
await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument();
type SubmitFn = () => Promise<
(opts: { result: { type: string }; update: () => Promise<void> }) => Promise<void>
(opts: {
result: { type: string; [key: string]: unknown };
update: () => Promise<void>;
}) => Promise<void>
>;
const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)();
await innerFn({