Skip to content

Commit 96a1df8

Browse files
committed
Replaced @Input/@output with input/output
1 parent e9abaf4 commit 96a1df8

20 files changed

+78
-49
lines changed

angular/src/account/register/register.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Injector } from '@angular/core';
1+
import { Component, Injector, Input } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { finalize } from 'rxjs/operators';
44
import { AppComponentBase } from '@shared/app-component-base';

angular/src/app/roles/create-role/create-role-dialog.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
Injector,
44
OnInit,
55
EventEmitter,
6-
Output,
6+
output,
7+
ChangeDetectorRef,
78
} from '@angular/core';
89
import { BsModalRef } from 'ngx-bootstrap/modal';
910
import { AppComponentBase } from '@shared/app-component-base';
@@ -27,12 +28,13 @@ export class CreateRoleDialogComponent extends AppComponentBase
2728
checkedPermissionsMap: { [key: string]: boolean } = {};
2829
defaultPermissionCheckedStatus = true;
2930

30-
@Output() onSave = new EventEmitter<any>();
31+
onSave = output<EventEmitter<any>>()
3132

3233
constructor(
3334
injector: Injector,
3435
private _roleService: RoleServiceProxy,
35-
public bsModalRef: BsModalRef
36+
public bsModalRef: BsModalRef,
37+
private cd: ChangeDetectorRef
3638
) {
3739
super(injector);
3840
}
@@ -43,6 +45,7 @@ export class CreateRoleDialogComponent extends AppComponentBase
4345
.subscribe((result: PermissionDtoListResultDto) => {
4446
this.permissions = result.items;
4547
this.setInitialPermissionsStatus();
48+
this.cd.detectChanges();
4649
});
4750
}
4851

@@ -87,10 +90,11 @@ export class CreateRoleDialogComponent extends AppComponentBase
8790
() => {
8891
this.notify.info(this.l('SavedSuccessfully'));
8992
this.bsModalRef.hide();
90-
this.onSave.emit();
93+
this.onSave.emit(null);
9194
},
9295
() => {
9396
this.saving = false;
97+
this.cd.detectChanges();
9498
}
9599
);
96100
}

angular/src/app/roles/edit-role/edit-role-dialog.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
OnInit,
55
EventEmitter,
66
Output,
7+
ChangeDetectorRef,
78
} from '@angular/core';
89
import { BsModalRef } from 'ngx-bootstrap/modal';
910
import { forEach as _forEach, includes as _includes, map as _map } from 'lodash-es';
@@ -34,7 +35,8 @@ export class EditRoleDialogComponent extends AppComponentBase
3435
constructor(
3536
injector: Injector,
3637
private _roleService: RoleServiceProxy,
37-
public bsModalRef: BsModalRef
38+
public bsModalRef: BsModalRef,
39+
private cd: ChangeDetectorRef
3840
) {
3941
super(injector);
4042
}
@@ -47,6 +49,7 @@ export class EditRoleDialogComponent extends AppComponentBase
4749
this.permissions = result.permissions;
4850
this.grantedPermissionNames = result.grantedPermissionNames;
4951
this.setInitialPermissionsStatus();
52+
this.cd.detectChanges();
5053
});
5154
}
5255

angular/src/app/roles/roles.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>{{ "Roles" | localize }}</h1>
6363
totalItems: totalItems
6464
}
6565
; track
66-
role) {
66+
role.id) {
6767
<tr>
6868
<td>{{ role.name }}</td>
6969
<td>{{ role.displayName }}</td>

angular/src/app/roles/roles.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Injector } from '@angular/core';
1+
import { Component, Injector, ChangeDetectorRef } from '@angular/core';
22
import { finalize } from 'rxjs/operators';
33
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
44
import { appModuleAnimation } from '@shared/animations/routerTransition';
@@ -29,9 +29,10 @@ export class RolesComponent extends PagedListingComponentBase<RoleDto> {
2929
constructor(
3030
injector: Injector,
3131
private _rolesService: RoleServiceProxy,
32-
private _modalService: BsModalService
32+
private _modalService: BsModalService,
33+
cd: ChangeDetectorRef
3334
) {
34-
super(injector);
35+
super(injector, cd);
3536
}
3637

3738
list(
@@ -51,6 +52,7 @@ export class RolesComponent extends PagedListingComponentBase<RoleDto> {
5152
.subscribe((result: RoleDtoPagedResultDto) => {
5253
this.roles = result.items;
5354
this.showPaging(result, pageNumber);
55+
this.cd.detectChanges();
5456
});
5557
}
5658

angular/src/app/tenants/create-tenant/create-tenant-dialog.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
Injector,
44
OnInit,
55
Output,
6-
EventEmitter
6+
EventEmitter,
7+
ChangeDetectorRef
78
} from '@angular/core';
89
import { BsModalRef } from 'ngx-bootstrap/modal';
910
import { AppComponentBase } from '@shared/app-component-base';
@@ -25,13 +26,15 @@ export class CreateTenantDialogComponent extends AppComponentBase
2526
constructor(
2627
injector: Injector,
2728
public _tenantService: TenantServiceProxy,
28-
public bsModalRef: BsModalRef
29+
public bsModalRef: BsModalRef,
30+
private cd: ChangeDetectorRef
2931
) {
3032
super(injector);
3133
}
3234

3335
ngOnInit(): void {
3436
this.tenant.isActive = true;
37+
this.cd.detectChanges();
3538
}
3639

3740
save(): void {

angular/src/app/tenants/edit-tenant/edit-tenant-dialog.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
Injector,
44
OnInit,
55
Output,
6-
EventEmitter
6+
EventEmitter,
7+
ChangeDetectorRef
78
} from '@angular/core';
89
import { BsModalRef } from 'ngx-bootstrap/modal';
910
import { AppComponentBase } from '@shared/app-component-base';
@@ -26,14 +27,16 @@ export class EditTenantDialogComponent extends AppComponentBase
2627
constructor(
2728
injector: Injector,
2829
public _tenantService: TenantServiceProxy,
29-
public bsModalRef: BsModalRef
30+
public bsModalRef: BsModalRef,
31+
private cd: ChangeDetectorRef
3032
) {
3133
super(injector);
3234
}
3335

3436
ngOnInit(): void {
3537
this._tenantService.get(this.id).subscribe((result: TenantDto) => {
3638
this.tenant = result;
39+
this.cd.detectChanges();
3740
});
3841
}
3942

angular/src/app/tenants/tenants.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h1>{{ "Tenants" | localize }}</h1>
159159
totalItems: totalItems
160160
}
161161
; track
162-
tenant) {
162+
tenant.id) {
163163
<tr
164164
>
165165
<td>{{ tenant.tenancyName }}</td>

angular/src/app/tenants/tenants.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Injector } from '@angular/core';
1+
import { ChangeDetectorRef, Component, Injector } from '@angular/core';
22
import { finalize } from 'rxjs/operators';
33
import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
44
import { appModuleAnimation } from '@shared/animations/routerTransition';
@@ -32,9 +32,10 @@ export class TenantsComponent extends PagedListingComponentBase<TenantDto> {
3232
constructor(
3333
injector: Injector,
3434
private _tenantService: TenantServiceProxy,
35-
private _modalService: BsModalService
35+
private _modalService: BsModalService,
36+
cd: ChangeDetectorRef
3637
) {
37-
super(injector);
38+
super(injector, cd);
3839
}
3940

4041
list(

angular/src/app/users/create-user/create-user-dialog.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
Injector,
44
OnInit,
55
EventEmitter,
6-
Output
6+
Output,
7+
ChangeDetectorRef
78
} from '@angular/core';
89
import { BsModalRef } from 'ngx-bootstrap/modal';
910
import { forEach as _forEach, map as _map } from 'lodash-es';
@@ -44,7 +45,8 @@ export class CreateUserDialogComponent extends AppComponentBase
4445
constructor(
4546
injector: Injector,
4647
public _userService: UserServiceProxy,
47-
public bsModalRef: BsModalRef
48+
public bsModalRef: BsModalRef,
49+
private cd: ChangeDetectorRef
4850
) {
4951
super(injector);
5052
}
@@ -55,6 +57,7 @@ export class CreateUserDialogComponent extends AppComponentBase
5557
this._userService.getRoles().subscribe((result) => {
5658
this.roles = result.items;
5759
this.setInitialRolesStatus();
60+
this.cd.detectChanges();
5861
});
5962
}
6063

0 commit comments

Comments
 (0)