From 3a3cef0a4ff262c742b14f035476fd1d8799f05a Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Mon, 20 Dec 2021 12:30:07 +0100 Subject: [PATCH] [player] Improve event handling on 'NavigationDenied' Show warning messages of input fields at event 'NavigationDenied' only if reason "responsesIncomplete" is sent --- docs/release-notes-player.txt | 1 + .../src/app/components/unit-state/unit-state.component.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/release-notes-player.txt b/docs/release-notes-player.txt index f67f1b15d..7de7fd600 100644 --- a/docs/release-notes-player.txt +++ b/docs/release-notes-player.txt @@ -5,6 +5,7 @@ Player - Color the disabled progress bar of the media player green - Fix the section from being placed in front of elements with negative z-index - Fix saving of drop list elements + - Show warning messages of input fields at event 'NavigationDenied' only if reason "responsesIncomplete" is sent 1.12.0 - Use fixed size property for dynamic button, drop-list and text-field components diff --git a/projects/player/src/app/components/unit-state/unit-state.component.ts b/projects/player/src/app/components/unit-state/unit-state.component.ts index 839f974e3..299d3a67d 100644 --- a/projects/player/src/app/components/unit-state/unit-state.component.ts +++ b/projects/player/src/app/components/unit-state/unit-state.component.ts @@ -126,7 +126,9 @@ export class UnitStateComponent implements OnInit, OnDestroy { console.log('player: onNavigationDenied', message); const reasons = message.reason?.map((reason: string) => this.translateService.instant(reason)); this.messageService.showWarning(reasons?.join(', ') || this.translateService.instant('noReason')); - this.form.markAllAsTouched(); + if (message.reason && message.reason.find(reason => reason === 'responsesIncomplete')) { + this.form.markAllAsTouched(); + } } private addGroup = (group: ChildFormGroup): void => { -- GitLab