Browse Source

feat(client): enforce encapsulation

pull/6934/head
KenTandrian 2 days ago
parent
commit
e0609fe9a8
  1. 4
      apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts
  2. 25
      apps/client/src/app/components/user-account-access/user-account-access.component.ts

4
apps/client/src/app/components/user-account-access/create-or-update-access-dialog/create-or-update-access-dialog.component.ts

@ -115,11 +115,11 @@ export class GfCreateOrUpdateAccessDialogComponent implements OnInit {
}); });
} }
public onCancel() { protected onCancel() {
this.dialogRef.close(); this.dialogRef.close();
} }
public async onSubmit() { protected async onSubmit() {
if (this.mode === 'create') { if (this.mode === 'create') {
await this.createAccess(); await this.createAccess();
} else { } else {

25
apps/client/src/app/components/user-account-access/user-account-access.component.ts

@ -59,20 +59,21 @@ import { CreateOrUpdateAccessDialogParams } from './create-or-update-access-dial
templateUrl: './user-account-access.html' templateUrl: './user-account-access.html'
}) })
export class GfUserAccountAccessComponent implements OnInit { export class GfUserAccountAccessComponent implements OnInit {
public accessesGet: Access[]; protected accessesGet: Access[];
public accessesGive: Access[]; protected accessesGive: Access[];
public deviceType: string; protected hasPermissionToCreateAccess: boolean;
public hasPermissionToCreateAccess: boolean; protected hasPermissionToDeleteAccess: boolean;
public hasPermissionToDeleteAccess: boolean; protected hasPermissionToUpdateOwnAccessToken: boolean;
public hasPermissionToUpdateOwnAccessToken: boolean; protected isAccessTokenHidden = true;
public isAccessTokenHidden = true; protected updateOwnAccessTokenForm = new FormGroup({
public updateOwnAccessTokenForm = new FormGroup({
accessToken: new FormControl<string>('', { accessToken: new FormControl<string>('', {
nonNullable: true, nonNullable: true,
validators: [Validators.required] validators: [Validators.required]
}) })
}); });
public user: User; protected user: User;
private deviceType: string;
private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly changeDetectorRef = inject(ChangeDetectorRef);
private readonly dataService = inject(DataService); private readonly dataService = inject(DataService);
@ -136,7 +137,7 @@ export class GfUserAccountAccessComponent implements OnInit {
this.update(); this.update();
} }
public onDeleteAccess(aId: string) { protected onDeleteAccess(aId: string) {
this.dataService this.dataService
.deleteAccess(aId) .deleteAccess(aId)
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
@ -147,7 +148,7 @@ export class GfUserAccountAccessComponent implements OnInit {
}); });
} }
public onGenerateAccessToken() { protected onGenerateAccessToken() {
this.notificationService.confirm({ this.notificationService.confirm({
confirmFn: () => { confirmFn: () => {
this.dataService this.dataService
@ -182,7 +183,7 @@ export class GfUserAccountAccessComponent implements OnInit {
}); });
} }
public onUpdateAccess(aId: string) { protected onUpdateAccess(aId: string) {
this.router.navigate([], { this.router.navigate([], {
queryParams: { accessId: aId, editDialog: true } queryParams: { accessId: aId, editDialog: true }
}); });

Loading…
Cancel
Save