diff --git a/.env.json b/.env.json new file mode 100644 index 000000000..0fa6162d9 --- /dev/null +++ b/.env.json @@ -0,0 +1,6 @@ +{ + "salixHost": "localhost", + "salixPort": "3306", + "salixUser": "root", + "salixPassword": "root" +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index d004f86bc..958de4d57 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,10 +6,14 @@ def branchTest = "test"; env.BRANCH_NAME = branchName; env.TAG = "${env.BUILD_NUMBER}"; +env.salixUser="${env.salixUser}"; +env.salixPassword="${env.salixPassword}"; switch (branchName){ case branchTest: env.NODE_ENV = "test"; + env.salixHost = "${env.testSalixHost}"; + env.salixPort = "${env.testSalixPort}"; break; case branchProduction: env.DOCKER_HOST = "tcp://172.16.255.29:2375"; @@ -20,7 +24,7 @@ switch (branchName){ node { stage ('Print environment variables'){ - echo "Branch ${branchName}, Build ${env.TAG}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" + echo "Branch ${branchName}, Build ${env.TAG}, salixHost ${env.salixHost}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" } stage ('Checkout') { checkout scm diff --git a/client/client/routes.json b/client/client/routes.json index e7824f866..c466ad7f9 100644 --- a/client/client/routes.json +++ b/client/client/routes.json @@ -30,7 +30,7 @@ }, "menu": { "description": "Basic data", - "icon": "person" + "icon": "settings" } }, { @@ -54,7 +54,7 @@ }, "menu": { "description": "Pay method", - "icon": "assignment" + "icon": "icon-payment" } }, { @@ -94,7 +94,7 @@ }, "menu": { "description": "Web access", - "icon": "language" + "icon": "cloud" } }, { @@ -186,7 +186,7 @@ "component": "vn-client-invoices", "menu": { "description": "Invoices", - "icon": "insert_drive_file" + "icon": "icon-invoices" } }, { @@ -204,7 +204,7 @@ }, "menu": { "description": "Recovery", - "icon": "credit_card" + "icon": "icon-recovery" } }, { "url": "/create", diff --git a/client/client/src/address-edit/address-edit.html b/client/client/src/address-edit/address-edit.html index 55154a996..84f00a579 100644 --- a/client/client/src/address-edit/address-edit.html +++ b/client/client/src/address-edit/address-edit.html @@ -59,9 +59,7 @@ field="observation.observationTypeFk" data="observationsTypes.model" show-field="description" - label="Observation type" - order="description ASC" - filter-search="{where: {description: {regexp: 'search'}}}"> + label="Observation type"> {{$parent.$parent.item.description}} + where="{or: [{firstName: {regexp: 'search'}}, {name: {regexp: 'search'}}]}"> - + @@ -26,7 +26,7 @@ value-field="id" select-fields="name" label="Salesperson" - filter-search="{where: {or: [{name: {regexp: 'search'}}, {name: {regexp: 'search'}}]}}"> + where="{or: [{firstName: {regexp: 'search'}}, {name: {regexp: 'search'}}]}"> diff --git a/client/client/src/create/locale/es.yml b/client/client/src/create/locale/es.yml index c20f5a8ec..e48239855 100644 --- a/client/client/src/create/locale/es.yml +++ b/client/client/src/create/locale/es.yml @@ -1,7 +1,7 @@ Name: Nombre Tax number: NIF/CIF Business name: Razón social -User name: Nombre de usuario +Web user: Usuario Web Email: Correo electrónico Create and edit: Crear y editar Create: Crear diff --git a/client/client/src/descriptor/descriptor.js b/client/client/src/descriptor/descriptor.js index 729b85fb3..b8d68c493 100644 --- a/client/client/src/descriptor/descriptor.js +++ b/client/client/src/descriptor/descriptor.js @@ -25,6 +25,7 @@ class ClientDescriptor { } } } +ClientDescriptor.$inject = ['$http']; ngModule.component('vnClientDescriptor', { template: require('./descriptor.html'), diff --git a/client/client/src/index/item-client.html b/client/client/src/index/item-client.html index 3daed725e..7ebb6b8f0 100644 --- a/client/client/src/index/item-client.html +++ b/client/client/src/index/item-client.html @@ -14,7 +14,7 @@ + icon="desktop_windows"> diff --git a/client/core/src/components/drop-down/drop-down.js b/client/core/src/components/drop-down/drop-down.js index 066e26810..482297618 100755 --- a/client/core/src/components/drop-down/drop-down.js +++ b/client/core/src/components/drop-down/drop-down.js @@ -312,7 +312,7 @@ export default class DropDown extends Component { this.ul.appendChild(fragment); this.activateOption(this._activeOption); - this.$.popover.relocate(); + this.$.$applyAsync(() => this.$.popover.relocate()); } destroyList() { diff --git a/client/core/src/components/drop-down/drop-down.spec.js b/client/core/src/components/drop-down/drop-down.spec.js index f0bd93853..0b46f9ade 100644 --- a/client/core/src/components/drop-down/drop-down.spec.js +++ b/client/core/src/components/drop-down/drop-down.spec.js @@ -30,6 +30,8 @@ describe('Component vnDropDown', () => { let popoverTemplate = require('../popover/popover.html'); let $popover = angular.element(`
${popoverTemplate}
`); $scope.popover = $componentController('vnPopover', {$element: $popover, $scope, $timeout, $transitions}); + $scope.popover.$postLink(); + $scope.model = $componentController('vnModel', {$httpBackend, $q, $filter}); controller = $componentController('vnDropDown', {$element, $scope, $transclude: null, $timeout, $httpBackend, $translate: null}); controller.$postLink(); diff --git a/client/core/src/components/index.js b/client/core/src/components/index.js index 9077ada71..774971572 100644 --- a/client/core/src/components/index.js +++ b/client/core/src/components/index.js @@ -2,8 +2,6 @@ import './textfield/textfield'; import './watcher/watcher'; import './paging/paging'; import './icon/icon'; -import './autocomplete/autocomplete'; -import './popover/popover'; import './dialog/dialog'; import './confirm/confirm'; import './title/title'; @@ -12,7 +10,10 @@ import './spinner/spinner'; import './snackbar/snackbar'; import './tooltip/tooltip'; import './icon-menu/icon-menu'; +import './popover/popover'; +import './autocomplete/autocomplete'; import './drop-down/drop-down'; +import './menu/menu'; import './column-header/column-header'; import './grid-header/grid-header'; import './multi-check/multi-check'; diff --git a/client/core/src/components/menu/menu.js b/client/core/src/components/menu/menu.js new file mode 100755 index 000000000..ce32502d9 --- /dev/null +++ b/client/core/src/components/menu/menu.js @@ -0,0 +1,24 @@ +import ngModule from '../../module'; +import Popover from '../popover/popover'; + +export default class Menu extends Popover { + $postLink() { + super.$postLink(); + this.element.addEventListener('click', + () => this.onClick()); + } + + onClick() { + this.hide(); + } +} + +ngModule.component('vnMenu', { + template: require('../popover/popover.html'), + controller: Menu, + transclude: true, + bindings: { + onOpen: '&?', + onClose: '&?' + } +}); diff --git a/client/core/src/components/popover/popover.js b/client/core/src/components/popover/popover.js index 45a25918f..4e2326c77 100644 --- a/client/core/src/components/popover/popover.js +++ b/client/core/src/components/popover/popover.js @@ -11,6 +11,10 @@ export default class Popover extends Component { this.$timeout = $timeout; this.$transitions = $transitions; this._shown = false; + } + + $postLink() { + this.$element.addClass('vn-popover'); this.docKeyDownHandler = e => this.onDocKeyDown(e); this.docFocusInHandler = e => this.onDocFocusIn(e); @@ -153,7 +157,6 @@ export default class Popover extends Component { if (event.keyCode == 27) { // Esc event.preventDefault(); this.hide(); - this.$.$applyAsync(); } } diff --git a/client/core/src/components/popover/style.scss b/client/core/src/components/popover/style.scss index f8323fb5e..458a47df9 100644 --- a/client/core/src/components/popover/style.scss +++ b/client/core/src/components/popover/style.scss @@ -1,4 +1,4 @@ -vn-popover { +.vn-popover { display: none; z-index: 10; position: fixed; diff --git a/client/core/src/components/textarea/style.scss b/client/core/src/components/textarea/style.scss new file mode 100644 index 000000000..91b29b3cf --- /dev/null +++ b/client/core/src/components/textarea/style.scss @@ -0,0 +1,6 @@ +vn-textarea { + & > .mdl-textfield { + width: initial; + display: block; + } +} \ No newline at end of file diff --git a/client/core/src/components/textarea/textarea.js b/client/core/src/components/textarea/textarea.js index 6bacdfc9f..122259ff3 100644 --- a/client/core/src/components/textarea/textarea.js +++ b/client/core/src/components/textarea/textarea.js @@ -1,5 +1,6 @@ import ngModule from '../../module'; import template from './textarea.html'; +import './style.scss'; directive.$inject = ['vnTemplate']; export function directive(vnTemplate) { diff --git a/client/core/src/styles/fontello-icons.css b/client/core/src/styles/fontello-icons.css index 4a1201de1..03698f3cf 100644 --- a/client/core/src/styles/fontello-icons.css +++ b/client/core/src/styles/fontello-icons.css @@ -1,6 +1,18 @@ -.icon-tags:before { content: '\e800'; } -.icon-tree:before { content: '\e801'; } -.icon-clone2:before { content: '\e802'; } -.icon-preview:before { content: '\e803'; } -.icon-history:before { content: '\f1da'; } \ No newline at end of file +.icon-barcode:before { content: '\e800'; } /* '' */ +.icon-volume:before { content: '\e801'; } /* '' */ +.icon-bucket:before { content: '\e802'; } /* '' */ +.icon-disabled:before { content: '\e80b'; } /* '' */ +.icon-invoices:before { content: '\e80c'; } /* '' */ +.icon-noweb:before { content: '\e812'; } /* '' */ +.icon-payment:before { content: '\e813'; } /* '' */ +.icon-recovery:before { content: '\e815'; } /* '' */ +.icon-risk:before { content: '\e816'; } /* '' */ +.icon-lines:before { content: '\e819'; } /* '' */ +.icon-volum:before { content: '\e81b'; } /* '' */ +.icon-components:before { content: '\e81c'; } /* '' */ +.icon-clone:before { content: '\e81d'; } /* '' */ +.icon-addperson:before { content: '\e81e'; } /* '' */ +.icon-bin:before { content: '\e81f'; } /* '' */ +.icon-sms:before { content: '\e820'; } /* '' */ +.icon-tags:before { content: '\e821'; } /* '' */ \ No newline at end of file diff --git a/client/core/src/styles/fontello.woff2 b/client/core/src/styles/fontello.woff2 index 22d0e459c..eea564017 100644 Binary files a/client/core/src/styles/fontello.woff2 and b/client/core/src/styles/fontello.woff2 differ diff --git a/client/item/routes.json b/client/item/routes.json index 3ae66df76..d6cb65da6 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -35,7 +35,7 @@ }, "menu": { "description": "Basic data", - "icon": "folder" + "icon": "settings" }, "acl": ["buyer"] }, @@ -48,7 +48,7 @@ }, "menu": { "description": "Tags", - "icon": "folder" + "icon": "icon-tags" }, "acl": ["buyer"] }, @@ -70,7 +70,7 @@ }, "menu": { "description": "History", - "icon": "folder" + "icon": "history" } }, { @@ -107,7 +107,7 @@ }, "menu": { "description": "Barcode", - "icon": "folder" + "icon": "icon-barcode" }, "acl": ["buyer","replenisher"] },{ diff --git a/client/item/src/create/item-create.html b/client/item/src/create/item-create.html index 50495b2d9..d537fe7f6 100644 --- a/client/item/src/create/item-create.html +++ b/client/item/src/create/item-create.html @@ -23,12 +23,9 @@ - {{$parent.$parent.item.description}} + show-field="description" + field="$ctrl.item.intrastatFk"> diff --git a/client/item/src/data/item-data.html b/client/item/src/data/item-data.html index ebf47872d..507fdc2b2 100644 --- a/client/item/src/data/item-data.html +++ b/client/item/src/data/item-data.html @@ -30,10 +30,9 @@ show-field="description" value-field="id" field="$ctrl.item.intrastatFk" - order="description ASC" - filter-search= "{where: {or: [{id: {regexp: 'search'}}, {description: {regexp: 'search'}}]}}" + where="{or: [{id: {regexp: 'search'}}, {description: {regexp: 'search'}}]}" initial-data="$ctrl.item.intrastat"> - {{$parent.$parent.item.id}} : {{$parent.$parent.item.description}} + {{id}} : {{description}} diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 0c9eb1739..30663314c 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -20,12 +20,12 @@ + icon="icon-clone"> + icon="desktop_windows"> diff --git a/client/item/src/niche/item-niche.html b/client/item/src/niche/item-niche.html index eb33f1c4b..ae30034db 100644 --- a/client/item/src/niche/item-niche.html +++ b/client/item/src/niche/item-niche.html @@ -1,7 +1,7 @@ + form="form">
@@ -9,13 +9,12 @@ diff --git a/client/item/src/tags/item-tags.html b/client/item/src/tags/item-tags.html index cfcfa736a..318a5dec7 100644 --- a/client/item/src/tags/item-tags.html +++ b/client/item/src/tags/item-tags.html @@ -14,7 +14,6 @@ data="tags.model" show-field="name" label="Tag" - order="name ASC" vn-acl="buyer"> - -
    + +
    • {{::mod.name}}
    - +
    - -
      + +
      • {{::lang}}
      - +
      vn-icon { padding-right: .3em; diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index e424708e1..7f146d30e 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -23,7 +23,7 @@ Nightmare.action('changeLanguageToEnglish', function(done) { this.then(done); } else { this.click('#lang') - .click('#langs-menu > li[name="en"]') + .click('vn-main-menu [vn-id="langs-menu"] ul > li[name="en"]') .then(done); } }); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 62e0278ac..ab30e2db7 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -150,8 +150,8 @@ export default { itemsIndex: { createItemButton: `${components.vnFloatButton}`, searchResult: `vn-item-product a`, - searchResultPreviewButton: `vn-item-product .buttons > [icon="icon-preview"]`, - searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone2"]`, + searchResultPreviewButton: `vn-item-product .buttons > [icon="desktop_windows"]`, + searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone"]`, acceptClonationAlertButton: `vn-item-list [vn-id="clone"] [response="ACCEPT"]`, searchItemInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button > button`, diff --git a/gulpfile.js b/gulpfile.js index e1b3df473..b2d6f6d3f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,6 +6,7 @@ const exec = require('child_process').exec; const PluginError = require('plugin-error'); const argv = require('minimist')(process.argv.slice(2)); const log = require('fancy-log'); +const environment = require('gulp-env'); // Configuration @@ -37,7 +38,13 @@ let defaultPort = proxyConf.defaultPort; // Development gulp.task('default', () => { - return gulp.start('services', 'client'); + return gulp.start('environment', 'services', 'client'); +}); + +gulp.task('environment', async () => { + await environment({ + file: '.env.json' + }); }); gulp.task('client', ['build-clean'], async () => { @@ -48,7 +55,7 @@ gulp.task('client', ['build-clean'], async () => { * Starts all backend services, including the nginx proxy and the database. */ gulp.task('services', async () => { - await runSequenceP('docker-start', 'services-only', 'nginx'); + await runSequenceP('environment', 'docker-start', 'services-only', 'nginx'); }); /** @@ -137,7 +144,7 @@ gulp.task('install', () => { // Deployment gulp.task('build', ['clean'], async () => { - await runSequenceP(['routes', 'locales', 'webpack', 'docker-compose', 'nginx-conf']); + await runSequenceP(['environment', 'routes', 'locales', 'webpack', 'docker-compose', 'nginx-conf']); }); gulp.task('docker-compose', async () => { @@ -154,7 +161,9 @@ gulp.task('docker-compose', async () => { // dockerFile = 'Dockerfile'; composeYml.services[service.name] = { - environment: ['NODE_ENV=${NODE_ENV}'], + environment: ['NODE_ENV=${NODE_ENV}' ,'salixHost=${salixHost}', 'salixPort=${salixPort}', + 'salixUser=${salixUser}', 'salixPassword=${salixPassword}' + ], container_name: `\${BRANCH_NAME}-${service.name}`, image: `${service.name}:\${TAG}`, build: { @@ -480,7 +489,8 @@ gulp.task('docker-wait', callback => { let conn = mysql.createConnection({ host: 'localhost', - user: 'root' + user: 'root', + password: 'root' }); conn.on('error', () => {}); conn.connect(err => { diff --git a/package.json b/package.json index 059a1bedd..7b4c19023 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "file-loader": "^1.1.6", "gulp": "^3.9.1", "gulp-concat": "^2.6.0", + "gulp-env": "^0.4.0", "gulp-extend": "^0.2.0", "gulp-install": "^1.1.0", "gulp-jasmine": "^3.0.0", diff --git a/services-test.config.js b/services-test.config.js deleted file mode 100644 index aa8866fc8..000000000 --- a/services-test.config.js +++ /dev/null @@ -1,24 +0,0 @@ -// const SpecReporter = require('jasmine-spec-reporter').SpecReporter; - -// module.exports = { -// reporter: new SpecReporter({ -// spec: { -// // displayStacktrace: 'summary', -// displaySuccessful: false, -// displayFailedSpec: true, -// displaySpecDuration: true -// } -// }), -// config: { -// spec_dir: 'services', -// spec_files: [ -// // '**/*.spec.js', -// 'auth/server/**/*.spec.js', -// 'client/common/**/*.spec.js', -// 'loopback/common/**/*.spec.js' -// ], -// helpers: [ -// '/services/utils/jasmineHelpers.js' -// ] -// } -// }; diff --git a/services/db/03-changes.sh b/services/db/03-changes.sh index 4e0d23d3a..0f714b2aa 100644 --- a/services/db/03-changes.sh +++ b/services/db/03-changes.sh @@ -2,5 +2,5 @@ for file in changes/*/*.sql; do echo "Importing $file" - mysql -u root < $file + mysql -u root -proot < $file done diff --git a/services/db/Dockerfile b/services/db/Dockerfile index 1cc2b17eb..55ca078d2 100644 --- a/services/db/Dockerfile +++ b/services/db/Dockerfile @@ -1,6 +1,6 @@ FROM mysql:5.6.37 -ENV MYSQL_ALLOW_EMPTY_PASSWORD yes +ENV MYSQL_ROOT_PASSWORD root ENV TZ GMT-1 WORKDIR /docker-entrypoint-initdb.d diff --git a/services/db/testing_fixtures.js b/services/db/testing_fixtures.js index ca525ccb1..a6e32c0d5 100644 --- a/services/db/testing_fixtures.js +++ b/services/db/testing_fixtures.js @@ -4,7 +4,7 @@ let connection = mysql.createConnection({ multipleStatements: true, host: 'localhost', user: 'root', - password: '', + password: 'root', database: 'salix' }); diff --git a/services/loopback/common/models/client.js b/services/loopback/common/models/client.js index c5e2b8404..928fe43d5 100644 --- a/services/loopback/common/models/client.js +++ b/services/loopback/common/models/client.js @@ -25,12 +25,6 @@ module.exports = function(Self) { Self.validatesUniquenessOf('socialName', { message: 'La razón social debe ser única' }); - Self.validatesFormatOf('postcode', { - message: 'El código postal solo debe contener números', - allowNull: true, - allowBlank: true, - with: /^\d+$/ - }); Self.validatesFormatOf('email', { message: 'Correo electrónico inválido', allowNull: true, diff --git a/services/loopback/common/validations/specs/validateDni.spec.js b/services/loopback/common/validations/specs/validateDni.spec.js index 432e64006..e61ab23c8 100644 --- a/services/loopback/common/validations/specs/validateDni.spec.js +++ b/services/loopback/common/validations/specs/validateDni.spec.js @@ -1,39 +1,39 @@ const validateDni = require('../validateDni'); describe('DNI validation', () => { - it('should return false for invented DNI', () => { + it('should return true for any DNI when no country is passed', () => { let isValid = validateDni('Pepinillos'); - expect(isValid).toBeFalsy(); + expect(isValid).toBeTruthy(); }); describe('Spanish', () => { it('should return true for valid spanish DNI', () => { - let isValid = validateDni('20849756A'); + let isValid = validateDni('20849756A', 'es'); expect(isValid).toBeTruthy(); }); it('should return false for spanish DNI with exceeded digits', () => { - let isValid = validateDni('208497563239A'); + let isValid = validateDni('208497563239A', 'es'); expect(isValid).toBeFalsy(); }); it('should return false for spanish DNI with invalid letter', () => { - let isValid = validateDni('20243746E'); + let isValid = validateDni('20243746E', 'es'); expect(isValid).toBeFalsy(); }); it('should return true for valid spanish CIF', () => { - let isValid = validateDni('B97367486'); + let isValid = validateDni('B97367486', 'es'); expect(isValid).toBeTruthy(); }); it('should return false for spanish CIF with invalid letter', () => { - let isValid = validateDni('A97527786'); + let isValid = validateDni('A97527786', 'es'); expect(isValid).toBeFalsy(); }); diff --git a/services/loopback/common/validations/validateDni.js b/services/loopback/common/validations/validateDni.js index 33c8760dc..b169b6100 100644 --- a/services/loopback/common/validations/validateDni.js +++ b/services/loopback/common/validations/validateDni.js @@ -1,9 +1,11 @@ module.exports = function(fi, country) { - if (fi == null) return true; - if (typeof fi != 'string') return false; + if (fi == null || country == null) + return true; + if (typeof fi != 'string' || typeof country != 'string') + return false; fi = fi.toUpperCase(); - country = country ? country.toLowerCase() : 'es'; + country = country.toLowerCase(); let len = fi.length; diff --git a/services/loopback/common/validations/validateIban.js b/services/loopback/common/validations/validateIban.js index 76fffef5e..2e8883642 100644 --- a/services/loopback/common/validations/validateIban.js +++ b/services/loopback/common/validations/validateIban.js @@ -4,7 +4,7 @@ module.exports = function(iban) { iban = iban.toUpperCase(); iban = trim(iban); - iban = iban.replace(/\s/g, ""); + iban = iban.replace(/\s/g, ''); if (iban.length != 24) { return false; @@ -33,7 +33,7 @@ module.exports = function(iban) { function module97(iban) { var parts = Math.ceil(iban.length / 7); - var remainer = ""; + var remainer = ''; for (var i = 1; i <= parts; i++) { remainer = String(parseFloat(remainer + iban.substr((i - 1) * 7, 7)) % 97); @@ -48,6 +48,6 @@ module.exports = function(iban) { } function trim(text) { - return (text || "").replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, "" ); + return (text || '').replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, ''); } }; diff --git a/services/loopback/server/datasources.json b/services/loopback/server/datasources.json index da7bcd44a..945c81966 100644 --- a/services/loopback/server/datasources.json +++ b/services/loopback/server/datasources.json @@ -1,37 +1,41 @@ { "db": { + "name": "db", "connector": "memory" }, "vn": { + "name": "mysql", "connector": "mysql", "database": "vn", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, "salix": { + "name": "mysql", "connector": "mysql", "database": "salix", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, "account": { + "name": "mysql", "connector": "mysql", "database": "account", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, @@ -39,10 +43,10 @@ "connector": "mysql", "database": "edi", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 } diff --git a/services/mailer/application/config/datasources.json b/services/mailer/application/config/datasources.json index 865c68e47..6d489ec36 100644 --- a/services/mailer/application/config/datasources.json +++ b/services/mailer/application/config/datasources.json @@ -11,7 +11,7 @@ "port": 3306, "database": "vn", "user": "root", - "password": "" + "password": "root" }, "smtp": { "host": "localhost", diff --git a/services/print/application/config/datasources.json b/services/print/application/config/datasources.json index c797136ea..0c08c7d0a 100644 --- a/services/print/application/config/datasources.json +++ b/services/print/application/config/datasources.json @@ -9,7 +9,7 @@ "port": 3306, "database": "vn", "user": "root", - "password": "" + "password": "root" }, "pdf": { "format": "A4", diff --git a/services_tests.js b/services_tests.js index fe3c907da..cbd7e7f81 100644 --- a/services_tests.js +++ b/services_tests.js @@ -13,6 +13,9 @@ if (process.argv[2] === '--v') { var Jasmine = require('jasmine'); var jasmine = new Jasmine(); var SpecReporter = require('jasmine-spec-reporter').SpecReporter; +let environment = require('gulp-env'); + +environment(".env.json"); jasmine.loadConfig({ spec_dir: 'services',