Skip to content
Permalink
Browse files

Revert "#9392 Added possibility to print qr code"

  • Loading branch information...
cmgustavo committed Dec 24, 2018
1 parent 3867074 commit b796f21b717dbb2904b77964c0627399e9711c85
@@ -116,8 +116,6 @@ npm run test:link # Check if the code matches style rules
npm run fix:prettier # Modify files to match style rules
```

Your git commit must be gpg-signed. You'll find further readings on how to sign commits here: https://help.github.com/articles/signing-commits/

**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
license your work under the same license as that used by the project.

@@ -169,7 +169,6 @@
"@ionic-native/fcm": "4.14.0",
"@ionic-native/file": "4.14.0",
"@ionic-native/launch-review": "4.14.0",
"@ionic-native/printer": "4.14.0",
"@ionic-native/qr-scanner": "4.14.0",
"@ionic-native/screen-orientation": "4.14.0",
"@ionic-native/social-sharing": "4.14.0",
@@ -205,7 +204,6 @@
"cordova-plugin-inappbrowser": "2.0.2",
"cordova-plugin-ionic-keyboard": "2.1.3",
"cordova-plugin-network-information": "2.0.1",
"cordova-plugin-printer": "0.7.3",
"cordova-plugin-qrscanner": "2.6.0",
"cordova-plugin-screen-orientation": "3.0.1",
"cordova-plugin-spinner-dialog": "1.3.1",
@@ -329,8 +327,7 @@
"im.ltdev.cordova.UserAgent": {},
"cordova-launch-review": {},
"cordova-plugin-wkwebview-engine": {},
"cordova-plugin-wkwebview-inputfocusfix": {},
"cordova-plugin-printer": {}
"cordova-plugin-wkwebview-inputfocusfix": {}
},
"platforms": [
"android",
@@ -1,4 +1,4 @@
<ion-header class="on-print-hide">
<ion-header>
<ion-navbar [navbar-bg]="wallet?.color">
<ion-title>{{'Export wallet' | translate}}</ion-title>
</ion-navbar>
@@ -84,21 +84,9 @@
</ion-list>
<ion-list *ngSwitchCase="'qr-code'">
<div class="qrCode" *ngIf="supported && showQrCode">
<div id="cordovaPrintWrapper">
<div class="on-print-show">
<p translate>QR code to recover wallet {{walletName}}</p>
</div>
<ngx-qrcode qrc-value="{{exportWalletInfo}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
<ion-item-divider>
<span translate>From the destination device, go to Add wallet &gt; Import wallet and scan this QR code</span>
</ion-item-divider>
</div>
<ion-item-divider class="on-print-hide" *ngIf="isPrintingAvailableOnMobile || !isCordova">
<form>
<button class="button-standard" ion-button type="submit" (click)="printQr()">
<span translate>Print</span>
</button>
</form>
<ngx-qrcode qrc-value="{{exportWalletInfo}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
<ion-item-divider>
<span translate>From the destination device, go to Add wallet &gt; Import wallet and scan this QR code</span>
</ion-item-divider>
</div>
<div class="not-supported-message" *ngIf="!supported && showQrCode">
@@ -7,23 +7,9 @@ page-wallet-export {
border: 1px solid #e9e9e9;
border-radius: 4px;
}
.on-print-show {
display: none;
}
}
.not-supported-message {
margin-top: 5rem;
text-align: center;
}
@media print {
.scroll-content {
margin: 0 !important; // start printing at the top of the page
}
.on-print-hide {
display: none;
}
.on-print-show {
display: block !important;
}
}
}
@@ -6,7 +6,6 @@ import { Logger } from '../../../../../providers/logger/logger';

// native
import { Clipboard } from '@ionic-native/clipboard';
import { Printer, PrintOptions } from '@ionic-native/printer';
import { SocialSharing } from '@ionic-native/social-sharing';

// providers
@@ -43,8 +42,6 @@ export class WalletExportPage extends WalletTabsChild {
public exportWalletInfo;
public supported: boolean;
public showQrCode: boolean;
public isPrintingAvailableOnMobile: boolean = false;
public walletName: string = '';

constructor(
public profileProvider: ProfileProvider,
@@ -57,7 +54,6 @@ export class WalletExportPage extends WalletTabsChild {
private backupProvider: BackupProvider,
private platformProvider: PlatformProvider,
private socialSharing: SocialSharing,
private printer: Printer,
private appProvider: AppProvider,
private clipboard: Clipboard,
public toastCtrl: ToastController,
@@ -89,14 +85,6 @@ export class WalletExportPage extends WalletTabsChild {
this.isCordova = this.platformProvider.isCordova;
this.isSafari = this.platformProvider.isSafari;
this.isIOS = this.platformProvider.isIOS;
this.printer.isAvailable().then(
() => {
this.isPrintingAvailableOnMobile = true;
},
() => {}
);
this.walletName =
this.wallet.credentials.walletName || this.wallet.credentials.walletId;
}

private matchingPasswords(passwordKey: string, confirmPasswordKey: string) {
@@ -375,26 +363,6 @@ export class WalletExportPage extends WalletTabsChild {
});
}

public printQr(): boolean {
if (this.isCordova) {
const elementToPrint = document.getElementById('cordovaPrintWrapper');
const options: PrintOptions = {
name: 'Exported wallet from ' + this.appProvider.info.userVisibleName
};
this.printer.print(elementToPrint, options).then(
() => {
this.logger.debug('Printing dialog finished');
},
() => {
this.logger.error('Unable to print');
}
);
} else {
window.print();
}
return false;
}

private showErrorInfoSheet(err?: Error | string): void {
const title = this.translate.instant('Error');
const msg = err ? err : this.translate.instant('Failed to export');
@@ -5,7 +5,6 @@ export { Device } from '@ionic-native/device';
export { FCM } from '@ionic-native/fcm';
export { File } from '@ionic-native/file';
export { LaunchReview } from '@ionic-native/launch-review';
export { Printer } from '@ionic-native/printer';
export { QRScanner } from '@ionic-native/qr-scanner';
export { ScreenOrientation } from '@ionic-native/screen-orientation';
export { SocialSharing } from '@ionic-native/social-sharing';
@@ -43,7 +43,6 @@ import {
PersistenceProvider,
PlatformProvider,
PopupProvider,
Printer,
ProfileProvider,
PushNotificationsProvider,
QRScanner,
@@ -104,7 +103,6 @@ import {
OnGoingProcessProvider,
PayproProvider,
PlatformProvider,
Printer,
ProfileProvider,
PopupProvider,
QRScanner,

0 comments on commit b796f21

Please sign in to comment.
You can’t perform that action at this time.