This commit is contained in:
Gerard 2019-01-25 16:22:04 +01:00
commit bb54ec3bdc
94 changed files with 495 additions and 284 deletions

View File

@ -46,7 +46,7 @@ module.exports = Self => {
let filter = {where: {name: user}}; let filter = {where: {name: user}};
let instance = await Self.findOne(filter); let instance = await Self.findOne(filter);
if (!instance || instance.password !== md5(password)) if (!instance || instance.password !== md5(password || ''))
throw err; throw err;
let where = {id: instance.id}; let where = {id: instance.id};

View File

@ -169,9 +169,9 @@ export default class Watcher extends Component {
*/ */
check() { check() {
if (this.form && this.form.$invalid) 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) if (!this.dirty)
throw new UserError(this._.instant('No changes to save')); throw new UserError('No changes to save');
} }
/** /**

View File

@ -7,9 +7,10 @@ import UserError from 'core/lib/user-error';
* @property {Boolean} loggedIn Whether the user is currently logged * @property {Boolean} loggedIn Whether the user is currently logged
*/ */
export default class Auth { export default class Auth {
constructor($http, $state, $transitions, $window, vnToken, vnModules, aclService) { constructor($http, $q, $state, $transitions, $window, vnToken, vnModules, aclService) {
Object.assign(this, { Object.assign(this, {
$http, $http,
$q,
$state, $state,
$transitions, $transitions,
$window, $window,
@ -43,7 +44,7 @@ export default class Auth {
} }
login(user, password, remember) { login(user, password, remember) {
if (!user) if (!user)
throw new UserError('Please insert your user and password'); return this.$q.reject(new UserError('Please enter your username'));
let params = { let params = {
user, user,
@ -51,8 +52,7 @@ export default class Auth {
}; };
return this.$http.post('/api/Accounts/login', params).then( return this.$http.post('/api/Accounts/login', params).then(
json => this.onLoginOk(json, remember), json => this.onLoginOk(json, remember));
json => this.onLoginErr(json));
} }
onLoginOk(json, remember) { onLoginOk(json, remember) {
this.vnToken.set(json.data.token, remember); this.vnToken.set(json.data.token, remember);
@ -65,22 +65,6 @@ export default class Auth {
this.$state.go('home'); 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() { logout() {
let promise = this.$http.post('/api/Accounts/logout', null, { let promise = this.$http.post('/api/Accounts/logout', null, {
headers: {Authorization: this.vnToken.token} 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); ngModule.service('vnAuth', Auth);

View File

@ -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

View File

@ -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

View File

@ -3,7 +3,6 @@ import '@babel/polyfill';
import * as ng from 'angular'; import * as ng from 'angular';
export {ng}; export {ng};
import 'angular-cookies';
import 'angular-translate'; import 'angular-translate';
import 'angular-translate-loader-partial'; import 'angular-translate-loader-partial';
import '@uirouter/angularjs'; import '@uirouter/angularjs';
@ -11,7 +10,6 @@ import 'mg-crud';
import 'oclazyload'; import 'oclazyload';
export const ngDeps = [ export const ngDeps = [
'ngCookies',
'pascalprecht.translate', 'pascalprecht.translate',
'ui.router', 'ui.router',
'mgCrud', 'mgCrud',

View File

@ -31,11 +31,6 @@
"resolved": "https://registry.npmjs.org/angular/-/angular-1.7.5.tgz", "resolved": "https://registry.npmjs.org/angular/-/angular-1.7.5.tgz",
"integrity": "sha512-760183yxtGzni740IBTieNuWLtPNAoMqvmC0Z62UoU0I3nqk+VJuO3JbQAXOyvo3Oy/ZsdNQwrSTh/B0OQZjNw==" "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": { "angular-translate": {
"version": "2.18.1", "version": "2.18.1",
"resolved": "https://registry.npmjs.org/angular-translate/-/angular-translate-2.18.1.tgz", "resolved": "https://registry.npmjs.org/angular-translate/-/angular-translate-2.18.1.tgz",

View File

@ -11,7 +11,6 @@
"@babel/polyfill": "^7.2.5", "@babel/polyfill": "^7.2.5",
"@uirouter/angularjs": "^1.0.20", "@uirouter/angularjs": "^1.0.20",
"angular": "^1.7.5", "angular": "^1.7.5",
"angular-cookies": "^1.7.5",
"angular-translate": "^2.18.1", "angular-translate": "^2.18.1",
"angular-translate-loader-partial": "^2.18.1", "angular-translate-loader-partial": "^2.18.1",
"flatpickr": "^4.5.2", "flatpickr": "^4.5.2",

View File

@ -21,11 +21,11 @@ export default class Controller {
localStorage.setItem('lastUser', this.user); localStorage.setItem('lastUser', this.user);
this.loading = false; this.loading = false;
}) })
.catch(error => { .catch(err => {
this.loading = false; this.loading = false;
this.password = ''; this.password = '';
this.focusUser(); this.focusUser();
throw error; throw err;
}); });
} }
focusUser() { focusUser() {

View File

@ -5,7 +5,6 @@ Logout: Logout
Change language: Change language Change language: Change language
Profile: Profile Profile: Profile
Data saved!: Data saved! 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 Push on applications menu: To open a module push on applications menu
Clients: Clients Clients: Clients
Modules access: Modules access Modules access: Modules access

View File

@ -1,5 +1,4 @@
Applications: Aplicaciones Applications: Aplicaciones
Can't contact with server: No se pudo contactar con el servidor
Change language: Cambiar idioma Change language: Cambiar idioma
Client Frozen: Cliente congelado Client Frozen: Cliente congelado
Client has debt: Cliente con riesgo Client has debt: Cliente con riesgo

View File

@ -66,10 +66,12 @@ ngModule.config(config);
// Unhandled exceptions // Unhandled exceptions
$exceptionHandler.$inject = ['vnApp', '$window', '$state']; $exceptionHandler.$inject = ['vnApp', '$window', '$state', '$injector'];
function $exceptionHandler(vnApp, $window, $state) { function $exceptionHandler(vnApp, $window, $state, $injector) {
return function(exception, cause) { return function(exception, cause) {
let message; let message;
let messageT;
let $translate = $injector.get('$translate');
if (exception.name == 'HttpError') { if (exception.name == 'HttpError') {
switch (exception.xhrStatus) { switch (exception.xhrStatus) {
@ -78,27 +80,44 @@ function $exceptionHandler(vnApp, $window, $state) {
return; return;
} }
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 (!messageT) {
let data = exception.data; let data = exception.data;
if (data && data.error instanceof Object) if (data && data.error instanceof Object)
message = data.error.message; message = data.error.message;
else if (exception.status === -1)
message = `Can't contact with server`;
else else
message = `${exception.status}: ${exception.statusText}`; message = `${exception.status}: ${exception.statusText}`;
if (exception.status === 401 && $state.current.name != 'login') {
let params = {continue: $window.location.hash};
$state.go('login', params);
} }
} else if (exception.name == 'UserError') } else if (exception.name == 'UserError')
message = exception.message; messageT = exception.message;
else { else {
vnApp.showError('Ups! Something went wrong'); vnApp.showError('Ups! Something went wrong');
console.error(exception); console.error(exception);
throw exception; throw exception;
} }
if (messageT)
message = $translate.instant(messageT);
vnApp.showError(message); vnApp.showError(message);
}; };
} }

View File

@ -24,6 +24,7 @@ class Controller {
this.$state.go('zone.index'); this.$state.go('zone.index');
}); });
} }
console.log('res', response);
} }
} }

View File

@ -6,7 +6,15 @@
<a translate-attr="{title: 'Preview'}" ui-sref="claim.card.summary({id: $ctrl.claim.id})"> <a translate-attr="{title: 'Preview'}" ui-sref="claim.card.summary({id: $ctrl.claim.id})">
<vn-icon icon="desktop_windows"></vn-icon> <vn-icon icon="desktop_windows"></vn-icon>
</a> </a>
<div></div> <vn-icon-menu
vn-id="more-button"
icon="more_vert"
show-filter="false"
value-field="callback"
translate-fields="['name']"
data="$ctrl.moreOptions"
on-change="$ctrl.onMoreChange(value)">
</vn-icon-menu>
</div> </div>
<div class="body"> <div class="body">
<div class="attributes"> <div class="attributes">
@ -58,3 +66,9 @@
</div> </div>
</div> </div>
</div> </div>
<vn-confirm
vn-id="confirm-dialog"
on-response="$ctrl.returnDialog(response)"
question="Pickup order"
message="Do you want to send it directly?">
</vn-confirm>

View File

@ -1,8 +1,15 @@
import ngModule from '../module'; import ngModule from '../module';
class Controller { class Controller {
constructor($state) { constructor($scope, $state, $http, $translate, vnApp) {
this.$scope = $scope;
this.$state = $state; this.$state = $state;
this.$http = $http;
this.$translate = $translate;
this.vnApp = vnApp;
this.moreOptions = [
{callback: this.showConfirmDialog, name: 'Pickup order'}
];
} }
get claim() { get claim() {
@ -30,9 +37,28 @@ class Controller {
get quicklinks() { get quicklinks() {
return this._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', { ngModule.component('vnClaimDescriptor', {
template: require('./index.html'), template: require('./index.html'),

View File

@ -7,6 +7,8 @@ Remove sale: Borrar linea
Claim Id: Id reclamación Claim Id: Id reclamación
Created: Creado Created: Creado
Enter a new search: Introduce una nueva búsqueda 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 #sections
Claims: Reclamaciones Claims: Reclamaciones

181
package-lock.json generated
View File

@ -1271,7 +1271,7 @@
}, },
"ansi-escapes": { "ansi-escapes": {
"version": "3.1.0", "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==", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==",
"dev": true "dev": true
}, },
@ -1564,7 +1564,7 @@
}, },
"util": { "util": {
"version": "0.10.3", "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=", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1883,7 +1883,7 @@
"base": { "base": {
"version": "0.11.2", "version": "0.11.2",
"resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
"integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=",
"dev": true, "dev": true,
"requires": { "requires": {
"cache-base": "^1.0.1", "cache-base": "^1.0.1",
@ -2685,7 +2685,7 @@
}, },
"browserify-rsa": { "browserify-rsa": {
"version": "4.0.1", "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=", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -2735,7 +2735,7 @@
}, },
"buffer": { "buffer": {
"version": "4.9.1", "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=", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -2910,7 +2910,7 @@
"cache-base": { "cache-base": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
"integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=",
"dev": true, "dev": true,
"requires": { "requires": {
"collection-visit": "^1.0.0", "collection-visit": "^1.0.0",
@ -2954,7 +2954,7 @@
}, },
"camelcase-keys": { "camelcase-keys": {
"version": "2.1.0", "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=", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -3157,7 +3157,7 @@
"class-utils": { "class-utils": {
"version": "0.3.6", "version": "0.3.6",
"resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "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, "dev": true,
"requires": { "requires": {
"arr-union": "^3.1.0", "arr-union": "^3.1.0",
@ -3317,7 +3317,7 @@
}, },
"string_decoder": { "string_decoder": {
"version": "1.1.1", "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==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -3431,7 +3431,7 @@
}, },
"colors": { "colors": {
"version": "1.1.2", "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=", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
"dev": true "dev": true
}, },
@ -3624,7 +3624,7 @@
}, },
"content-disposition": { "content-disposition": {
"version": "0.5.2", "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=" "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
}, },
"content-security-policy-builder": { "content-security-policy-builder": {
@ -3825,7 +3825,7 @@
}, },
"css-loader": { "css-loader": {
"version": "0.25.0", "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=", "integrity": "sha1-w/68jOKPTINXa2sTcH9H+Qw5AiM=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -4449,7 +4449,7 @@
"dot-prop": { "dot-prop": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", "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, "dev": true,
"requires": { "requires": {
"is-obj": "^1.0.0" "is-obj": "^1.0.0"
@ -4482,7 +4482,7 @@
}, },
"readable-stream": { "readable-stream": {
"version": "1.1.14", "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=", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -4609,7 +4609,7 @@
"dependencies": { "dependencies": {
"fs-extra": { "fs-extra": {
"version": "0.30.0", "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=", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -4622,7 +4622,7 @@
}, },
"jsonfile": { "jsonfile": {
"version": "2.4.0", "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=", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -5151,7 +5151,7 @@
}, },
"events": { "events": {
"version": "1.1.1", "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=", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
"dev": true "dev": true
}, },
@ -5654,7 +5654,7 @@
}, },
"file-loader": { "file-loader": {
"version": "1.1.11", "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==", "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -5874,7 +5874,7 @@
}, },
"fs-access": { "fs-access": {
"version": "1.0.1", "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=", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -5947,7 +5947,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -5968,12 +5969,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -5988,17 +5991,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -6115,7 +6121,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -6127,6 +6134,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -6141,6 +6149,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -6148,12 +6157,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -6172,6 +6183,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -6252,7 +6264,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -6264,6 +6277,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -6349,7 +6363,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -6385,6 +6400,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -6404,6 +6420,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -6447,12 +6464,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },
@ -6654,7 +6673,7 @@
"global-modules": { "global-modules": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
"integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=",
"dev": true, "dev": true,
"requires": { "requires": {
"global-prefix": "^1.0.1", "global-prefix": "^1.0.1",
@ -6697,7 +6716,7 @@
}, },
"globby": { "globby": {
"version": "5.0.0", "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=", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -6742,7 +6761,7 @@
}, },
"got": { "got": {
"version": "6.7.1", "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=", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -6919,7 +6938,7 @@
}, },
"kind-of": { "kind-of": {
"version": "1.1.0", "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=", "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
"dev": true "dev": true
}, },
@ -7103,7 +7122,7 @@
"dependencies": { "dependencies": {
"es6-promise": { "es6-promise": {
"version": "3.3.1", "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=", "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=",
"dev": true "dev": true
}, },
@ -7885,7 +7904,7 @@
"is-absolute": { "is-absolute": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
"integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=",
"dev": true, "dev": true,
"requires": { "requires": {
"is-relative": "^1.0.0", "is-relative": "^1.0.0",
@ -7940,7 +7959,7 @@
}, },
"is-builtin-module": { "is-builtin-module": {
"version": "1.0.0", "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=", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -8087,7 +8106,7 @@
}, },
"is-obj": { "is-obj": {
"version": "1.0.1", "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=", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true "dev": true
}, },
@ -8124,7 +8143,7 @@
"is-plain-object": { "is-plain-object": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "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, "dev": true,
"requires": { "requires": {
"isobject": "^3.0.1" "isobject": "^3.0.1"
@ -8160,7 +8179,7 @@
"is-relative": { "is-relative": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", "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, "dev": true,
"requires": { "requires": {
"is-unc-path": "^1.0.0" "is-unc-path": "^1.0.0"
@ -8203,7 +8222,7 @@
"is-unc-path": { "is-unc-path": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
"integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=",
"dev": true, "dev": true,
"requires": { "requires": {
"unc-path-regex": "^0.1.2" "unc-path-regex": "^0.1.2"
@ -8304,7 +8323,7 @@
}, },
"jasmine-core": { "jasmine-core": {
"version": "2.99.1", "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=", "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=",
"dev": true "dev": true
}, },
@ -8321,7 +8340,7 @@
"jasmine-spec-reporter": { "jasmine-spec-reporter": {
"version": "4.2.1", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", "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, "dev": true,
"requires": { "requires": {
"colors": "1.1.2" "colors": "1.1.2"
@ -8609,7 +8628,7 @@
"karma-chrome-launcher": { "karma-chrome-launcher": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", "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, "dev": true,
"requires": { "requires": {
"fs-access": "^1.0.0", "fs-access": "^1.0.0",
@ -8787,7 +8806,7 @@
}, },
"load-json-file": { "load-json-file": {
"version": "1.1.0", "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=", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10295,7 +10314,7 @@
}, },
"media-typer": { "media-typer": {
"version": "0.3.0", "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=" "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
}, },
"mem": { "mem": {
@ -10318,7 +10337,7 @@
}, },
"meow": { "meow": {
"version": "3.7.0", "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=", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10441,7 +10460,7 @@
}, },
"minimist": { "minimist": {
"version": "1.2.0", "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=" "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}, },
"minstache": { "minstache": {
@ -10534,7 +10553,7 @@
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "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=", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
@ -10542,7 +10561,7 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "0.0.8", "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=" "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
} }
} }
@ -10694,7 +10713,7 @@
}, },
"multipipe": { "multipipe": {
"version": "0.1.2", "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=", "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10823,7 +10842,7 @@
}, },
"named-placeholders": { "named-placeholders": {
"version": "1.1.1", "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=", "integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -10832,7 +10851,7 @@
"dependencies": { "dependencies": {
"lru-cache": { "lru-cache": {
"version": "2.5.0", "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=", "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=",
"dev": true "dev": true
} }
@ -10919,7 +10938,7 @@
"dependencies": { "dependencies": {
"jsesc": { "jsesc": {
"version": "0.5.0", "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=", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true "dev": true
} }
@ -11812,7 +11831,7 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "0.0.10", "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=", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
"dev": true "dev": true
}, },
@ -11874,7 +11893,7 @@
}, },
"os-homedir": { "os-homedir": {
"version": "1.0.2", "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=", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true "dev": true
}, },
@ -11890,7 +11909,7 @@
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "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=", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true "dev": true
}, },
@ -12078,7 +12097,7 @@
}, },
"path-browserify": { "path-browserify": {
"version": "0.0.0", "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=", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
"dev": true "dev": true
}, },
@ -12829,7 +12848,7 @@
}, },
"pretty-bytes": { "pretty-bytes": {
"version": "1.0.4", "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=", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -12918,7 +12937,7 @@
}, },
"through2": { "through2": {
"version": "0.2.3", "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=", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -13457,7 +13476,7 @@
"dependencies": { "dependencies": {
"jsesc": { "jsesc": {
"version": "0.5.0", "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=", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true "dev": true
} }
@ -13863,7 +13882,7 @@
}, },
"safe-regex": { "safe-regex": {
"version": "1.1.0", "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=", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -13987,7 +14006,7 @@
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "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=", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -14127,7 +14146,7 @@
"set-value": { "set-value": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=",
"dev": true, "dev": true,
"requires": { "requires": {
"extend-shallow": "^2.0.1", "extend-shallow": "^2.0.1",
@ -14314,7 +14333,7 @@
"snapdragon-node": { "snapdragon-node": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
"integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=",
"dev": true, "dev": true,
"requires": { "requires": {
"define-property": "^1.0.0", "define-property": "^1.0.0",
@ -14365,7 +14384,7 @@
"snapdragon-util": { "snapdragon-util": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
"integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=",
"dev": true, "dev": true,
"requires": { "requires": {
"kind-of": "^3.2.0" "kind-of": "^3.2.0"
@ -14710,7 +14729,7 @@
"split-string": { "split-string": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "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, "dev": true,
"requires": { "requires": {
"extend-shallow": "^3.0.0" "extend-shallow": "^3.0.0"
@ -14719,7 +14738,7 @@
"split2": { "split2": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz",
"integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=",
"dev": true, "dev": true,
"requires": { "requires": {
"through2": "^2.0.2" "through2": "^2.0.2"
@ -14821,7 +14840,7 @@
}, },
"stream-browserify": { "stream-browserify": {
"version": "2.0.1", "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=", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -14900,7 +14919,7 @@
}, },
"string_decoder": { "string_decoder": {
"version": "1.1.1", "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==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -14992,7 +15011,7 @@
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "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=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -15252,7 +15271,7 @@
}, },
"style-loader": { "style-loader": {
"version": "0.20.3", "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==", "integrity": "sha512-2I7AVP73MvK33U7B9TKlYZAqdROyMXDYSMvHLX43qy3GCOaJNiV6i0v/sv9idWIaQ42Yn2dNv79Q5mKXbKhAZg==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -15398,7 +15417,7 @@
}, },
"tar": { "tar": {
"version": "2.2.1", "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=", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -15568,7 +15587,7 @@
}, },
"through": { "through": {
"version": "2.3.8", "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=" "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
}, },
"through2": { "through2": {
@ -15751,7 +15770,7 @@
"touch": { "touch": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
"integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=",
"dev": true, "dev": true,
"requires": { "requires": {
"nopt": "~1.0.10" "nopt": "~1.0.10"
@ -15840,7 +15859,7 @@
}, },
"tty-browserify": { "tty-browserify": {
"version": "0.0.0", "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=", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
"dev": true "dev": true
}, },
@ -16250,7 +16269,7 @@
"useragent": { "useragent": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz",
"integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", "integrity": "sha1-IX+UOtVAyyEoZYqyP8lg9qiMmXI=",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "4.1.x", "lru-cache": "4.1.x",
@ -16484,7 +16503,7 @@
}, },
"vm-browserify": { "vm-browserify": {
"version": "0.0.4", "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=", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -16972,7 +16991,7 @@
}, },
"globby": { "globby": {
"version": "6.1.0", "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=", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -16985,7 +17004,7 @@
"dependencies": { "dependencies": {
"pify": { "pify": {
"version": "2.3.0", "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=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true "dev": true
} }
@ -17373,7 +17392,7 @@
"write-file-atomic": { "write-file-atomic": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", "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, "dev": true,
"requires": { "requires": {
"graceful-fs": "^4.1.11", "graceful-fs": "^4.1.11",

View File

@ -1,3 +1,9 @@
.container {
font-family: verdana, sans-serif;
font-size: 16px;
zoom: 0.55
}
.columns { .columns {
overflow: hidden overflow: hidden
} }
@ -27,46 +33,6 @@
float: left 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 { .row {
margin-bottom: 15px; margin-bottom: 15px;
overflow: hidden overflow: hidden
@ -139,6 +105,37 @@
overflow: visible 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 { .box {
border-top: 1px solid #CCC; border-top: 1px solid #CCC;
border-right: 1px solid #CCC; border-right: 1px solid #CCC;
@ -164,22 +161,3 @@
.pull-right { .pull-right {
float: 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;
}

View File

@ -4,9 +4,10 @@
{"type": "email", "name": "payment-update"}, {"type": "email", "name": "payment-update"},
{"type": "email", "name": "letter-debtor-st"}, {"type": "email", "name": "letter-debtor-st"},
{"type": "email", "name": "letter-debtor-nd"}, {"type": "email", "name": "letter-debtor-nd"},
{"type": "email", "name": "claim-pickup-order"},
{"type": "report", "name": "delivery-note"}, {"type": "report", "name": "delivery-note"},
{"type": "report", "name": "invoice"}, {"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-header"},
{"type": "static", "name": "email-footer"}, {"type": "static", "name": "email-footer"},
{"type": "static", "name": "report-header"}, {"type": "static", "name": "report-header"},

View File

@ -4,18 +4,16 @@ const renderer = require('vue-server-renderer').createRenderer();
const fs = require('fs-extra'); const fs = require('fs-extra');
const juice = require('juice'); const juice = require('juice');
const smtp = require('./smtp'); const smtp = require('./smtp');
const i18n = new VueI18n({ const fallbackLocale = 'es';
locale: 'es',
});
Vue.use(VueI18n);
if (!process.env.OPENSSL_CONF) if (!process.env.OPENSSL_CONF)
process.env.OPENSSL_CONF = '/etc/ssl/'; process.env.OPENSSL_CONF = '/etc/ssl/';
Vue.use(VueI18n);
module.exports = { module.exports = {
path: `${appPath}/reports`, path: `${appPath}/report`,
/** /**
* Renders a report component * Renders a report component
@ -25,17 +23,18 @@ module.exports = {
*/ */
async render(name, ctx) { async render(name, ctx) {
const component = require(`${this.path}/${name}`); const component = require(`${this.path}/${name}`);
const prefetchedData = await this.preFetch(component, ctx); const result = await this.preFetch(component, ctx);
const i18n = new VueI18n({
const app = new Vue({ locale: 'es',
i18n, fallbackLocale
render: h => h(component),
}); });
const app = new Vue({i18n,
render: h => h(result.component)});
return renderer.renderToString(app).then(renderedHtml => { return renderer.renderToString(app).then(renderedHtml => {
return { return {
html: renderedHtml, html: renderedHtml,
data: prefetchedData, data: result.mergedData,
}; };
}); });
}, },
@ -43,10 +42,11 @@ module.exports = {
/** /**
* Prefetch all component data from asyncData method * Prefetch all component data from asyncData method
* *
* @param {Object} component - Component object * @param {Object} orgComponent - Component object
* @param {Object} ctx - Request context * @param {Object} ctx - Request context
*/ */
async preFetch(component, ctx) { async preFetch(orgComponent, ctx) {
let component = Object.create(orgComponent);
let mergedData = {attachments: []}; let mergedData = {attachments: []};
let asyncData = {}; let asyncData = {};
let data = {}; let data = {};
@ -60,14 +60,18 @@ module.exports = {
await this.attachAssets(component); await this.attachAssets(component);
if (component.hasOwnProperty('data')) if (orgComponent.hasOwnProperty('data'))
data = component.data(); data = orgComponent.data();
if (component.hasOwnProperty('asyncData')) { if (orgComponent.hasOwnProperty('asyncData')) {
asyncData = await component.asyncData(ctx, params); asyncData = await orgComponent.asyncData(ctx, params);
if (asyncData.locale) { 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; mergedData.subject = locale.subject;
} }
} }
@ -81,7 +85,7 @@ module.exports = {
if (data.hasOwnProperty('files')) { if (data.hasOwnProperty('files')) {
const files = data.files; const files = data.files;
files.forEach(file => { files.forEach(file => {
const componentPath = `${this.path}/${component.name}`; const componentPath = `${this.path}/${orgComponent.name}`;
let fileSrc = componentPath + file; let fileSrc = componentPath + file;
if (file.slice(0, 4) === 'http' || file.slice(0, 4) === 'https') if (file.slice(0, 4) === 'http' || file.slice(0, 4) === 'https')
@ -96,25 +100,30 @@ module.exports = {
}); });
} }
if (component.components) { const components = orgComponent.components;
const components = component.components;
const promises = [];
Object.keys(components).forEach(component => { if (components) {
promises.push(this.preFetch(components[component], ctx)); 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 => { await Promise.all(promises).then(results => {
results.forEach(result => { results.forEach((result, i) => {
result.attachments.forEach(atth => { result.mergedData.attachments.forEach(atth => {
mergedData.attachments.push(atth); mergedData.attachments.push(atth);
}); });
component.components[childNames[i]] = result.component;
}); });
return mergedData;
}); });
} }
return mergedData; return {component, mergedData};
}, },
async attachAssets(component) { async attachAssets(component) {

View File

@ -13,7 +13,7 @@ if (!process.env.OPENSSL_CONF)
module.exports = { module.exports = {
path: `${appPath}/reports`, path: `${appPath}/report`,
/** /**
* Renders a report component * Renders a report component
@ -23,16 +23,13 @@ module.exports = {
*/ */
async render(name, ctx) { async render(name, ctx) {
const component = require(`${this.path}/${name}`); const component = require(`${this.path}/${name}`);
const result = await this.preFetch(component, ctx);
await this.preFetch(component, ctx);
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: 'es', locale: 'es',
fallbackLocale: 'en'
}); });
const app = new Vue({ const app = new Vue({i18n,
i18n, render: h => h(result.component)});
render: h => h(component),
});
return renderer.renderToString(app); return renderer.renderToString(app);
}, },
@ -40,10 +37,11 @@ module.exports = {
/** /**
* Prefetch all component data from asyncData method * Prefetch all component data from asyncData method
* *
* @param {Object} component - Component object * @param {Object} orgComponent - Component object
* @param {Object} ctx - Request context * @param {Object} ctx - Request context
*/ */
async preFetch(component, ctx) { async preFetch(orgComponent, ctx) {
let component = Object.create(orgComponent);
let mergedData = {}; let mergedData = {};
let asyncData = {}; let asyncData = {};
let data = {}; let data = {};
@ -57,11 +55,11 @@ module.exports = {
await this.attachAssets(component); await this.attachAssets(component);
if (component.hasOwnProperty('data')) if (orgComponent.hasOwnProperty('data'))
data = component.data(); data = orgComponent.data();
if (component.hasOwnProperty('asyncData')) if (orgComponent.hasOwnProperty('asyncData'))
asyncData = await component.asyncData(ctx, params); asyncData = await orgComponent.asyncData(ctx, params);
mergedData = Object.assign(mergedData, data, asyncData); mergedData = Object.assign(mergedData, data, asyncData);
@ -69,16 +67,25 @@ module.exports = {
return mergedData; return mergedData;
}; };
if (component.components) { const components = orgComponent.components;
const components = component.components; if (components) {
const promises = []; const promises = [];
const childNames = [];
component.components = {};
Object.keys(components).forEach(component => { Object.keys(components).forEach(childName => {
promises.push(this.preFetch(components[component], ctx)); 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) { async attachAssets(component) {

View File

@ -4,7 +4,7 @@ const express = require('express');
const routes = require(`../config/routes.json`); const routes = require(`../config/routes.json`);
module.exports = app => { module.exports = app => {
this.path = `${appPath}/reports`; this.path = `${appPath}/report`;
/** /**
* Enables a report * Enables a report
@ -15,10 +15,9 @@ module.exports = app => {
if (!name) throw new Error('Report name required'); if (!name) throw new Error('Report name required');
app.get(`/report/${name}`, (request, response, next) => { app.get(`/report/${name}`, (request, response, next) => {
reportEngine.toPdf(name, request).then(stream => {
response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`);
response.setHeader('Content-type', 'application/pdf'); response.setHeader('Content-type', 'application/pdf');
reportEngine.toPdf(name, request).then(stream => {
stream.pipe(response); stream.pipe(response);
}).catch(e => { }).catch(e => {
next(e); next(e);

View File

@ -3,10 +3,8 @@ body {
} }
.container { .container {
font-family: arial, sans-serif;
max-width: 600px; max-width: 600px;
min-width: 320px; min-width: 320px;
font-size: 16px;
margin: 0 auto; margin: 0 auto;
color: #555 color: #555
} }

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="es">
<head>
<title>{{ $t('subject') }}</title>
</head>
<body>
<section class="container">
<email-header></email-header>
<section class="main">
<!-- Title block -->
<div class="title">
<h1>{{ $t('title') }}</h1>
</div>
<!-- Title block end -->
<p>{{$t('description.dear')}},</p>
<p>{{$t('description.instructions')}}</p>
<!-- <h1>{{$t('sections.howToBuy.title')}}</h1>
<p>{{$t('sections.howToBuy.description')}}</p>
<ol>
<li v-for="requeriment in $t('sections.howToBuy.requeriments')">
<span v-html="requeriment"></span>
</li>
</ol>
<p>{{$t('sections.howToBuy.stock')}}</p>
<p>{{$t('sections.howToBuy.delivery')}}</p> -->
</section>
<email-footer></email-footer>
</section>
</body>
</html>

View File

@ -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,
},
};

View File

@ -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.',
}
}
},
},
};

View File

@ -3,10 +3,8 @@ body {
} }
.container { .container {
font-family: arial, sans-serif;
max-width: 600px; max-width: 600px;
min-width: 320px; min-width: 320px;
font-size: 16px;
margin: 0 auto; margin: 0 auto;
color: #555 color: #555
} }

View File

@ -15,6 +15,8 @@ module.exports = {
return this.methods.fetchClient(params.clientFk) return this.methods.fetchClient(params.clientFk)
.then(([result]) => { .then(([result]) => {
if (!result)
throw new UserException('No client data found');
return Object.assign(data, result[0]); return Object.assign(data, result[0]);
}); });
}, },

View File

@ -1,11 +1,3 @@
footer {
font-family: arial, sans-serif;
max-width: 600px;
min-width: 320px;
font-size: 16px;
margin: 0 auto
}
.buttons { .buttons {
background-color: #FFF; background-color: #FFF;
text-align: center; text-align: center;

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,7 @@
header {
color: #555
}
header img {
width: 100%
}

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,6 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -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
}

View File

@ -15,6 +15,8 @@ module.exports = {
return this.methods.fetchClientData(params.clientFk) return this.methods.fetchClientData(params.clientFk)
.then(([result]) => { .then(([result]) => {
if (!result)
throw new UserException('No client data found');
return Object.assign(data, result[0]); return Object.assign(data, result[0]);
}); });
}, },

View File

@ -0,0 +1,6 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -3,10 +3,8 @@ body {
} }
.container { .container {
font-family: arial, sans-serif;
max-width: 600px; max-width: 600px;
min-width: 320px; min-width: 320px;
font-size: 16px;
margin: 0 auto; margin: 0 auto;
color: #555 color: #555
} }

View File

@ -15,6 +15,8 @@ module.exports = {
return this.methods.fetchClientData(params.clientFk) return this.methods.fetchClientData(params.clientFk)
.then(([result]) => { .then(([result]) => {
if (!result)
throw new UserException('No client data found');
return Object.assign(data, result[0]); return Object.assign(data, result[0]);
}); });
}, },

View File

@ -1,9 +1,6 @@
footer { footer {
font-family: arial, sans-serif;
margin-top: 30px; margin-top: 30px;
font-size: 16px; color: #555
color: #555;
zoom: 0.55
} }
footer, footer p { footer, footer p {

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,6 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -0,0 +1,3 @@
.container {
color: #000
}

View File

@ -7,7 +7,7 @@
<div class="columns"> <div class="columns">
<div class="size50"> <div class="size50">
<div class="size75"> <div class="size75">
<h1 style="margin-top:0" class="font extraLarge">{{$t('title')}}</h1> <h1 style="margin-top:0" class="font extraLarge" style="font-weight: 100">{{$t('title')}}</h1>
<div class="row inline font normal"> <div class="row inline font normal">
<div class="text font gray">{{$t('claimId')}}:</div> <div class="text font gray">{{$t('claimId')}}:</div>
<div class="control">{{claimId}}</div> <div class="control">{{claimId}}</div>

View File

@ -3,7 +3,7 @@ const database = require(`${appPath}/lib/database`);
const UserException = require(`${appPath}/lib/exceptions/userException`); const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = { module.exports = {
name: 'claim-pickup', name: 'rpt-claim-pickup-order',
async asyncData(ctx, params) { async asyncData(ctx, params) {
const promises = []; const promises = [];
const data = {}; const data = {};
@ -18,6 +18,9 @@ module.exports = {
const [[claim]] = result[0]; const [[claim]] = result[0];
const [sales] = result[1]; const [sales] = result[1];
if (!claim)
throw new UserException('No claim data found');
Object.assign(data, claim, {sales}); Object.assign(data, claim, {sales});
return data; return data;

View File

@ -1,6 +0,0 @@
.container {
font-family: arial, sans-serif;
font-size: 16px;
color: #555;
zoom: 0.55
}

View File

@ -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%
}