Commit e7590561 authored by Emily Jensen's avatar Emily Jensen

Added hasfinished functionality and storybook knobs

parent 537c687e
......@@ -37,8 +37,9 @@
<progress-indicator [inProgress]="hasStarted" inProgressText="Saving" [completed]="hasFinished" completedText="Saved"></progress-indicator>
</div>
</form>
<div *ngIf="hasFinished">
<button (click)="downloadPDF()" class="button button--primary">
Download PDF
</button>
</div>
</div>
import { Component, ChangeDetectionStrategy } from "@angular/core";
import * as fromAccount from "../account.reducer";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { SubmitForm, ResetForm } from "./manage-backup-code.actions";
import { manageBackupCodeNewBackupCode } from "../account.reducer";
import { BackupCodePdfService } from "../backup-code-pdf.service";
......@@ -22,8 +22,8 @@ import { BackupCodePdfService } from "../backup-code-pdf.service";
})
export class ManageBackupCodeContainer {
form$ = this.store.select(fromAccount.manageBackupCode);
hasStarted$ = this.store.select(fromAccount.manageBackupCode);
hasFinished$ = this.store.select(fromAccount.manageBackupCode);
hasStarted$ = this.store.pipe(select(fromAccount.manageBackupCodeHasStarted));
hasFinished$ = this.store.pipe(select(fromAccount.manageBackupCodeHasFinished));
errorMessage$ = this.store.select(fromAccount.manageBackupCodeErrorMessage);
backupCode: string | null;
......
......@@ -123,7 +123,9 @@ storiesOf("Account", module)
.add("Manage Backup Code", () => ({
component: ManageBackupCodeComponent,
props: {
form: fromChangePassword.initialState.form
form: fromChangePassword.initialState.form,
hasStarted: boolean("hasStarted", false),
hasFinished: boolean("hasFinished", false)
}
}))
.add("Set Password", () => ({
......@@ -132,4 +134,3 @@ storiesOf("Account", module)
form: fromSetPassword.initialState.form
}
}));
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