From dbb8ebab82ddbace4c6feb7180a4c6eff5697493 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 15 Nov 2019 14:12:11 +0100 Subject: [PATCH] Fixes of the darkMode Fixed some tslint warnings Change-Id: I66602b55746f23131a14d614a170b74f0158473f Issue-ID: NONRTRIC-61 Signed-off-by: PatrikBuhr --- .../src/app/footer/footer.component.html | 8 +- .../src/app/footer/footer.component.scss | 6 +- .../src/app/footer/footer.component.ts | 8 +- .../sidenav-list/sidenav-list.component.ts | 2 +- .../policy-control/policy-control.component.html | 95 ++++++------- .../app/policy-control/policy-control.component.ts | 14 +- .../policy-instance-dialog.component.html | 18 ++- .../policy-instance-dialog.component.scss | 45 ++++-- .../policy-instance-dialog.component.ts | 28 ++-- .../policy-control/policy-instance.component.html | 9 +- .../policy-control/policy-instance.component.scss | 12 +- .../policy-control/policy-instance.component.ts | 19 ++- .../webapp-frontend/src/app/rd.component.html | 155 ++++++++++----------- .../webapp-frontend/src/app/rd.component.scss | 33 +++-- dashboard/webapp-frontend/src/app/rd.component.ts | 12 +- .../src/app/services/ui/confirm-dialog.service.ts | 14 +- .../src/app/services/ui/error-dialog.service.ts | 14 +- .../src/app/services/ui/loading-dialog.service.ts | 14 +- .../app/ui/error-dialog/error-dialog.component.ts | 4 +- .../app/ui/policy-card/policy-card.component.ts | 8 +- dashboard/webapp-frontend/src/styles.scss | 11 +- .../webapp-frontend/src/styles/dark-theme.scss | 7 +- 22 files changed, 282 insertions(+), 254 deletions(-) diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.html b/dashboard/webapp-frontend/src/app/footer/footer.component.html index 29702097..eca6cf3a 100644 --- a/dashboard/webapp-frontend/src/app/footer/footer.component.html +++ b/dashboard/webapp-frontend/src/app/footer/footer.component.html @@ -18,10 +18,10 @@ limitations under the License. ========================LICENSE_END=================================== --> - \ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.scss b/dashboard/webapp-frontend/src/app/footer/footer.component.scss index e2456d72..c06dc010 100644 --- a/dashboard/webapp-frontend/src/app/footer/footer.component.scss +++ b/dashboard/webapp-frontend/src/app/footer/footer.component.scss @@ -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 diff --git a/dashboard/webapp-frontend/src/app/footer/footer.component.ts b/dashboard/webapp-frontend/src/app/footer/footer.component.ts index 66430ecb..b776c9be 100644 --- a/dashboard/webapp-frontend/src/app/footer/footer.component.ts +++ b/dashboard/webapp-frontend/src/app/footer/footer.component.ts @@ -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; }); diff --git a/dashboard/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts b/dashboard/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts index c0f05afc..80c3cd8e 100644 --- a/dashboard/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts +++ b/dashboard/webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts @@ -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) => { diff --git a/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.html b/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.html index 04d440c9..7bfa7f7c 100644 --- a/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.html +++ b/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.html @@ -18,65 +18,62 @@ ========================LICENSE_END=================================== --> -
-

Policy Control

+

Policy Control

- +
- - Policy Type - - {{isInstancesShown(policyType) ? 'expand_less' : 'expand_more'}} - {{getPolicyTypeName(policyType)}} - - + + Policy Type + + {{isInstancesShown(policyType) ? 'expand_less' : 'expand_more'}} + + {{getPolicyTypeName(policyType)}} + + - - Description - {{policyType.description}} - + + Description + {{policyType.description}} + - - Action - - - - + + Action + + + + - - - - + + + + - - - + + + - - No records found. - + + No records found. + - - - + + + - - + + - - + + -
+ -
- -
+
+
\ No newline at end of file diff --git a/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.ts b/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.ts index 70b8c453..3bfe5eaa 100644 --- a/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.ts +++ b/dashboard/webapp-frontend/src/app/policy-control/policy-control.component.ts @@ -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 = new Subject(); -}; +} @Component({ selector: 'rd-policy-control', @@ -59,21 +60,26 @@ export class PolicyControlComponent implements OnInit { @ViewChild(MatSort, { static: true }) sort: MatSort; expandedTypes = new Map(); + 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); } diff --git a/dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.html b/dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.html index ad7ea49e..e9b6ff07 100644 --- a/dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.html +++ b/dashboard/webapp-frontend/src/app/policy-control/policy-instance-dialog.component.html @@ -17,15 +17,15 @@ limitations under the License. ========================LICENSE_END=================================== --> -