]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: reset pwd notification value
authorTatjana Dehler <tdehler@suse.com>
Tue, 26 May 2020 13:41:02 +0000 (15:41 +0200)
committerTatjana Dehler <tdehler@suse.com>
Tue, 11 Aug 2020 13:59:47 +0000 (15:59 +0200)
Reset the password notification value if the
user logs out. Otherwise if a another user logs
in, who doesn't see the password expiration
notification (because his password is not going to
expire soon), will see a blank bar instead.

Signed-off-by: Tatjana Dehler <tdehler@suse.com>
(cherry picked from commit 7a6e5be64babc1c2d5f235e1f2e92bcbf60ceb63)

src/pybind/mgr/dashboard/frontend/src/app/shared/components/pwd-expiration-notification/pwd-expiration-notification.component.ts

index cfa8e145d4a22c79e619a8eb4c31fc7b32149580..83e1664643bd386874fa615b62e302a6e18b30e0 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit } from '@angular/core';
 
 import { SettingsService } from '../../api/settings.service';
 import { CdPwdExpirationSettings } from '../../models/cd-pwd-expiration-settings';
@@ -9,7 +9,7 @@ import { AuthStorageService } from '../../services/auth-storage.service';
   templateUrl: './pwd-expiration-notification.component.html',
   styleUrls: ['./pwd-expiration-notification.component.scss']
 })
-export class PwdExpirationNotificationComponent implements OnInit {
+export class PwdExpirationNotificationComponent implements OnInit, OnDestroy {
   alertType: string;
   expirationDays: number;
   pwdExpirationSettings: CdPwdExpirationSettings;
@@ -37,6 +37,10 @@ export class PwdExpirationNotificationComponent implements OnInit {
     });
   }
 
+  ngOnDestroy() {
+    this.authStorageService.isPwdDisplayedSource.next(false);
+  }
+
   private getExpirationDays(pwdExpirationDate: number): number {
     const current = new Date();
     const expiration = new Date(pwdExpirationDate * 1000);