Browse Source

Feature restructure-user-account-registration-flow implemented

pull/4393/head
tobikugel 2 months ago
committed by Thomas Kaul
parent
commit
82d063033b
  1. 11
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.component.ts
  2. 136
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.html
  3. 26
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.module.ts
  4. 12
      apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.scss

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

@ -9,11 +9,16 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
standalone: false standalone: false
}) })
export class ShowAccessTokenDialog { export class ShowAccessTokenDialog {
public isAgreeButtonDisabled = true; public isCreateAccountButtonDisabled = true;
public disclaimerChecked = false;
public constructor(@Inject(MAT_DIALOG_DATA) public data: any) {} public constructor(@Inject(MAT_DIALOG_DATA) public data: any) {}
public enableAgreeButton() { public onChangeDislaimerChecked() {
this.isAgreeButtonDisabled = false; this.disclaimerChecked = !this.disclaimerChecked;
}
public enableCreateAccountButton() {
this.isCreateAccountButtonDisabled = false;
} }
} }

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

@ -5,44 +5,106 @@
} }
</h1> </h1>
<div class="py-3" mat-dialog-content> <div class="py-3" mat-dialog-content>
<div> <mat-stepper #stepper linear>
<mat-form-field appearance="outline" class="w-100"> <mat-step
<mat-label i18n>Security Token</mat-label> editable="false"
<textarea state="disclaimer"
cdkTextareaAutosize [completed]="disclaimerChecked"
matInput >
readonly <ng-template matStepLabel>Terms and Conditions</ng-template>
type="text" <div class="terms-and-conditions pt-2" i18n>
[(value)]="data.accessToken" Please take a moment to read and accept the
></textarea> <a
<div class="float-right mt-3"> href="https://ghostfol.io/en/about/privacy-policy"
<button target="_blank"
color="secondary" title="Terms and Conditions"
mat-flat-button
[cdkCopyToClipboard]="data.accessToken"
(click)="enableAgreeButton()"
> >
<ion-icon class="mr-1" name="copy-outline" /><span i18n terms and conditions</a
>Copy to clipboard</span >. Remember to keep your security token safe. If you lose it, you will
not be able to recover your account.
</div>
<mat-checkbox
class="pt-2"
color="primary"
i18n
(change)="onChangeDislaimerChecked()"
>
I agree to the terms and understand that if I lose my security token, I
cannot recover my account.
</mat-checkbox>
<div mat-dialog-actions>
<div class="flex-grow-1">
<button i18n mat-button [mat-dialog-close]="undefined">Cancel</button>
</div>
<div>
<button
color="primary"
i18n
mat-flat-button
matStepperNext
[disabled]="!disclaimerChecked"
> >
</button> Continue
</button>
</div>
</div> </div>
</mat-form-field> </mat-step>
</div> <mat-step editable="false" state="copy">
<p i18n> <ng-template matStepLabel>Security Token</ng-template>
I agree to have stored my <i>Security Token</i> from above in a secure <div class="pt-2" i18n>
place. If I lose it, I cannot get my account back. Here is your security token. It is only visible once, please store and
</p> keep it in a safe place.
</div> </div>
<div class="justify-content-end" mat-dialog-actions> <mat-form-field appearance="outline" class="w-100 pt-3">
<button i18n mat-flat-button [mat-dialog-close]="undefined">Cancel</button> <mat-label i18n>Security Token</mat-label>
<button <textarea
color="primary" cdkTextareaAutosize
mat-flat-button matInput
[disabled]="isAgreeButtonDisabled" readonly
[mat-dialog-close]="data" type="text"
> [(value)]="data.accessToken"
<span i18n>Agree and continue</span> ></textarea>
<ion-icon class="ml-1" name="arrow-forward-outline" /> <div class="float-right mt-1">
</button> <button
color="secondary"
mat-flat-button
[cdkCopyToClipboard]="data.accessToken"
(click)="enableCreateAccountButton()"
>
<ion-icon class="mr-1" name="copy-outline" />
<span i18n> Copy to clipboard </span>
</button>
</div>
</mat-form-field>
<div align="end" mat-dialog-actions>
<div>
<button
color="primary"
mat-flat-button
matStepperNext
[disabled]="isCreateAccountButtonDisabled"
[mat-dialog-close]="data"
>
<span i18n>Create Account</span>
<ion-icon class="ml-1" name="arrow-forward-outline" />
</button>
</div>
</div>
</mat-step>
<!-- Custom icons -->
<ng-template matStepperIcon="disclaimer">
<ion-icon name="information-outline"></ion-icon>
</ng-template>
<ng-template matStepperIcon="create">
<ion-icon name="information-outline"></ion-icon>
</ng-template>
<ng-template matStepperIcon="copy">
<ion-icon name="copy-outline"></ion-icon>
</ng-template>
<ng-template matStepperIcon="done">
<ion-icon name="checkmark-outline"></ion-icon>
</ng-template>
</mat-stepper>
<div></div>
</div> </div>

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

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

12
apps/client/src/app/pages/register/show-access-token-dialog/show-access-token-dialog.scss

@ -1,2 +1,14 @@
:host { :host {
.terms-and-conditions {
text-align: justify;
a {
color: rgba(var(--palette-primary-500), 1);
font-weight: 500;
&:hover {
color: rgba(var(--palette-primary-300), 1);
}
}
}
} }

Loading…
Cancel
Save