Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2503-backend_unit_jest

This commit is contained in:
Carlos Jimenez Ruiz 2020-11-24 11:41:54 +01:00
commit 2e623eb100
146 changed files with 1633 additions and 410 deletions

2
Jenkinsfile vendored
View File

@ -65,7 +65,7 @@ pipeline {
stage('Frontend') {
steps {
nodejs('node-lts') {
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=1'
sh 'jest --ci --reporters=default --reporters=jest-junit --maxWorkers=2'
}
}
}

View File

@ -20,6 +20,9 @@
"Container": {
"dataSource": "storage"
},
"Continent": {
"dataSource": "vn"
},
"Collection": {
"dataSource": "vn"
},
@ -76,12 +79,6 @@
},
"UserLog": {
"dataSource": "vn"
},
"WorkerTimeControlParams": {
"dataSource": "vn"
},
"WorkerTimeControlMail": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,27 @@
{
"name": "Continent",
"base": "VnModel",
"options": {
"mysql": {
"table": "continent"
}
},
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"code": {
"id": true,
"type": "string"
}
},
"acls": [{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}]
}

View File

@ -1,3 +0,0 @@
module.exports = Self => {
require('../methods/imap-time-control/checkInbox')(Self);
};

View File

@ -0,0 +1,20 @@
CREATE TABLE `vn`.continent
(
id TINYINT(4) AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
code VARCHAR(2) NOT NULL COLLATE utf8_general_ci,
CONSTRAINT continent_pk
PRIMARY KEY (id)
)
COMMENT 'World continents';
CREATE UNIQUE INDEX continent_name_uindex
ON `vn`.continent (name);
INSERT IGNORE INTO `vn`.continent (`name`, `code`)
VALUES
('Asia', 'AS'),
('América', 'AM'),
('África', 'AF'),
('Europa', 'EU'),
('Oceanía', 'OC');

View File

@ -0,0 +1,13 @@
ALTER TABLE `vn`.`country`
ADD COLUMN `continentFk` TINYINT(4) NULL AFTER `ibanLength`,
ADD INDEX `continent_id_fk_idx` (`continentFk` ASC);
ALTER TABLE `vn`.`country`
ADD CONSTRAINT `continent_id_fk`
FOREIGN KEY (`continentFk`)
REFERENCES `vn`.`continent` (`id`)
ON DELETE NO ACTION
ON UPDATE CASCADE;
UPDATE `vn`.`country` SET `continentFk` = '2' WHERE (`id` = '11');
UPDATE `vn`.`country` SET `continentFk` = '2' WHERE (`id` = '13');

View File

@ -3,3 +3,4 @@ host = localhost
port = 3306
user = root
password = root
default-character-set=utf8

View File

@ -92,17 +92,17 @@ INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossF
(109, 'HLK', 'Bruce' , 'Banner', 109, 19, 432978109),
(110, 'JJJ', 'Jessica' , 'Jones' , 110, 19, 432978110);
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`)
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`)
VALUES
(1, 'España', 1, 'ES', 1, 24),
(2, 'Italia', 1, 'IT', 1, 27),
(3, 'Alemania', 1, 'DE', 1, 22),
(4, 'Rumania', 1, 'RO', 1, 24),
(5, 'Holanda', 1, 'NL', 1, 18),
(8, 'Portugal', 1, 'PT', 1, 27),
(13,'Ecuador', 0, 'EC', 1, 24),
(19,'Francia', 1, 'FR', 1, 27),
(30,'Canarias', 1, 'IC', 1, 24);
(1, 'España', 1, 'ES', 1, 24, 4),
(2, 'Italia', 1, 'IT', 1, 27, 4),
(3, 'Alemania', 1, 'DE', 1, 22, 4),
(4, 'Rumania', 1, 'RO', 1, 24, 4),
(5, 'Holanda', 1, 'NL', 1, 18, 4),
(8, 'Portugal', 1, 'PT', 1, 27, 4),
(13,'Ecuador', 0, 'EC', 1, 24, 2),
(19,'Francia', 1, 'FR', 1, 27, 4),
(30,'Canarias', 1, 'IC', 1, 24, 4);
INSERT INTO `hedera`.`language` (`code`, `name`, `orgName`, `isActive`)
VALUES
@ -118,13 +118,13 @@ INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
(1, 'Main Warehouse'),
(2, 'Silla');
INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`)
INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`)
VALUES
(1, 'Warehouse One', 1, 1, 1, 1, 1, 1, 1, 2),
(2, 'Warehouse Two', 1, 1, 1, 1, 0, 0, 1, 2),
(3, 'Warehouse Three', 1, 1, 1, 1, 0, 0, 0, 2),
(4, 'Warehouse Four', 1, 1, 1, 1, 0, 0, 0, 2),
(5, 'Warehouse Five', 1, 1, 1, 1, 0, 0, 0, 2);
(1, 'Warehouse One', 1, 1, 1, 1, 1, 1, 1, 2, 1),
(2, 'Warehouse Two', 1, 1, 1, 1, 0, 0, 1, 2, 13),
(3, 'Warehouse Three', 1, 1, 1, 1, 0, 0, 0, 2, 1),
(4, 'Warehouse Four', 1, 1, 1, 1, 0, 0, 0, 2, 1),
(5, 'Warehouse Five', 1, 1, 1, 1, 0, 0, 0, 2, 1);
INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPreparedByPacking`, `code`, `pickingPlacement`, `path`)
VALUES
@ -1250,11 +1250,11 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(1, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1),
(2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150, 2000, 'second travel', 2, 2),
(3, CURDATE(), CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1),
(4, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 50.00, 500, 'fourth travel', 0, 2),
(5, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 2, 1, 50.00, 500, 'fifth travel', 1, 1),
(6, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4, 2, 1, 50.00, 500, 'sixth travel', 1, 2),
(7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 2, 1),
(8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'eight travel', 1, 2);
(4, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2),
(5, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1),
(6, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2),
(7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
(8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`)
VALUES

View File

@ -155,7 +155,7 @@ let actions = {
document.querySelector(selector).scrollIntoViewIfNeeded();
}, selector);
await this.waitToClick(selector);
await this.wait('vn-left-menu .expanded');
await this.waitForSelector('vn-left-menu .expanded');
}
await this.evaluate(state => {
@ -168,14 +168,14 @@ let actions = {
},
reloadSection: async function(state) {
await this.click('vn-icon[icon="desktop_windows"]');
await this.click('vn-icon[icon="preview"]');
await this.accessToSection(state);
},
forceReloadSection: async function(sectionRoute) {
await this.waitToClick('vn-icon[icon="desktop_windows"]');
await this.waitToClick('vn-icon[icon="preview"]');
await this.waitToClick('button[response="accept"]');
await this.wait('vn-card.summary');
await this.waitForSelector('vn-card.summary');
await this.waitToClick(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`);
},
@ -190,7 +190,7 @@ let actions = {
accessToSearchResult: async function(searchValue) {
await this.doSearch(searchValue);
await this.waitFor('.vn-descriptor');
await this.waitForSelector('.vn-descriptor');
},
getProperty: async function(selector, property) {
@ -267,12 +267,13 @@ let actions = {
writeOnEditableTD: async function(selector, text) {
let builtSelector = await this.selectorFormater(selector);
await this.waitToClick(selector);
await this.waitForSelector(builtSelector, {visible: true});
await this.type(builtSelector, text);
await this.keyboard.press('Enter');
},
focusElement: async function(selector) {
await this.wait(selector);
await this.waitForSelector(selector);
return await this.evaluate(selector => {
let element = document.querySelector(selector);
element.focus();
@ -285,8 +286,8 @@ let actions = {
},
waitImgLoad: async function(selector) {
await this.wait(selector);
return await this.wait(selector => {
await this.waitForSelector(selector);
return await this.waitForFunction(selector => {
const imageReady = document.querySelector(selector).complete;
return imageReady;
}, {}, selector);
@ -305,16 +306,16 @@ let actions = {
},
waitForClassNotPresent: async function(selector, className) {
await this.wait(selector);
return await this.wait((selector, className) => {
await this.waitForSelector(selector);
return await this.waitForFunction((selector, className) => {
if (!document.querySelector(selector).classList.contains(className))
return true;
}, {}, selector, className);
},
waitForClassPresent: async function(selector, className) {
await this.wait(selector);
return await this.wait((elementSelector, targetClass) => {
await this.waitForSelector(selector);
return await this.waitForFunction((elementSelector, targetClass) => {
if (document.querySelector(elementSelector).classList.contains(targetClass))
return true;
}, {}, selector, className);
@ -387,7 +388,7 @@ let actions = {
},
waitForEmptyInnerText: async function(selector) {
return await this.wait(selector => {
return await this.waitFunction(selector => {
return document.querySelector(selector).innerText == '';
}, selector);
},
@ -395,7 +396,7 @@ let actions = {
hideSnackbar: async function() {
// Holds up for the snackbar to be visible for a small period of time.
if (process.env.E2E_DEBUG)
await this.waitFor(300);
await this.waitForTimeout(300);
await this.evaluate(() => {
let hideButton = document
@ -403,7 +404,7 @@ let actions = {
if (hideButton)
return hideButton.click();
});
await this.waitFor('vn-snackbar .shape.shown', {hidden: true});
await this.waitForSelector('vn-snackbar .shape.shown', {hidden: true});
},
waitForSnackbar: async function() {
@ -438,7 +439,7 @@ let actions = {
const localDate = (new Date(date.getTime() - timeZoneOffset))
.toISOString().substr(0, 10);
await this.wait(selector);
await this.waitForSelector(selector);
await this.evaluate((selector, localDate) => {
let input = document.querySelector(selector).$ctrl.input;
input.value = localDate;
@ -447,7 +448,7 @@ let actions = {
},
pickTime: async function(selector, time) {
await this.wait(selector);
await this.waitForSelector(selector);
await this.evaluate((selector, time) => {
let input = document.querySelector(selector).$ctrl.input;
input.value = time;
@ -510,11 +511,11 @@ let actions = {
.includes(searchValue.toLowerCase());
}, {}, builtSelector, searchValue);
await this.waitFor('.vn-drop-down', {hidden: true});
await this.waitForSelector('.vn-drop-down', {hidden: true});
},
checkboxState: async function(selector) {
await this.wait(selector);
await this.waitForSelector(selector);
return await this.evaluate(selector => {
let checkbox = document.querySelector(selector);
switch (checkbox.$ctrl.field) {
@ -537,7 +538,7 @@ let actions = {
},
waitForStylePresent: async function(selector, property, value) {
return await this.wait((selector, property, value) => {
return await this.waitForFunction((selector, property, value) => {
const element = document.querySelector(selector);
return element.style[property] == value;
}, {}, selector, property, value);
@ -548,8 +549,8 @@ let actions = {
},
waitForWatcherData: async function(selector) {
await this.wait(selector);
await this.wait(selector => {
await this.waitForSelector(selector);
await this.waitForFunction(selector => {
let watcher = document.querySelector(selector);
let orgData = watcher.$ctrl.orgData;
return !angular.equals({}, orgData) && orgData != null;
@ -596,7 +597,7 @@ let actions = {
closePopup: async function() {
await Promise.all([
this.keyboard.press('Escape'),
this.waitFor('.vn-popup', {hidden: true}),
this.waitForSelector('.vn-popup', {hidden: true}),
]);
},

View File

@ -211,7 +211,7 @@ export default {
newClassificationStartingDate: 'vn-client-credit-insurance-create vn-date-picker[ng-model="$ctrl.creditClassification.started"]',
newInsuranceStartingDate: 'vn-client-credit-insurance-insurance-create vn-date-picker[ng-model="$ctrl.insurance.created"]',
endCurrentContract: 'vn-client-credit-insurance-index vn-icon-button[icon="lock"]',
firstContratViewCreditButton: 'vn-client-credit-insurance-index vn-card > vn-horizontal:nth-child(1) vn-icon-button[icon="desktop_windows"]',
firstContratViewCreditButton: 'vn-client-credit-insurance-index vn-card > vn-horizontal:nth-child(1) vn-icon-button[icon="preview"]',
addNewCredit: 'vn-client-credit-insurance-insurance-index vn-float-button vn-icon[icon="add"]',
saveNewContract: 'vn-client-credit-insurance-create vn-submit',
saveNewInsuranceCredit: 'vn-client-credit-insurance-insurance-create button[type="submit"]',
@ -228,7 +228,7 @@ export default {
createItemButton: `vn-float-button`,
firstSearchResult: 'vn-item-index a:nth-child(1)',
searchResult: 'vn-item-index a.vn-tr',
firstResultPreviewButton: 'vn-item-index vn-tbody > :nth-child(1) .buttons > [icon="desktop_windows"]',
firstResultPreviewButton: 'vn-item-index vn-tbody > :nth-child(1) .buttons > [icon="preview"]',
searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]',
acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]',
closeItemSummaryPreview: '.vn-popup.shown',
@ -823,6 +823,10 @@ export default {
anySearchResult: 'vn-travel-index vn-tbody > a',
firstSearchResult: 'vn-travel-index vn-tbody > a:nth-child(1)'
},
travelExtraCommunity: {
firstTravelReference: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr > vn-td-editable',
removeContinentFilter: 'vn-searchbar > form > vn-textfield > div.container > div.prepend > prepend > div > span:nth-child(3) > vn-icon > i'
},
travelBasicDada: {
reference: 'vn-travel-basic-data vn-textfield[ng-model="$ctrl.travel.ref"]',
agency: 'vn-travel-basic-data vn-autocomplete[ng-model="$ctrl.travel.agencyModeFk"]',

View File

@ -45,7 +45,7 @@ describe('Login path', async() => {
describe('Successful login', async() => {
it('should log in and go to home state', async() => {
await page.doLogin('employee');
await page.waitFor('vn-home');
await page.waitForSelector('vn-home');
const state = await page.getState();
expect(state).toBe('home');
@ -58,7 +58,7 @@ describe('Login path', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitToClick(selectors.globalItems.logoutButton);
await page.waitFor('vn-login');
await page.waitForSelector('vn-login');
const state = await page.getState();
expect(state).toBe('login');

View File

@ -124,9 +124,9 @@ describe('Client create path', () => {
it('should click on the Clients button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton);
await page.waitForSelector(selectors.clientsIndex.createClientButton);
await page.waitForState('client.index');
});

View File

@ -18,7 +18,7 @@ describe('Client Edit basicData path', () => {
describe('as employee', () => {
it('should not be able to change the salesPerson', async() => {
await page.wait(selectors.clientBasicData.name);
await page.waitForSelector(selectors.clientBasicData.name);
const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, `${selectors.clientBasicData.salesPerson} input`);

View File

@ -40,7 +40,7 @@ describe('Client Edit fiscalData path', () => {
});
it('should not be able to edit the verified data checkbox', async() => {
await page.wait(selectors.clientFiscalData.verifiedDataCheckbox);
await page.waitForSelector(selectors.clientFiscalData.verifiedDataCheckbox);
const result = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
expect(result).toBeTruthy();
@ -55,7 +55,7 @@ describe('Client Edit fiscalData path', () => {
});
it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => {
await page.wait(selectors.clientFiscalData.socialName);
await page.waitForSelector(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialName, 'SMASH');
await page.clearInput(selectors.clientFiscalData.fiscalId);
@ -159,7 +159,7 @@ describe('Client Edit fiscalData path', () => {
});
it('should propagate the Equalization tax changes', async() => {
await page.waitFor(1000);
await page.waitForTimeout(1000);
await page.waitToClick(selectors.globalItems.acceptButton);
const message = await page.waitForSnackbar();

View File

@ -17,7 +17,7 @@ describe('Client Add address path', () => {
});
it(`should click on the add new address button to access to the new address form`, async() => {
await page.waitFor(500);
await page.waitForTimeout(500);
await page.waitToClick(selectors.clientAddresses.createAddress);
await page.waitForState('client.card.address.create');
});
@ -81,7 +81,7 @@ describe('Client Add address path', () => {
});
it(`should confirm the new address exists and it's the default one`, async() => {
await page.waitFor(2000); // needs more than a single second to load the section
await page.waitForTimeout(2000); // needs more than a single second to load the section
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
expect(result).toContain('320 Park Avenue New York');

View File

@ -26,7 +26,7 @@ describe('Client Add notes path', () => {
});
it(`should create a note`, async() => {
await page.waitFor(selectors.clientNotes.note);
await page.waitForSelector(selectors.clientNotes.note);
await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
await page.waitToClick(selectors.clientNotes.saveButton);
const message = await page.waitForSnackbar();

View File

@ -18,15 +18,15 @@ describe('Client lock verified data path', () => {
describe('as salesPerson', () => {
it('should confirm verified data button is disabled for salesPerson', async() => {
await page.wait(200);
await page.wait(selectors.clientFiscalData.verifiedDataCheckbox);
await page.waitForTimeout(200);
await page.waitForSelector(selectors.clientFiscalData.verifiedDataCheckbox);
const result = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
expect(result).toBeTruthy();
});
it('should edit the social name', async() => {
await page.wait(selectors.clientFiscalData.socialName);
await page.waitForSelector(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialName, 'Captain America Civil War');
await page.waitToClick(selectors.clientFiscalData.saveButton);
@ -75,7 +75,7 @@ describe('Client lock verified data path', () => {
});
it('should again edit the social name', async() => {
await page.wait(selectors.clientFiscalData.socialName);
await page.waitForSelector(selectors.clientFiscalData.socialName);
await page.clearInput(selectors.clientFiscalData.socialName);
await page.write(selectors.clientFiscalData.socialName, 'Ant man and the Wasp');
await page.waitToClick(selectors.clientFiscalData.saveButton);
@ -161,7 +161,7 @@ describe('Client lock verified data path', () => {
});
it('should confirm the form is enabled for salesPerson', async() => {
await page.wait(selectors.clientFiscalData.socialName);
await page.waitForSelector(selectors.clientFiscalData.socialName);
const result = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div');

View File

@ -113,9 +113,9 @@ describe('Client balance path', () => {
it('should now click on the Clients button of the top bar menu', async() => {
await page.login('employee');
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton);
await page.waitForSelector(selectors.clientsIndex.createClientButton);
await page.waitForState('client.index');
});
@ -125,6 +125,6 @@ describe('Client balance path', () => {
});
it('should not be able to click the new payment button as it isnt present', async() => {
await page.waitFor(selectors.clientBalance.newPaymentButton, {hidden: true});
await page.waitForSelector(selectors.clientBalance.newPaymentButton, {hidden: true});
});
});

View File

@ -52,7 +52,7 @@ describe('User config', () => {
it('should open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitFor(1000);
await page.waitForTimeout(1000);
let expectedLocalWarehouse = await page
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');

View File

@ -18,7 +18,7 @@ describe('Client web Payment', () => {
describe('as employee', () => {
it('should not be able to confirm payments', async() => {
await page.waitFor(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
await page.waitForSelector(selectors.webPayment.confirmFirstPaymentButton, {hidden: true});
});
});
@ -31,7 +31,7 @@ describe('Client web Payment', () => {
it('should be able to confirm payments', async() => {
await page.waitToClick(selectors.webPayment.confirmFirstPaymentButton);
await page.waitFor(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
await page.waitForSelector(selectors.webPayment.firstPaymentConfirmed, {hidden: true});
});
});
});

View File

@ -28,7 +28,7 @@ describe('Client contacts', () => {
});
it('should delete de contact', async() => {
await page.waitFor(3000);
await page.waitForTimeout(3000);
await page.waitToClick(selectors.clientContacts.deleteFirstPhone);
await page.waitToClick(selectors.clientContacts.saveButton);
const message = await page.waitForSnackbar();

View File

@ -26,33 +26,33 @@ describe('Worker calendar path', () => {
it('should set two days as holidays on the calendar and check the total holidays increased by 1.5', async() => {
await page.waitToClick(selectors.workerCalendar.holidays);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.absence);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.marchTwentyThird);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.halfHoliday);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayFourth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.furlough);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayTwelfth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayThirteenth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayFourteenth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.halfFurlough);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayEighth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
@ -68,33 +68,33 @@ describe('Worker calendar path', () => {
});
it('should undo what was done here', async() => {
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.holidays);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.absence);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.marchTwentyThird);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.halfHoliday);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayFourth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.furlough);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayTwelfth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayThirteenth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayFourteenth);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.halfFurlough);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.mayEighth);
});
@ -113,9 +113,9 @@ describe('Worker calendar path', () => {
});
it('should make a futile attempt to add holidays', async() => {
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.holidays);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
await page.waitToClick(selectors.workerCalendar.januaryThirtyFirst);
});
@ -131,7 +131,7 @@ describe('Worker calendar path', () => {
await page.autocompleteSearch(selectors.workerCalendar.year, lastYear);
await page.waitFor(reasonableTimeBetweenClicks);
await page.waitForTimeout(reasonableTimeBetweenClicks);
const result = await page.waitToGetProperty(selectors.workerCalendar.totalHolidaysUsed, 'innerText');
expect(result).toContain(' 0 ');

View File

@ -46,7 +46,7 @@ describe('Item Edit basic data path', () => {
await page.write(selectors.itemBasicData.newIntrastatId, '588420239');
await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers');
await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton); // this popover obscures the rest of the form for aprox 2 seconds
await page.waitFor(2000);
await page.waitForTimeout(2000);
await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');

View File

@ -31,7 +31,7 @@ describe('Item create tags path', () => {
it(`should confirm the fourth row data is the expected one`, async() => {
await page.reloadSection('item.card.tags');
await page.wait('vn-item-tags');
await page.waitForSelector('vn-item-tags');
let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
expect(result).toEqual('Ancho de la base');

View File

@ -77,7 +77,7 @@ describe('Item Create/Clone path', () => {
xdescribe('clone', () => {
it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
await page.waitForSelector(selectors.itemsIndex.createItemButton);
await page.waitForState('item.index');
});

View File

@ -56,7 +56,7 @@ describe('Item regularize path', () => {
it('should click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await Promise.all([
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton)
@ -96,7 +96,7 @@ describe('Item regularize path', () => {
it('should now click on the Items button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.itemsButton);
await page.waitForState('item.index');
});
@ -119,7 +119,7 @@ describe('Item regularize path', () => {
it('should again click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await Promise.all([
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton)

View File

@ -43,7 +43,7 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
await page.waitToClick(selectors.globalItems.searchButton);
await page.wait(selectors.itemsIndex.searchResult);
await page.waitForSelector(selectors.itemsIndex.searchResult);
await page.waitImgLoad(selectors.itemsIndex.firstItemImage);
const imageVisible = await page.isVisible(selectors.itemsIndex.firstItemImageTd);
@ -55,7 +55,7 @@ describe('Item index path', () => {
});
it('should mark all unchecked boxes to leave the index as it was', async() => {
await page.waitFor(500); // otherwise the snackbar doesnt appear some times.
await page.waitForTimeout(500); // otherwise the snackbar doesnt appear some times.
await page.waitToClick(selectors.itemsIndex.fieldsToShowButton);
await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
@ -77,7 +77,7 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
await page.waitToClick(selectors.globalItems.searchButton);
await page.wait(selectors.itemsIndex.searchResult);
await page.waitForSelector(selectors.itemsIndex.searchResult);
const idVisible = await page.isVisible(selectors.itemsIndex.firstItemId);
expect(idVisible).toBeTruthy();

View File

@ -39,7 +39,7 @@ describe('Item log path', () => {
it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
await page.waitForSelector(selectors.itemsIndex.createItemButton);
await page.waitForState('item.index');
});
@ -49,7 +49,7 @@ describe('Item log path', () => {
});
it(`should confirm the log is showing 5 entries`, async() => {
await page.wait(selectors.itemLog.anyLineCreated);
await page.waitForSelector(selectors.itemLog.anyLineCreated);
const anyLineCreatedCount = await page.countElement(selectors.itemLog.anyLineCreated);
expect(anyLineCreatedCount).toEqual(5);

View File

@ -17,7 +17,7 @@ describe('Item descriptor path', () => {
});
it('should check the descriptor inactive icon is dark as the item is active', async() => {
await page.wait(selectors.itemDescriptor.inactiveIcon);
await page.waitForSelector(selectors.itemDescriptor.inactiveIcon);
await page.waitForClassNotPresent(selectors.itemDescriptor.inactiveIcon, 'bright');
const darkIcon = await page.isVisible(selectors.itemDescriptor.inactiveIcon);

View File

@ -24,7 +24,7 @@ describe('Ticket Edit sale path', () => {
it('should navigate to the tickets index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
@ -128,7 +128,7 @@ describe('Ticket Edit sale path', () => {
it('should return to ticket sales section', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
@ -143,9 +143,9 @@ describe('Ticket Edit sale path', () => {
});
it('should remove 1 from the first sale quantity', async() => {
await page.waitFor(500);
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell);
await page.waitFor(selectors.ticketSales.firstSaleQuantity);
await page.waitForSelector(selectors.ticketSales.firstSaleQuantity);
await page.type(selectors.ticketSales.firstSaleQuantity, '9\u000d');
const message = await page.waitForSnackbar();
@ -154,7 +154,7 @@ describe('Ticket Edit sale path', () => {
it('should update the price', async() => {
await page.waitToClick(selectors.ticketSales.firstSalePrice);
await page.waitFor(selectors.ticketSales.firstSalePriceInput);
await page.waitForSelector(selectors.ticketSales.firstSalePriceInput);
await page.type(selectors.ticketSales.firstSalePriceInput, '5\u000d');
const message = await page.waitForSnackbar();
@ -175,7 +175,7 @@ describe('Ticket Edit sale path', () => {
it('should update the discount', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleDiscount);
await page.waitFor(selectors.ticketSales.firstSaleDiscountInput);
await page.waitForSelector(selectors.ticketSales.firstSaleDiscountInput);
await page.type(selectors.ticketSales.firstSaleDiscountInput, '50\u000d');
const message = await page.waitForSnackbar();
@ -205,7 +205,7 @@ describe('Ticket Edit sale path', () => {
it('should click on the Claims button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.claimsButton);
await page.waitForState('claim.index');
});
@ -217,7 +217,7 @@ describe('Ticket Edit sale path', () => {
it('should click the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
@ -225,16 +225,16 @@ describe('Ticket Edit sale path', () => {
it('should search for a ticket then access to the sales section', async() => {
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
await page.wait(2000);
await page.waitForTimeout(2000);
});
it('should select the third sale and delete it', async() => {
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.wait(2000);
await page.waitForTimeout(2000);
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.wait(2000);
await page.waitForTimeout(2000);
await page.waitToClick(selectors.globalItems.acceptButton);
await page.wait(2000);
await page.waitForTimeout(2000);
await page.waitForSpinnerLoad();
const message = await page.waitForSnackbar();
@ -260,7 +260,7 @@ describe('Ticket Edit sale path', () => {
});
it('should confirm the transfered line is the correct one', async() => {
await page.wait(selectors.ticketSales.secondSaleText);
await page.waitForSelector(selectors.ticketSales.secondSaleText);
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleText, 'innerText');
expect(result).toContain(`Melee weapon heavy shield`);
@ -279,7 +279,7 @@ describe('Ticket Edit sale path', () => {
});
it(`should confirm the original ticket has still three lines`, async() => {
await page.wait(selectors.ticketSales.saleLine);
await page.waitForSelector(selectors.ticketSales.saleLine);
const result = await page.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(3);

View File

@ -48,13 +48,13 @@ describe('Ticket Create new tracking state path', () => {
});
it('should now access to the create state view by clicking the create floating button', async() => {
await page.waitFor('.vn-popup', {hidden: true});
await page.waitForSelector('.vn-popup', {hidden: true});
await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForState('ticket.card.tracking.edit');
});
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
await page.waitFor(1500);
await page.waitForTimeout(1500);
await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar();

View File

@ -34,7 +34,7 @@ describe('Ticket Edit basic data path', () => {
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
await page.waitForSpinnerLoad();
await page.wait(selectors.ticketBasicData.zone);
await page.waitForSelector(selectors.ticketBasicData.zone);
const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, `${selectors.ticketBasicData.zone} input`);
@ -51,7 +51,7 @@ describe('Ticket Edit basic data path', () => {
it(`should edit the ticket agency then check there are no zones for it`, async() => {
await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery');
await page.waitFor(1000);
await page.waitForTimeout(1000);
let emptyZone = await page
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');

View File

@ -38,7 +38,7 @@ describe('Ticket descriptor path', () => {
it('should again click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
@ -52,7 +52,7 @@ describe('Ticket descriptor path', () => {
it('should click on the Tickets button of the top bar menu once more', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
@ -73,7 +73,7 @@ describe('Ticket descriptor path', () => {
it('should click on the Tickets button of the top bar menu once again', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});

View File

@ -18,7 +18,7 @@ describe('Ticket purchase request path', () => {
});
it('should add a new request', async() => {
await page.waitFor(500);
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketRequests.addRequestButton);
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
await page.write(selectors.ticketRequests.quantity, '9');
@ -72,7 +72,7 @@ describe('Ticket purchase request path', () => {
it('should check the request was deleted', async() => {
await page.reloadSection('ticket.card.request.index');
await page.wait(selectors.ticketRequests.addRequestButton);
await page.waitForSelector(selectors.ticketRequests.addRequestButton);
await page.waitForSelector(selectors.ticketRequests.thirdDescription, {hidden: true});
});
});

View File

@ -92,7 +92,7 @@ describe('Ticket descriptor path', () => {
});
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddStowaway);
await page.wait(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
await page.waitForSelector(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
const isVisible = await page.isVisible(selectors.ticketDescriptor.addStowawayDialogFirstTicket);
expect(isVisible).toBeTruthy();

View File

@ -22,7 +22,7 @@ describe('Ticket services path', () => {
it('should find the add descripton button disabled for this user role', async() => {
await page.waitForClassPresent(selectors.ticketService.firstAddServiceTypeButton, 'disabled');
await page.waitToClick(selectors.ticketService.addServiceButton);
await page.wait(selectors.ticketService.firstAddServiceTypeButton);
await page.waitForSelector(selectors.ticketService.firstAddServiceTypeButton);
const result = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton);
expect(result).toBe(true);
@ -63,7 +63,7 @@ describe('Ticket services path', () => {
it('should click on the add new service type to open the dialog', async() => {
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
await page.wait('.vn-dialog.shown');
await page.waitForSelector('.vn-dialog.shown');
const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
expect(result).toBeTruthy();

View File

@ -42,7 +42,7 @@ describe('Ticket create path', () => {
it('should again open the new ticket form', async() => {
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
await page.waitFor(500);
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
await page.waitForState('ticket.create');
});

View File

@ -45,7 +45,7 @@ describe('Claim edit basic data path', () => {
it('should confirm the claim state was edited', async() => {
await page.reloadSection('claim.card.basicData');
await page.wait(selectors.claimBasicData.claimState);
await page.waitForSelector(selectors.claimBasicData.claimState);
const result = await page.waitToGetProperty(selectors.claimBasicData.claimState, 'value');
expect(result).toEqual('Gestionado');

View File

@ -106,7 +106,7 @@ xdescribe('Claim detail', () => {
it('should navigate back to claim.detail to confirm the claim contains now two items', async() => {
await page.accessToSection('claim.card.detail');
await page.wait(selectors.claimDetail.claimDetailLine);
await page.waitForSelector(selectors.claimDetail.claimDetailLine);
const result = await page.countElement(selectors.claimDetail.claimDetailLine);
expect(result).toEqual(2);

View File

@ -27,7 +27,7 @@ describe('Claim action path', () => {
it('should import the second importable ticket', async() => {
// the animation adding the header element for the claimed total
// obscures somehow other elements for about 2 seconds
await page.waitFor(3000);
await page.waitForTimeout(3000);
await page.waitToClick(selectors.claimAction.importTicketButton);
await page.waitToClick(selectors.claimAction.secondImportableTicket);

View File

@ -8,7 +8,7 @@ describe('Order summary path', () => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'order');
await page.waitFor(2000);
await page.waitForTimeout(2000);
await page.accessToSearchResult('16');
});

View File

@ -17,7 +17,7 @@ describe('Route create path', () => {
describe('as employee', () => {
it('should click on the add new route button and open the creation form', async() => {
await page.waitFor(500);
await page.waitForTimeout(500);
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
await page.waitForState('route.create');
});

View File

@ -26,9 +26,9 @@ describe('InvoiceOut descriptor path', () => {
it('should navigate to the invoiceOut index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
await page.wait(selectors.invoiceOutIndex.topbarSearch);
await page.waitForSelector(selectors.invoiceOutIndex.topbarSearch);
await page.waitForState('invoiceOut.index');
});
@ -59,7 +59,7 @@ describe('InvoiceOut descriptor path', () => {
it('should navigate to the ticket index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
@ -73,7 +73,7 @@ describe('InvoiceOut descriptor path', () => {
it('should now navigate to the invoiceOut index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
await page.waitForState('invoiceOut.index');
});
@ -126,7 +126,7 @@ describe('InvoiceOut descriptor path', () => {
it(`should check the salesPerson role doens't see the book option in the more menu`, async() => {
await page.waitToClick(selectors.invoiceOutDescriptor.moreMenu);
await page.wait(selectors.invoiceOutDescriptor.moreMenuShowInvoiceOutPdf);
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuShowInvoiceOutPdf);
await page.waitForSelector(selectors.invoiceOutDescriptor.moreMenuBookInvoiceOut, {hidden: true});
});

View File

@ -43,7 +43,7 @@ describe('Travel basic data path', () => {
it('should now edit the whole form then save', async() => {
await page.clearInput(selectors.travelBasicDada.reference);
await page.write(selectors.travelBasicDada.reference, 'new reference!');
await page.waitFor(2000);
await page.waitForTimeout(2000);
await page.autocompleteSearch(selectors.travelBasicDada.agency, 'Entanglement');
await page.autocompleteSearch(selectors.travelBasicDada.outputWarehouse, 'Warehouse Three');
await page.autocompleteSearch(selectors.travelBasicDada.inputWarehouse, 'Warehouse Four');

View File

@ -0,0 +1,33 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Travel extra community path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'travel');
await page.accessToSection('travel.extraCommunity');
});
afterAll(async() => {
await browser.close();
});
it('should edit the travel reference', async() => {
await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter);
await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference');
});
it('should reload the index and confirm the reference was edited', async() => {
await page.accessToSection('travel.index');
await page.accessToSection('travel.extraCommunity');
await page.waitToClick(selectors.travelExtraCommunity.removeContinentFilter);
await page.waitForTextInElement(selectors.travelExtraCommunity.firstTravelReference, 'edited reference');
const reference = await page.getProperty(selectors.travelExtraCommunity.firstTravelReference, 'innerText');
expect(reference).toContain('edited reference');
});
});

View File

@ -17,7 +17,7 @@ describe('Entry lastest buys path', () => {
it('should access the latest buys seccion and search not seeing the edit buys button yet', async() => {
await page.waitToClick(selectors.entryLatestBuys.latestBuysSectionButton);
await page.waitFor(250);
await page.waitForTimeout(250);
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false});
});

View File

@ -22,28 +22,7 @@ vn-table {
& > * > vn-th[field] {
position: relative;
overflow: visible;
cursor: pointer;
&.active > :after {
color: $color-font;
opacity: 1;
}
&.desc > :after {
content: 'arrow_drop_down';
}
&.asc > :after {
content: 'arrow_drop_up';
}
& > :after {
font-family: 'Material Icons';
content: 'arrow_drop_down';
position: absolute;
color: $color-spacer;
opacity: 0;
}
&:hover > :after {
opacity: 1;
}
cursor: pointer
}
}
& > vn-tbody,

View File

@ -54,7 +54,6 @@ export default class Th {
else
this.table.setOrder(this.field, this.order);
this.updateArrow();
this.table.applyOrder(this.field, this.order);

View File

@ -0,0 +1,33 @@
@import "effects";
@import "variables";
vn-th {
font-weight: normal;
}
vn-th[field] {
&.active > :after {
color: $color-font;
opacity: 1;
}
&.desc > :after {
content: 'arrow_drop_down';
}
&.asc > :after {
content: 'arrow_drop_up';
}
& > :after {
font-family: 'Material Icons';
content: 'arrow_drop_down';
position: absolute;
color: $color-spacer;
font-size: 1.5em;
margin-top: -2px;
opacity: 0
}
&:hover > :after {
opacity: 1;
}
}

View File

@ -14,7 +14,7 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('./icons/MaterialIcons-Regular.woff2') format('woff2');
src: url(./fonts/MaterialIcons-Regular.woff2) format('woff2');
}
.material-icons {

Binary file not shown.

View File

@ -15,9 +15,9 @@
<a
translate-attr="{title: 'Preview'}"
ui-sref="{{::$ctrl.summaryState}}({id: $ctrl.descriptor.id})">
<vn-icon icon="desktop_windows"></vn-icon>
<vn-icon icon="preview"></vn-icon>
</a>
<vn-icon-button ng-if="$ctrl.$transclude.isSlotFilled('menu')"
<vn-icon-button ng-if="!$ctrl.$transclude.isSlotFilled('dotMenu')"
ng-class="::{invisible: !$ctrl.$transclude.isSlotFilled('menu')}"
icon="more_vert"
vn-popover="menu">

View File

@ -1 +1,9 @@
import ngModule from '../../module';
import Section from '../section';
import './style.scss';
export default class Summary extends Section {}
ngModule.vnComponent('vnSummary', {
controller: Summary
});

View File

@ -1,10 +1,22 @@
@import "./effects";
@import "./variables";
ui-view > .vn-summary {
h5 > a[name="goToSummary"],
h5 * > vn-icon-button[icon="more_vert"] {
display: none
}
}
.summary {
margin: 0 auto;
max-width: 950px;
& > h5 {
display: flex;
justify-content: space-between;
align-items: center;
align-content: center;
padding: $spacing-sm;
border: none;
background: $color-main;
@ -15,6 +27,32 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
& > a > vn-icon-button[icon="launch"] {
@extend %clickable;
color: $color-font-dark;
display: flex;
min-width: 45px;
height: 45px;
box-sizing: border-box;
align-items: center;
justify-content: center;
& > vn-icon {
padding: 10px;
}
vn-icon {
font-size: 1.75rem;
}
}
span {
flex: 1;
}
vn-button {
flex: none
}
}
& > vn-horizontal {
flex-wrap: wrap;

View File

@ -84,6 +84,32 @@ class VnMySQL extends MySQL {
return wrappedConnector.buildWhere(null, where);
}
/**
* Constructs SQL GROUP BY clause from Loopback filter.
*
* @param {Object} group The group by definition
* @return {String} Built SQL group by
*/
makeGroupBy(group) {
if (!group)
return '';
if (typeof group === 'string')
group = [group];
let clauses = [];
for (let clause of group) {
let sqlGroup = '';
let t = clause.split(/[\s,]+/);
sqlGroup += this.escapeName(t[0]);
clauses.push(sqlGroup);
}
return `GROUP BY ${clauses.join(', ')}`;
}
/**
* Constructs SQL order clause from Loopback filter.
*

View File

@ -20,7 +20,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(alias)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-item-section>
</a>

View File

@ -26,7 +26,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(user)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-item-section>
</a>

View File

@ -8,3 +8,4 @@ Role: Rol
Mail aliases: Alias de correo
Account not enabled: Cuenta no habilitada
Inherited roles: Roles heredados
Go to the user: Ir al usuario

View File

@ -21,7 +21,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(role)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-item-section>
</a>

View File

@ -11,7 +11,7 @@
{"state": "account.alias", "icon": "email"},
{"state": "account.accounts", "icon": "accessibility"},
{"state": "account.ldap", "icon": "account_tree"},
{"state": "account.samba", "icon": "desktop_windows"},
{"state": "account.samba", "icon": "preview"},
{"state": "account.acl", "icon": "check"},
{"state": "account.connections", "icon": "share"}
],

View File

@ -1,5 +1,13 @@
<vn-card class="summary">
<h5>{{summary.nickname}}</h5>
<h5>
<a ng-if="::summary.id"
vn-tooltip="Go to the user"
ui-sref="account.card.summary({id: {{::summary.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{summary.id}} - {{summary.nickname}}</span>
</h5>
<vn-horizontal class="vn-pa-md">
<vn-one>
<h4 translate>Basic data</h4>

View File

@ -1,7 +1,7 @@
import ngModule from '../module';
import Component from 'core/lib/component';
import Summary from 'salix/components/summary';
class Controller extends Component {
class Controller extends Summary {
set user(value) {
this._user = value;
this.$.summary = null;

View File

@ -46,7 +46,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(claim)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-td>
</a>

View File

@ -16,3 +16,4 @@ Search claim by id or client name: Buscar reclamaciones por identificador o nomb
Claim deleted!: Reclamación eliminada!
claim: reclamación
Photos: Fotos
Go to the claim: Ir a la reclamación

View File

@ -3,7 +3,15 @@
data="photos">
</vn-crud-model>
<vn-card class="summary">
<h5>{{::$ctrl.summary.claim.id}} - {{::$ctrl.summary.claim.client.name}}</h5>
<h5>
<a ng-if="::$ctrl.summary.claim.id"
vn-tooltip="Go to the claim"
ui-sref="claim.card.summary({id: {{::$ctrl.summary.claim.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{::$ctrl.summary.claim.id}} - {{::$ctrl.summary.claim.client.name}}</span>
</h5>
<vn-horizontal>
<vn-one>
<vn-label-value

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
constructor($element, $, vnFile) {
super($element, $);
this.vnFile = vnFile;

View File

@ -42,7 +42,7 @@
</vn-horizontal>
</vn-vertical>
<a vn-auto ui-sref="client.card.creditInsurance.insurance.index({classificationId: {{classification.id}}})">
<vn-icon-button icon="desktop_windows" vn-tooltip="View credits"></vn-icon-button>
<vn-icon-button icon="preview" vn-tooltip="View credits"></vn-icon-button>
</a>
</vn-horizontal>
</vn-one>

View File

@ -52,7 +52,7 @@
icon="add"
ui-sref="client.card.greuge.create"
vn-tooltip="New greuge"
vn-acl="salesAssistant"
vn-acl="salesAssistant,claimManager"
vn-acl-action="remove"
vn-bind="+"
fixed-bottom-right>

View File

@ -47,7 +47,7 @@
<vn-icon-button
ng-click="$ctrl.openSummary(client, $event)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-item-section>
</a>

View File

@ -185,7 +185,7 @@
"state": "client.card.greuge.create",
"component": "vn-client-greuge-create",
"description": "New greuge",
"acl": ["salesAssistant"],
"acl": ["salesAssistant", "claimManager"],
"params": {
"client": "$ctrl.client"
}

View File

@ -1,5 +1,15 @@
<vn-card class="summary">
<h5>{{$ctrl.summary.name}} - {{$ctrl.summary.id}} - {{$ctrl.summary.salesPersonUser.name}}</h5>
<h5>
<a ng-if="::$ctrl.summary.id"
vn-tooltip="Go to the client"
ui-sref="client.card.summary({id: {{::$ctrl.summary.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>
{{$ctrl.summary.name}} - {{$ctrl.summary.id}} - {{$ctrl.summary.salesPersonUser.name}}
</span>
</h5>
<vn-horizontal>
<vn-one>
<h4 translate>Basic data</h4>

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
$onChanges() {
if (!this.client)
return;

View File

@ -17,3 +17,4 @@ Verdnatura's maximum risk: Riesgo máximo asumido por Verdnatura
Solunion's maximum risk: Riesgo máximo asumido por Solunion
Invoices minus payments: Facturas menos recibos
Deviated invoices minus payments: Facturas fuera de plazo menos recibos
Go to the client: Ir al cliente

View File

@ -34,9 +34,6 @@
"stickers": {
"type": "number"
},
"packageFk": {
"type": "number"
},
"groupingMode": {
"type": "number"
},
@ -68,6 +65,11 @@
"model": "Item",
"foreignKey": "itemFk",
"required": true
}
},
"package": {
"type": "belongsTo",
"model": "Packaging",
"foreignKey": "packageFk"
}
}
}

View File

@ -1,5 +1,13 @@
<vn-card class="summary">
<h5><span translate>Entry</span> #{{$ctrl.entryData.id}} - {{$ctrl.entryData.supplier.nickname}}</h5>
<h5>
<a ng-if="::$ctrl.entryData.id"
vn-tooltip="Go to the entry"
ui-sref="entry.card.summary({id: {{::$ctrl.entryData.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span> #{{$ctrl.entryData.id}} - {{$ctrl.entryData.supplier.nickname}}</span>
</h5>
<vn-horizontal>
<vn-one>
<vn-label-value label="Commission"

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import './style.scss';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
class Controller extends Section {
class Controller extends Summary {
get entry() {
return this._entry;
}

View File

@ -7,3 +7,5 @@ Item type: Tipo
Minimum price: Precio mínimo
Buys: Compras
Travel: Envio
Go to the entry: Ir a la entrada

View File

@ -49,7 +49,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(invoiceOut)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-td>
</a>

View File

@ -1,5 +1,13 @@
<vn-card class="summary">
<h5>{{$ctrl.summary.invoiceOut.ref}} - {{$ctrl.summary.invoiceOut.client.socialName}}</h5>
<h5>
<a ng-if="::$ctrl.summary.invoiceOut.id"
vn-tooltip="Go to the Invoice Out"
ui-sref="invoiceOut.card.summary({id: {{::$ctrl.summary.invoiceOut.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{$ctrl.summary.invoiceOut.ref}} - {{$ctrl.summary.invoiceOut.client.socialName}}</span>
</h5>
<vn-horizontal>
<vn-one>
<vn-label-value label="Date"

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
set invoiceOut(value) {
this._invoiceOut = value;
if (value && value.id)

View File

@ -9,4 +9,5 @@ Type: Tipo
Rate: Tasa
Fee: Cuota
Taxable base: Base imp.
Tax breakdown: Desglose impositivo
Tax breakdown: Desglose impositivo
Go to the Invoice Out: Ir a la factura emitida

View File

@ -5,10 +5,8 @@ describe('item getBalance()', () => {
let params = {where: {itemFk: 1, warehouseFk: 2}};
let result = await app.models.Item.getBalance(params);
expect(result.length).toBe(4);
expect(result.length).toBe(2);
expect(result[0].balance).toBe(-100);
expect(result[1].balance).toBe(-110);
expect(result[2].balance).toBe(-110);
expect(result[3].balance).toBe(-210);
expect(result[1].balance).toBe(-200);
});
});

View File

@ -94,7 +94,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(item)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-horizontal>
</vn-td>

View File

@ -1,5 +1,13 @@
<vn-card class="summary">
<h5>{{$ctrl.item.id}} - {{$ctrl.summary.item.name}}</h5>
<h5>
<a ng-if="::$ctrl.item.id"
vn-tooltip="Go to the item"
ui-sref="item.card.summary({id: {{::$ctrl.item.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{$ctrl.item.id}} - {{$ctrl.summary.item.name}}</span>
</h5>
<vn-horizontal>
<vn-one>
<img style="width: 100%; display: block;"

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
getSummary() {
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;

View File

@ -1,3 +1,4 @@
Niche: Nichos
Barcode: Códigos de barras
Other data: Otros datos
Other data: Otros datos
Go to the item: Ir al artículo

View File

@ -58,7 +58,7 @@
<vn-td shrink>
<vn-icon-button
vn-click-stop="$ctrl.preview(order)"
icon="desktop_windows"
icon="preview"
vn-tooltip="Preview">
</vn-icon-button>
</vn-td>

View File

@ -26,4 +26,5 @@ Confirm lines: Confirmar las lineas
Confirm: Confirmar
Real hour: Hora real
T. Hour: Hora T.
Theoretical hour: Hora Teórica
Theoretical hour: Hora Teórica
Go to the order: Ir al pedido

View File

@ -1,5 +1,11 @@
<vn-card class="summary">
<h5>
<a ng-if="::$ctrl.summary.id"
vn-tooltip="Go to the order"
ui-sref="order.card.summary({id: {{::$ctrl.summary.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>
Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}}
({{$ctrl.summary.client.salesPersonFk}})

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
setSummary() {
this.$http.get(`Orders/${this.order.id}/summary`)
.then(res => this.summary = res.data);

View File

@ -3,21 +3,6 @@
vn-order-summary .summary{
max-width: $width-lg;
h5 {
display: flex;
justify-content: space-between;
align-items: center;
align-content: center;
span {
flex: 1;
}
vn-button {
flex: none
}
}
& > vn-horizontal > vn-one {
min-width: 160px;

View File

@ -0,0 +1,52 @@
const app = require('vn-loopback/server/server');
const LoopBackContext = require('loopback-context');
describe('route ticketToRoute()', () => {
const deliveryId = 56;
let originalTicket;
const routeId = 2;
const activeCtx = {
accessToken: {userId: deliveryId},
};
beforeAll(async done => {
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx
});
done();
});
afterAll(async done => {
try {
await originalTicket.updateAttribute('routeFk', null);
} catch (error) {
console.error(error);
}
done();
});
it('should add the ticket to a route', async() => {
originalTicket = await app.models.Ticket.findById(14);
const ticketId = 14;
const result = await app.models.Route.ticketToRoute(ticketId, routeId);
expect(result.routeFk).toEqual(2);
});
it('should throw and error if the ticket is not suitable for the route', async() => {
const ticketId = 23;
let error;
try {
await app.models.Route.ticketToRoute(ticketId, routeId);
} catch (e) {
error = e.message;
}
expect(error).toBeDefined();
expect(error).toEqual('The selected ticket is not suitable for this route');
});
});

View File

@ -0,0 +1,51 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('ticketToRoute', {
description: 'Check if the ticket can be insert into the route and insert it',
accessType: 'READ',
accepts: [{
arg: 'ticketId',
type: 'number',
required: true,
description: 'ticketId ',
http: {source: 'path'}
},
{
arg: 'routeId',
type: 'number',
required: true
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/:ticketId/ticketToRoute`,
verb: 'PATCH'
}
});
Self.ticketToRoute = async(ticketId, routeId) => {
const models = Self.app.models;
const route = await models.Route.findById(routeId);
const minDate = new Date(route.finished);
minDate.setHours(0, 0, 0, 0);
const maxDate = new Date(route.finished);
maxDate.setHours(23, 59, 59, 59);
const ticket = await models.Ticket.findOne({
where: {
id: ticketId,
zoneFk: route.zoneFk,
routeFk: null,
landed: {between: [minDate, maxDate]},
}
});
if (!ticket)
throw new UserError('The selected ticket is not suitable for this route');
return await ticket.updateAttribute('routeFk', route.id);
};
};

View File

@ -5,6 +5,7 @@ module.exports = Self => {
require('../methods/route/guessPriority')(Self);
require('../methods/route/updateVolume')(Self);
require('../methods/route/getDeliveryPoint')(Self);
require('../methods/route/ticketToRoute')(Self);
Self.validate('kmStart', validateDistance, {
message: 'Distance must be lesser than 1000'
@ -17,9 +18,7 @@ module.exports = Self => {
function validateDistance(err) {
const routeTotalKm = this.kmEnd - this.kmStart;
const routeMaxKm = 1000;
if ( routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err();
}
};

View File

@ -50,7 +50,7 @@
<vn-icon-button
vn-click-stop="$ctrl.preview(route)"
vn-tooltip="Preview"
icon="desktop_windows">
icon="preview">
</vn-icon-button>
</vn-td>
</a>

View File

@ -1,5 +1,13 @@
<vn-card class="summary">
<h5>{{$ctrl.summary.route.id}} - {{$ctrl.summary.route.description}}</h5>
<h5>
<a ng-if="::$ctrl.summary.route.id"
vn-tooltip="Go to the route"
ui-sref="route.card.summary({id: {{::$ctrl.summary.route.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{$ctrl.summary.route.id}} - {{$ctrl.summary.route.description}}</span>
</h5>
<vn-horizontal>
<vn-one>
<vn-label-value label="Id"

View File

@ -1,8 +1,8 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Section {
class Controller extends Summary {
set route(value) {
this._route = value;
if (value && value.id)

View File

@ -5,4 +5,5 @@ Starting time: H. Inicio
Finishing time: H. Fin
Km Start: Km de inicio
Km End: Km de fin
PC: CP
PC: CP
Go to the route: Ir a la ruta

View File

@ -162,8 +162,10 @@ class Controller extends Section {
}
insert(id) {
const params = {routeFk: this.route.id};
this.$http.patch(`Tickets/${id}`, params).then(() => {
const params = {routeId: this.route.id};
const query = `Routes/${id}/ticketToRoute`;
return this.$http.patch(query, params).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.model.refresh();
this.card.reload();

Some files were not shown because too many files have changed in this diff Show More