diff --git a/src/app/components/access/access.component.html b/src/app/components/access/access.component.html index e6e868c..99122f3 100644 --- a/src/app/components/access/access.component.html +++ b/src/app/components/access/access.component.html @@ -7,10 +7,10 @@
- +
-

Access Denied

- You do not have the necesary permisions. Please contact admins. +

Access Denied

+ You do not have the necesary permisions. Please contact admins. Access denied
Go to Dashboard diff --git a/src/app/components/access/access.component.ts b/src/app/components/access/access.component.ts index fb55ed1..1867c97 100644 --- a/src/app/components/access/access.component.ts +++ b/src/app/components/access/access.component.ts @@ -1,7 +1,28 @@ -import { Component } from '@angular/core'; - +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ConfigService } from '../../service/app.config.service'; +import { AppConfig } from '../../api/appconfig'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-access', templateUrl: './access.component.html', }) -export class AccessComponent { } +export class AccessComponent implements OnInit, OnDestroy { + + config: AppConfig; + subscription: Subscription; + + constructor(public configService: ConfigService){ } + + ngOnInit(): void { + this.config = this.configService.config; + this.subscription = this.configService.configUpdate$.subscribe(config => { + this.config = config; + }); + } + + ngOnDestroy(): void { + if(this.subscription){ + this.subscription.unsubscribe(); + } + } +} diff --git a/src/app/components/error/error.component.html b/src/app/components/error/error.component.html index 1a061cf..9a19020 100644 --- a/src/app/components/error/error.component.html +++ b/src/app/components/error/error.component.html @@ -7,10 +7,10 @@
- +
-

Error Occured

- Requested resource is not available. +

Error Occured

+ Requested resource is not available. Error
Go to Dashboard diff --git a/src/app/components/error/error.component.ts b/src/app/components/error/error.component.ts index 8828f32..8f8fd3b 100644 --- a/src/app/components/error/error.component.ts +++ b/src/app/components/error/error.component.ts @@ -1,7 +1,29 @@ -import { Component } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ConfigService } from '../../service/app.config.service'; +import { AppConfig } from '../../api/appconfig'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-error', templateUrl: './error.component.html', }) -export class ErrorComponent { } +export class ErrorComponent implements OnInit, OnDestroy { + + config: AppConfig; + subscription: Subscription; + + constructor(public configService: ConfigService){ } + + ngOnInit(): void { + this.config = this.configService.config; + this.subscription = this.configService.configUpdate$.subscribe(config => { + this.config = config; + }); + } + + ngOnDestroy(): void { + if(this.subscription){ + this.subscription.unsubscribe(); + } + } +} diff --git a/src/app/components/landing/landing.component.ts b/src/app/components/landing/landing.component.ts index 5b75fa2..4fe1ea8 100644 --- a/src/app/components/landing/landing.component.ts +++ b/src/app/components/landing/landing.component.ts @@ -1,4 +1,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ConfigService } from '../../service/app.config.service'; +import { AppConfig } from '../../api/appconfig'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-landing', templateUrl: './landing.component.html', @@ -49,19 +52,27 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; } `] }) -export class LandingComponent implements OnInit { +export class LandingComponent implements OnInit, OnDestroy { themeElement: any; - constructor() { } + config: AppConfig; + + subscription: Subscription; + + constructor(public configService: ConfigService) { } ngOnInit(): void { + this.config = this.configService.config; + this.subscription = this.configService.configUpdate$.subscribe(config => { + this.config = config; + }); this.themeElement = document.getElementById('theme-css'); this.themeElement.setAttribute('href','assets/theme/saga-blue/theme.css'); } ngOnDestroy(): void { - this.themeElement.setAttribute('href', 'assets/theme/lara-light-indigo/theme.css'); + this.themeElement.setAttribute('href',`assets/theme/${this.config.theme}/theme.css`); } } diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index 24c5559..f38c712 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -7,15 +7,15 @@
Image -
Welcome, Isabel!
- Sign in to continue +
Welcome, Isabel!
+ Sign in to continue
- + - +
@@ -25,7 +25,7 @@
Forgot password?
- +
diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index 81f11f3..edf5b6b 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -1,5 +1,7 @@ -import { Component, OnInit } from '@angular/core'; - +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ConfigService } from '../../service/app.config.service'; +import { AppConfig } from '../../api/appconfig'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-login', templateUrl: './login.component.html', @@ -20,21 +22,28 @@ import { Component, OnInit } from '@angular/core'; } `] }) -export class LoginComponent implements OnInit { +export class LoginComponent implements OnInit, OnDestroy { valCheck: string[] = ['remember']; - password: string; - themeElement: any; - constructor() { } + password: string; + + config: AppConfig; + + subscription: Subscription; + + constructor(public configService: ConfigService){ } ngOnInit(): void { - this.themeElement = document.getElementById('theme-css'); - this.themeElement.setAttribute('href','assets/theme/saga-blue/theme.css'); + this.config = this.configService.config; + this.subscription = this.configService.configUpdate$.subscribe(config => { + this.config = config; + }); } ngOnDestroy(): void { - this.themeElement.setAttribute('href', 'assets/theme/lara-light-indigo/theme.css'); + if(this.subscription){ + this.subscription.unsubscribe(); + } } - } diff --git a/src/app/components/notfound/notfound.component.html b/src/app/components/notfound/notfound.component.html index a5d359d..44375d1 100644 --- a/src/app/components/notfound/notfound.component.html +++ b/src/app/components/notfound/notfound.component.html @@ -7,33 +7,33 @@
404 -

Looks like you are lost

- Requested resource is not available. +

Looks like you are lost

+ Requested resource is not available.
- +
-

Frequently Asked Questions

- Ultricies mi quis hendrerit dolor. +

Frequently Asked Questions

+ Ultricies mi quis hendrerit dolor.
- +
-

Solution Center

- Phasellus faucibus scelerisque eleifend. +

Solution Center

+ Phasellus faucibus scelerisque eleifend.
- +
-

Permission Manager

- Accumsan in nisl nisi scelerisque +

Permission Manager

+ Accumsan in nisl nisi scelerisque
diff --git a/src/app/components/notfound/notfound.component.ts b/src/app/components/notfound/notfound.component.ts index 1d57db4..d607612 100644 --- a/src/app/components/notfound/notfound.component.ts +++ b/src/app/components/notfound/notfound.component.ts @@ -1,7 +1,29 @@ -import { Component } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ConfigService } from '../../service/app.config.service'; +import { AppConfig } from '../../api/appconfig'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-notfound', templateUrl: './notfound.component.html', }) -export class NotfoundComponent { } +export class NotfoundComponent implements OnInit, OnDestroy { + + config: AppConfig; + subscription: Subscription; + + constructor(public configService: ConfigService){ } + + ngOnInit(): void { + this.config = this.configService.config; + this.subscription = this.configService.configUpdate$.subscribe(config => { + this.config = config; + }); + } + + ngOnDestroy(): void { + if(this.subscription){ + this.subscription.unsubscribe(); + } + } +}