From f7b8c3af2b2cdb231e7900a68d994dbc177854e9 Mon Sep 17 00:00:00 2001
From: Viktor Rudko <43116821+vktrrdk@users.noreply.github.com>
Date: Mon, 16 Sep 2024 14:56:35 +0200
Subject: [PATCH] Fix/facility expiry (#6213)
* further changes
* fix(Facility News): Adjusted model handling
---
.../news-manager.component.html | 17 ++++++--
.../newsmanagement/news-manager.component.ts | 5 ++-
src/app/pipe-module/pipe-module.module.ts | 17 ++++++--
src/app/pipe-module/pipes/news-valid.pipe.ts | 41 +++++++++++++++++--
4 files changed, 68 insertions(+), 12 deletions(-)
diff --git a/src/app/facility_manager/newsmanagement/news-manager.component.html b/src/app/facility_manager/newsmanagement/news-manager.component.html
index 67a28302c0..28b4381bc0 100644
--- a/src/app/facility_manager/newsmanagement/news-manager.component.html
+++ b/src/app/facility_manager/newsmanagement/news-manager.component.html
@@ -136,7 +136,9 @@
Please select the facilities to load news from:
class="form-control"
[(ngModel)]="selectedFacilityNews.title"
[ngClass]="
- !isNewsTitleValid() && (news_title.dirty || news_title.touched) ? 'is-invalid' : 'is-valid'
+ !(selectedFacilityNews | newsTitleValid) && (news_title.dirty || news_title.touched)
+ ? 'is-invalid'
+ : 'is-valid'
"
id="news_title"
name="news_title"
@@ -151,7 +153,11 @@ Please select the facilities to load news from:
class="form-control"
id="news_text"
[(ngModel)]="selectedFacilityNews.text"
- [ngClass]="!isNewsTextValid() && (news_text.dirty || news_text.touched) ? 'is-invalid' : 'is-valid'"
+ [ngClass]="
+ !(selectedFacilityNews | newsTextValid) && (news_text.dirty || news_text.touched)
+ ? 'is-invalid'
+ : 'is-valid'
+ "
name="news_text"
#news_text="ngModel"
placeholder="e.g. Dear cloud users, we are happy to inform..."
@@ -165,7 +171,11 @@ Please select the facilities to load news from:
id="news_motd"
name="news_motd"
#news_motd="ngModel"
- [ngClass]="!isNewsMOTDValid() && (news_motd.dirty || news_motd.touched) ? 'is-invalid' : 'is-valid'"
+ [ngClass]="
+ !(selectedFacilityNews | newsMOTDValid) && (news_motd.dirty || news_motd.touched)
+ ? 'is-invalid'
+ : 'is-valid'
+ "
[(ngModel)]="selectedFacilityNews.motd"
placeholder="e.g. There are important changes..."
>
@@ -473,7 +483,6 @@ Upload News: {{ selectedFacilityNews.title }} ?
Consider: This news will not be send to your users via mail!
-