Commit d28e4c74 authored by Emily Jensen's avatar Emily Jensen

Added download PFD component

parent 1f37f375
......@@ -37,6 +37,7 @@ import { PasswordInputComponent } from "./change-password/password-input/passwor
import { ManageBackupCodeComponent } from "./manage-backup-code/manage-backup-code.component";
import { ManageBackupCodeContainer } from "./manage-backup-code/manage-backup-code.container";
import { ManageBackupCodeEffects } from "./manage-backup-code/manage-backup-code.effects";
import { DownloadBackupCodeComponent } from "./manage-backup-code/download-backup-code/download-backup-code.component";
import { BackupCodePdfService } from "./backup-code-pdf.service";
import { SetPasswordComponent } from "./reset-password/set-password/set-password.component";
import { SetPasswordContainer } from "./reset-password/set-password/set-password.container";
......@@ -65,6 +66,7 @@ export const COMPONENTS = [
ErrorReportingComponent,
ErrorReportingContainer,
BackupCodeComponent,
DownloadBackupCodeComponent,
ResetPasswordComponent,
ResetPasswordContainer,
ResetPasswordVerifyComponent,
......
<app-form-label
[isLarge]="true"
[isInactive]="!hasFinished"
[isComplete]="false">
Download PDF with New Backup Code
</app-form-label>
<div *ngIf="hasFinished">
<p>
Your backup code is the <strong>only</strong> way to recover your
account if you forget&nbsp;your&nbsp;password.
</p>
<p>
Download it, print it out, and save it someplace safe. Destroy your old
backup&nbsp;code&nbsp;file.
</p>
<button (click)="downloadPDF()" class="button button--primary u-margin-b-15">
Download
</button>
<p class="manage-backup-code__note">
Your previous code is now invalid. If you navigate away from this page,
you will not be able to use&nbsp;this&nbsp;code&nbsp;either.
</p>
</div>
\ No newline at end of file
<Button text="new-backup-code works!" class="btn btn-primary"></Button>
\ No newline at end of file
import { Component, Input } from '@angular/core';
import { BackupCodePdfService } from "../../backup-code-pdf.service";
@Component({
selector: 'app-download-backup-code',
templateUrl: './download-backup-code.component.html',
styleUrls: ['./download-backup-code.component.scss']
})
export class DownloadBackupCodeComponent {
@Input()
code: string;
@Input()
hasFinished: boolean;
constructor(private backupCodeToPdf: BackupCodePdfService) {
}
downloadPDF() {
this.backupCodeToPdf.download(this.code);
}
}
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