From 8f07ac1751d0f127a619dacafbe294940abad111 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 25 Jan 2019 15:08:11 +0100 Subject: [PATCH 1/2] print fixes & claim pickup order --- modules/agency/front/descriptor/index.js | 1 + modules/claim/front/descriptor/index.html | 16 +- modules/claim/front/descriptor/index.js | 30 ++- modules/claim/front/locale/es.yml | 2 + package-lock.json | 181 ++++++++++-------- print/common/css/layout.css | 96 ++++------ print/config/routes.json | 3 +- print/lib/emailEngine.js | 69 ++++--- print/lib/reportEngine.js | 45 +++-- print/lib/router.js | 7 +- .../claim-pickup-order}/assets/css/index.js | 0 .../claim-pickup-order}/assets/css/style.css | 2 - print/report/claim-pickup-order/index.html | 32 ++++ print/report/claim-pickup-order/index.js | 52 +++++ print/report/claim-pickup-order/locale.js | 25 +++ .../client-welcome/assets/css/index.js | 0 .../client-welcome}/assets/css/style.css | 2 - .../client-welcome/index.html | 0 .../client-welcome/index.js | 2 + .../client-welcome/locale.js | 0 .../delivery-note/assets/css/style.css | 0 .../delivery-note/index.html | 0 .../delivery-note/index.js | 0 .../delivery-note/locale.js | 0 .../email-footer/assets/css/index.js | 0 .../email-footer/assets/css/style.css | 8 - .../email-footer/assets/images/action.png | Bin .../email-footer/assets/images/facebook.png | Bin .../email-footer/assets/images/info.png | Bin .../email-footer/assets/images/instagram.png | Bin .../email-footer/assets/images/linkedin.png | Bin .../email-footer/assets/images/pinterest.png | Bin .../email-footer/assets/images/twitter.png | Bin .../email-footer/assets/images/youtube.png | Bin .../email-footer/index.html | 0 .../{reports => report}/email-footer/index.js | 0 .../email-footer/locale.js | 0 .../email-header/assets/css/index.js | 0 .../report/email-header/assets/css/style.css | 7 + .../email-header/assets/images/email-logo.png | Bin .../email-header/index.html | 0 .../{reports => report}/email-header/index.js | 0 .../email-header/locale.js | 0 .../letter-debtor-nd}/assets/css/style.css | 0 .../letter-debtor-nd/index.html | 0 .../letter-debtor-nd/index.js | 0 .../letter-debtor-nd/locale.js | 0 .../letter-debtor-st}/assets/css/style.css | 0 .../letter-debtor-st/index.html | 0 .../letter-debtor-st/index.js | 0 .../letter-debtor-st/locale.js | 0 .../report/payment-update/assets/css/index.js | 6 + .../payment-update/assets/css/style.css | 39 ++++ .../payment-update/index.html | 0 .../payment-update/index.js | 2 + .../payment-update/locale.js | 0 .../report/printer-setup/assets/css/index.js | 6 + .../printer-setup}/assets/css/style.css | 2 - .../printer-setup/assets/files/model.ezp | Bin .../printer-setup/index.html | 0 .../printer-setup/index.js | 2 + .../printer-setup/locale.js | 0 .../report-footer/assets/css/index.js | 0 .../report-footer/assets/css/style.css | 5 +- .../report-footer/index.html | 0 .../report-footer/index.js | 0 .../report-footer/locale.js | 0 .../report-header/assets/css/index.js | 0 .../report-header/assets/css/style.css | 0 .../assets/images/report-logo.png | Bin .../assets/images/report-logo.svg | 0 .../report-header/index.html | 0 .../report-header/index.js | 0 .../report-header/locale.js | 0 .../assets/css/index.js | 6 + .../assets/css/style.css | 3 + .../rpt-claim-pickup-order}/index.html | 2 +- .../rpt-claim-pickup-order}/index.js | 5 +- .../rpt-claim-pickup-order}/locale.js | 0 .../reports/claim-pickup/assets/css/style.css | 6 - .../client-welcome/assets/css/test.css | 0 .../reports/email-header/assets/css/style.css | 12 -- 82 files changed, 441 insertions(+), 235 deletions(-) rename print/{reports/claim-pickup => report/claim-pickup-order}/assets/css/index.js (100%) rename print/{reports/payment-update => report/claim-pickup-order}/assets/css/style.css (88%) create mode 100644 print/report/claim-pickup-order/index.html create mode 100755 print/report/claim-pickup-order/index.js create mode 100644 print/report/claim-pickup-order/locale.js rename print/{reports => report}/client-welcome/assets/css/index.js (100%) rename print/{reports/printer-setup => report/client-welcome}/assets/css/style.css (88%) rename print/{reports => report}/client-welcome/index.html (100%) rename print/{reports => report}/client-welcome/index.js (94%) rename print/{reports => report}/client-welcome/locale.js (100%) rename print/{reports => report}/delivery-note/assets/css/style.css (100%) rename print/{reports => report}/delivery-note/index.html (100%) rename print/{reports => report}/delivery-note/index.js (100%) rename print/{reports => report}/delivery-note/locale.js (100%) rename print/{reports => report}/email-footer/assets/css/index.js (100%) rename print/{reports => report}/email-footer/assets/css/style.css (85%) rename print/{reports => report}/email-footer/assets/images/action.png (100%) rename print/{reports => report}/email-footer/assets/images/facebook.png (100%) rename print/{reports => report}/email-footer/assets/images/info.png (100%) rename print/{reports => report}/email-footer/assets/images/instagram.png (100%) rename print/{reports => report}/email-footer/assets/images/linkedin.png (100%) rename print/{reports => report}/email-footer/assets/images/pinterest.png (100%) rename print/{reports => report}/email-footer/assets/images/twitter.png (100%) rename print/{reports => report}/email-footer/assets/images/youtube.png (100%) rename print/{reports => report}/email-footer/index.html (100%) rename print/{reports => report}/email-footer/index.js (100%) rename print/{reports => report}/email-footer/locale.js (100%) rename print/{reports => report}/email-header/assets/css/index.js (100%) create mode 100644 print/report/email-header/assets/css/style.css rename print/{reports => report}/email-header/assets/images/email-logo.png (100%) rename print/{reports => report}/email-header/index.html (100%) rename print/{reports => report}/email-header/index.js (100%) rename print/{reports => report}/email-header/locale.js (100%) rename print/{reports/client-welcome => report/letter-debtor-nd}/assets/css/style.css (100%) rename print/{reports => report}/letter-debtor-nd/index.html (100%) rename print/{reports => report}/letter-debtor-nd/index.js (100%) rename print/{reports => report}/letter-debtor-nd/locale.js (100%) rename print/{reports/letter-debtor-nd => report/letter-debtor-st}/assets/css/style.css (100%) rename print/{reports => report}/letter-debtor-st/index.html (100%) rename print/{reports => report}/letter-debtor-st/index.js (100%) rename print/{reports => report}/letter-debtor-st/locale.js (100%) create mode 100644 print/report/payment-update/assets/css/index.js create mode 100644 print/report/payment-update/assets/css/style.css rename print/{reports => report}/payment-update/index.html (100%) rename print/{reports => report}/payment-update/index.js (93%) rename print/{reports => report}/payment-update/locale.js (100%) create mode 100644 print/report/printer-setup/assets/css/index.js rename print/{reports/letter-debtor-st => report/printer-setup}/assets/css/style.css (88%) rename print/{reports => report}/printer-setup/assets/files/model.ezp (100%) rename print/{reports => report}/printer-setup/index.html (100%) rename print/{reports => report}/printer-setup/index.js (94%) rename print/{reports => report}/printer-setup/locale.js (100%) rename print/{reports => report}/report-footer/assets/css/index.js (100%) rename print/{reports => report}/report-footer/assets/css/style.css (73%) rename print/{reports => report}/report-footer/index.html (100%) rename print/{reports => report}/report-footer/index.js (100%) rename print/{reports => report}/report-footer/locale.js (100%) rename print/{reports => report}/report-header/assets/css/index.js (100%) rename print/{reports => report}/report-header/assets/css/style.css (100%) rename print/{reports => report}/report-header/assets/images/report-logo.png (100%) rename print/{reports => report}/report-header/assets/images/report-logo.svg (100%) rename print/{reports => report}/report-header/index.html (100%) rename print/{reports => report}/report-header/index.js (100%) rename print/{reports => report}/report-header/locale.js (100%) create mode 100644 print/report/rpt-claim-pickup-order/assets/css/index.js create mode 100644 print/report/rpt-claim-pickup-order/assets/css/style.css rename print/{reports/claim-pickup => report/rpt-claim-pickup-order}/index.html (98%) rename print/{reports/claim-pickup => report/rpt-claim-pickup-order}/index.js (94%) rename print/{reports/claim-pickup => report/rpt-claim-pickup-order}/locale.js (100%) delete mode 100644 print/reports/claim-pickup/assets/css/style.css delete mode 100644 print/reports/client-welcome/assets/css/test.css delete mode 100644 print/reports/email-header/assets/css/style.css diff --git a/modules/agency/front/descriptor/index.js b/modules/agency/front/descriptor/index.js index c8d6bbc26..3986f6edc 100644 --- a/modules/agency/front/descriptor/index.js +++ b/modules/agency/front/descriptor/index.js @@ -24,6 +24,7 @@ class Controller { this.$state.go('zone.index'); }); } + console.log('res', response); } } diff --git a/modules/claim/front/descriptor/index.html b/modules/claim/front/descriptor/index.html index 9278713cf..59b51247c 100644 --- a/modules/claim/front/descriptor/index.html +++ b/modules/claim/front/descriptor/index.html @@ -6,7 +6,15 @@ -
+ +
@@ -58,3 +66,9 @@
+ + \ No newline at end of file diff --git a/modules/claim/front/descriptor/index.js b/modules/claim/front/descriptor/index.js index 993b4331c..ac53e1203 100644 --- a/modules/claim/front/descriptor/index.js +++ b/modules/claim/front/descriptor/index.js @@ -1,8 +1,15 @@ import ngModule from '../module'; class Controller { - constructor($state) { + constructor($scope, $state, $http, $translate, vnApp) { + this.$scope = $scope; this.$state = $state; + this.$http = $http; + this.$translate = $translate; + this.vnApp = vnApp; + this.moreOptions = [ + {callback: this.showConfirmDialog, name: 'Pickup order'} + ]; } get claim() { @@ -30,9 +37,28 @@ class Controller { get quicklinks() { return this._quicklinks; } + + onMoreChange(callback) { + callback.call(this); + } + + showConfirmDialog() { + this.$scope.confirmDialog.show(); + } + + returnDialog(response) { + if (response === 'CANCEL') { + let url = `/report/rpt-claim-pickup-order?claimFk=${this.claim.id}`; + window.open(url); + } else if (response === 'ACCEPT') { + this.$http.post(`/email/claim-pickup-order`, {claimFk: this.claim.id}).then( + () => this.vnApp.showMessage(this.$translate.instant('Notification sent!')) + ); + } + } } -Controller.$inject = ['$state']; +Controller.$inject = ['$scope', '$state', '$http', '$translate', 'vnApp']; ngModule.component('vnClaimDescriptor', { template: require('./index.html'), diff --git a/modules/claim/front/locale/es.yml b/modules/claim/front/locale/es.yml index e5266af5d..654f20fa1 100644 --- a/modules/claim/front/locale/es.yml +++ b/modules/claim/front/locale/es.yml @@ -7,6 +7,8 @@ Remove sale: Borrar linea Claim Id: Id reclamación Created: Creado Enter a new search: Introduce una nueva búsqueda +Pickup order: Orden de recogida +Do you want to send it directly?: ¿Quieres enviarlo directamente? #sections Claims: Reclamaciones diff --git a/package-lock.json b/package-lock.json index da05e2a95..a7904cff8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1271,7 +1271,7 @@ }, "ansi-escapes": { "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, @@ -1564,7 +1564,7 @@ }, "util": { "version": "0.10.3", - "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -1883,7 +1883,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -2685,7 +2685,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2735,7 +2735,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -2910,7 +2910,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -2954,7 +2954,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -3157,7 +3157,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -3317,7 +3317,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -3431,7 +3431,7 @@ }, "colors": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, @@ -3624,7 +3624,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-security-policy-builder": { @@ -3825,7 +3825,7 @@ }, "css-loader": { "version": "0.25.0", - "resolved": "http://registry.npmjs.org/css-loader/-/css-loader-0.25.0.tgz", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.25.0.tgz", "integrity": "sha1-w/68jOKPTINXa2sTcH9H+Qw5AiM=", "dev": true, "requires": { @@ -4449,7 +4449,7 @@ "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", "dev": true, "requires": { "is-obj": "^1.0.0" @@ -4482,7 +4482,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -4609,7 +4609,7 @@ "dependencies": { "fs-extra": { "version": "0.30.0", - "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { @@ -4622,7 +4622,7 @@ }, "jsonfile": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { @@ -5151,7 +5151,7 @@ }, "events": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, @@ -5654,7 +5654,7 @@ }, "file-loader": { "version": "1.1.11", - "resolved": "http://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", "dev": true, "requires": { @@ -5874,7 +5874,7 @@ }, "fs-access": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", "dev": true, "requires": { @@ -5947,7 +5947,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5968,12 +5969,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5988,17 +5991,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6115,7 +6121,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6127,6 +6134,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6141,6 +6149,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6148,12 +6157,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -6172,6 +6183,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6252,7 +6264,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6264,6 +6277,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6349,7 +6363,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -6385,6 +6400,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6404,6 +6420,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6447,12 +6464,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -6654,7 +6673,7 @@ "global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", "dev": true, "requires": { "global-prefix": "^1.0.1", @@ -6697,7 +6716,7 @@ }, "globby": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { @@ -6742,7 +6761,7 @@ }, "got": { "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -6919,7 +6938,7 @@ }, "kind-of": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", "dev": true }, @@ -7103,7 +7122,7 @@ "dependencies": { "es6-promise": { "version": "3.3.1", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", "dev": true }, @@ -7885,7 +7904,7 @@ "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=", "dev": true, "requires": { "is-relative": "^1.0.0", @@ -7940,7 +7959,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -8087,7 +8106,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -8124,7 +8143,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -8160,7 +8179,7 @@ "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=", "dev": true, "requires": { "is-unc-path": "^1.0.0" @@ -8203,7 +8222,7 @@ "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=", "dev": true, "requires": { "unc-path-regex": "^0.1.2" @@ -8304,7 +8323,7 @@ }, "jasmine-core": { "version": "2.99.1", - "resolved": "http://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=", "dev": true }, @@ -8321,7 +8340,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", + "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", "dev": true, "requires": { "colors": "1.1.2" @@ -8609,7 +8628,7 @@ "karma-chrome-launcher": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", + "integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=", "dev": true, "requires": { "fs-access": "^1.0.0", @@ -8787,7 +8806,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -10295,7 +10314,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { @@ -10318,7 +10337,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -10441,7 +10460,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minstache": { @@ -10534,7 +10553,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -10542,7 +10561,7 @@ "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } @@ -10694,7 +10713,7 @@ }, "multipipe": { "version": "0.1.2", - "resolved": "http://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", "dev": true, "requires": { @@ -10823,7 +10842,7 @@ }, "named-placeholders": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz", "integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=", "dev": true, "requires": { @@ -10832,7 +10851,7 @@ "dependencies": { "lru-cache": { "version": "2.5.0", - "resolved": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=", "dev": true } @@ -10919,7 +10938,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -11812,7 +11831,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -11874,7 +11893,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -11890,7 +11909,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -12078,7 +12097,7 @@ }, "path-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, @@ -12829,7 +12848,7 @@ }, "pretty-bytes": { "version": "1.0.4", - "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { @@ -12918,7 +12937,7 @@ }, "through2": { "version": "0.2.3", - "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { @@ -13457,7 +13476,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -13863,7 +13882,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -13987,7 +14006,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -14127,7 +14146,7 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -14314,7 +14333,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -14365,7 +14384,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -14710,7 +14729,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -14719,7 +14738,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", "dev": true, "requires": { "through2": "^2.0.2" @@ -14821,7 +14840,7 @@ }, "stream-browserify": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { @@ -14900,7 +14919,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -14992,7 +15011,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -15252,7 +15271,7 @@ }, "style-loader": { "version": "0.20.3", - "resolved": "http://registry.npmjs.org/style-loader/-/style-loader-0.20.3.tgz", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.20.3.tgz", "integrity": "sha512-2I7AVP73MvK33U7B9TKlYZAqdROyMXDYSMvHLX43qy3GCOaJNiV6i0v/sv9idWIaQ42Yn2dNv79Q5mKXbKhAZg==", "dev": true, "requires": { @@ -15398,7 +15417,7 @@ }, "tar": { "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { @@ -15568,7 +15587,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { @@ -15751,7 +15770,7 @@ "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=", "dev": true, "requires": { "nopt": "~1.0.10" @@ -15840,7 +15859,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -16250,7 +16269,7 @@ "useragent": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", - "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", + "integrity": "sha1-IX+UOtVAyyEoZYqyP8lg9qiMmXI=", "dev": true, "requires": { "lru-cache": "4.1.x", @@ -16484,7 +16503,7 @@ }, "vm-browserify": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { @@ -16972,7 +16991,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -16985,7 +17004,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -17373,7 +17392,7 @@ "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "integrity": "sha1-H/YVdcLipOjlENb6TiQ8zhg5mas=", "dev": true, "requires": { "graceful-fs": "^4.1.11", diff --git a/print/common/css/layout.css b/print/common/css/layout.css index 4a0d4ff22..3f540622e 100644 --- a/print/common/css/layout.css +++ b/print/common/css/layout.css @@ -1,3 +1,9 @@ +.container { + font-family: verdana, sans-serif; + font-size: 16px; + zoom: 0.55 +} + .columns { overflow: hidden } @@ -27,46 +33,6 @@ float: left } -.pull-left { - float: left -} - -.pull-right { - float: right -} - -.grid { - border-bottom: 3px solid #888888 -} - -.grid .row { - padding: 5px; - margin-bottom: 0 -} - -.grid .header { - border-bottom: 1px solid #808080; - border-top: 1px solid #808080; - background-color: #c0c0c0; -} - - -.grid .row.inline > div { - float: left; -} - - -.panel { - border: 1px solid #DDD; - margin-bottom: 10px; - position: relative; - padding:10px -} - -.panel .header { - font-weight: bold -} - .row { margin-bottom: 15px; overflow: hidden @@ -139,6 +105,37 @@ overflow: visible } +.grid { + border-bottom: 3px solid #888888 +} + +.grid .row { + padding: 5px; + margin-bottom: 0 +} + +.grid .header { + border-bottom: 1px solid #808080; + border-top: 1px solid #808080; + font-weight: bold +} + + +.grid .row.inline > div { + float: left; +} + +.panel { + border: 1px solid #DDD; + margin-bottom: 10px; + position: relative; + padding:10px +} + +.panel .header { + font-weight: bold +} + .box { border-top: 1px solid #CCC; border-right: 1px solid #CCC; @@ -163,23 +160,4 @@ .pull-right { float: right -} - -.grid { - border-bottom: 3px solid #888888 -} - -.grid .row { - padding: 5px; - margin-bottom: 0 -} - -.grid .header { - border-bottom: 1px solid #808080; - border-top: 1px solid #808080; - background-color: #c0c0c0; -} - -.grid .row.inline > div { - float: left; } \ No newline at end of file diff --git a/print/config/routes.json b/print/config/routes.json index 05d2e85a0..added704e 100644 --- a/print/config/routes.json +++ b/print/config/routes.json @@ -4,9 +4,10 @@ {"type": "email", "name": "payment-update"}, {"type": "email", "name": "letter-debtor-st"}, {"type": "email", "name": "letter-debtor-nd"}, + {"type": "email", "name": "claim-pickup-order"}, {"type": "report", "name": "delivery-note"}, {"type": "report", "name": "invoice"}, - {"type": "report", "name": "claim-pickup"}, + {"type": "report", "name": "rpt-claim-pickup-order"}, {"type": "static", "name": "email-header"}, {"type": "static", "name": "email-footer"}, {"type": "static", "name": "report-header"}, diff --git a/print/lib/emailEngine.js b/print/lib/emailEngine.js index 9b4a0ffdf..86342bb36 100644 --- a/print/lib/emailEngine.js +++ b/print/lib/emailEngine.js @@ -4,18 +4,16 @@ const renderer = require('vue-server-renderer').createRenderer(); const fs = require('fs-extra'); const juice = require('juice'); const smtp = require('./smtp'); -const i18n = new VueI18n({ - locale: 'es', -}); - -Vue.use(VueI18n); +const fallbackLocale = 'es'; if (!process.env.OPENSSL_CONF) process.env.OPENSSL_CONF = '/etc/ssl/'; +Vue.use(VueI18n); + module.exports = { - path: `${appPath}/reports`, + path: `${appPath}/report`, /** * Renders a report component @@ -25,17 +23,18 @@ module.exports = { */ async render(name, ctx) { const component = require(`${this.path}/${name}`); - const prefetchedData = await this.preFetch(component, ctx); - - const app = new Vue({ - i18n, - render: h => h(component), + const result = await this.preFetch(component, ctx); + const i18n = new VueI18n({ + locale: 'es', + fallbackLocale }); + const app = new Vue({i18n, + render: h => h(result.component)}); return renderer.renderToString(app).then(renderedHtml => { return { html: renderedHtml, - data: prefetchedData, + data: result.mergedData, }; }); }, @@ -43,10 +42,11 @@ module.exports = { /** * Prefetch all component data from asyncData method * - * @param {Object} component - Component object + * @param {Object} orgComponent - Component object * @param {Object} ctx - Request context */ - async preFetch(component, ctx) { + async preFetch(orgComponent, ctx) { + let component = Object.create(orgComponent); let mergedData = {attachments: []}; let asyncData = {}; let data = {}; @@ -60,14 +60,18 @@ module.exports = { await this.attachAssets(component); - if (component.hasOwnProperty('data')) - data = component.data(); + if (orgComponent.hasOwnProperty('data')) + data = orgComponent.data(); - if (component.hasOwnProperty('asyncData')) { - asyncData = await component.asyncData(ctx, params); + if (orgComponent.hasOwnProperty('asyncData')) { + asyncData = await orgComponent.asyncData(ctx, params); if (asyncData.locale) { - const locale = component.i18n.messages[asyncData.locale]; + let locale = component.i18n.messages[asyncData.locale]; + + if (!locale) + locale = component.i18n.messages[fallbackLocale]; + mergedData.subject = locale.subject; } } @@ -81,7 +85,7 @@ module.exports = { if (data.hasOwnProperty('files')) { const files = data.files; files.forEach(file => { - const componentPath = `${this.path}/${component.name}`; + const componentPath = `${this.path}/${orgComponent.name}`; let fileSrc = componentPath + file; if (file.slice(0, 4) === 'http' || file.slice(0, 4) === 'https') @@ -96,25 +100,30 @@ module.exports = { }); } - if (component.components) { - const components = component.components; - const promises = []; + const components = orgComponent.components; - Object.keys(components).forEach(component => { - promises.push(this.preFetch(components[component], ctx)); + if (components) { + const promises = []; + const childNames = []; + component.components = {}; + + Object.keys(components).forEach(childName => { + childNames.push(childName); + promises.push(this.preFetch(components[childName], ctx)); }); - return Promise.all(promises).then(results => { - results.forEach(result => { - result.attachments.forEach(atth => { + await Promise.all(promises).then(results => { + results.forEach((result, i) => { + result.mergedData.attachments.forEach(atth => { mergedData.attachments.push(atth); }); + + component.components[childNames[i]] = result.component; }); - return mergedData; }); } - return mergedData; + return {component, mergedData}; }, async attachAssets(component) { diff --git a/print/lib/reportEngine.js b/print/lib/reportEngine.js index af8d93441..b77d88267 100644 --- a/print/lib/reportEngine.js +++ b/print/lib/reportEngine.js @@ -13,7 +13,7 @@ if (!process.env.OPENSSL_CONF) module.exports = { - path: `${appPath}/reports`, + path: `${appPath}/report`, /** * Renders a report component @@ -23,16 +23,13 @@ module.exports = { */ async render(name, ctx) { const component = require(`${this.path}/${name}`); - - await this.preFetch(component, ctx); - + const result = await this.preFetch(component, ctx); const i18n = new VueI18n({ locale: 'es', + fallbackLocale: 'en' }); - const app = new Vue({ - i18n, - render: h => h(component), - }); + const app = new Vue({i18n, + render: h => h(result.component)}); return renderer.renderToString(app); }, @@ -40,10 +37,11 @@ module.exports = { /** * Prefetch all component data from asyncData method * - * @param {Object} component - Component object + * @param {Object} orgComponent - Component object * @param {Object} ctx - Request context */ - async preFetch(component, ctx) { + async preFetch(orgComponent, ctx) { + let component = Object.create(orgComponent); let mergedData = {}; let asyncData = {}; let data = {}; @@ -57,11 +55,11 @@ module.exports = { await this.attachAssets(component); - if (component.hasOwnProperty('data')) - data = component.data(); + if (orgComponent.hasOwnProperty('data')) + data = orgComponent.data(); - if (component.hasOwnProperty('asyncData')) - asyncData = await component.asyncData(ctx, params); + if (orgComponent.hasOwnProperty('asyncData')) + asyncData = await orgComponent.asyncData(ctx, params); mergedData = Object.assign(mergedData, data, asyncData); @@ -69,16 +67,25 @@ module.exports = { return mergedData; }; - if (component.components) { - const components = component.components; + const components = orgComponent.components; + if (components) { const promises = []; + const childNames = []; + component.components = {}; - Object.keys(components).forEach(component => { - promises.push(this.preFetch(components[component], ctx)); + Object.keys(components).forEach(childName => { + childNames.push(childName); + promises.push(this.preFetch(components[childName], ctx)); }); - return Promise.all(promises); + await Promise.all(promises).then(results => { + results.forEach((result, i) => { + component.components[childNames[i]] = result.component; + }); + }); } + + return {component}; }, async attachAssets(component) { diff --git a/print/lib/router.js b/print/lib/router.js index 0418a07d9..30fd0d347 100644 --- a/print/lib/router.js +++ b/print/lib/router.js @@ -4,7 +4,7 @@ const express = require('express'); const routes = require(`../config/routes.json`); module.exports = app => { - this.path = `${appPath}/reports`; + this.path = `${appPath}/report`; /** * Enables a report @@ -15,10 +15,9 @@ module.exports = app => { if (!name) throw new Error('Report name required'); app.get(`/report/${name}`, (request, response, next) => { - response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); - response.setHeader('Content-type', 'application/pdf'); - reportEngine.toPdf(name, request).then(stream => { + response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); + response.setHeader('Content-type', 'application/pdf'); stream.pipe(response); }).catch(e => { next(e); diff --git a/print/reports/claim-pickup/assets/css/index.js b/print/report/claim-pickup-order/assets/css/index.js similarity index 100% rename from print/reports/claim-pickup/assets/css/index.js rename to print/report/claim-pickup-order/assets/css/index.js diff --git a/print/reports/payment-update/assets/css/style.css b/print/report/claim-pickup-order/assets/css/style.css similarity index 88% rename from print/reports/payment-update/assets/css/style.css rename to print/report/claim-pickup-order/assets/css/style.css index 8f5acd032..a197ee5cd 100644 --- a/print/reports/payment-update/assets/css/style.css +++ b/print/report/claim-pickup-order/assets/css/style.css @@ -3,10 +3,8 @@ body { } .container { - font-family: arial, sans-serif; max-width: 600px; min-width: 320px; - font-size: 16px; margin: 0 auto; color: #555 } diff --git a/print/report/claim-pickup-order/index.html b/print/report/claim-pickup-order/index.html new file mode 100644 index 000000000..d598d3261 --- /dev/null +++ b/print/report/claim-pickup-order/index.html @@ -0,0 +1,32 @@ + + + + {{ $t('subject') }} + + +
+ +
+ +
+

{{ $t('title') }}

+
+ + +

{{$t('description.dear')}},

+

{{$t('description.instructions')}}

+ + +
+ +
+ + \ No newline at end of file diff --git a/print/report/claim-pickup-order/index.js b/print/report/claim-pickup-order/index.js new file mode 100755 index 000000000..95d381d5c --- /dev/null +++ b/print/report/claim-pickup-order/index.js @@ -0,0 +1,52 @@ +const UserException = require(`${appPath}/lib/exceptions/userException`); +const reportEngine = require(`${appPath}/lib/reportEngine`); +const database = require(`${appPath}/lib/database`); +const emailHeader = require('../email-header'); +const emailFooter = require('../email-footer'); + + +module.exports = { + name: 'claim-pickup-order', + async asyncData(ctx, params) { + const promises = []; + const data = { + isPreview: ctx.method === 'GET', + }; + + if (!params.claimFk) + throw new UserException('No claim id specified'); + + promises.push(reportEngine.toPdf('rpt-claim-pickup-order', ctx)); + promises.push(this.methods.fetchClient(params.claimFk)); + + return Promise.all(promises).then(result => { + const stream = result[0]; + const [[client]] = result[1]; + + Object.assign(data, client); + Object.assign(data, {attachments: [{filename: 'claim-pickup-order.pdf', content: stream}]}); + + return data; + }); + }, + created() { + this.$i18n.locale = this.locale; + }, + methods: { + fetchClient(claimFk) { + return database.pool.query(` + SELECT + c.id, + u.lang locale, + c.email recipient + FROM claim cl + JOIN client c ON c.id = cl.clientFk + JOIN account.user u ON u.id = c.id + WHERE cl.id = ?`, [claimFk]); + }, + }, + components: { + emailHeader, + emailFooter, + }, +}; diff --git a/print/report/claim-pickup-order/locale.js b/print/report/claim-pickup-order/locale.js new file mode 100644 index 000000000..343a9f9ab --- /dev/null +++ b/print/report/claim-pickup-order/locale.js @@ -0,0 +1,25 @@ +module.exports = { + messages: { + es: { + subject: 'Orden de recogida', + title: 'Orden de recogida', + description: { + dear: 'Estimado cliente', + instructions: 'Aqui tienes tu orden de recogida.' + }, + sections: { + howToBuy: { + title: 'Cómo hacer un pedido', + description: `Para realizar un pedido en nuestra web, + debes configurarlo indicando:`, + requeriments: [ + 'Si quieres recibir el pedido (por agencia o por nuestro propio reparto) o si lo prefieres recoger en alguno de nuestros almacenes.', + 'La fecha en la que quieres recibir el pedido (se preparará el día anterior).', + 'La dirección de entrega o el almacén donde quieres recoger el pedido.'], + stock: 'En nuestra web y aplicaciones puedes visualizar el stock disponible de flor cortada, verdes, plantas, complementos y artificial. Ten en cuenta que dicho stock puede variar en función de la fecha seleccionada al configurar el pedido. Es importante CONFIRMAR los pedidos para que la mercancía quede reservada.', + delivery: 'El reparto se realiza de lunes a sábado según la zona en la que te encuentres. Por regla general, los pedidos que se entregan por agencia, deben estar confirmados y pagados antes de las 17h del día en que se preparan (el día anterior a recibirlos), aunque esto puede variar si el pedido se envía a través de nuestro reparto y según la zona.', + } + } + }, + }, +}; diff --git a/print/reports/client-welcome/assets/css/index.js b/print/report/client-welcome/assets/css/index.js similarity index 100% rename from print/reports/client-welcome/assets/css/index.js rename to print/report/client-welcome/assets/css/index.js diff --git a/print/reports/printer-setup/assets/css/style.css b/print/report/client-welcome/assets/css/style.css similarity index 88% rename from print/reports/printer-setup/assets/css/style.css rename to print/report/client-welcome/assets/css/style.css index 8f5acd032..a197ee5cd 100644 --- a/print/reports/printer-setup/assets/css/style.css +++ b/print/report/client-welcome/assets/css/style.css @@ -3,10 +3,8 @@ body { } .container { - font-family: arial, sans-serif; max-width: 600px; min-width: 320px; - font-size: 16px; margin: 0 auto; color: #555 } diff --git a/print/reports/client-welcome/index.html b/print/report/client-welcome/index.html similarity index 100% rename from print/reports/client-welcome/index.html rename to print/report/client-welcome/index.html diff --git a/print/reports/client-welcome/index.js b/print/report/client-welcome/index.js similarity index 94% rename from print/reports/client-welcome/index.js rename to print/report/client-welcome/index.js index 852455b6a..d3ac31205 100755 --- a/print/reports/client-welcome/index.js +++ b/print/report/client-welcome/index.js @@ -15,6 +15,8 @@ module.exports = { return this.methods.fetchClient(params.clientFk) .then(([result]) => { + if (!result) + throw new UserException('No client data found'); return Object.assign(data, result[0]); }); }, diff --git a/print/reports/client-welcome/locale.js b/print/report/client-welcome/locale.js similarity index 100% rename from print/reports/client-welcome/locale.js rename to print/report/client-welcome/locale.js diff --git a/print/reports/delivery-note/assets/css/style.css b/print/report/delivery-note/assets/css/style.css similarity index 100% rename from print/reports/delivery-note/assets/css/style.css rename to print/report/delivery-note/assets/css/style.css diff --git a/print/reports/delivery-note/index.html b/print/report/delivery-note/index.html similarity index 100% rename from print/reports/delivery-note/index.html rename to print/report/delivery-note/index.html diff --git a/print/reports/delivery-note/index.js b/print/report/delivery-note/index.js similarity index 100% rename from print/reports/delivery-note/index.js rename to print/report/delivery-note/index.js diff --git a/print/reports/delivery-note/locale.js b/print/report/delivery-note/locale.js similarity index 100% rename from print/reports/delivery-note/locale.js rename to print/report/delivery-note/locale.js diff --git a/print/reports/email-footer/assets/css/index.js b/print/report/email-footer/assets/css/index.js similarity index 100% rename from print/reports/email-footer/assets/css/index.js rename to print/report/email-footer/assets/css/index.js diff --git a/print/reports/email-footer/assets/css/style.css b/print/report/email-footer/assets/css/style.css similarity index 85% rename from print/reports/email-footer/assets/css/style.css rename to print/report/email-footer/assets/css/style.css index c3ad26042..cf0242f36 100644 --- a/print/reports/email-footer/assets/css/style.css +++ b/print/report/email-footer/assets/css/style.css @@ -1,11 +1,3 @@ -footer { - font-family: arial, sans-serif; - max-width: 600px; - min-width: 320px; - font-size: 16px; - margin: 0 auto -} - .buttons { background-color: #FFF; text-align: center; diff --git a/print/reports/email-footer/assets/images/action.png b/print/report/email-footer/assets/images/action.png similarity index 100% rename from print/reports/email-footer/assets/images/action.png rename to print/report/email-footer/assets/images/action.png diff --git a/print/reports/email-footer/assets/images/facebook.png b/print/report/email-footer/assets/images/facebook.png similarity index 100% rename from print/reports/email-footer/assets/images/facebook.png rename to print/report/email-footer/assets/images/facebook.png diff --git a/print/reports/email-footer/assets/images/info.png b/print/report/email-footer/assets/images/info.png similarity index 100% rename from print/reports/email-footer/assets/images/info.png rename to print/report/email-footer/assets/images/info.png diff --git a/print/reports/email-footer/assets/images/instagram.png b/print/report/email-footer/assets/images/instagram.png similarity index 100% rename from print/reports/email-footer/assets/images/instagram.png rename to print/report/email-footer/assets/images/instagram.png diff --git a/print/reports/email-footer/assets/images/linkedin.png b/print/report/email-footer/assets/images/linkedin.png similarity index 100% rename from print/reports/email-footer/assets/images/linkedin.png rename to print/report/email-footer/assets/images/linkedin.png diff --git a/print/reports/email-footer/assets/images/pinterest.png b/print/report/email-footer/assets/images/pinterest.png similarity index 100% rename from print/reports/email-footer/assets/images/pinterest.png rename to print/report/email-footer/assets/images/pinterest.png diff --git a/print/reports/email-footer/assets/images/twitter.png b/print/report/email-footer/assets/images/twitter.png similarity index 100% rename from print/reports/email-footer/assets/images/twitter.png rename to print/report/email-footer/assets/images/twitter.png diff --git a/print/reports/email-footer/assets/images/youtube.png b/print/report/email-footer/assets/images/youtube.png similarity index 100% rename from print/reports/email-footer/assets/images/youtube.png rename to print/report/email-footer/assets/images/youtube.png diff --git a/print/reports/email-footer/index.html b/print/report/email-footer/index.html similarity index 100% rename from print/reports/email-footer/index.html rename to print/report/email-footer/index.html diff --git a/print/reports/email-footer/index.js b/print/report/email-footer/index.js similarity index 100% rename from print/reports/email-footer/index.js rename to print/report/email-footer/index.js diff --git a/print/reports/email-footer/locale.js b/print/report/email-footer/locale.js similarity index 100% rename from print/reports/email-footer/locale.js rename to print/report/email-footer/locale.js diff --git a/print/reports/email-header/assets/css/index.js b/print/report/email-header/assets/css/index.js similarity index 100% rename from print/reports/email-header/assets/css/index.js rename to print/report/email-header/assets/css/index.js diff --git a/print/report/email-header/assets/css/style.css b/print/report/email-header/assets/css/style.css new file mode 100644 index 000000000..957e12f19 --- /dev/null +++ b/print/report/email-header/assets/css/style.css @@ -0,0 +1,7 @@ +header { + color: #555 +} + +header img { + width: 100% +} \ No newline at end of file diff --git a/print/reports/email-header/assets/images/email-logo.png b/print/report/email-header/assets/images/email-logo.png similarity index 100% rename from print/reports/email-header/assets/images/email-logo.png rename to print/report/email-header/assets/images/email-logo.png diff --git a/print/reports/email-header/index.html b/print/report/email-header/index.html similarity index 100% rename from print/reports/email-header/index.html rename to print/report/email-header/index.html diff --git a/print/reports/email-header/index.js b/print/report/email-header/index.js similarity index 100% rename from print/reports/email-header/index.js rename to print/report/email-header/index.js diff --git a/print/reports/email-header/locale.js b/print/report/email-header/locale.js similarity index 100% rename from print/reports/email-header/locale.js rename to print/report/email-header/locale.js diff --git a/print/reports/client-welcome/assets/css/style.css b/print/report/letter-debtor-nd/assets/css/style.css similarity index 100% rename from print/reports/client-welcome/assets/css/style.css rename to print/report/letter-debtor-nd/assets/css/style.css diff --git a/print/reports/letter-debtor-nd/index.html b/print/report/letter-debtor-nd/index.html similarity index 100% rename from print/reports/letter-debtor-nd/index.html rename to print/report/letter-debtor-nd/index.html diff --git a/print/reports/letter-debtor-nd/index.js b/print/report/letter-debtor-nd/index.js similarity index 100% rename from print/reports/letter-debtor-nd/index.js rename to print/report/letter-debtor-nd/index.js diff --git a/print/reports/letter-debtor-nd/locale.js b/print/report/letter-debtor-nd/locale.js similarity index 100% rename from print/reports/letter-debtor-nd/locale.js rename to print/report/letter-debtor-nd/locale.js diff --git a/print/reports/letter-debtor-nd/assets/css/style.css b/print/report/letter-debtor-st/assets/css/style.css similarity index 100% rename from print/reports/letter-debtor-nd/assets/css/style.css rename to print/report/letter-debtor-st/assets/css/style.css diff --git a/print/reports/letter-debtor-st/index.html b/print/report/letter-debtor-st/index.html similarity index 100% rename from print/reports/letter-debtor-st/index.html rename to print/report/letter-debtor-st/index.html diff --git a/print/reports/letter-debtor-st/index.js b/print/report/letter-debtor-st/index.js similarity index 100% rename from print/reports/letter-debtor-st/index.js rename to print/report/letter-debtor-st/index.js diff --git a/print/reports/letter-debtor-st/locale.js b/print/report/letter-debtor-st/locale.js similarity index 100% rename from print/reports/letter-debtor-st/locale.js rename to print/report/letter-debtor-st/locale.js diff --git a/print/report/payment-update/assets/css/index.js b/print/report/payment-update/assets/css/index.js new file mode 100644 index 000000000..c1943eee1 --- /dev/null +++ b/print/report/payment-update/assets/css/index.js @@ -0,0 +1,6 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/payment-update/assets/css/style.css b/print/report/payment-update/assets/css/style.css new file mode 100644 index 000000000..f6f42c447 --- /dev/null +++ b/print/report/payment-update/assets/css/style.css @@ -0,0 +1,39 @@ +body { + background-color: #EEE +} + +.container { + max-width: 600px; + min-width: 320px; + margin: 0 auto; + color: #555 +} +.main { + background-color: #FFF; + padding: 20px +} + +.main a { + color: #8dba25 +} + +.main h1 { + color: #999 +} + +.main h3 { + font-size: 16px +} + +.title { + background-color: #95d831; + text-transform: uppercase; + text-align: center; + padding: 35px 0 +} + +.title h1 { + font-size: 32px; + color: #333; + margin: 0 +} \ No newline at end of file diff --git a/print/reports/payment-update/index.html b/print/report/payment-update/index.html similarity index 100% rename from print/reports/payment-update/index.html rename to print/report/payment-update/index.html diff --git a/print/reports/payment-update/index.js b/print/report/payment-update/index.js similarity index 93% rename from print/reports/payment-update/index.js rename to print/report/payment-update/index.js index f6a296298..d5a51d255 100755 --- a/print/reports/payment-update/index.js +++ b/print/report/payment-update/index.js @@ -15,6 +15,8 @@ module.exports = { return this.methods.fetchClientData(params.clientFk) .then(([result]) => { + if (!result) + throw new UserException('No client data found'); return Object.assign(data, result[0]); }); }, diff --git a/print/reports/payment-update/locale.js b/print/report/payment-update/locale.js similarity index 100% rename from print/reports/payment-update/locale.js rename to print/report/payment-update/locale.js diff --git a/print/report/printer-setup/assets/css/index.js b/print/report/printer-setup/assets/css/index.js new file mode 100644 index 000000000..c1943eee1 --- /dev/null +++ b/print/report/printer-setup/assets/css/index.js @@ -0,0 +1,6 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/reports/letter-debtor-st/assets/css/style.css b/print/report/printer-setup/assets/css/style.css similarity index 88% rename from print/reports/letter-debtor-st/assets/css/style.css rename to print/report/printer-setup/assets/css/style.css index 8f5acd032..a197ee5cd 100644 --- a/print/reports/letter-debtor-st/assets/css/style.css +++ b/print/report/printer-setup/assets/css/style.css @@ -3,10 +3,8 @@ body { } .container { - font-family: arial, sans-serif; max-width: 600px; min-width: 320px; - font-size: 16px; margin: 0 auto; color: #555 } diff --git a/print/reports/printer-setup/assets/files/model.ezp b/print/report/printer-setup/assets/files/model.ezp similarity index 100% rename from print/reports/printer-setup/assets/files/model.ezp rename to print/report/printer-setup/assets/files/model.ezp diff --git a/print/reports/printer-setup/index.html b/print/report/printer-setup/index.html similarity index 100% rename from print/reports/printer-setup/index.html rename to print/report/printer-setup/index.html diff --git a/print/reports/printer-setup/index.js b/print/report/printer-setup/index.js similarity index 94% rename from print/reports/printer-setup/index.js rename to print/report/printer-setup/index.js index b15542fe4..5214bbb43 100755 --- a/print/reports/printer-setup/index.js +++ b/print/report/printer-setup/index.js @@ -15,6 +15,8 @@ module.exports = { return this.methods.fetchClientData(params.clientFk) .then(([result]) => { + if (!result) + throw new UserException('No client data found'); return Object.assign(data, result[0]); }); }, diff --git a/print/reports/printer-setup/locale.js b/print/report/printer-setup/locale.js similarity index 100% rename from print/reports/printer-setup/locale.js rename to print/report/printer-setup/locale.js diff --git a/print/reports/report-footer/assets/css/index.js b/print/report/report-footer/assets/css/index.js similarity index 100% rename from print/reports/report-footer/assets/css/index.js rename to print/report/report-footer/assets/css/index.js diff --git a/print/reports/report-footer/assets/css/style.css b/print/report/report-footer/assets/css/style.css similarity index 73% rename from print/reports/report-footer/assets/css/style.css rename to print/report/report-footer/assets/css/style.css index 9e828f879..cb1a69e4c 100644 --- a/print/reports/report-footer/assets/css/style.css +++ b/print/report/report-footer/assets/css/style.css @@ -1,9 +1,6 @@ footer { - font-family: arial, sans-serif; margin-top: 30px; - font-size: 16px; - color: #555; - zoom: 0.55 + color: #555 } footer, footer p { diff --git a/print/reports/report-footer/index.html b/print/report/report-footer/index.html similarity index 100% rename from print/reports/report-footer/index.html rename to print/report/report-footer/index.html diff --git a/print/reports/report-footer/index.js b/print/report/report-footer/index.js similarity index 100% rename from print/reports/report-footer/index.js rename to print/report/report-footer/index.js diff --git a/print/reports/report-footer/locale.js b/print/report/report-footer/locale.js similarity index 100% rename from print/reports/report-footer/locale.js rename to print/report/report-footer/locale.js diff --git a/print/reports/report-header/assets/css/index.js b/print/report/report-header/assets/css/index.js similarity index 100% rename from print/reports/report-header/assets/css/index.js rename to print/report/report-header/assets/css/index.js diff --git a/print/reports/report-header/assets/css/style.css b/print/report/report-header/assets/css/style.css similarity index 100% rename from print/reports/report-header/assets/css/style.css rename to print/report/report-header/assets/css/style.css diff --git a/print/reports/report-header/assets/images/report-logo.png b/print/report/report-header/assets/images/report-logo.png similarity index 100% rename from print/reports/report-header/assets/images/report-logo.png rename to print/report/report-header/assets/images/report-logo.png diff --git a/print/reports/report-header/assets/images/report-logo.svg b/print/report/report-header/assets/images/report-logo.svg similarity index 100% rename from print/reports/report-header/assets/images/report-logo.svg rename to print/report/report-header/assets/images/report-logo.svg diff --git a/print/reports/report-header/index.html b/print/report/report-header/index.html similarity index 100% rename from print/reports/report-header/index.html rename to print/report/report-header/index.html diff --git a/print/reports/report-header/index.js b/print/report/report-header/index.js similarity index 100% rename from print/reports/report-header/index.js rename to print/report/report-header/index.js diff --git a/print/reports/report-header/locale.js b/print/report/report-header/locale.js similarity index 100% rename from print/reports/report-header/locale.js rename to print/report/report-header/locale.js diff --git a/print/report/rpt-claim-pickup-order/assets/css/index.js b/print/report/rpt-claim-pickup-order/assets/css/index.js new file mode 100644 index 000000000..c1943eee1 --- /dev/null +++ b/print/report/rpt-claim-pickup-order/assets/css/index.js @@ -0,0 +1,6 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/rpt-claim-pickup-order/assets/css/style.css b/print/report/rpt-claim-pickup-order/assets/css/style.css new file mode 100644 index 000000000..35505aeea --- /dev/null +++ b/print/report/rpt-claim-pickup-order/assets/css/style.css @@ -0,0 +1,3 @@ +.container { + color: #000 +} \ No newline at end of file diff --git a/print/reports/claim-pickup/index.html b/print/report/rpt-claim-pickup-order/index.html similarity index 98% rename from print/reports/claim-pickup/index.html rename to print/report/rpt-claim-pickup-order/index.html index 08964ad6e..d73284a45 100644 --- a/print/reports/claim-pickup/index.html +++ b/print/report/rpt-claim-pickup-order/index.html @@ -7,7 +7,7 @@
-

{{$t('title')}}

+

{{$t('title')}}

{{$t('claimId')}}:
{{claimId}}
diff --git a/print/reports/claim-pickup/index.js b/print/report/rpt-claim-pickup-order/index.js similarity index 94% rename from print/reports/claim-pickup/index.js rename to print/report/rpt-claim-pickup-order/index.js index e8b9ce5a5..686a40cd3 100755 --- a/print/reports/claim-pickup/index.js +++ b/print/report/rpt-claim-pickup-order/index.js @@ -3,7 +3,7 @@ const database = require(`${appPath}/lib/database`); const UserException = require(`${appPath}/lib/exceptions/userException`); module.exports = { - name: 'claim-pickup', + name: 'rpt-claim-pickup-order', async asyncData(ctx, params) { const promises = []; const data = {}; @@ -18,6 +18,9 @@ module.exports = { const [[claim]] = result[0]; const [sales] = result[1]; + if (!claim) + throw new UserException('No claim data found'); + Object.assign(data, claim, {sales}); return data; diff --git a/print/reports/claim-pickup/locale.js b/print/report/rpt-claim-pickup-order/locale.js similarity index 100% rename from print/reports/claim-pickup/locale.js rename to print/report/rpt-claim-pickup-order/locale.js diff --git a/print/reports/claim-pickup/assets/css/style.css b/print/reports/claim-pickup/assets/css/style.css deleted file mode 100644 index ecc403ec0..000000000 --- a/print/reports/claim-pickup/assets/css/style.css +++ /dev/null @@ -1,6 +0,0 @@ -.container { - font-family: arial, sans-serif; - font-size: 16px; - color: #555; - zoom: 0.55 -} \ No newline at end of file diff --git a/print/reports/client-welcome/assets/css/test.css b/print/reports/client-welcome/assets/css/test.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/print/reports/email-header/assets/css/style.css b/print/reports/email-header/assets/css/style.css deleted file mode 100644 index 73dfb8abc..000000000 --- a/print/reports/email-header/assets/css/style.css +++ /dev/null @@ -1,12 +0,0 @@ -header { - font-family: arial, sans-serif; - max-width: 600px; - min-width: 320px; - font-size: 16px; - margin: 0 auto; - color: #555 -} - -header img { - width: 100% -} \ No newline at end of file From 95c15a0ee9d20150251e6e5331dd1008d30c9f0c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 25 Jan 2019 15:09:29 +0100 Subject: [PATCH 2/2] #981 Login fixes --- back/methods/account/login.js | 2 +- front/core/components/watcher/watcher.js | 4 +-- front/core/services/auth.js | 26 +++----------- front/core/services/locale/en.yml | 6 ++++ front/core/services/locale/es.yml | 6 ++++ front/core/vendor.js | 2 -- front/package-lock.json | 5 --- front/package.json | 1 - front/salix/components/login/login.js | 4 +-- front/salix/locale/en.yml | 1 - front/salix/locale/es.yml | 1 - front/salix/module.js | 45 +++++++++++++++++------- 12 files changed, 54 insertions(+), 49 deletions(-) create mode 100644 front/core/services/locale/en.yml create mode 100644 front/core/services/locale/es.yml diff --git a/back/methods/account/login.js b/back/methods/account/login.js index cad85f035..075d3669c 100644 --- a/back/methods/account/login.js +++ b/back/methods/account/login.js @@ -46,7 +46,7 @@ module.exports = Self => { let filter = {where: {name: user}}; let instance = await Self.findOne(filter); - if (!instance || instance.password !== md5(password)) + if (!instance || instance.password !== md5(password || '')) throw err; let where = {id: instance.id}; diff --git a/front/core/components/watcher/watcher.js b/front/core/components/watcher/watcher.js index ba2cf79b4..d00d6d782 100644 --- a/front/core/components/watcher/watcher.js +++ b/front/core/components/watcher/watcher.js @@ -169,9 +169,9 @@ export default class Watcher extends Component { */ check() { if (this.form && this.form.$invalid) - throw new UserError(this._.instant('Some fields are invalid')); + throw new UserError('Some fields are invalid'); if (!this.dirty) - throw new UserError(this._.instant('No changes to save')); + throw new UserError('No changes to save'); } /** diff --git a/front/core/services/auth.js b/front/core/services/auth.js index 30b199c2c..3cdf21055 100644 --- a/front/core/services/auth.js +++ b/front/core/services/auth.js @@ -7,9 +7,10 @@ import UserError from 'core/lib/user-error'; * @property {Boolean} loggedIn Whether the user is currently logged */ export default class Auth { - constructor($http, $state, $transitions, $window, vnToken, vnModules, aclService) { + constructor($http, $q, $state, $transitions, $window, vnToken, vnModules, aclService) { Object.assign(this, { $http, + $q, $state, $transitions, $window, @@ -43,7 +44,7 @@ export default class Auth { } login(user, password, remember) { if (!user) - throw new UserError('Please insert your user and password'); + return this.$q.reject(new UserError('Please enter your username')); let params = { user, @@ -51,8 +52,7 @@ export default class Auth { }; return this.$http.post('/api/Accounts/login', params).then( - json => this.onLoginOk(json, remember), - json => this.onLoginErr(json)); + json => this.onLoginOk(json, remember)); } onLoginOk(json, remember) { this.vnToken.set(json.data.token, remember); @@ -65,22 +65,6 @@ export default class Auth { this.$state.go('home'); }); } - onLoginErr(json) { - let message; - - switch (json.status) { - case 401: - message = 'Invalid credentials'; - break; - case -1: - message = 'Can\'t contact with server'; - break; - default: - message = 'Something went wrong'; - } - - throw new UserError(message); - } logout() { let promise = this.$http.post('/api/Accounts/logout', null, { headers: {Authorization: this.vnToken.token} @@ -106,6 +90,6 @@ export default class Auth { }); } } -Auth.$inject = ['$http', '$state', '$transitions', '$window', 'vnToken', 'vnModules', 'aclService']; +Auth.$inject = ['$http', '$q', '$state', '$transitions', '$window', 'vnToken', 'vnModules', 'aclService']; ngModule.service('vnAuth', Auth); diff --git a/front/core/services/locale/en.yml b/front/core/services/locale/en.yml new file mode 100644 index 000000000..eab8860be --- /dev/null +++ b/front/core/services/locale/en.yml @@ -0,0 +1,6 @@ +Invalid login: Invalid login, remember that distinction is made between uppercase and lowercase +Could not contact the server: Could not contact the server, make sure you have a connection to the network +Please enter your username: Please enter your username +It seems that the server has fall down: It seems that the server has fall down, wait a few minutes and try again +Your session has expired: Your session has expired +Access denied: Access denied \ No newline at end of file diff --git a/front/core/services/locale/es.yml b/front/core/services/locale/es.yml new file mode 100644 index 000000000..78c911459 --- /dev/null +++ b/front/core/services/locale/es.yml @@ -0,0 +1,6 @@ +Invalid login: Usuario o contraseña incorrectos, recuerda que se hace distinción entre mayúsculas y minúsculas +Could not contact the server: No se ha podido contactar con el servidor, asegurate de que dispones de conexión con la red +Please enter your username: Por favor introduce tu nombre de usuario +It seems that the server has fall down: Parece que el servidor se ha caído, espera unos minutos e inténtalo de nuevo +Your session has expired: Tu sesión ha expirado +Access denied: Acción no permitida \ No newline at end of file diff --git a/front/core/vendor.js b/front/core/vendor.js index ccb3d2f49..e10cd1036 100644 --- a/front/core/vendor.js +++ b/front/core/vendor.js @@ -3,7 +3,6 @@ import '@babel/polyfill'; import * as ng from 'angular'; export {ng}; -import 'angular-cookies'; import 'angular-translate'; import 'angular-translate-loader-partial'; import '@uirouter/angularjs'; @@ -11,7 +10,6 @@ import 'mg-crud'; import 'oclazyload'; export const ngDeps = [ - 'ngCookies', 'pascalprecht.translate', 'ui.router', 'mgCrud', diff --git a/front/package-lock.json b/front/package-lock.json index 5eedeaff7..52fc8d351 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -31,11 +31,6 @@ "resolved": "https://registry.npmjs.org/angular/-/angular-1.7.5.tgz", "integrity": "sha512-760183yxtGzni740IBTieNuWLtPNAoMqvmC0Z62UoU0I3nqk+VJuO3JbQAXOyvo3Oy/ZsdNQwrSTh/B0OQZjNw==" }, - "angular-cookies": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/angular-cookies/-/angular-cookies-1.7.5.tgz", - "integrity": "sha512-/8xvvSl/Z9Vwu8ChRm+OQE3vmli8Icwl8uTYkHqD7j7cknJP9kNaf7SgsENlsLVtOqLE/I7TCFYrSx3bmSeNQA==" - }, "angular-translate": { "version": "2.18.1", "resolved": "https://registry.npmjs.org/angular-translate/-/angular-translate-2.18.1.tgz", diff --git a/front/package.json b/front/package.json index d723617f6..88a693bfd 100644 --- a/front/package.json +++ b/front/package.json @@ -11,7 +11,6 @@ "@babel/polyfill": "^7.2.5", "@uirouter/angularjs": "^1.0.20", "angular": "^1.7.5", - "angular-cookies": "^1.7.5", "angular-translate": "^2.18.1", "angular-translate-loader-partial": "^2.18.1", "flatpickr": "^4.5.2", diff --git a/front/salix/components/login/login.js b/front/salix/components/login/login.js index 49df6a701..401d4a4d9 100644 --- a/front/salix/components/login/login.js +++ b/front/salix/components/login/login.js @@ -21,11 +21,11 @@ export default class Controller { localStorage.setItem('lastUser', this.user); this.loading = false; }) - .catch(error => { + .catch(err => { this.loading = false; this.password = ''; this.focusUser(); - throw error; + throw err; }); } focusUser() { diff --git a/front/salix/locale/en.yml b/front/salix/locale/en.yml index fbae9a742..0391172cb 100644 --- a/front/salix/locale/en.yml +++ b/front/salix/locale/en.yml @@ -5,7 +5,6 @@ Logout: Logout Change language: Change language Profile: Profile Data saved!: Data saved! -Can't contact with server: Can't contact with server Push on applications menu: To open a module push on applications menu Clients: Clients Modules access: Modules access \ No newline at end of file diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index 308d0d937..9f86e267a 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -1,5 +1,4 @@ Applications: Aplicaciones -Can't contact with server: No se pudo contactar con el servidor Change language: Cambiar idioma Client Frozen: Cliente congelado Client has debt: Cliente con riesgo diff --git a/front/salix/module.js b/front/salix/module.js index 8f3a022da..fc734e1fb 100644 --- a/front/salix/module.js +++ b/front/salix/module.js @@ -66,10 +66,12 @@ ngModule.config(config); // Unhandled exceptions -$exceptionHandler.$inject = ['vnApp', '$window', '$state']; -function $exceptionHandler(vnApp, $window, $state) { +$exceptionHandler.$inject = ['vnApp', '$window', '$state', '$injector']; +function $exceptionHandler(vnApp, $window, $state, $injector) { return function(exception, cause) { let message; + let messageT; + let $translate = $injector.get('$translate'); if (exception.name == 'HttpError') { switch (exception.xhrStatus) { @@ -78,27 +80,44 @@ function $exceptionHandler(vnApp, $window, $state) { return; } - let data = exception.data; + switch (exception.status) { + case 401: + if ($state.current.name != 'login') { + messageT = 'Your session has expired'; + let params = {continue: $window.location.hash}; + $state.go('login', params); + } else + messageT = 'Invalid login'; + break; + case 403: + messageT = 'Access denied'; + break; + case 502: + messageT = 'It seems that the server has fall down'; + break; + case -1: + messageT = 'Could not contact the server'; + break; + } - if (data && data.error instanceof Object) - message = data.error.message; - else if (exception.status === -1) - message = `Can't contact with server`; - else - message = `${exception.status}: ${exception.statusText}`; + if (!messageT) { + let data = exception.data; - if (exception.status === 401 && $state.current.name != 'login') { - let params = {continue: $window.location.hash}; - $state.go('login', params); + if (data && data.error instanceof Object) + message = data.error.message; + else + message = `${exception.status}: ${exception.statusText}`; } } else if (exception.name == 'UserError') - message = exception.message; + messageT = exception.message; else { vnApp.showError('Ups! Something went wrong'); console.error(exception); throw exception; } + if (messageT) + message = $translate.instant(messageT); vnApp.showError(message); }; }