From f0fb9066705c9a65abef506906ed1175735543c9 Mon Sep 17 00:00:00 2001 From: bernat Date: Mon, 4 Jan 2021 10:54:46 +0100 Subject: [PATCH 1/5] add in travel index, entry create --- modules/travel/front/descriptor-menu/index.html | 6 ++++++ modules/travel/front/descriptor-menu/locale/es.yml | 3 ++- modules/travel/front/index/index.html | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/travel/front/descriptor-menu/index.html b/modules/travel/front/descriptor-menu/index.html index 1eb558008..7d5760b39 100644 --- a/modules/travel/front/descriptor-menu/index.html +++ b/modules/travel/front/descriptor-menu/index.html @@ -10,6 +10,12 @@ translate> Clone travel + + Add entry + diff --git a/modules/travel/front/descriptor-menu/locale/es.yml b/modules/travel/front/descriptor-menu/locale/es.yml index 117611660..e34e94ee2 100644 --- a/modules/travel/front/descriptor-menu/locale/es.yml +++ b/modules/travel/front/descriptor-menu/locale/es.yml @@ -1 +1,2 @@ -Clone travel: Clonar envío \ No newline at end of file +Clone travel: Clonar envío +Add entry: Añadir entrada \ No newline at end of file diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html index d85b62a4c..1a0f59e14 100644 --- a/modules/travel/front/index/index.html +++ b/modules/travel/front/index/index.html @@ -49,6 +49,11 @@ vn-tooltip="Clone" icon="icon-clone"> + + Date: Thu, 7 Jan 2021 14:33:42 +0100 Subject: [PATCH 2/5] Changed order --- modules/travel/front/descriptor-menu/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/travel/front/descriptor-menu/index.html b/modules/travel/front/descriptor-menu/index.html index 294be71b4..c7edcd59e 100644 --- a/modules/travel/front/descriptor-menu/index.html +++ b/modules/travel/front/descriptor-menu/index.html @@ -11,12 +11,6 @@ translate> Clone travel - - Add entry - Clone travel and his entries + + Add entry + From a6c330cf4990b5e56bace7f31193a9586f6b756b Mon Sep 17 00:00:00 2001 From: bernat Date: Mon, 11 Jan 2021 10:20:40 +0100 Subject: [PATCH 3/5] change triger itemTag --- db/changes/10270-wisemen/00-itemTag.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/changes/10270-wisemen/00-itemTag.sql diff --git a/db/changes/10270-wisemen/00-itemTag.sql b/db/changes/10270-wisemen/00-itemTag.sql new file mode 100644 index 000000000..371548566 --- /dev/null +++ b/db/changes/10270-wisemen/00-itemTag.sql @@ -0,0 +1,19 @@ +DROP TRIGGER IF EXISTS `vn`.`itemTag_afterUpdate`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemTag_afterUpdate` + AFTER UPDATE ON `itemTag` FOR EACH ROW +trig: BEGIN + IF @isTriggerDisabled THEN + LEAVE trig; + END IF; + + DROP TEMPORARY TABLE IF EXISTS tmp.item; + CREATE TEMPORARY TABLE tmp.item + SELECT vItem id; + + CALL item_refreshTags(); + DROP TEMPORARY TABLE tmp.item; +END$$ +DELIMITER ; From db956ab64a9fc8fd8730262ee3b417f01c19f5c4 Mon Sep 17 00:00:00 2001 From: bernat Date: Mon, 11 Jan 2021 11:30:26 +0100 Subject: [PATCH 4/5] delete sql --- db/changes/10270-wisemen/00-itemTag.sql | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 db/changes/10270-wisemen/00-itemTag.sql diff --git a/db/changes/10270-wisemen/00-itemTag.sql b/db/changes/10270-wisemen/00-itemTag.sql deleted file mode 100644 index 371548566..000000000 --- a/db/changes/10270-wisemen/00-itemTag.sql +++ /dev/null @@ -1,19 +0,0 @@ -DROP TRIGGER IF EXISTS `vn`.`itemTag_afterUpdate`; - -DELIMITER $$ -USE `vn`$$ -CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemTag_afterUpdate` - AFTER UPDATE ON `itemTag` FOR EACH ROW -trig: BEGIN - IF @isTriggerDisabled THEN - LEAVE trig; - END IF; - - DROP TEMPORARY TABLE IF EXISTS tmp.item; - CREATE TEMPORARY TABLE tmp.item - SELECT vItem id; - - CALL item_refreshTags(); - DROP TEMPORARY TABLE tmp.item; -END$$ -DELIMITER ; From e917955404318ddea11d7479b4954adf4a57f9e9 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Wed, 20 Jan 2021 20:28:22 +0100 Subject: [PATCH 5/5] e2e tests for travel add entry --- e2e/helpers/selectors.js | 8 +++- e2e/paths/10-travel/03_descriptor.spec.js | 55 +++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 42c01ac07..ad81b9b3a 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -840,7 +840,8 @@ export default { }, travelIndex: { anySearchResult: 'vn-travel-index vn-tbody > a', - firstSearchResult: 'vn-travel-index vn-tbody > a:nth-child(1)' + firstSearchResult: 'vn-travel-index vn-tbody > a:nth-child(1)', + firstTravelAddEntryButton: 'vn-travel-index a:nth-child(1) vn-icon[icon="icon-ticket"]', }, travelExtraCommunity: { anySearchResult: 'vn-travel-extra-community > vn-data-viewer div > vn-tbody > vn-tr', @@ -879,6 +880,7 @@ export default { dotMenu: 'vn-travel-descriptor vn-icon-button[icon="more_vert"]', dotMenuClone: '#clone', dotMenuCloneWithEntries: '#cloneWithEntries', + dotMenuAddEntry: '[name="addEntry"]', acceptClonation: 'tpl-buttons > button[response="accept"]' }, travelCreate: { @@ -909,6 +911,10 @@ export default { volumetric: 'vn-zone-basic-data vn-check[ng-model="$ctrl.zone.isVolumetric"]', saveButton: 'vn-zone-basic-data vn-submit > button', }, + entryCreate: { + travel: 'vn-entry-create vn-autocomplete[ng-model="$ctrl.entry.travelFk"]', + company: 'vn-entry-create vn-autocomplete[ng-model="$ctrl.entry.companyFk"]' + }, entrySummary: { header: 'vn-entry-summary > vn-card > h5', reference: 'vn-entry-summary vn-label-value[label="Reference"]', diff --git a/e2e/paths/10-travel/03_descriptor.spec.js b/e2e/paths/10-travel/03_descriptor.spec.js index cdca379ad..a1a035317 100644 --- a/e2e/paths/10-travel/03_descriptor.spec.js +++ b/e2e/paths/10-travel/03_descriptor.spec.js @@ -33,6 +33,61 @@ describe('Travel descriptor path', () => { expect(state).toBe('travel.card.summary'); }); + it('should be redirected to the create entry view', async() => { + await page.waitToClick(selectors.travelDescriptor.dotMenu); + await page.waitToClick(selectors.travelDescriptor.dotMenuAddEntry); + await page.waitForState('entry.create'); + const state = await page.getState(); + + expect(state).toBe('entry.create'); + }); + + it('should check some data was imported from the travel', async() => { + const travel = await page.waitToGetProperty(selectors.entryCreate.travel, 'value'); + const campany = await page.waitToGetProperty(selectors.entryCreate.company, 'value'); + + expect(travel).toContain('Warehouse'); + expect(campany).toContain('VNL'); + }); + + it('should navigate back to the travel index', async() => { + await page.waitToClick('.cancel'); + await page.waitToClick(selectors.globalItems.homeButton); + await page.selectModule('travel'); + await page.waitForState('travel.index'); + const state = await page.getState(); + + expect(state).toBe('travel.index'); + }); + + it('should click on the add entry button of the third result to be redirected to create entry', async() => { + await page.keyboard.press('Enter'); + await page.waitToClick(selectors.travelIndex.firstTravelAddEntryButton); + await page.waitForState('entry.create'); + const state = await page.getState(); + + expect(state).toBe('entry.create'); + }); + + it('should check again some data was imported from the travel', async() => { + const travel = await page.waitToGetProperty(selectors.entryCreate.travel, 'value'); + const campany = await page.waitToGetProperty(selectors.entryCreate.company, 'value'); + + expect(travel).toContain('Warehouse'); + expect(campany).toContain('VNL'); + }); + + it('should navigate to the travel summary of a given travel', async() => { + await page.waitToClick('.cancel'); + await page.waitToClick(selectors.globalItems.homeButton); + await page.selectModule('travel'); + await page.accessToSearchResult('3'); + await page.waitForState('travel.card.summary'); + const state = await page.getState(); + + expect(state).toBe('travel.card.summary'); + }); + it('should be redirected to the create travel when using the clone option of the dot menu', async() => { await page.waitToClick(selectors.travelDescriptor.dotMenu); await page.waitToClick(selectors.travelDescriptor.dotMenuClone);