From b796f21b717dbb2904b77964c0627399e9711c85 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 24 Dec 2018 17:46:48 -0300 Subject: [PATCH] Revert "#9392 Added possibility to print qr code" --- CONTRIBUTING.md | 2 -- package.json | 5 +-- .../wallet-export/wallet-export.html | 20 +++--------- .../wallet-export/wallet-export.scss | 14 -------- .../wallet-export/wallet-export.ts | 32 ------------------- src/providers/index.ts | 1 - src/providers/providers.module.ts | 2 -- 7 files changed, 5 insertions(+), 71 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17a73f20d0..f3da5c8d11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/package.json b/package.json index 729e579535..7ef5e13404 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.html b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.html index 3f05a022e0..acd661678d 100644 --- a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.html +++ b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.html @@ -1,4 +1,4 @@ - + {{'Export wallet' | translate}} @@ -84,21 +84,9 @@
-
-
-

QR code to recover wallet {{walletName}}

-
- - - From the destination device, go to Add wallet > Import wallet and scan this QR code - -
- -
- -
+ + + From the destination device, go to Add wallet > Import wallet and scan this QR code
diff --git a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.scss b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.scss index f615ec23ee..5946c9b2de 100644 --- a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.scss +++ b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.scss @@ -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; - } - } } diff --git a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.ts b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.ts index e9a9c0dfbf..0ada3a8ba4 100644 --- a/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.ts +++ b/src/pages/settings/wallet-settings/wallet-settings-advanced/wallet-export/wallet-export.ts @@ -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'); diff --git a/src/providers/index.ts b/src/providers/index.ts index 63c4aa9d83..188e9f73eb 100644 --- a/src/providers/index.ts +++ b/src/providers/index.ts @@ -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'; diff --git a/src/providers/providers.module.ts b/src/providers/providers.module.ts index cd6faedc04..fc6d84dd6c 100644 --- a/src/providers/providers.module.ts +++ b/src/providers/providers.module.ts @@ -43,7 +43,6 @@ import { PersistenceProvider, PlatformProvider, PopupProvider, - Printer, ProfileProvider, PushNotificationsProvider, QRScanner, @@ -104,7 +103,6 @@ import { OnGoingProcessProvider, PayproProvider, PlatformProvider, - Printer, ProfileProvider, PopupProvider, QRScanner,