From 21894ca0f8a81e924c0d8e0c8ea389cd8de06596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20S=C3=A1nchez?= Date: Wed, 27 Dec 2017 09:44:27 +0100 Subject: [PATCH 1/7] =?UTF-8?q?Configuraci=C3=B3n=20en=20entorno=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/mailer/application/config.js | 17 +++++++++++------ .../application/config/datasources.test.json | 6 +++--- services/mailer/application/mail.js | 4 +++- services/print/application/config.js | 17 +++++++++++------ .../application/config/datasources.test.json | 4 ++-- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/services/mailer/application/config.js b/services/mailer/application/config.js index 1442e85ed..c46f236f8 100644 --- a/services/mailer/application/config.js +++ b/services/mailer/application/config.js @@ -1,15 +1,20 @@ var path = require('path'); -var fs = require('fs'); -var config = {}; +let defaultFile = 'datasources.json'; -let devConfigPath = path.join(__dirname, '/config/datasources.development.json'); -let configPath = path.join(__dirname, '/config/datasources.json'); +function getFile(fileName) { + return require(path.join(__dirname, `/config/${fileName}`)); +} try { - config = Object.assign(require(configPath), require(devConfigPath)); + let envFile = 'datasources.development.json'; + + if (process.env.NODE_ENV === 'test') + envFile = 'datasources.test.json'; + + config = getFile(envFile); } catch (e) { if (e.code == 'MODULE_NOT_FOUND') - config = require(configPath); + config = getFile(defaultFile); } config.proxy = require('../../nginx/config.json'); diff --git a/services/mailer/application/config/datasources.test.json b/services/mailer/application/config/datasources.test.json index 69943439d..d3a2d8b33 100644 --- a/services/mailer/application/config/datasources.test.json +++ b/services/mailer/application/config/datasources.test.json @@ -4,14 +4,14 @@ "debug": false, "defaultLanguage": "es", "senderMail": "noreply@localhost", - "senderName": "" + "senderName": "VerdNatura" }, "mysql": { "host": "localhost", "port": 3306, - "user": "reports", + "user": "root", "password": "", - "database": "" + "database": "vn" }, "smtp": { "host": "localhost", diff --git a/services/mailer/application/mail.js b/services/mailer/application/mail.js index 3980e5128..04af6b007 100644 --- a/services/mailer/application/mail.js +++ b/services/mailer/application/mail.js @@ -12,15 +12,17 @@ module.exports = { * Load mail config. */ init: function() { + this.transporter = nodemailer.createTransport(config.smtp); this.transporter.verify(function(error, success) { if (error) { - throw new Error(error); + console.error(error); } else if (config.app.debug) { console.log('SMTP connection stablished'); } }); + }, /** diff --git a/services/print/application/config.js b/services/print/application/config.js index 1442e85ed..c46f236f8 100644 --- a/services/print/application/config.js +++ b/services/print/application/config.js @@ -1,15 +1,20 @@ var path = require('path'); -var fs = require('fs'); -var config = {}; +let defaultFile = 'datasources.json'; -let devConfigPath = path.join(__dirname, '/config/datasources.development.json'); -let configPath = path.join(__dirname, '/config/datasources.json'); +function getFile(fileName) { + return require(path.join(__dirname, `/config/${fileName}`)); +} try { - config = Object.assign(require(configPath), require(devConfigPath)); + let envFile = 'datasources.development.json'; + + if (process.env.NODE_ENV === 'test') + envFile = 'datasources.test.json'; + + config = getFile(envFile); } catch (e) { if (e.code == 'MODULE_NOT_FOUND') - config = require(configPath); + config = getFile(defaultFile); } config.proxy = require('../../nginx/config.json'); diff --git a/services/print/application/config/datasources.test.json b/services/print/application/config/datasources.test.json index 92965aa5a..d51ae1fa2 100644 --- a/services/print/application/config/datasources.test.json +++ b/services/print/application/config/datasources.test.json @@ -7,9 +7,9 @@ "mysql": { "host": "localhost", "port": 3306, - "user": "reports", + "user": "root", "password": "", - "database": "" + "database": "vn" }, "pdf": { "footer": { From f2872da4dbf7d68c4a0c00a0aa7bc739a9bd5aee Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 08:05:50 +0100 Subject: [PATCH 2/7] validation client side unit tests --- .../src/directives/specs/validation.spec.js | 81 +++++++++++++++++++ client/core/src/directives/validation.js | 4 +- client/core/src/lib/validator.js | 2 +- services/mailer/application/auth.js | 3 +- services/mailer/application/config.js | 2 +- 5 files changed, 86 insertions(+), 6 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index e69de29bb..3ff608a68 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -0,0 +1,81 @@ +describe('Directive validation', () => { + let scope; + let element; + let compile; + + beforeEach(() => { + angular.mock.module('client'); + }); + + compile = (_element, validations, value) => { + inject(($compile, $rootScope, aclService, _$timeout_, $window) => { + $window.validations = validations; + scope = $rootScope.$new(); + scope.user = {name: value}; + element = angular.element(_element); + $compile(element)(scope); + scope.$digest(); + }); + }; + + it(`should throw an error if the vnValidation doesn't have the right syntax`, () => { + let html = ``; + + expect(() => { + compile(html, {}); + }).toThrow(new Error(`vnValidation: Attribute must have this syntax: [entity].[field]`)); + }); + + it('should throw an error if the window.validations are not defined', () => { + let html = ``; + + expect(() => { + compile(html, {}); + }).toThrow(new Error(`vnValidation: Entity 'User' doesn't exist`)); + }); + + // should adapt the test to whathver needs to test the user name instead of mail validation as it should be in mail-validation.js + describe('Validator Presence()', () => { + it('should not validate the user name as it is an empty string', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; + compile(html, validations, 'Spiderman'); + scope.user.name = ''; + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + }); + + it(`should not validate the name as it's format is incorrect`, () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.email = '1234?'; + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + + it(`should validate the email as it's format is correct`, () => { + let html = `
`; + let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; + compile(html, validations, 'user@verdnatura.es'); + scope.user.email = 'user@verdnatura.es'; + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); +}); diff --git a/client/core/src/directives/validation.js b/client/core/src/directives/validation.js index cd3878d9e..db34fe12b 100644 --- a/client/core/src/directives/validation.js +++ b/client/core/src/directives/validation.js @@ -51,9 +51,9 @@ export function directive(interpolate, compile, $window) { } }; - scope.$watch(function() { + scope.$watch(() => { return (form.$submitted || input.$dirty) && input.$invalid; - }, function(value) { + }, value => { let parent = element.parent(); if (value) { diff --git a/client/core/src/lib/validator.js b/client/core/src/lib/validator.js index d31fa9e36..ce6dc989b 100644 --- a/client/core/src/lib/validator.js +++ b/client/core/src/lib/validator.js @@ -1,7 +1,7 @@ import {validator} from 'vendor'; export const validators = { - presence: function(value, conf) { + presence: value => { if (validator.isEmpty(value)) throw new Error(`Value can't be empty`); }, diff --git a/services/mailer/application/auth.js b/services/mailer/application/auth.js index 7e9457537..dc84cd911 100644 --- a/services/mailer/application/auth.js +++ b/services/mailer/application/auth.js @@ -47,8 +47,7 @@ module.exports = { this.request.user = { id: token.userId, token: this.getToken() - } - + }; this.next(); }); }, diff --git a/services/mailer/application/config.js b/services/mailer/application/config.js index 1442e85ed..ab30f576b 100644 --- a/services/mailer/application/config.js +++ b/services/mailer/application/config.js @@ -15,4 +15,4 @@ try { config.proxy = require('../../nginx/config.json'); config.package = require('../package.json'); -module.exports = config; \ No newline at end of file +module.exports = config; From 12b33429533338c0084fc652deb203691522ae05 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 08:17:40 +0100 Subject: [PATCH 3/7] validation Presence() unit tests for ng-invalid class --- client/core/src/directives/specs/validation.spec.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index 3ff608a68..33fdbc6fd 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -55,10 +55,7 @@ describe('Directive validation', () => { let html = `
`; let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; compile(html, validations, 'spiderman'); - scope.user.email = '1234?'; - - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); + scope.user.name = ''; scope.$digest(); expect(element[0].classList).toContain('ng-invalid'); @@ -70,9 +67,6 @@ describe('Directive validation', () => { let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; compile(html, validations, 'user@verdnatura.es'); scope.user.email = 'user@verdnatura.es'; - - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); scope.$digest(); expect(element[0].classList).toContain('ng-valid'); From 86630be3989439dd4da305030264fec481559837 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 08:26:46 +0100 Subject: [PATCH 4/7] validation unit tests for validation > validator presence plus small refactor on validator --- client/core/src/directives/specs/validation.spec.js | 1 - client/core/src/lib/validator.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index 33fdbc6fd..1b39a862c 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -34,7 +34,6 @@ describe('Directive validation', () => { }).toThrow(new Error(`vnValidation: Entity 'User' doesn't exist`)); }); - // should adapt the test to whathver needs to test the user name instead of mail validation as it should be in mail-validation.js describe('Validator Presence()', () => { it('should not validate the user name as it is an empty string', () => { let html = `
`; diff --git a/client/core/src/lib/validator.js b/client/core/src/lib/validator.js index ce6dc989b..d25776ab3 100644 --- a/client/core/src/lib/validator.js +++ b/client/core/src/lib/validator.js @@ -5,7 +5,7 @@ export const validators = { if (validator.isEmpty(value)) throw new Error(`Value can't be empty`); }, - absence: function(value, conf) { + absence: value => { if (!validator.isEmpty(value)) throw new Error(`Value should be empty`); }, From b172f12ff6e929a8561a96cd4f3e92f5cb654a98 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 14:10:17 +0100 Subject: [PATCH 5/7] validation unit tests for absence, length and numericality --- .../src/directives/specs/validation.spec.js | 148 +++++++++++++++--- client/core/src/directives/validation.js | 2 +- client/core/src/lib/validator.js | 5 +- 3 files changed, 131 insertions(+), 24 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index 1b39a862c..5a819aced 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -26,7 +26,7 @@ describe('Directive validation', () => { }).toThrow(new Error(`vnValidation: Attribute must have this syntax: [entity].[field]`)); }); - it('should throw an error if the window.validations are not defined', () => { + it('should throw an error if the window.validations aint defined', () => { let html = ``; expect(() => { @@ -34,15 +34,12 @@ describe('Directive validation', () => { }).toThrow(new Error(`vnValidation: Entity 'User' doesn't exist`)); }); - describe('Validator Presence()', () => { + describe('Validator presence()', () => { it('should not validate the user name as it is an empty string', () => { let html = `
`; let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; compile(html, validations, 'Spiderman'); scope.user.name = ''; - - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); scope.$digest(); expect(element[0].classList).toContain('ng-invalid'); @@ -50,25 +47,134 @@ describe('Directive validation', () => { }); }); - it(`should not validate the name as it's format is incorrect`, () => { - let html = `
`; - let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; - compile(html, validations, 'spiderman'); - scope.user.name = ''; - scope.$digest(); + describe('Validator absence()', () => { + it('should not validate the entity as it should be an empty string', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'absence'}]}}}; + compile(html, validations, 'Spiderman'); + scope.$digest(); - expect(element[0].classList).toContain('ng-invalid'); - expect(element[0].classList).not.toContain('ng-valid'); + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + + it('should validate the entity as it is an empty string', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'absence'}]}}}; + compile(html, validations, ''); + scope.$digest(); + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); }); - it(`should validate the email as it's format is correct`, () => { - let html = `
`; - let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; - compile(html, validations, 'user@verdnatura.es'); - scope.user.email = 'user@verdnatura.es'; - scope.$digest(); + describe('Validator length()', () => { + it('should not validate the user name as it should have min length of 15', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'length', min: 10, max: 50, is: 15}]}}}; + compile(html, validations, 'fifteen!'); + scope.$digest(); - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + + it('should validate the user name as it has length of 15', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'length', min: 10, max: 50, is: 15}]}}}; + compile(html, validations, 'fifteen length!'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); + + it('should not validate the user name as it should have min length of 10', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'length', min: 10}]}}}; + compile(html, validations, 'shortname'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + + it('should validate the user name as its length is greater then the minimum', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'length', min: 10}]}}}; + compile(html, validations, 'verylongname'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); + + it('should not validate the user name as its length is greater then the maximum', () => { + let html = `
`; + let validations = {User: {validations: {name: [{validation: 'length', max: 10}]}}}; + compile(html, validations, 'toolongname'); + scope.$digest(); + + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); }); + + describe('Validator numericality()', () => { + it('should not validate the phone number as it should a integer', () => { + let html = `
`; + let validations = {User: {validations: {phone: [{validation: 'numericality', is: 'what is this?'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.phone = 'this is not a phone number!'; + scope.$digest(); + + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + + it('should validate the phone number as it an integer', () => { + let html = `
`; + let validations = {User: {validations: {phone: [{validation: 'numericality', is: 'what is this?'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.phone = '555555555'; + scope.$digest(); + + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); + }); + + // it(`should not validate the name as it's format is incorrect`, () => { + // let html = `
`; + // let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; + // compile(html, validations, 'spiderman'); + // scope.user.name = ''; + // scope.$digest(); + + // expect(element[0].classList).toContain('ng-invalid'); + // expect(element[0].classList).not.toContain('ng-valid'); + // }); + + // it(`should validate the email as it's format is correct`, () => { + // let html = `
`; + // let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; + // compile(html, validations, 'spiderman'); + // scope.user.email = 'user@verdnatura.es'; + // scope.$digest(); + + // expect(element[0].classList).toContain('ng-valid'); + // expect(element[0].classList).not.toContain('ng-invalid'); + // }); + + // it(`should not validate the email as it's missing the @`, () => { + // let html = `
`; + // let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; + // compile(html, validations, 'spiderman'); + // scope.user.email = 'userverdnatura.es'; + // scope.$digest(); + + // expect(element[0].classList).toContain('ng-invalid'); + // expect(element[0].classList).not.toContain('ng-valid'); + // }); }); diff --git a/client/core/src/directives/validation.js b/client/core/src/directives/validation.js index db34fe12b..10669e738 100644 --- a/client/core/src/directives/validation.js +++ b/client/core/src/directives/validation.js @@ -40,7 +40,7 @@ export function directive(interpolate, compile, $window) { let errorShown = false; input.$options.$$options.allowInvalid = true; - input.$validators.entity = function(value) { + input.$validators.entity = value => { try { validateAll(value, validations); return true; diff --git a/client/core/src/lib/validator.js b/client/core/src/lib/validator.js index d25776ab3..018d1b26e 100644 --- a/client/core/src/lib/validator.js +++ b/client/core/src/lib/validator.js @@ -9,11 +9,12 @@ export const validators = { if (!validator.isEmpty(value)) throw new Error(`Value should be empty`); }, - length: function(value, conf) { + length: (value, conf) => { let options = { min: conf.min || conf.is, max: conf.max || conf.is }; + if (!validator.isLength(value, options)) { if (conf.is) { throw new Error(`Value should be ${conf.is} characters long`); @@ -26,7 +27,7 @@ export const validators = { } } }, - numericality: function(value, conf) { + numericality: (value, conf) => { if (conf.int) { if (!validator.isInt(value)) throw new Error(`Value should be integer`); From 67d99e788e5348cf850acdccc2738ab436921bad Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 14:49:11 +0100 Subject: [PATCH 6/7] unit tests for valudation > validator inclusion, exclusion and format --- .../src/directives/specs/validation.spec.js | 60 ++++++++++--------- client/core/src/lib/validator.js | 8 +-- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index 5a819aced..f13f0024f 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -145,36 +145,42 @@ describe('Directive validation', () => { }); }); - // it(`should not validate the name as it's format is incorrect`, () => { - // let html = `
`; - // let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; - // compile(html, validations, 'spiderman'); - // scope.user.name = ''; - // scope.$digest(); + describe('Validator inclusion()', () => { + it('should not validate the phone number as it is not an integer', () => { + let html = `
`; + let validations = {User: {validations: {phone: [{validation: 'inclusion'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.phone = 'this is not a phone number!'; + scope.$digest(); - // expect(element[0].classList).toContain('ng-invalid'); - // expect(element[0].classList).not.toContain('ng-valid'); - // }); + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + }); - // it(`should validate the email as it's format is correct`, () => { - // let html = `
`; - // let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; - // compile(html, validations, 'spiderman'); - // scope.user.email = 'user@verdnatura.es'; - // scope.$digest(); + describe('Validator exclusion()', () => { + it('should validate the phone number as it is an integer', () => { + let html = `
`; + let validations = {User: {validations: {phone: [{validation: 'exclusion'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.phone = '555555555'; + scope.$digest(); - // expect(element[0].classList).toContain('ng-valid'); - // expect(element[0].classList).not.toContain('ng-invalid'); - // }); + expect(element[0].classList).toContain('ng-valid'); + expect(element[0].classList).not.toContain('ng-invalid'); + }); + }); - // it(`should not validate the email as it's missing the @`, () => { - // let html = `
`; - // let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; - // compile(html, validations, 'spiderman'); - // scope.user.email = 'userverdnatura.es'; - // scope.$digest(); + describe('Validator format()', () => { + it('should not validate the email number as it doesnt contain @', () => { + let html = `
`; + let validations = {User: {validations: {email: [{validation: 'format', with: '@'}]}}}; + compile(html, validations, 'spiderman'); + scope.user.email = 'userverdnatura.es'; + scope.$digest(); - // expect(element[0].classList).toContain('ng-invalid'); - // expect(element[0].classList).not.toContain('ng-valid'); - // }); + expect(element[0].classList).toContain('ng-invalid'); + expect(element[0].classList).not.toContain('ng-valid'); + }); + }); }); diff --git a/client/core/src/lib/validator.js b/client/core/src/lib/validator.js index 018d1b26e..c29142653 100644 --- a/client/core/src/lib/validator.js +++ b/client/core/src/lib/validator.js @@ -34,19 +34,19 @@ export const validators = { } else if (!validator.isNumeric(value)) throw new Error(`Value should be a number`); }, - inclusion: function(value, conf) { + inclusion: (value, conf) => { if (!validator.isIn(value, conf.in)) throw new Error(`Invalid value`); }, - exclusion: function(value, conf) { + exclusion: (value, conf) => { if (validator.isIn(value, conf.in)) throw new Error(`Invalid value`); }, - format: function(value, conf) { + format: (value, conf) => { if (!validator.matches(value, conf.with)) throw new Error(`Invalid value`); }, - custom: function(value, conf) { + custom: (value, conf) => { if (!conf.bindedFunction(value)) throw new Error(`Invalid value`); } From 50dd055c996ba76a27140cb7722a62f42432b038 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 14:51:39 +0100 Subject: [PATCH 7/7] removed the timeout 400 of the snackbar as it shouldnt be hardcoded --- client/core/src/lib/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/core/src/lib/app.js b/client/core/src/lib/app.js index 5851357d8..3b58309b4 100644 --- a/client/core/src/lib/app.js +++ b/client/core/src/lib/app.js @@ -12,7 +12,7 @@ export default class App { this.$rootScope = $rootScope; } show(message) { - if (this.snackbar) this.snackbar.show({message: message, timeout: 400}); + if (this.snackbar) this.snackbar.show({message: message}); } showMessage(message) { this.show(message);