X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Ferror-dialog.service.ts;h=2f668282abd261316be12e4f6b05aedeaf1d7937;hb=43e79e4a410e1cf377d344cae2c9a7a6e4806fe9;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..2f668282 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 { - public errorMessage: string = ''; - constructor(private dialog: MatDialog) { } - public displayError(error: string){ + darkMode: boolean; + panelClass: string; + public errorMessage: 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 } + }); } }