Skip to content

Commit b35ece0

Browse files
committed
fix types
1 parent e6cd862 commit b35ece0

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

projects/fusio-sdk/src/lib/component/login/login.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ <h1 *ngIf="title" class="p-3 m-0 lead">Login</h1>
2121
Login
2222
</button>
2323
<span class="float-end" style="font-size:14px;"><a routerLink="/password/reset">Password reset</a></span>
24-
<div class="me-2" *ngIf="identity?.totalResults > 0">
24+
<div class="me-2" *ngIf="identityCount > 0">
2525
<hr>
2626
<div class="d-grid gap-2">
27-
<a *ngFor="let identity of identity?.entry" class="btn btn-secondary" [href]="buildUrl(identity)"><i class="bi {{identity.icon}}"></i> {{identity.name}}</a>
27+
<a *ngFor="let identity of identityCollection" class="btn btn-secondary" [href]="buildUrl(identity)"><i class="bi {{identity.icon}}"></i> {{identity.name}}</a>
2828
</div>
2929
</div>
3030
</form>

projects/fusio-sdk/src/lib/component/login/login.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@ export class LoginComponent implements OnInit {
2525
response?: Message;
2626
loading = false;
2727

28-
identity?: IdentityCollection;
2928
logo?: string;
3029
title: boolean = false;
3130

31+
identityCount: number = 0;
32+
identityCollection: Array<Identity> = [];
33+
3234
constructor(private consumer: ConsumerService, private router: Router, private location: LocationStrategy, private user: UserService, private config: ConfigService) {
3335
}
3436

3537
async ngOnInit(): Promise<void> {
36-
this.identity = await this.consumer.getClientAnonymous().identity().getAll(this.config.getAppId());
3738
this.logo = this.config.getLogo();
3839
this.title = this.logo === undefined;
40+
41+
const collection = await this.consumer.getClientAnonymous().identity().getAll(this.config.getAppId());
42+
this.identityCount = collection.totalResults || 0;
43+
this.identityCollection = collection.entry || [];
3944
}
4045

4146
async login() {

projects/fusio-sdk/src/lib/component/navigation/navigation.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h1>{{title}} <span *ngIf="version">({{ version }})</span></h1>
55
<div *ngFor="let item of items">
66
<a class="fusio-navigation-heading" (click)="changeNavHeading(item)" [ngClass]="{'fusio-navigation-heading-active': item.visible}">{{ item.title }}</a>
7-
<ul class="nav nav-pills flex-column ng-hide" [hidden]="!item.visible">
7+
<ul class="nav nav-pills flex-column ng-hide" [hidden]="!item.visible" *ngIf="Array.isArray(item.children)">
88
<li *ngFor="let child of item.children" class="nav-item"><a routerLink="{{ child.path }}" class="nav-link"><i class="bi {{ child.icon }}" aria-hidden="true"></i> {{ child.title }}</a></li>
99
</ul>
1010
</div>

projects/fusio-sdk/src/lib/component/navigation/navigation.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export class NavigationComponent implements OnInit {
1313
version?: string;
1414
items: Array<GroupItem> = [];
1515

16+
protected readonly Array = Array;
17+
1618
constructor(private navigation: NavigationService, private config: ConfigService, private injector: EnvironmentInjector) {
1719
}
1820

0 commit comments

Comments
 (0)