From 2f273daea114a6361813d554c01bb5c9b9789322 Mon Sep 17 00:00:00 2001 From: Florian Glombik Date: Thu, 28 Nov 2024 13:50:34 +0100 Subject: [PATCH] Add a warning when leaving the page with unsaved changes --- src/main/webapp/app/lecture/lecture-update.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/webapp/app/lecture/lecture-update.component.ts b/src/main/webapp/app/lecture/lecture-update.component.ts index b9f94733cfe1..f97af4073ca0 100644 --- a/src/main/webapp/app/lecture/lecture-update.component.ts +++ b/src/main/webapp/app/lecture/lecture-update.component.ts @@ -168,6 +168,10 @@ export class LectureUpdateComponent implements OnInit, OnDestroy { } ngOnDestroy() { + if (this.isChangeMadeToTitleOrPeriodSection) { + // TODO add a proper modal and find out where the changes are + alert('Unsaved changes in Title and/or period section, are you sure you want to leave without saving?'); + } this.subscriptions.unsubscribe(); }