Fixes of the darkMode 12/1612/3
authorPatrikBuhr <patrik.buhr@est.tech>
Fri, 15 Nov 2019 13:12:11 +0000 (14:12 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Mon, 18 Nov 2019 10:24:13 +0000 (11:24 +0100)
Fixed some tslint warnings

Change-Id: I66602b55746f23131a14d614a170b74f0158473f
Issue-ID: NONRTRIC-61
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
22 files changed:
dashboard/webapp-frontend/src/app/footer/footer.component.html
dashboard/webapp-frontend/src/app/footer/footer.component.scss
dashboard/webapp-frontend/src/app/footer/footer.component.ts
dashboard/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts
dashboard/webapp-frontend/src/app/policy-control/policy-control.component.html
dashboard/webapp-frontend/src/app/policy-control/policy-control.component.ts
dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.html
dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.scss
dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.ts
dashboard/webapp-frontend/src/app/policy-control/policy-instance.component.html
dashboard/webapp-frontend/src/app/policy-control/policy-instance.component.scss
dashboard/webapp-frontend/src/app/policy-control/policy-instance.component.ts
dashboard/webapp-frontend/src/app/rd.component.html
dashboard/webapp-frontend/src/app/rd.component.scss
dashboard/webapp-frontend/src/app/rd.component.ts
dashboard/webapp-frontend/src/app/services/ui/confirm-dialog.service.ts
dashboard/webapp-frontend/src/app/services/ui/error-dialog.service.ts
dashboard/webapp-frontend/src/app/services/ui/loading-dialog.service.ts
dashboard/webapp-frontend/src/app/ui/error-dialog/error-dialog.component.ts
dashboard/webapp-frontend/src/app/ui/policy-card/policy-card.component.ts
dashboard/webapp-frontend/src/styles.scss
dashboard/webapp-frontend/src/styles/dark-theme.scss

index 2970209..eca6cf3 100644 (file)
   limitations under the License.
   ========================LICENSE_END===================================
   -->
-<div class="copyright__text" [ngClass]="{'footer-dark': darkMode}">
+<div class="copyright__text" [ngClass]="{'copyright__text-dark': darkMode}">
   Copyright (C) 2019 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0.
-  <br/>
+  <br />
   Modifications Copyright (C) 2019 Nordix Foundation
-  <br/>
+  <br />
   Version {{dashboardVersion}}
-</div>
+</div>
\ No newline at end of file
index e2456d7..c06dc01 100644 (file)
@@ -20,9 +20,9 @@
 .copyright__text {
   color: gray;
   letter-spacing: 0.1rem;
-  font-size: 12px;
+  font-size: 10px;
 }
 
-.footer-dark {
-  color: white;
+.copyright__text-dark {
+  color: gray;
 }
\ No newline at end of file
index 66430ec..b776c9b 100644 (file)
@@ -8,9 +8,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,11 +38,11 @@ export class FooterComponent implements OnInit {
 
   // Inject the service
   constructor(private dashboardService: DashboardService,
-              public ui: UiService ) { }
+    private ui: UiService) { }
 
   ngOnInit() {
     this.dashboardVersion = '0.0';
-    //this.dashboardService.getVersion().subscribe((res: DashboardSuccessTransport) => this.dashboardVersion = res.data);
+    // this.dashboardService.getVersion().subscribe((res: DashboardSuccessTransport) => this.dashboardVersion = res.data);
     this.ui.darkModeState.subscribe((isDark) => {
       this.darkMode = isDark;
     });
index c0f05af..80c3cd8 100644 (file)
@@ -29,7 +29,7 @@ export class SidenavListComponent implements OnInit {
   darkMode: boolean;
   @Output() sidenavClose = new EventEmitter();
 
-  constructor(public ui: UiService) { }
+  constructor(private ui: UiService) { }
 
   ngOnInit() {
     this.ui.darkModeState.subscribe((isDark) => {
index 04d440c..7bfa7f7 100644 (file)
   ========================LICENSE_END===================================
   -->
 
-<div>
-    <h3 class="rd-global-page-title">Policy Control</h3>
+<h3 class="rd-global-page-title">Policy Control</h3>
 
-    <table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows
-        class="policy-type-table mat-elevation-z8">
+<table mat-table [dataSource]="policyTypesDataSource" matSort multiTemplateDataRows
+    class="policy-type-table mat-elevation-z8">
 
-        <ng-container matColumnDef="name">
-            <mat-header-cell *matHeaderCellDef mat-sort-header>Policy Type</mat-header-cell>
-            <mat-cell *matCellDef="let policyType"> 
-                 <mat-icon matTooltip="Properties">{{isInstancesShown(policyType)  ? 'expand_less' : 'expand_more'}}</mat-icon>
-                 {{getPolicyTypeName(policyType)}}
-            </mat-cell>
-        </ng-container>
+    <ng-container matColumnDef="name">
+        <mat-header-cell *matHeaderCellDef mat-sort-header>Policy Type</mat-header-cell>
+        <mat-cell *matCellDef="let policyType">
+            <mat-icon matTooltip="Properties">{{isInstancesShown(policyType)  ? 'expand_less' : 'expand_more'}}
+            </mat-icon>
+            {{getPolicyTypeName(policyType)}}
+        </mat-cell>
+    </ng-container>
 
-        <ng-container matColumnDef="description">
-            <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
-            <mat-cell *matCellDef="let policyType"> {{policyType.description}} </mat-cell>
-        </ng-container>
+    <ng-container matColumnDef="description">
+        <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
+        <mat-cell *matCellDef="let policyType"> {{policyType.description}} </mat-cell>
+    </ng-container>
 
-        <ng-container matColumnDef="action">
-            <mat-header-cell class="action-cell" *matHeaderCellDef>Action </mat-header-cell>
-            <mat-cell class="action-cell" *matCellDef="let policyType" (click)="$event.stopPropagation()">               
-                <button mat-icon-button (click)="createPolicyInstance(policyType)">
-                    <mat-icon matTooltip="Create instance">add_box</mat-icon>
-                </button>
-            </mat-cell>
-        </ng-container>
+    <ng-container matColumnDef="action">
+        <mat-header-cell class="action-cell" *matHeaderCellDef>Action </mat-header-cell>
+        <mat-cell class="action-cell" *matCellDef="let policyType" (click)="$event.stopPropagation()">
+            <button mat-icon-button (click)="createPolicyInstance(policyType)">
+                <mat-icon matTooltip="Create instance">add_box</mat-icon>
+            </button>
+        </mat-cell>
+    </ng-container>
 
-        <!-- =================== Policy instances for one type ======================== -->
-        <ng-container matColumnDef="instanceTableContainer">
-            <mat-cell *matCellDef="let policyType">
-                <rd-policy-instance 
-                [policyType]=policyType 
-                [expanded]=getObservable(policyType)>
+    <!-- =================== Policy instances for one type ======================== -->
+    <ng-container matColumnDef="instanceTableContainer">
+        <mat-cell *matCellDef="let policyType">
+            <rd-policy-instance [policyType]=policyType [expanded]=getObservable(policyType)>
             </rd-policy-instance>
-            </mat-cell>
-        </ng-container>
-        <!-- ======= -->
+        </mat-cell>
+    </ng-container>
+    <!-- ======= -->
 
-        <ng-container matColumnDef="noRecordsFound">
-            <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
-        </ng-container>
+    <ng-container matColumnDef="noRecordsFound">
+        <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
+    </ng-container>
 
-        <mat-header-row *matHeaderRowDef="['name', 'description', 'action']"></mat-header-row>
-        <mat-row *matRowDef="let policyType; columns: ['name', 'description', 'action']"
-            (click)="toggleListInstances(policyType)">
-        </mat-row>
+    <mat-header-row *matHeaderRowDef="['name', 'description', 'action']"></mat-header-row>
+    <mat-row *matRowDef="let policyType; columns: ['name', 'description', 'action']"
+        (click)="toggleListInstances(policyType)">
+    </mat-row>
 
-        <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];"
-            [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden">
-        </mat-row>
+    <mat-row *matRowDef="let policyType; columns: ['instanceTableContainer'];"
+        [@detailExpand]="isInstancesShown(policyType) ? 'expanded' : 'collapsed'" style="overflow: hidden">
+    </mat-row>
 
-        <mat-footer-row *matFooterRowDef="['noRecordsFound']"
-            [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
-        </mat-footer-row>
+    <mat-footer-row *matFooterRowDef="['noRecordsFound']"
+        [ngClass]="{'display-none': policyTypesDataSource.rowCount > 0}">
+    </mat-footer-row>
 
-    </table>
+</table>
 
-    <div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async">
-        <mat-spinner diameter="50"></mat-spinner>
-    </div>
+<div class="spinner-container" *ngIf="policyTypesDataSource.loading$ | async">
+    <mat-spinner diameter="50"></mat-spinner>
 </div>
\ No newline at end of file
index 70b8c45..3bfe5ea 100644 (file)
@@ -34,12 +34,13 @@ import { NotificationService } from '../services/ui/notification.service';
 import { ErrorDialogService } from '../services/ui/error-dialog.service';
 import { ConfirmDialogService } from './../services/ui/confirm-dialog.service';
 import { Subject } from 'rxjs';
+import { UiService } from '../services/ui/ui.service';
 
 class PolicyTypeInfo {
     constructor(public type: PolicyType, public isExpanded: boolean) { }
 
     isExpandedObservers: Subject<boolean> = new Subject<boolean>();
-};
+}
 
 @Component({
     selector: 'rd-policy-control',
@@ -59,21 +60,26 @@ export class PolicyControlComponent implements OnInit {
     @ViewChild(MatSort, { static: true }) sort: MatSort;
 
     expandedTypes = new Map<string, PolicyTypeInfo>();
+    darkMode: boolean;
 
     constructor(
         private policySvc: PolicyService,
         private dialog: MatDialog,
         private errorDialogService: ErrorDialogService,
         private notificationService: NotificationService,
-        private confirmDialogService: ConfirmDialogService) { }
+        private confirmDialogService: ConfirmDialogService,
+        private ui: UiService) { }
 
     ngOnInit() {
         this.policyTypesDataSource = new PolicyTypeDataSource(this.policySvc, this.sort, this.notificationService);
         this.policyTypesDataSource.loadTable();
+        this.ui.darkModeState.subscribe((isDark) => {
+            this.darkMode = isDark;
+        });
     }
 
     createPolicyInstance(policyType: PolicyType): void {
-        const dialogRef = this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(policyType, null));
+        const dialogRef = this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(policyType, null, this.darkMode));
         const info: PolicyTypeInfo = this.getPolicyTypeInfo(policyType);
         dialogRef.afterClosed().subscribe(
             (result: any) => {
@@ -83,7 +89,7 @@ export class PolicyControlComponent implements OnInit {
     }
 
     toggleListInstances(policyType: PolicyType): void {
-        let info = this.getPolicyTypeInfo(policyType);
+        const info = this.getPolicyTypeInfo(policyType);
         info.isExpanded = !info.isExpanded;
         info.isExpandedObservers.next(info.isExpanded);
     }
index ad7ea49..e9b6ff0 100644 (file)
   limitations under the License.
   ========================LICENSE_END===================================
   -->
-<div class="text-muted logo" fxLayout="row" fxLayoutGap="50px">
+<div class="text-muted logo" fxLayout="row" fxLayoutGap="50px" fxLayoutAlign="space-around center">
     <div *ngIf="policyInstanceId">{{policyInstanceId}}</div>
 </div>
-<div class="mat-elevation-z8 header row logo">
+<div class="mat-elevation-z8 header row" [ngClass]="{'header-dark': darkMode}">
     <div class="logo">
         <img src="../../assets/oran-logo.png" width="30px" height="30px" style="position: relative; z-index: 50" />
-        <svg class="logo__icon" viewBox="150.3 22.2 400 50">
-            <text [ngClass]="{'logo__text-dark': darkModeActive}" class="logo__text" fill="#432c85" font-size="30"
-                font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
+        <svg class="logo__icon" viewBox="150.3 22.2 1000 50">
+            <text class="logo__text" [ngClass]="{'logo__text-dark': darkMode}" font-size="30" font-weight="600"
+                letter-spacing=".1em" transform="translate(149 56)">
                 <tspan>Policy editor</tspan>
                 <tspan *ngIf="jsonSchemaObject.title"> {{this.jsonSchemaObject.title}}</tspan>
                 <tspan *ngIf="!jsonSchemaObject.title"> {{this.policyTypeName}}</tspan>
@@ -37,7 +37,7 @@
 <!--<div class="text-muted" *ngIf="jsonSchemaObject.description">{{jsonSchemaObject.description}}</div>-->
 
 <div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-sm="column" fxLayoutAlign.lt-sm="flex-start center">
-    <mat-card class="card">
+    <mat-card class="card" [ngClass]="{'card-dark': darkMode}">
         <h4 class="default-cursor" (click)="toggleVisible('form')">
             <mat-icon matTooltip="Properties">{{isVisible.form ? 'expand_less' : 'expand_more'}}</mat-icon>
             Properties
@@ -72,9 +72,7 @@
                 <div *ngIf="prettyValidationErrors" class="text-danger" [innerHTML]="prettyValidationErrors"></div>
             </div>
             <div>
-                <pre [class.data-good]="!prettyValidationErrors && prettyLiveFormData !== '{}'"
-                    [class.data-bad]="prettyValidationErrors">{{prettyLiveFormData}}
-                </pre>
+                <pre [class.text__dark]='this.darkMode'>{{prettyLiveFormData}}</pre>
             </div>
         </div>
 
@@ -84,7 +82,7 @@
         </h4>
         <div *ngIf="isVisible.schema" fxLayout="column" [@expandSection]="true">
             <strong class="text-muted">Schema</strong>
-            <pre>{{schemaAsString}}</pre>
+            <pre [class.text__dark]='this.darkMode'>{{schemaAsString}}</pre>
         </div>
     </mat-card>
 </div>
\ No newline at end of file
index 7050020..076fa90 100644 (file)
  * ========================LICENSE_END===================================
  */
 
+
+.logo__text {
+    fill: #2B244D;
+}
+
+.logo__text-dark {
+    fill: #ffffff;
+}
+
+.text__dark {
+    color: white;
+}
+
 .header {
-    color: black;
-    background: linear-gradient(to right, white 0%, rgb(217, 216, 231) 100%);
+    background: linear-gradient(to bottom, white 0%, grayscale($color: #eeeaea) 100%);
     font-size: 40px;
-    font-weight: 400;
     margin-top: 10px;
     margin-bottom: 10px;
+    margin-left: 2px;
+    margin-right: 2px;
 }
 
-.logo {
-    margin-left: 10px;
+.header-dark {
+    background: #2B244D;
 }
 
-.logo__text {
-    fill: #2B244D;
-}
-  
-.logo__text-dark {
-    fill: #ffffff;
+.logo {
+    margin-left: 10px;
 }
 
 .logo__icon {
 }
 
 .submitBtn {
-    background-color: #4CAF50; /* Green */
+    background-color: #4CAF50;
+    /* Green */
 }
 
 .card {
     height: 100%;
-    width: 100%;  
-    margin-left: 10px;
-    margin-right: 1px;
+    width: 100%;
+    margin-left: 2px;
+    margin-right: 2px;
+    background-color: grayscale($color: #eeeaea);
+}
+
+.card-dark {
+    background-color: #1c1c24;
 }
\ No newline at end of file
index 0f483d4..b635418 100644 (file)
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-import { Component, OnInit, ViewChild, Inject, AfterViewInit, Self } from '@angular/core';
+import { animate, state, style, transition, trigger } from '@angular/animations';
+import { AfterViewInit, Component, Inject, OnInit, ViewChild } from '@angular/core';
+import { MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { MatMenuTrigger } from '@angular/material/menu';
-import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
-import { trigger, state, style, animate, transition } from '@angular/animations';
-import * as uuid from 'uuid';
-
 import { JsonPointer } from 'angular6-json-schema-form';
+import * as uuid from 'uuid';
+import { PolicyInstance, PolicyType } from '../interfaces/policy.types';
 import { PolicyService } from '../services/policy/policy.service';
 import { ErrorDialogService } from '../services/ui/error-dialog.service';
 import { NotificationService } from './../services/ui/notification.service';
+import { UiService } from '../services/ui/ui.service';
 
-import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
-import { PolicyType } from '../interfaces/policy.types';
-import { PolicyInstance } from '../interfaces/policy.types';
 
 @Component({
     selector: 'rd-policy-instance-dialog',
@@ -81,14 +79,17 @@ export class PolicyInstanceDialogComponent implements OnInit, AfterViewInit {
 
     public policyInstanceId: string;
     public policyTypeName: string;
+    darkMode: boolean;
     private policyTypeId: number;
 
+
     constructor(
         private dataService: PolicyService,
         private errorService: ErrorDialogService,
         private notificationService: NotificationService,
         @Inject(MAT_DIALOG_DATA) private data,
-        private dialogRef: MatDialogRef<PolicyInstanceDialogComponent>) {
+        private dialogRef: MatDialogRef<PolicyInstanceDialogComponent>,
+        private ui: UiService) {
         this.formActive = false;
         this.policyInstanceId = this.data.instanceId;
         this.policyTypeName = this.data.name;
@@ -99,6 +100,9 @@ export class PolicyInstanceDialogComponent implements OnInit, AfterViewInit {
     ngOnInit() {
         this.jsonFormStatusMessage = 'Init';
         this.formActive = true;
+        this.ui.darkModeState.subscribe((isDark) => {
+            this.darkMode = isDark;
+        });
     }
 
     ngAfterViewInit() {
@@ -189,19 +193,19 @@ export class PolicyInstanceDialogComponent implements OnInit, AfterViewInit {
     }
 }
 
-export function getPolicyDialogProperties(policyType: PolicyType, instance: PolicyInstance): MatDialogConfig {
+export function getPolicyDialogProperties(policyType: PolicyType, instance: PolicyInstance, darkMode: boolean): MatDialogConfig {
     const policyTypeId = policyType.policy_type_id;
     const createSchema = policyType.create_schema;
     const instanceId = instance ? instance.instanceId : null;
     const instanceJson = instance ? instance.instance : null;
     const name = policyType.name;
-
     return {
         maxWidth: '1200px',
-        height: '1200px',
+        maxHeight: '900px',
         width: '900px',
         role: 'dialog',
         disableClose: false,
+        panelClass: darkMode ? 'dark-theme' : '',
         data: {
             policyTypeId,
             createSchema,
index 60bfab2..e1a67dd 100644 (file)
   limitations under the License.
   ========================LICENSE_END===================================
   -->
-<table #table mat-table class="instances-table mat-elevation-z8" matSort  multiTemplateDataRows [dataSource]="instanceDataSource">
+<table #table mat-table class="instances-table mat-elevation-z8" [ngClass]="{'table-dark': darkMode}" matSort
+    multiTemplateDataRows [dataSource]="instanceDataSource">
 
     <ng-container matColumnDef="instanceId">
-        <mat-header-cell mat-sort-header *matHeaderCellDef >Instance</mat-header-cell>
+        <mat-header-cell mat-sort-header *matHeaderCellDef>Instance</mat-header-cell>
         <mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.instanceId}}
         </mat-cell>
     </ng-container>
@@ -41,8 +42,7 @@
         <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
     </ng-container>
 
-    <mat-header-row *matHeaderRowDef="['instanceId',  'action']"
-        [ngClass]="{'display-none': !this.hasInstances()}">
+    <mat-header-row *matHeaderRowDef="['instanceId',  'action']" [ngClass]="{'display-none': !this.hasInstances()}">
     </mat-header-row>
     <mat-row *matRowDef="let instance; columns: ['instanceId', 'action'];"></mat-row>
 
@@ -51,7 +51,6 @@
 
 </table>
 
-
 <div class="spinner-container" *ngIf="instanceDataSource.loading$ | async">
     <mat-spinner diameter="50"></mat-spinner>
 </div>
\ No newline at end of file
index 5c1d7c3..83f6f66 100644 (file)
  */
 
 .instances-table {
-  width: 60%; ;
+  width: 60%;
   min-height: 150px;
   min-width: 600px;
   margin-top: 10px;
   margin-bottom: 10px;
-  background-color:rgb(233, 233, 240);   
+  background-color: grayscale($color: #eeeaea);
+}
+
+.table-dark {
+  background-color: #1d1d27;
 }
 
 .action-cell {
-      display: flex; 
-      justify-content: flex-end;
+  display: flex;
+  justify-content: flex-end;
 }
 
 .display-none {
index 3544275..b62deb4 100644 (file)
@@ -32,6 +32,7 @@ import { PolicyInstanceDialogComponent } from './policy-instance-dialog.componen
 import { getPolicyDialogProperties } from './policy-instance-dialog.component';
 import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
 import { Observable } from 'rxjs';
+import { UiService } from '../services/ui/ui.service';
 
 @Component({
     selector: 'rd-policy-instance',
@@ -45,20 +46,25 @@ export class PolicyInstanceComponent implements OnInit, AfterViewInit {
     @Input() policyType: PolicyType;
     @Input() expanded: Observable<boolean>;
     @ViewChild(MatSort, { static: true }) sort: MatSort;
+    darkMode: boolean;
 
     constructor(
         private policySvc: PolicyService,
         private dialog: MatDialog,
         private errorDialogService: ErrorDialogService,
         private notificationService: NotificationService,
-        private confirmDialogService: ConfirmDialogService) {
+        private confirmDialogService: ConfirmDialogService,
+        private ui: UiService) {
     }
-   
+
     ngOnInit() {
         this.instanceDataSource = new PolicyInstanceDataSource(this.policySvc, this.sort, this.notificationService, this.policyType);
         this.expanded.subscribe((isExpanded: boolean) => this.onExpand(isExpanded));
+        this.ui.darkModeState.subscribe((isDark) => {
+            this.darkMode = isDark;
+        });
     }
-    
+
     ngAfterViewInit() {
         this.instanceDataSource.sort = this.sort;
     }
@@ -73,11 +79,11 @@ export class PolicyInstanceComponent implements OnInit, AfterViewInit {
         this.policySvc.getPolicy(this.policyType.policy_type_id, instance.instanceId).subscribe(
             (refreshedJson: any) => {
                 instance.instance = JSON.stringify(refreshedJson);
-                this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(this.policyType, instance));
+                this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(this.policyType, instance, this.darkMode));
             },
             (httpError: HttpErrorResponse) => {
                 this.notificationService.error('Could not refresh instance ' + httpError.message);
-                this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(this.policyType, instance));
+                this.dialog.open(PolicyInstanceDialogComponent, getPolicyDialogProperties(this.policyType, instance, this.darkMode));
             }
         );
     }
@@ -110,4 +116,7 @@ export class PolicyInstanceComponent implements OnInit, AfterViewInit {
                     }
                 });
     }
+
+
+
 }
index aef2941..1c2c3c7 100644 (file)
   ========================LICENSE_END===================================
   -->
 <!-- Slide Menu-->
-<mat-drawer-container autosize >
-  <mat-drawer #drawer mode="push" [ngClass]="{'side-menu__dark': darkModeActive}">
-  <section class="menu-header" [ngClass]="{'menu-header__dark': darkModeActive}">
+<mat-drawer-container autosize>
+  <mat-drawer #drawer mode="push" [ngClass]="{'side-menu__dark': darkMode}">
+    <section class="menu-header" [ngClass]="{'menu-header__dark': darkMode}">
 
-    <div class="left__section3Col" *ngIf="drawer.opened"  [ngClass]="{'menumargin-top': drawer.opened}">
-      <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
-           viewBox="31.5 30 49.9 32">
-        <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 9" rx="2"
-              transform="translate(31.5 58)"/>
-        <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 10" rx="2"
-              transform="translate(31.5 44)"/>
-        <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 11" rx="2"
-              transform="translate(31.5 30)"/>
-      </svg>
-      <img src="../../assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50"/>
-      <svg class="logo__icon" viewBox="150.3 22.2 400 50">
-        <text [ngClass]="{'logo__text-dark': darkModeActive}" class="logo__text" fill="#432c85"
-              font-size="30" font-weight="600"
-              letter-spacing=".1em" transform="translate(149 56)">
-          <tspan x="0" y="0">Non RT RIC Dashboard</tspan>
-        </text>
-      </svg>
+      <div class="left__section3Col" *ngIf="drawer.opened" [ngClass]="{'menumargin-top': drawer.opened}">
+        <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
+          viewBox="31.5 30 49.9 32">
+          <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
+          <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
+          <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
+        </svg>
+        <img src="../../assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
+        <svg class="logo__icon" viewBox="150.3 22.2 400 50">
+          <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
+            font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
+            <tspan x="0" y="0">Non RT RIC Dashboard</tspan>
+          </text>
+        </svg>
 
-    </div>
+      </div>
 
       <div class="profile-image__container">
-        <img src="assets/profile_default.png" alt="profile-image"
-             class="profile__image">
+        <img src="assets/profile_default.png" alt="profile-image" class="profile__image">
       </div>
       <div class="account-details">
         <span class="name__text">Demo</span>
         <span class="email__text">demo@o-ran-sc.org</span>
       </div>
     </section>
-    <section #sidenav class="menu-body" >
-       <rd-sidenav-list ></rd-sidenav-list>
+    <section #sidenav class="menu-body">
+      <rd-sidenav-list></rd-sidenav-list>
     </section>
     <section class="menu-footer">
 
     </section>
-</mat-drawer>
+  </mat-drawer>
 
-<mat-drawer-content>
-<div class="root__container">
+  <mat-drawer-content>
+    <div class="root__container">
 
-  <header [ngClass]="{'main__header-dark': darkModeActive}" class="main__header">
+      <header [ngClass]="{'main__header-dark': darkMode}" class="main__header">
 
-    <div class="left__section3Col" *ngIf="!drawer.opened">
-      <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
-           viewBox="31.5 30 49.9 32">
-        <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 9" rx="2"
-              transform="translate(31.5 58)"/>
-        <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 10" rx="2"
-              transform="translate(31.5 44)"/>
-        <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkModeActive}"
-              class="hamburger__icon__fill" data-name="Rectangle 11" rx="2"
-              transform="translate(31.5 30)"/>
-      </svg>
-      <img src="../../assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50"/>
-      <svg class="logo__icon" viewBox="150.3 22.2 400 50">
-        <text [ngClass]="{'logo__text-dark': darkModeActive}" class="logo__text" fill="#432c85"
-              font-size="30" font-weight="600"
-              letter-spacing=".1em" transform="translate(149 56)">
-          <tspan x="0" y="0">Non RT RIC Dashboard</tspan>
-        </text>
-      </svg>
+        <div class="left__section3Col" *ngIf="!drawer.opened">
+          <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
+            viewBox="31.5 30 49.9 32">
+            <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
+            <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
+            <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
+          </svg>
+          <img src="../../assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
+          <svg class="logo__icon" viewBox="150.3 22.2 400 50">
+            <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
+              font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
+              <tspan x="0" y="0">Non RT RIC Dashboard</tspan>
+            </text>
+          </svg>
 
-    </div>
+        </div>
 
-    <h3 class="date__text"></h3>
+        <h3 class="date__text"></h3>
 
-    <div class="mode-toggle__container">
-      <span class="mode-toggle__text">Light</span>
-      <label class="toggle-button__container">
-        <input (click)="modeToggleSwitch()" type="checkbox" class="mode-toggle__input"/>
-        <span [ngClass]="{'mode-toggle__bg-checked': darkModeActive}" class="mode-toggle__bg"></span>
-        <span [ngClass]="{'mode-toggle__circle-checked': darkModeActive}" class="mode-toggle__circle"></span>
-      </label>
-      <span class="mode-toggle__text">Dark</span>
-    </div>
+        <div class="mode-toggle__container">
+          <span class="mode-toggle__text">Light</span>
+          <label class="toggle-button__container">
+            <input (click)="modeToggleSwitch()" type="checkbox" class="mode-toggle__input" />
+            <span [ngClass]="{'mode-toggle__bg-checked': darkMode}" class="mode-toggle__bg"></span>
+            <span [ngClass]="{'mode-toggle__circle-checked': darkMode}" class="mode-toggle__circle"></span>
+          </label>
+          <span class="mode-toggle__text">Dark</span>
+        </div>
 
-  </header>
+      </header>
 
-  <!-- Main Content -->
-  <main class="main__container" [ngClass]="{'main-container__bg-dark': darkModeActive}" >
-    <div class = main__container__body [ngClass]="{'dark-theme': darkModeActive}">
-      <div class="main-container__bg"></div>
-      <router-outlet></router-outlet>
-    </div>
-  </main>
+      <!-- Main Content -->
+      <main class="main__container" [ngClass]="{'main-container__bg-dark': darkMode}">
+        <div class=main__container__body [ngClass]="{'dark-theme': darkMode}">
+          <div class="main-container__bg"></div>
+          <router-outlet></router-outlet>
+        </div>
+      </main>
 
-  <!-- Footer -->
-  <footer class="main__footer" [ngClass]="{'main-footer__bg-dark': darkModeActive}">
-    <div class="main-footer__bg">
-      <rd-footer></rd-footer>
-    </div>
-  </footer>
+      <!-- Footer -->
+      <footer class="main__footer" [ngClass]="{'main-footer__bg-dark': darkMode}">
+        <div class="main-footer__bg">
+          <rd-footer></rd-footer>
+        </div>
+      </footer>
 
-</div>
-</mat-drawer-content>
-</mat-drawer-container>
+    </div>
+  </mat-drawer-content>
+</mat-drawer-container>
\ No newline at end of file
index f9e4735..ddefe09 100644 (file)
     Header
 ================
 */
-mat-sidenav-container, mat-sidenav-content, mat-sidenav {
-    height: 100%;
+mat-sidenav-container,
+mat-sidenav-content,
+mat-sidenav {
+  height: 100%;
 }
 
 mat-sidenav {
-    width: 250px;
+  width: 250px;
 }
 
 main {
-    padding: 10px;
+  padding: 10px;
 }
 
 /*
@@ -109,6 +111,7 @@ main {
 .slide-menu-active {
   transform: none;
 }
+
 .menu-header.menu-header__dark {
   background: #2B244D;
 }
@@ -118,7 +121,7 @@ main {
   display: grid;
   grid-template-rows: 1fr 4fr;
   grid-template-columns: 1fr 4fr;
-  grid-template-areas: "greeting greeting" "image details";
+  grid-template-areas: "greeting greeting""image details";
   box-sizing: border-box;
   width: 100%;
   align-content: center;
@@ -135,7 +138,7 @@ mat-drawer-content {
 }
 
 .menumargin-top {
-    margin-top: 10px;
+  margin-top: 10px;
 }
 
 .greeting__text {
@@ -190,12 +193,12 @@ mat-drawer-content {
   max-width: 4rem;
 }
 
-.home_bg_image{
-    height:40em;
-    background-size:cover;
-    width:auto;
-    background-image:url('../assets/intelligence.png');
-    background-position:50% 50%;
+.home_bg_image {
+  height: 40em;
+  background-size: cover;
+  width: auto;
+  background-image: url('../assets/intelligence.png');
+  background-position: 50% 50%;
 }
 
 /*Header*/
@@ -344,7 +347,7 @@ mat-drawer-content {
 
 .main-container__bg-dark {
   opacity: 1;
-  background: linear-gradient(to bottom, #B290FF, #2E1D65);
+  background: linear-gradient(to bottom, rgb(62, 59, 68), rgb(11, 10, 15));
   transition: opacity 300ms linear;
 }
 
@@ -365,7 +368,7 @@ mat-drawer-content {
 
 .main-footer__bg-dark {
   opacity: 1;
-  background: linear-gradient(to bottom, #B290FF, #2E1D65);
+  background: rgb(11, 10, 15);
   transition: opacity 300ms linear;
 }
 
@@ -373,4 +376,4 @@ mat-drawer-content {
   .slide-menu {
     width: 100%;
   }
-}
+}
\ No newline at end of file
index 1673280..f7acff8 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,14 +27,14 @@ import { UiService } from './services/ui/ui.service';
 })
 export class RdComponent implements OnInit {
   showMenu = false;
-  darkModeActive: boolean;
+  darkMode: boolean;
 
-  constructor(public ui: UiService) {
+  constructor(private ui: UiService) {
   }
 
   ngOnInit() {
     this.ui.darkModeState.subscribe((value) => {
-      this.darkModeActive = value;
+      this.darkMode = value;
     });
   }
 
@@ -43,7 +43,7 @@ export class RdComponent implements OnInit {
   }
 
   modeToggleSwitch() {
-    this.ui.darkModeState.next(!this.darkModeActive);
+    this.ui.darkModeState.next(!this.darkMode);
   }
 
 }
index 297e673..184d64f 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,22 +26,22 @@ import { UiService } from './ui.service';
 @Injectable({
   providedIn: 'root'
 })
-export class ConfirmDialogService  {
+export class ConfirmDialogService {
 
   darkMode: boolean;
-  panelClass: string = "";
+  panelClass = '';
 
   constructor(private dialog: MatDialog,
-    public ui: UiService) { }
+    private ui: UiService) { }
 
   openConfirmDialog(msg: string) {
     this.ui.darkModeState.subscribe((isDark) => {
       this.darkMode = isDark;
     });
     if (this.darkMode) {
-      this.panelClass = "dark-theme";
+      this.panelClass = 'dark-theme';
     } else {
-      this.panelClass = "";
+      this.panelClass = '';
     }
     return this.dialog.open(ConfirmDialogComponent, {
       panelClass: this.panelClass,
index a5a12f4..bd5587d 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,20 +27,20 @@ import { UiService } from './ui.service';
 export class ErrorDialogService {
 
   darkMode: boolean;
-  panelClass: string = "";
-  public errorMessage: string = '';
+  panelClass = '';
+  public errorMessage = '';
 
   constructor(private dialog: MatDialog,
-    public ui: UiService) { }
+    private ui: UiService) { }
 
   public displayError(error: string) {
     this.ui.darkModeState.subscribe((isDark) => {
       this.darkMode = isDark;
     });
     if (this.darkMode) {
-      this.panelClass = "dark-theme";
+      this.panelClass = 'dark-theme';
     } else {
-      this.panelClass = "";
+      this.panelClass = '';
     }
     return this.dialog.open(ErrorDialogComponent, {
       panelClass: this.panelClass,
index bf0830a..d40928b 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,10 +29,10 @@ import { UiService } from './ui.service';
 export class LoadingDialogService {
 
   darkMode: boolean;
-  panelClass: string = "";
+  panelClass = '';
 
   constructor(private dialog: MatDialog,
-    public ui: UiService) { }
+    private ui: UiService) { }
 
   private loadingDialogRef: MatDialogRef<LoadingDialogComponent>;
 
@@ -41,9 +41,9 @@ export class LoadingDialogService {
       this.darkMode = isDark;
     });
     if (this.darkMode) {
-      this.panelClass = "dark-theme";
+      this.panelClass = 'dark-theme';
     } else {
-      this.panelClass = "";
+      this.panelClass = '';
     }
     this.loadingDialogRef = this.dialog.open(LoadingDialogComponent, {
       panelClass: this.panelClass,
@@ -57,7 +57,7 @@ export class LoadingDialogService {
   }
 
   stopLoading() {
-    this.loadingDialogRef.close()
+    this.loadingDialogRef.close();
   }
 
 }
index 1636c0d..6b5111d 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 174af1d..902e260 100644 (file)
@@ -17,9 +17,9 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-import {Component, OnDestroy, OnInit} from '@angular/core';
-import {Router} from '@angular/router';
-import {UiService} from '../../services/ui/ui.service';
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { UiService } from '../../services/ui/ui.service';
 
 @Component({
   selector: 'rd-policy-card',
@@ -29,7 +29,7 @@ import {UiService} from '../../services/ui/ui.service';
 export class PolicyCardComponent implements OnInit, OnDestroy {
   darkMode: boolean;
 
-  constructor(public router: Router, public ui: UiService) { }
+  constructor(public router: Router, private ui: UiService) { }
 
   ngOnInit() {
     this.ui.darkModeState.subscribe((isDark) => {
index c74cf88..c37fc42 100644 (file)
 @import './styles/dark-theme';
 
 /* for sidenav to take a whole page */
-html, body { 
-    margin: 0;
-    height: 100%;
-    font-family: Helvetica, Arial, sans-serif;
+html,
+body {
+  margin: 0;
+  height: 100%;
+  font-family: Helvetica, Arial, sans-serif;
 }
 
 /* notification */
@@ -41,4 +42,4 @@ html, body {
   color: #432c85;
   font-size: 25px;
   font-weight: 100;
-}
+}
\ No newline at end of file
index 8cc0ece..6214081 100644 (file)
 
 .dark-theme {
   color: white;
-  $dark-primary: mat-palette($mat-yellow);
-  $dark-accent: mat-palette($mat-amber, A400, A100, A700);
+  $dark-primary: mat-palette($mat-blue-grey);
+  $dark-accent: mat-palette($mat-amber, A200, A100, A400);
   $dark-warn: mat-palette($mat-red);
+
   $dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn);
 
   @include angular-material-theme($dark-theme);
 }
 
 .dark-theme .rd-global-page-title {
-  color:white;
+  color: white;
 }
\ No newline at end of file