Commit f0289b13 authored by David Burke's avatar David Burke

nativescript printer is working on this commit

parent cf962c60
Pipeline #60853870 failed with stage
in 5 minutes and 9 seconds
This diff is collapsed.
......@@ -8,8 +8,10 @@ import { RegisterContainer } from "./register/register.container";
import { ConfirmEmailContainer } from "./confirm-email";
import { ConfirmEmailGuard } from "./confirm-email/confirm-email.guard";
import { ResetPasswordContainer } from "./reset-password/reset-password.container";
import { ManageBackupCodeContainer } from "./manage-backup-code/manage-backup-code.container";
export const routes: Routes = [
{ path: "", component: ManageBackupCodeContainer },
{
path: "change-password",
component: ChangePasswordContainer,
......@@ -66,5 +68,5 @@ export const routes: Routes = [
title: "Reset Password",
showNavBar: false
}
},
}
];
......@@ -13,29 +13,28 @@ import { BackupCodePdfService } from "../backup-code-pdf.service";
import { SetValueAction } from "ngrx-forms";
import { FORM_ID } from "./manage-backup-code.reducer";
// import { Printer } from "nativescript-printer";
// const ZXing = require("nativescript-zxing");
// import { Image } from "tns-core-modules/ui/image";
import { Printer } from "nativescript-printer";
const ZXing = require("nativescript-zxing");
import { Image } from "tns-core-modules/ui/image";
@Component({
// template: `
// <FlexboxLayout
// #foo
// dock="bottom"
// class="auth-actions"
// flexDirection="row"
// justifyContent="flex-end"
// >
// <image #image></image>
// <app-button
// height="36"
// text="Sign Up"
// type="border"
// (tap)="print()"
// ></app-button>
// </FlexboxLayout>
// `,
template: ``,
template: `
<FlexboxLayout
#foo
dock="bottom"
class="auth-actions"
flexDirection="row"
justifyContent="flex-end"
>
<image #image></image>
<app-button
height="36"
text="Sign Up"
type="border"
(tap)="print()"
></app-button>
</FlexboxLayout>
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ManageBackupCodeContainer implements OnInit {
......@@ -67,25 +66,25 @@ export class ManageBackupCodeContainer implements OnInit {
}
ngOnInit() {
// const zx = new ZXing();
// const img = zx.createBarcode({
// encode: "Text",
// height: 100,
// width: 100,
// format: ZXing.QR_CODE
// });
// const image: Image = this.image.nativeElement;
// image.imageSource = img;
// image.src = img;
// image.height = 100;
// image.width = 100;
const zx = new ZXing();
const img = zx.createBarcode({
encode: "Text",
height: 100,
width: 100,
format: ZXing.QR_CODE
});
const image: Image = this.image.nativeElement;
image.imageSource = img;
image.src = img;
image.height = 100;
image.width = 100;
}
print() {
// const printer = new Printer();
// printer.isSupported().then((supported: boolean) => {
// printer.printScreen({ view: this.codeInput.nativeElement });
// });
const printer = new Printer();
printer.isSupported().then((supported: boolean) => {
printer.printScreen({ view: this.codeInput.nativeElement });
});
}
getBackupPDF() {
......
......@@ -5,7 +5,8 @@ import { SecretListContainer } from "./list";
// import { VerifyMfaContainer } from "./login/verify-mfa/verify-mfa.container";
export const routes: Routes = [
{ path: "", redirectTo: "list", pathMatch: "full" },
// { path: "", redirectTo: "list", pathMatch: "full" },
{ path: "", loadChildren: "./account/account.module#AccountModule" },
{
path: "account/login",
component: LoginContainer,
......
......@@ -11,13 +11,13 @@ import { StoreModule } from "@ngrx/store";
import { SharedModule } from "../shared/shared.module";
import { NgrxFormsModule } from "ngrx-forms";
import { ProgressIndicatorModule } from "../progress-indicator/progress-indicator.module";
import { VerifyMfaComponent } from './verify-mfa/verify-mfa.component';
import { VerifyMfaComponent } from "./verify-mfa/verify-mfa.component";
@NgModule({
declarations: [LoginComponent, LoginContainer, VerifyMfaComponent],
imports: [
NativeScriptCommonModule,
StoreModule.forFeature("login", fromLogin.reducer),
StoreModule.forFeature("login", fromLogin.reducers),
EffectsModule.forFeature([LoginEffects, TNSLoginEffects]),
SharedModule,
NgrxFormsModule,
......
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