Commit 1d3ba019 authored by Emily Jensen's avatar Emily Jensen

Made non field errors tns component

parent ba8ce903
Pipeline #61285954 (#2638) passed with stage
in 12 minutes and 13 seconds
<Scrollview #printArea>
<StackLayout class="auth-form-body">
<app-text-field
#password
autocorrect="false"
autocapitalizationType="none"
type="password"
label="Step 1: Verify Password"
returnKeyType="next"
[isFormSubmitted]="form.isSubmitted"
[ngrxFormControl]="form.controls.oldPassword"
></app-text-field>
<app-button text="Step 2: Submit" (tap)="onSubmit()"></app-button>
<app-download-backup-code
*ngIf="hasFinished"
[code]="backupCode"
></app-download-backup-code>
</StackLayout>
</Scrollview>
<ns-action-bar-container></ns-action-bar-container>
<account-frame
title="Change Backup Code"
submitText="Next"
(onSubmit)="onSubmit()"
>
<Label class="text-label m-b-20" textWrap="true" (tap)="learnMore()">
<FormattedString>
<Span
text="Replace your old backup code with a new one. Not sure what this is? "
></Span>
<Span text="Learn More &#8250;" class="text-link"></Span>
</FormattedString>
</Label>
<app-non-field-errors
*ngIf="nonFieldErrors"
[nonFieldErrors]="nonFieldErrors"
></app-non-field-errors>
<app-text-field
#password
autocorrect="false"
autocapitalizationType="none"
type="password"
label="Verify Password"
returnKeyType="next"
[isFormSubmitted]="form.isSubmitted"
[ngrxFormControl]="form.controls.oldPassword"
></app-text-field>
<progress-indicator
[inProgress]="hasStarted"
inProgressText="Verifying"
></progress-indicator>
<app-download-backup-code
*ngIf="hasFinished"
[code]="backupCode"
></app-download-backup-code>
</account-frame>
......@@ -38,7 +38,6 @@ export class ManageBackupCodeComponent implements OnDestroy {
onSubmit() {
if (this.form.isValid) {
alert("submitted and valid");
this.newBackupCode.emit();
}
}
......@@ -46,4 +45,8 @@ export class ManageBackupCodeComponent implements OnDestroy {
ngOnDestroy() {
this.reset.emit();
}
learnMore() {
alert("TODO: create learn more page and navigate to it");
}
}
......@@ -37,13 +37,11 @@
</FlexboxLayout>
<StackLayout orientation="vertical">
<Label
class="p-10 m-b-10"
<app-non-field-errors
*ngIf="nonFieldErrors"
[text]="nonFieldErrors"
backgroundColor="#f0f0f0"
flexGrow="1"
></Label>
[nonFieldErrors]="nonFieldErrors"
></app-non-field-errors>
<ng-content></ng-content>
</StackLayout>
</StackLayout>
......
import { Component, Input } from "@angular/core";
@Component({
selector: "app-non-field-errors",
template: `
<Label
class="p-10 m-b-10"
[text]="nonFieldErrors"
backgroundColor="#f0f0f0"
flexGrow="1"
></Label>
`
})
export class NonFieldErrorsComponent {
@Input() nonFieldErrors?: string[];
}
......@@ -16,6 +16,7 @@ import { NsCheckboxComponent } from "./ns-checkbox/ns-checkbox.component";
import { ServerSelectComponent } from "./server-select/server-select.component";
import { AccountFrameComponent } from "./account-frame/account-frame.component";
import { BulletListComponent } from "./bullet-list/bullet-list.component.tns";
import { NonFieldErrorsComponent } from "./non-field-errors/non-field-errors.component";
export const COMPONENTS = [
ButtonComponent,
......@@ -29,7 +30,8 @@ export const COMPONENTS = [
TextLinkComponent,
ServerSelectComponent,
AccountFrameComponent,
BulletListComponent
BulletListComponent,
NonFieldErrorsComponent
];
@NgModule({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment