From 8bd03a6fc92a6cd4db1f9b293a40c10491a43105 Mon Sep 17 00:00:00 2001 From: Martin Maul Date: Tue, 2 Jul 2024 16:08:50 +0200 Subject: [PATCH] chore(uux): 984 validation on notification save hover --- .../detail/edit/notification-edit.component.html | 10 +++++++++- .../detail/edit/notification-edit.component.ts | 5 ++++- .../notification-new-request.component.ts | 1 - frontend/src/assets/locales/de/common.json | 3 ++- frontend/src/assets/locales/en/common.json | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.html b/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.html index d2663d91eb..e37a3b402f 100644 --- a/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.html +++ b/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.html @@ -32,7 +32,14 @@
+
diff --git a/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.ts b/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.ts index a2569aae65..7e39a243fb 100644 --- a/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.ts +++ b/frontend/src/app/modules/page/notifications/detail/edit/notification-edit.component.ts @@ -18,7 +18,7 @@ ********************************************************************************/ import { Location } from '@angular/common'; -import { Component, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; +import { ChangeDetectorRef, Component, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { Pagination } from '@core/model/pagination.model'; @@ -93,6 +93,7 @@ export class NotificationEditComponent implements OnDestroy { private readonly toastService: ToastService, private readonly sharedPartService: SharedPartService, private location: Location, + private readonly cdr: ChangeDetectorRef, ) { this.editMode = this.determineEditModeOrCreateMode(); @@ -178,6 +179,8 @@ export class NotificationEditComponent implements OnDestroy { this.notificationFormGroup = notificationFormGroup; this.isSaveButtonDisabled = (notificationFormGroup.invalid || this.affectedPartIds.length < 1) || !this.notificationFormGroup.dirty; + this.cdr.detectChanges(); + if (this.notificationFormGroup && this.notificationFormGroup.getRawValue().type === NotificationType.INVESTIGATION.valueOf() && !this.notificationFormGroup.getRawValue().bpn && this.sharedPartService.affectedParts && this.sharedPartService.affectedParts.length > 0) { this.notificationFormGroup.get('bpn').setValue(this.sharedPartService.affectedParts[0].businessPartner); } diff --git a/frontend/src/app/modules/shared/components/request-notification-new/notification-new-request.component.ts b/frontend/src/app/modules/shared/components/request-notification-new/notification-new-request.component.ts index f91bfcb4d8..8e6ff829fa 100644 --- a/frontend/src/app/modules/shared/components/request-notification-new/notification-new-request.component.ts +++ b/frontend/src/app/modules/shared/components/request-notification-new/notification-new-request.component.ts @@ -129,7 +129,6 @@ export class RequestNotificationNewComponent implements OnDestroy, OnInit { } this.allTouched?.subscribe(next => { - console.log(next); if (next === true) { this.formGroup.markAllAsTouched(); } diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index 1f0f5f2726..f428265e38 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -290,7 +290,8 @@ "saveError": "Bei der Erstellung des Qualitätsthemas ist ein Fehler aufgetreten.", "saveEditSuccess": "Qualitätsthema wurde erfolgreich aktualisiert.", "saveEditError": "Bei der Aktualisierung des Qualitätsthemas ist ein Fehler aufgetreten.", - "save": "Qualitätsthema speichern" + "save" : "Qualitätsthema speichern", + "noChanges" : "Erfordert eine Änderung am Qualitätsthema" }, "editNotification": { "saveButton": "Speichern", diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index 9d48fdbd4f..9aa9092048 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -289,7 +289,8 @@ "saveError": "An error occurred while creating the quality topic.", "saveEditSuccess": "Quality topic was updated successfully.", "saveEditError": "An error occurred while updating the quality topic.", - "save": "Save quality topic" + "save" : "Save quality topic", + "noChanges" : "Requires a change on the quality topic" }, "editNotification": { "saveButton": "Save",