Browse Source

Minor improvements

pull/4393/head
Thomas Kaul 1 month ago
parent
commit
fc42be5714
  1. 11
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.component.ts
  2. 9
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.html
  3. 20
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.module.ts

11
apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.component.ts

@ -19,6 +19,7 @@ import { takeUntil } from 'rxjs/operators';
})
export class ShowAccessTokenDialog {
@ViewChild(MatStepper) stepper!: MatStepper;
public accessToken: string;
public authToken: string;
public isCreateAccountButtonDisabled = true;
@ -32,15 +33,11 @@ export class ShowAccessTokenDialog {
private dataService: DataService
) {}
public onChangeDislaimerChecked() {
this.isDisclaimerChecked = !this.isDisclaimerChecked;
}
public enableCreateAccountButton() {
this.isCreateAccountButtonDisabled = false;
}
public async createAccount() {
public createAccount() {
this.dataService
.postUser()
.pipe(takeUntil(this.unsubscribeSubject))
@ -54,4 +51,8 @@ export class ShowAccessTokenDialog {
this.changeDetectorRef.markForCheck();
});
}
public onChangeDislaimerChecked() {
this.isDisclaimerChecked = !this.isDisclaimerChecked;
}
}

9
apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.html

@ -9,8 +9,8 @@
<mat-step editable="false" [completed]="isDisclaimerChecked">
<ng-template i18n matStepLabel>Terms and Conditions</ng-template>
<div class="pt-2">
<ng-container i18n>
Please keep your security token safe. If you lose it, you will not be
<ng-container i18n
>Please keep your security token safe. If you lose it, you will not be
able to recover your account.</ng-container
>
</div>
@ -48,7 +48,7 @@
and keep it in a safe place.</ng-container
>
</div>
<mat-form-field appearance="outline" class="w-100 pt-3">
<mat-form-field appearance="outline" class="pt-3 w-100 without-hint">
<mat-label i18n>Security Token</mat-label>
<textarea
cdkTextareaAutosize
@ -69,7 +69,7 @@
</button>
</div>
</mat-form-field>
<div align="end" class="mt-3" mat-dialog-actions>
<div align="end" class="mt-1" mat-dialog-actions>
<div>
<button
color="primary"
@ -85,7 +85,6 @@
</div>
</mat-step>
<!-- Custom icons -->
<ng-template matStepperIcon="done">
<ion-icon name="checkmark-outline"></ion-icon>
</ng-template>

20
apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.module.ts

@ -1,5 +1,4 @@
import { ClipboardModule } from '@angular/cdk/clipboard';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { TextFieldModule } from '@angular/cdk/text-field';
import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
@ -7,10 +6,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatDialogModule } from '@angular/material/dialog';
import {
MAT_FORM_FIELD_DEFAULT_OPTIONS,
MatFormFieldModule
} from '@angular/material/form-field';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatStepperModule } from '@angular/material/stepper';
@ -31,20 +27,6 @@ import { ShowAccessTokenDialog } from './show-access-token-dialog.component';
ReactiveFormsModule,
TextFieldModule
],
providers: [
{
provide: STEPPER_GLOBAL_OPTIONS,
useValue: {
displayDefaultIndicatorType: false
}
},
{
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
useValue: {
subscriptSizing: 'dynamic'
}
}
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ShowAccessTokenDialogModule {}

Loading…
Cancel
Save