Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit b1d7fb5

Browse files
committed
bug fix
1 parent 89c42ae commit b1d7fb5

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

src/Frontend/Jp.AdminUI/src/app/app.routing.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export const routes = [
3636
export class RoutesModule {
3737
constructor(public menuService: MenuService, tr: TranslatorService, private settings: SettingsService) {
3838

39-
let isLight = this.settings.isLightVersion;
40-
menuService.addMenu(menu.filter(f => f.lightVersion == null || f.lightVersion == isLight));
39+
this.settings.isLightVersion$.subscribe(lightVersion => {
40+
menuService.addMenu(menu.filter(f => f.lightVersion == null || f.lightVersion == lightVersion));
41+
});
4142
}
4243
}

src/Frontend/Jp.AdminUI/src/app/core/settings/settings.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export class SettingsService {
1818
userProfileObservable: Observable<object>;
1919
loadDiscoveryDocumentAndTryLoginObservable: Observable<any>;
2020
doc: any;
21-
isLightVersion: boolean;
21+
isLightVersion$: Observable<boolean>;
22+
lightVersion: boolean;
2223

2324
constructor(
2425
private oauthService: OAuthService,
2526
private versionService: VersionService) {
2627

27-
this.versionService.getVersion().subscribe(s => this.isLightVersion = s == "light");
28+
this.isLightVersion$ = this.versionService.getVersion().pipe(tap(light =>
29+
this.lightVersion = light
30+
));
2831
// App Settings
2932
// -----------------------------------
3033
this.app = {

src/Frontend/Jp.AdminUI/src/app/panel/persisted-grants/list/persisted-grants-list.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<tr>
1818
<th></th>
1919
<th>{{ 'persistedGrant.list.creationTime' | translate }}</th>
20-
<th *ngIf="!settings.isLightVersion"> {{ 'persistedGrant.list.picture' | translate }} </th>
21-
<th *ngIf="!settings.isLightVersion"> {{ 'persistedGrant.list.email' | translate }}</th>
20+
<th *ngIf="!settings.lightVersion"> {{ 'persistedGrant.list.picture' | translate }} </th>
21+
<th *ngIf="!settings.lightVersion"> {{ 'persistedGrant.list.email' | translate }}</th>
2222
<th> {{ 'persistedGrant.list.clientId' | translate }}</th>
2323
<th> {{ 'persistedGrant.list.type' | translate }} </th>
2424
<th></th>
@@ -33,8 +33,8 @@
3333
&nbsp;
3434
</td>
3535
<td>{{grant.creationTime | date: 'short'}}</td>
36-
<td *ngIf="!settings.isLightVersion"><img *ngIf="grant.picture" width="32" [src]="grant.picture" /></td>
37-
<td *ngIf="!settings.isLightVersion">{{grant.email}}</td>
36+
<td *ngIf="!settings.lightVersion"><img *ngIf="grant.picture" width="32" [src]="grant.picture" /></td>
37+
<td *ngIf="!settings.lightVersion">{{grant.email}}</td>
3838
<td>{{grant.clientId}}</td>
3939
<td>{{grant.type}}</td>
4040
<td>

src/Frontend/Jp.AdminUI/src/app/shared/services/version.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
33
import { environment } from '@env/environment';
44
import { Observable } from 'rxjs';
5+
import { map } from 'rxjs/operators';
56

67
@Injectable()
78
export class VersionService {
@@ -12,7 +13,7 @@ export class VersionService {
1213
this.endpoint = environment.ResourceServer + "version";
1314
}
1415

15-
public getVersion(): Observable<string> {
16-
return this.http.get(`${this.endpoint}`, { responseType: 'text' });
16+
public getVersion(): Observable<boolean> {
17+
return this.http.get(`${this.endpoint}`, { responseType: 'text' }).pipe(map(t => t == "light"));
1718
}
1819
}

0 commit comments

Comments
 (0)