diff --git a/.gitignore b/.gitignore index 3ef8c28fd..8cb76a829 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ coverage node_modules -dist/* +dist e2e/dms/*/ !e2e/dms/c4c !e2e/dms/c81 diff --git a/db/changes/10081-agency/00-zone_getEvents.sql b/db/changes/10081-agency/00-zone_getEvents.sql index 199074a72..35d95f7bb 100644 --- a/db/changes/10081-agency/00-zone_getEvents.sql +++ b/db/changes/10081-agency/00-zone_getEvents.sql @@ -1,10 +1,12 @@ +USE `vn`; +DROP procedure IF EXISTS `zone_getEvents`; -DROP PROCEDURE IF EXISTS `vn`.`zone_getEvents`; DELIMITER $$ -CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`zone_getEvents`( - vAgencyModeFk INT, +USE `vn`$$ +CREATE DEFINER=`root`@`%` PROCEDURE `zone_getEvents`( vProvinceFk INT, - vPostCode VARCHAR(255)) + vPostCode VARCHAR(255), + vAgencyModeFk INT) BEGIN /** * Returns available events for the passed province/postcode and agency. @@ -13,9 +15,9 @@ BEGIN * @param vProvinceFk The province id * @param vPostCode The postcode or %NULL to use the province */ - DECLARE vGeoFk INT; - - IF vPostCode IS NOT NULL THEN + DECLARE vGeoFk INT; + + IF vPostCode IS NOT NULL THEN SELECT p.geoFk INTO vGeoFk FROM postCode p JOIN town t ON t.id = p.townFk @@ -24,24 +26,27 @@ BEGIN ELSE SELECT geoFk INTO vGeoFk FROM province - WHERE id = vProvinceFk; - END IF; + WHERE id = vProvinceFk; + END IF; - CALL zone_getFromGeo(vGeoFk); - - DELETE t FROM tmp.zone t - JOIN zone z ON z.id = t.id - WHERE z.agencyModeFk != vAgencyModeFk; - - SELECT e.`from`, e.`to`, e.weekDays + CALL zone_getFromGeo(vGeoFk); + + IF vAgencyModeFk IS NOT NULL THEN + DELETE t FROM tmp.zone t + JOIN zone z ON z.id = t.id + WHERE z.agencyModeFk != vAgencyModeFk; + END IF; + + SELECT e.`from`, e.`to`, e.weekDays FROM tmp.zone t JOIN zoneEvent e ON e.zoneFk = t.id; - - SELECT DISTINCT e.`day` + + SELECT DISTINCT e.`day` FROM tmp.zone t JOIN zoneExclusion e ON e.zoneFk = t.id; DROP TEMPORARY TABLE tmp.zone; END$$ + DELIMITER ; diff --git a/db/changes/10100-AllSaints/00-ACL.sql b/db/changes/10100-allSaints/00-ACL.sql similarity index 100% rename from db/changes/10100-AllSaints/00-ACL.sql rename to db/changes/10100-allSaints/00-ACL.sql diff --git a/db/changes/10100-AllSaints/00-travelLog.sql b/db/changes/10100-allSaints/00-travelLog.sql similarity index 100% rename from db/changes/10100-AllSaints/00-travelLog.sql rename to db/changes/10100-allSaints/00-travelLog.sql diff --git a/db/changes/10100-AllSaints/00-upperGap.sql b/db/changes/10100-allSaints/00-upperGap.sql similarity index 100% rename from db/changes/10100-AllSaints/00-upperGap.sql rename to db/changes/10100-allSaints/00-upperGap.sql diff --git a/db/changes/10100-AllSaints/00-userLog.sql b/db/changes/10100-allSaints/00-userLog.sql similarity index 100% rename from db/changes/10100-AllSaints/00-userLog.sql rename to db/changes/10100-allSaints/00-userLog.sql diff --git a/db/changes/10100-AllSaints/00-userPhoneType.sql b/db/changes/10100-allSaints/00-userPhoneType.sql similarity index 100% rename from db/changes/10100-AllSaints/00-userPhoneType.sql rename to db/changes/10100-allSaints/00-userPhoneType.sql diff --git a/db/changes/10100-AllSaints/00-zone.sql b/db/changes/10100-allSaints/00-zone.sql similarity index 100% rename from db/changes/10100-AllSaints/00-zone.sql rename to db/changes/10100-allSaints/00-zone.sql diff --git a/db/changes/10100-AllSaints/01-userPhone.sql b/db/changes/10100-allSaints/01-userPhone.sql similarity index 100% rename from db/changes/10100-AllSaints/01-userPhone.sql rename to db/changes/10100-allSaints/01-userPhone.sql diff --git a/db/changes/10100-AllSaints/01-zone_getAgency.sql b/db/changes/10100-allSaints/01-zone_getAgency.sql similarity index 100% rename from db/changes/10100-AllSaints/01-zone_getAgency.sql rename to db/changes/10100-allSaints/01-zone_getAgency.sql diff --git a/db/changes/10100-AllSaints/01-zone_getFirstShipped.sql b/db/changes/10100-allSaints/01-zone_getFirstShipped.sql similarity index 100% rename from db/changes/10100-AllSaints/01-zone_getFirstShipped.sql rename to db/changes/10100-allSaints/01-zone_getFirstShipped.sql diff --git a/db/changes/10100-AllSaints/01-zone_getLanded.sql b/db/changes/10100-allSaints/01-zone_getLanded.sql similarity index 100% rename from db/changes/10100-AllSaints/01-zone_getLanded.sql rename to db/changes/10100-allSaints/01-zone_getLanded.sql diff --git a/db/changes/10100-AllSaints/01-zone_getShippedWarehouse.sql b/db/changes/10100-allSaints/01-zone_getShippedWarehouse.sql similarity index 100% rename from db/changes/10100-AllSaints/01-zone_getShippedWarehouse.sql rename to db/changes/10100-allSaints/01-zone_getShippedWarehouse.sql diff --git a/db/changes/10100-AllSaints/01-zone_getWarehouse.sql b/db/changes/10100-allSaints/01-zone_getWarehouse.sql similarity index 100% rename from db/changes/10100-AllSaints/01-zone_getWarehouse.sql rename to db/changes/10100-allSaints/01-zone_getWarehouse.sql diff --git a/db/changes/10100-AllSaints/02-catalog_componentCalculate.sql b/db/changes/10100-allSaints/02-catalog_componentCalculate.sql similarity index 100% rename from db/changes/10100-AllSaints/02-catalog_componentCalculate.sql rename to db/changes/10100-allSaints/02-catalog_componentCalculate.sql diff --git a/db/changes/10100-AllSaints/02-ticketCalculate__.sql b/db/changes/10100-allSaints/02-ticketCalculate__.sql similarity index 100% rename from db/changes/10100-AllSaints/02-ticketCalculate__.sql rename to db/changes/10100-allSaints/02-ticketCalculate__.sql diff --git a/db/changes/10100-AllSaints/02-zoneGetAgency.sql b/db/changes/10100-allSaints/02-zoneGetAgency.sql similarity index 100% rename from db/changes/10100-AllSaints/02-zoneGetAgency.sql rename to db/changes/10100-allSaints/02-zoneGetAgency.sql diff --git a/db/changes/10100-AllSaints/02-zoneGetFirstShipped__.sql b/db/changes/10100-allSaints/02-zoneGetFirstShipped__.sql similarity index 100% rename from db/changes/10100-AllSaints/02-zoneGetFirstShipped__.sql rename to db/changes/10100-allSaints/02-zoneGetFirstShipped__.sql diff --git a/db/changes/10100-AllSaints/02-zoneGetLanded.sql b/db/changes/10100-allSaints/02-zoneGetLanded.sql similarity index 100% rename from db/changes/10100-AllSaints/02-zoneGetLanded.sql rename to db/changes/10100-allSaints/02-zoneGetLanded.sql diff --git a/db/changes/10100-AllSaints/02-zoneGetShipped.sql b/db/changes/10100-allSaints/02-zoneGetShipped.sql similarity index 100% rename from db/changes/10100-AllSaints/02-zoneGetShipped.sql rename to db/changes/10100-allSaints/02-zoneGetShipped.sql diff --git a/db/changes/10100-AllSaints/02-zoneGetShippedWarehouse.sql b/db/changes/10100-allSaints/02-zoneGetShippedWarehouse.sql similarity index 100% rename from db/changes/10100-AllSaints/02-zoneGetShippedWarehouse.sql rename to db/changes/10100-allSaints/02-zoneGetShippedWarehouse.sql diff --git a/db/changes/10100-AllSaints/03-available_calc.sql b/db/changes/10100-allSaints/03-available_calc.sql similarity index 100% rename from db/changes/10100-AllSaints/03-available_calc.sql rename to db/changes/10100-allSaints/03-available_calc.sql diff --git a/db/changes/10100-AllSaints/03-catalog_calculate.sql b/db/changes/10100-allSaints/03-catalog_calculate.sql similarity index 100% rename from db/changes/10100-AllSaints/03-catalog_calculate.sql rename to db/changes/10100-allSaints/03-catalog_calculate.sql diff --git a/db/changes/10100-AllSaints/03-order_confirmWithUser.sql b/db/changes/10100-allSaints/03-order_confirmWithUser.sql similarity index 100% rename from db/changes/10100-AllSaints/03-order_confirmWithUser.sql rename to db/changes/10100-allSaints/03-order_confirmWithUser.sql diff --git a/db/changes/10100-AllSaints/03-ticketCalculateClon.sql b/db/changes/10100-allSaints/03-ticketCalculateClon.sql similarity index 100% rename from db/changes/10100-AllSaints/03-ticketCalculateClon.sql rename to db/changes/10100-allSaints/03-ticketCalculateClon.sql diff --git a/db/changes/10100-AllSaints/03-ticketComponentCalculate.sql b/db/changes/10100-allSaints/03-ticketComponentCalculate.sql similarity index 100% rename from db/changes/10100-AllSaints/03-ticketComponentCalculate.sql rename to db/changes/10100-allSaints/03-ticketComponentCalculate.sql diff --git a/db/changes/10100-AllSaints/03-ticketCreateWithUser.sql b/db/changes/10100-allSaints/03-ticketCreateWithUser.sql similarity index 100% rename from db/changes/10100-AllSaints/03-ticketCreateWithUser.sql rename to db/changes/10100-allSaints/03-ticketCreateWithUser.sql diff --git a/db/changes/10100-AllSaints/03-ticketCreateWithoutZone.sql b/db/changes/10100-allSaints/03-ticketCreateWithoutZone.sql similarity index 100% rename from db/changes/10100-AllSaints/03-ticketCreateWithoutZone.sql rename to db/changes/10100-allSaints/03-ticketCreateWithoutZone.sql diff --git a/db/changes/10100-AllSaints/04-zone_getOptionsForDated.sql b/db/changes/10100-allSaints/04-zone_getOptionsForDated.sql similarity index 100% rename from db/changes/10100-AllSaints/04-zone_getOptionsForDated.sql rename to db/changes/10100-allSaints/04-zone_getOptionsForDated.sql diff --git a/db/changes/10100-AllSaints/04-zone_getOptionsForLanding.sql b/db/changes/10100-allSaints/04-zone_getOptionsForLanding.sql similarity index 100% rename from db/changes/10100-AllSaints/04-zone_getOptionsForLanding.sql rename to db/changes/10100-allSaints/04-zone_getOptionsForLanding.sql diff --git a/db/changes/10100-AllSaints/04-zone_getOptionsForShipment.sql b/db/changes/10100-allSaints/04-zone_getOptionsForShipment.sql similarity index 100% rename from db/changes/10100-AllSaints/04-zone_getOptionsForShipment.sql rename to db/changes/10100-allSaints/04-zone_getOptionsForShipment.sql diff --git a/db/changes/10100-AllSaints/05-catalog_calcFromItem.sql b/db/changes/10100-allSaints/05-catalog_calcFromItem.sql similarity index 100% rename from db/changes/10100-AllSaints/05-catalog_calcFromItem.sql rename to db/changes/10100-allSaints/05-catalog_calcFromItem.sql diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 3f021c910..4d6285603 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -45,14 +45,15 @@ let actions = { login: async function(userName) { if (currentUser !== userName) { - let logoutClicked = await this.clickIfExists('#logout'); + let accountClicked = await this.clickIfExists('#user'); - if (logoutClicked) { + if (accountClicked) { let buttonSelector = '.vn-dialog.shown button[response=accept]'; - await this.wait(buttonSelector => { - return document.querySelector(buttonSelector) != null - || location.hash == '#!/login'; - }, buttonSelector); + await this.waitToClick('#logout') + .wait(buttonSelector => { + return document.querySelector(buttonSelector) != null + || location.hash == '#!/login'; + }, buttonSelector); await this.clickIfExists(buttonSelector); } diff --git a/e2e/paths/01-login/01_login.spec.js b/e2e/paths/01-login/01_login.spec.js index 03acc98a8..f612ad23c 100644 --- a/e2e/paths/01-login/01_login.spec.js +++ b/e2e/paths/01-login/01_login.spec.js @@ -30,7 +30,7 @@ describe('Login path', () => { it('should log in', async() => { const url = await nightmare .doLogin('employee', null) - .wait('#logout') + .wait('#user') .parsedUrl(); expect(url.hash).toEqual('#!/'); diff --git a/front/core/components/drop-down/index.js b/front/core/components/drop-down/index.js index 25376841c..9f2dfe424 100644 --- a/front/core/components/drop-down/index.js +++ b/front/core/components/drop-down/index.js @@ -394,7 +394,7 @@ export default class DropDown extends Popover { let filter = { order, - limit: this.limit || 8 + limit: this.limit || 30 }; if (model instanceof CrudModel) { diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index e2f8409b0..31907792c 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -2,7 +2,7 @@ vn-searchbar { display: block; - max-width: 30em; + max-width: 35em; margin: 0 auto; .search-params { @@ -10,7 +10,7 @@ vn-searchbar { margin: .05em 0; overflow: visible; display: flex; - max-width: 16em; + max-width: 24em; & > .search-param { color: rgba(0, 0, 0, .6); @@ -19,7 +19,7 @@ vn-searchbar { margin-left: .2em; display: inline-block; border-radius: .8em; - max-width: 18em; + max-width: 12em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/front/core/styles/variables.scss b/front/core/styles/variables.scss index cd918342c..89e487ad7 100644 --- a/front/core/styles/variables.scss +++ b/front/core/styles/variables.scss @@ -36,11 +36,11 @@ $color-font-bg-marginal: rgba(0, 0, 0, .4); $color-font-bg-dark: rgba(255, 255, 255, .7); $color-font-bg-dark-marginal: rgba(255, 255, 255, .4); -$color-header: darken($color-primary, 5%); +$color-header: #3d3d3d; $color-menu-header: #3d3d3d; $color-bg: #e5e5e5; $color-bg-dark: #3d3d3d; -$color-active: $color-primary; +$color-active: #3d3d3d; $color-active-font: $color-font-dark; $color-bg-panel: white; $color-main: $color-primary; diff --git a/front/salix/components/index.js b/front/salix/components/index.js index af8380498..2afd55edf 100644 --- a/front/salix/components/index.js +++ b/front/salix/components/index.js @@ -5,7 +5,6 @@ import './home/home'; import './layout'; import './left-menu/left-menu'; import './login/login'; -import './main-menu/main-menu'; import './module-card'; import './module-main'; import './side-menu/side-menu'; diff --git a/front/salix/components/main-menu/main-menu.spec.js b/front/salix/components/layout/index..js similarity index 77% rename from front/salix/components/main-menu/main-menu.spec.js rename to front/salix/components/layout/index..js index 693bf8291..9fdcfc034 100644 --- a/front/salix/components/main-menu/main-menu.spec.js +++ b/front/salix/components/layout/index..js @@ -1,4 +1,4 @@ -import './main-menu.js'; +import './index.js'; describe('Component vnMainMenu', () => { let $httpBackend; @@ -14,8 +14,7 @@ describe('Component vnMainMenu', () => { describe('getCurrentUserName()', () => { it(`should set the user name property in the controller`, () => { - $httpBackend.when('GET', `Accounts/getCurrentUserData`).respond({name: 'batman'}); - $httpBackend.expect('GET', `Accounts/getCurrentUserData`); + $httpBackend.expect('GET', `Accounts/getUserData`).respond({name: 'batman'}); controller.getCurrentUserName(); $httpBackend.flush(); diff --git a/front/salix/components/layout/index.html b/front/salix/components/layout/index.html index 498189268..0ad400114 100644 --- a/front/salix/components/layout/index.html +++ b/front/salix/components/layout/index.html @@ -5,7 +5,10 @@ ng-if="$ctrl.leftMenu" ng-click="$ctrl.leftMenu.show()"> -