@@ -12,8 +13,7 @@
diff --git a/client/ticket/src/index/index.js b/client/ticket/src/index/index.js
index d53ec2b57..37cc9d1e7 100644
--- a/client/ticket/src/index/index.js
+++ b/client/ticket/src/index/index.js
@@ -16,10 +16,19 @@ export default class Controller {
today.setTime(today.getTime() - offset);
let tomorrow = new Date(today);
- tomorrow.setHours(23, 59, 59, 59);
+ tomorrow.setHours(23, 59, 59, 999);
tomorrow.setTime(tomorrow.getTime() - offset);
- this.filter = {myTeam: true, from: today, to: tomorrow};
+ // FIXME: History loop
+ // let filter = {myTeam: true, from: today, to: tomorrow};
+ // $state.go('.', {q: JSON.stringify(filter)});
+ }
+
+ onSearch(params) {
+ if (params)
+ this.$.model.applyFilter(null, params);
+ else
+ this.$.model.clear();
}
goToTurns() {
diff --git a/db_tests.js b/db_tests.js
index 4fb30cfe3..9581d46ff 100644
--- a/db_tests.js
+++ b/db_tests.js
@@ -4,19 +4,16 @@ process.on('warning', warning => {
console.log(warning.stack);
});
-var verbose = false;
+let verbose = false;
-if (process.argv[2] === '--v') {
+if (process.argv[2] === '--v')
verbose = true;
-}
+
servicesDir = `${__dirname}/services/db`;
-var Jasmine = require('jasmine');
-var jasmine = new Jasmine();
-var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
-let environment = require('gulp-env');
-
-environment(".env.json");
+let Jasmine = require('jasmine');
+let jasmine = new Jasmine();
+let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
let serviceSpecs = [
'db/tests/**/*[sS]pec.js'
diff --git a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
index c42788644..0a5a2b4ce 100644
--- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
+++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js
@@ -1,43 +1,41 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
-describe('Ticket', () => {
- describe('Create notes path', () => {
- const nightmare = createNightmare();
+describe('Ticket Create notes path', () => {
+ const nightmare = createNightmare();
- beforeAll(() => {
- return nightmare
- .loginAndModule('employee', 'ticket')
- .accessToSearchResult('id:1')
- .accessToSection('ticket.card.observation');
- });
+ beforeAll(() => {
+ return nightmare
+ .loginAndModule('employee', 'ticket')
+ .accessToSearchResult('id:1')
+ .accessToSection('ticket.card.observation');
+ });
- it(`should click create a new note and delete a former one`, async () => {
- let result = await nightmare
- .waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
- .waitToClick(selectors.ticketNotes.addNoteButton)
- .waitToClick(selectors.ticketNotes.firstNoteSelect)
- .waitToClick(selectors.ticketNotes.firstNoteSelectSecondOption)
- .type(selectors.ticketNotes.firstDescriptionInput, 'description')
- .click(selectors.ticketNotes.submitNotesButton)
- .waitForLastSnackbar();
+ it(`should click create a new note and delete a former one`, async () => {
+ let result = await nightmare
+ .waitToClick(selectors.ticketNotes.firstNoteRemoveButton)
+ .waitToClick(selectors.ticketNotes.addNoteButton)
+ .waitToClick(selectors.ticketNotes.firstNoteSelect)
+ .waitToClick(selectors.ticketNotes.firstNoteSelectSecondOption)
+ .type(selectors.ticketNotes.firstDescriptionInput, 'description')
+ .click(selectors.ticketNotes.submitNotesButton)
+ .waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
- });
+ expect(result).toEqual('Data saved!');
+ });
- it(`should confirm the note is the expected one`, async () => {
- let firstNoteSelect = await nightmare
- .click(selectors.ticketPackages.packagesButton)
- .wait(selectors.ticketPackages.firstPackageSelect)
- .click(selectors.ticketNotes.notesButton)
- .waitToGetProperty(selectors.ticketNotes.firstNoteSelect, 'value');
+ it(`should confirm the note is the expected one`, async () => {
+ let firstNoteSelect = await nightmare
+ .click(selectors.ticketPackages.packagesButton)
+ .wait(selectors.ticketPackages.firstPackageSelect)
+ .click(selectors.ticketNotes.notesButton)
+ .waitToGetProperty(selectors.ticketNotes.firstNoteSelect, 'value');
- expect(firstNoteSelect).toEqual('observation one');
+ expect(firstNoteSelect).toEqual('observation one');
- let firstDescription = await nightmare
- .waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value');
+ let firstDescription = await nightmare
+ .waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value');
- expect(firstDescription).toEqual('description');
- });
+ expect(firstDescription).toEqual('description');
});
});
diff --git a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js
index 77b250799..2d589ea9a 100644
--- a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js
+++ b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js
@@ -1,28 +1,26 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
-describe('Ticket', () => {
- describe('Delete expeditions path', () => {
- const nightmare = createNightmare();
+describe('Ticket Delete expeditions path', () => {
+ const nightmare = createNightmare();
- beforeAll(() => {
- return nightmare
- .loginAndModule('production', 'ticket')
- .accessToSearchResult('id:1')
- .accessToSection('ticket.card.expedition');
- });
+ beforeAll(() => {
+ return nightmare
+ .loginAndModule('production', 'ticket')
+ .accessToSearchResult('id:1')
+ .accessToSection('ticket.card.expedition');
+ });
- it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async () => {
- const result = await nightmare
- .waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
- .waitToClick(selectors.ticketExpedition.acceptDeleteRowButton)
- .click(selectors.ticketPackages.packagesButton)
- .wait(selectors.ticketPackages.firstPackageSelect)
- .click(selectors.ticketExpedition.expeditionButton)
- .wait(selectors.ticketExpedition.expeditionRow)
- .countElement(selectors.ticketExpedition.expeditionRow);
+ it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async () => {
+ const result = await nightmare
+ .waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
+ .waitToClick(selectors.ticketExpedition.acceptDeleteRowButton)
+ .click(selectors.ticketPackages.packagesButton)
+ .wait(selectors.ticketPackages.firstPackageSelect)
+ .click(selectors.ticketExpedition.expeditionButton)
+ .wait(selectors.ticketExpedition.expeditionRow)
+ .countElement(selectors.ticketExpedition.expeditionRow);
- expect(result).toEqual(3);
- });
+ expect(result).toEqual(3);
});
});
diff --git a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
index 70335a7b4..7af14fb6d 100644
--- a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
+++ b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js
@@ -1,62 +1,60 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
-describe('Ticket', () => {
- describe('Create new tracking state path', () => {
- const nightmare = createNightmare();
+describe('Ticket Create new tracking state path', () => {
+ const nightmare = createNightmare();
- beforeAll(() => {
- return nightmare
- .loginAndModule('production', 'ticket')
- .accessToSearchResult('id:1')
- .accessToSection('ticket.card.tracking.index');
- });
+ beforeAll(() => {
+ return nightmare
+ .loginAndModule('production', 'ticket')
+ .accessToSearchResult('id:1')
+ .accessToSection('ticket.card.tracking.index');
+ });
- it('should access to the create state view by clicking the create floating button', async () => {
- let url = await nightmare
- .waitToClick(selectors.ticketTracking.createStateButton)
- .wait(selectors.createStateView.stateInput)
- .parsedUrl();
+ it('should access to the create state view by clicking the create floating button', async () => {
+ let url = await nightmare
+ .waitToClick(selectors.ticketTracking.createStateButton)
+ .wait(selectors.createStateView.stateInput)
+ .parsedUrl();
- expect(url.hash).toContain('tracking/edit');
- });
+ expect(url.hash).toContain('tracking/edit');
+ });
- it(`should attempt create a new state but receive an error if state is empty`, async () => {
- let result = await nightmare
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
+ it(`should attempt create a new state but receive an error if state is empty`, async () => {
+ let result = await nightmare
+ .click(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- expect(result).toEqual('No changes to save');
- });
+ expect(result).toEqual('No changes to save');
+ });
- it(`should attempt create a new state then clear and save it`, async () => {
- let result = await nightmare
- .waitToClick(selectors.createStateView.stateInput)
- .waitToClick(selectors.createStateView.stateInputOptionOne)
- .waitToClick(selectors.createStateView.clearStateInputButton)
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
+ it(`should attempt create a new state then clear and save it`, async () => {
+ let result = await nightmare
+ .waitToClick(selectors.createStateView.stateInput)
+ .waitToClick(selectors.createStateView.stateInputOptionOne)
+ .waitToClick(selectors.createStateView.clearStateInputButton)
+ .click(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
- });
+ expect(result).toEqual('Data saved!');
+ });
- it('should again access to the create state view by clicking the create floating button', async () => {
- let url = await nightmare
- .click(selectors.ticketTracking.createStateButton)
- .wait(selectors.createStateView.stateInput)
- .parsedUrl();
+ it('should again access to the create state view by clicking the create floating button', async () => {
+ let url = await nightmare
+ .click(selectors.ticketTracking.createStateButton)
+ .wait(selectors.createStateView.stateInput)
+ .parsedUrl();
- expect(url.hash).toContain('tracking/edit');
- });
+ expect(url.hash).toContain('tracking/edit');
+ });
- it(`should create a new state`, async () => {
- let result = await nightmare
- .waitToClick(selectors.createStateView.stateInput)
- .waitToClick(selectors.createStateView.stateInputOptionOne)
- .click(selectors.createStateView.saveStateButton)
- .waitForLastSnackbar();
+ it(`should create a new state`, async () => {
+ let result = await nightmare
+ .waitToClick(selectors.createStateView.stateInput)
+ .waitToClick(selectors.createStateView.stateInputOptionOne)
+ .click(selectors.createStateView.saveStateButton)
+ .waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
- });
+ expect(result).toEqual('Data saved!');
});
});
diff --git a/karma.conf.js b/karma.conf.js
index b179de3b1..39592444d 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -1,4 +1,4 @@
-var webpackConfig = require('./webpack.config.js');
+let webpackConfig = require('./webpack.config.js');
delete webpackConfig.entry;
delete webpackConfig.output;
webpackConfig.devtool = 'inline-source-map';
@@ -10,19 +10,19 @@ webpackConfig.plugins = [];
module.exports = function(config) {
let baseConfig = {
- // base path that will be used to resolve all patterns (eg. files, exclude)
+ // base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
- // frameworks to use
- // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
- // list of files / patterns to load in the browser
+ // list of files / patterns to load in the browser
files: [
{pattern: 'client/test_index.js', watched: false}
],
- // list of files to exclude
+ // list of files to exclude
exclude: [],
webpack: webpackConfig,
@@ -35,40 +35,40 @@ module.exports = function(config) {
noInfo: true
},
- // preprocess matching files before serving them to the browser
- // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'./client/test_index.js': ['webpack', 'sourcemap']
},
- // test results reporter to use
- // possible values: 'dots', 'progress'
- // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
- // web server port
+ // web server port
port: 9876,
- // enable / disable colors in the output (reporters and logs)
+ // enable / disable colors in the output (reporters and logs)
colors: true,
- // level of logging
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
- // enable / disable watching file and executing tests whenever any file changes
+ // enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
- // start these browsers
- // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- browsers: [],
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['ChromeNoSandboxHeadless'],
- // Continuous Integration mode
- // if true, Karma captures browsers, runs the tests and exits
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
singleRun: false,
- // Concurrency level
- // how many browser should be started simultaneous
+ // Concurrency level
+ // how many browser should be started simultaneous
concurrency: Infinity,
plugins: [
@@ -100,8 +100,6 @@ module.exports = function(config) {
if (process.env.FIREFOX_BIN)
baseConfig.browsers = ['FirefoxHeadless'];
- else
- baseConfig.browsers = ['ChromeNoSandboxHeadless'];
config.set(baseConfig);
};
diff --git a/services/loopback/common/locale/en.json b/services/loopback/common/locale/en.json
index b05f755cb..e9dfdcd3a 100644
--- a/services/loopback/common/locale/en.json
+++ b/services/loopback/common/locale/en.json
@@ -20,5 +20,6 @@
"The sales of this ticket can't be modified": "The sales of this ticket can't be modified",
"Cannot check VIES and Equalization Tax": "Cannot check VIES and Equalization Tax",
"Cannot check Equalization Tax in this NIF/CIF": "Cannot check Equalization Tax in this NIF/CIF",
- "You can't create an order for a frozen client": "You can't create an order for a frozen client"
+ "You can't create an order for a frozen client": "You can't create an order for a frozen client",
+ "This address doesn't exist": "This address doesn't exist"
}
\ No newline at end of file
diff --git a/services/loopback/common/methods/vn-model/getSetValues.js b/services/loopback/common/methods/vn-model/getSetValues.js
index 8afb51f1e..74403e65c 100644
--- a/services/loopback/common/methods/vn-model/getSetValues.js
+++ b/services/loopback/common/methods/vn-model/getSetValues.js
@@ -8,10 +8,14 @@ module.exports = Self => {
let model = this.app.models[this.modelName].definition;
let properties = model.properties;
let columnName;
- let tableName;
+ let tableName = this.modelName;
+ let schema = null;
- if (model.settings && model.settings.mysql)
- tableName = model.settings.mysql.table;
+ if (model.settings && model.settings.mysql) {
+ let tableSplit = model.settings.mysql.table.split('.');
+ tableName = tableSplit.pop();
+ schema = tableSplit.pop() || null;
+ }
if (properties[column]) {
columnName = column;
@@ -27,10 +31,13 @@ module.exports = Self => {
if (findColumn)
columnName = properties[findColumn].mysql.columnName;
- let type = await this.rawSql(`
- SELECT DISTINCT column_type FROM information_schema.columns
+ let type = await this.rawSql(
+ `SELECT DISTINCT column_type FROM information_schema.columns
WHERE table_name = ?
- AND column_name = ?`, [tableName, columnName]);
+ AND table_schema = IFNULL(?, DATABASE())
+ AND column_name = ?`,
+ [tableName, schema, columnName]
+ );
if (!type) return;
diff --git a/services_tests.js b/services_tests.js
index 00b8a0a4e..9fd9ae846 100644
--- a/services_tests.js
+++ b/services_tests.js
@@ -5,19 +5,16 @@ process.on('warning', warning => {
console.log(warning.stack);
});
-var verbose = false;
+let verbose = false;
-if (process.argv[2] === '--v') {
+if (process.argv[2] === '--v')
verbose = true;
-}
+
servicesDir = `${__dirname}/services`;
-var Jasmine = require('jasmine');
-var jasmine = new Jasmine();
-var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
-let environment = require('gulp-env');
-
-environment(".env.json");
+let Jasmine = require('jasmine');
+let jasmine = new Jasmine();
+let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
let serviceList = fs.readdirSync(servicesDir);
let serviceSpecs = [