X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Ferror-dialog.service.ts;h=a5a12f4528a18315dfa3baa405f66998c163dd2a;hb=refs%2Fchanges%2F97%2F1197%2F3;hp=87c3815e3cca4c45868c34c52a60d9bc10eab898;hpb=5ab97dce8c10eadbe33ada5446cc7fc9b9e1a6cd;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/ui/error-dialog.service.ts b/webapp-frontend/src/app/services/ui/error-dialog.service.ts index 87c3815e..a5a12f45 100644 --- a/webapp-frontend/src/app/services/ui/error-dialog.service.ts +++ b/webapp-frontend/src/app/services/ui/error-dialog.service.ts @@ -2,7 +2,7 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * Copyright (C) 2019 AT&T Intellectual Property * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,18 +21,33 @@ import { ErrorDialogComponent } from '../../ui/error-dialog/error-dialog.compone import { HttpErrorResponse } from '@angular/common/http'; import { MatDialog } from '@angular/material/dialog'; import { Injectable } from '@angular/core'; - +import { UiService } from './ui.service'; + @Injectable() export class ErrorDialogService { + darkMode: boolean; + panelClass: string = ""; public errorMessage: string = ''; - constructor(private dialog: MatDialog) { } - public displayError(error: string){ + + constructor(private dialog: MatDialog, + public ui: UiService) { } + + public displayError(error: string) { + this.ui.darkModeState.subscribe((isDark) => { + this.darkMode = isDark; + }); + if (this.darkMode) { + this.panelClass = "dark-theme"; + } else { + this.panelClass = ""; + } return this.dialog.open(ErrorDialogComponent, { - width: '400px', - position: { top: '100px' }, - disableClose: true, - data: {'errorMessage': error} - }); + panelClass: this.panelClass, + width: '400px', + position: { top: '100px' }, + disableClose: true, + data: { 'errorMessage': error } + }); } }