From 456f167513762d4915c0a8cd245e379369f5365a Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 26 May 2022 11:09:03 +0200 Subject: [PATCH] feat: fix editExclusion mode --- db/changes/10470-family/00-zoneHoliday.sql | 4 ++-- modules/zone/front/events/index.html | 15 ++++++------ modules/zone/front/events/index.js | 27 ++++++++++------------ 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/db/changes/10470-family/00-zoneHoliday.sql b/db/changes/10470-family/00-zoneHoliday.sql index e89723818..40b38d4c7 100644 --- a/db/changes/10470-family/00-zoneHoliday.sql +++ b/db/changes/10470-family/00-zoneHoliday.sql @@ -1,11 +1,11 @@ -CREATE TABLE `zoneExclusionGeo` ( +CREATE TABLE `vn`.`zoneExclusionGeo` ( `zoneExclusionFk` int(11) NOT NULL, `geoFk` int(11) NOT NULL, PRIMARY KEY (`zoneExclusionFk`,`geoFk`), KEY `zoneExclusionGeo2_FK_1` (`geoFk`), CONSTRAINT `zoneExclusionGeo2_FK_1` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE, CONSTRAINT `zoneExclusionGeo_FK` FOREIGN KEY (`zoneExclusionFk`) REFERENCES `zoneExclusion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP PROCEDURE IF EXISTS `vn`.`zone_excludeFromGeo`; diff --git a/modules/zone/front/events/index.html b/modules/zone/front/events/index.html index 270f75ec7..090f27b97 100644 --- a/modules/zone/front/events/index.html +++ b/modules/zone/front/events/index.html @@ -1,9 +1,3 @@ - - + message="{{$ctrl.isNew ? 'Exclusion' : 'Edit exclusion'}}" + on-open="$ctrl.onSearch($params)"> - + +
{ const data = this.$.model.data; + + for (let geo of data) { + for (let exclusion of this.exclusions) { + if (geo.id == exclusion.geoFk) + geo.checked = true; + } + } + this.$.treeview.data = data; }); }