From 56331da20b144890280d8cacbdd1ab4b0788de2f Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 1 Feb 2022 09:37:11 +0100 Subject: [PATCH 1/3] feat(item_index): add column producer --- db/changes/10420/00-defaultViewConfig.sql | 3 +++ modules/item/back/methods/item/filter.js | 1 + modules/item/front/index/index.html | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 db/changes/10420/00-defaultViewConfig.sql diff --git a/db/changes/10420/00-defaultViewConfig.sql b/db/changes/10420/00-defaultViewConfig.sql new file mode 100644 index 000000000..c65c1f403 --- /dev/null +++ b/db/changes/10420/00-defaultViewConfig.sql @@ -0,0 +1,3 @@ +UPDATE salix.defaultViewConfig + SET `columns`='{"intrastat":false,"stemMultiplier":false,"landed":false,"producer":false}' + WHERE tableCode ='itemsIndex'; diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 98e78c7aa..5755de69b 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -161,6 +161,7 @@ module.exports = Self => { i.stemMultiplier, i.typeFk, i.isFloramondo, + pr.name AS producer, it.name AS typeName, it.workerFk AS buyerFk, u.name AS userName, diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 816777a74..1456c74ef 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -54,6 +54,9 @@ Active + + Producer + Landed @@ -122,6 +125,7 @@ ng-model="::item.isActive"> + {{::item.producer}} {{::item.landed | date:'dd/MM/yyyy'}} From f90607c8c7aa9e823d9a803724d6f4d34dc6fd23 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 1 Feb 2022 12:39:58 +0100 Subject: [PATCH 2/3] change changes folder name --- db/changes/{10420 => 10420-valentines}/00-defaultViewConfig.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename db/changes/{10420 => 10420-valentines}/00-defaultViewConfig.sql (100%) diff --git a/db/changes/10420/00-defaultViewConfig.sql b/db/changes/10420-valentines/00-defaultViewConfig.sql similarity index 100% rename from db/changes/10420/00-defaultViewConfig.sql rename to db/changes/10420-valentines/00-defaultViewConfig.sql From 902714ba7da69bfeed4c93d8f8c4a87dfd5ec85f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 3 Feb 2022 10:32:59 +0100 Subject: [PATCH 3/3] feat(item_index): add producer basic filter --- modules/item/front/index/index.html | 2 +- modules/item/front/index/index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 1456c74ef..750dbfc4d 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -125,7 +125,7 @@ ng-model="::item.isActive"> - {{::item.producer}} + {{::item.producer | dashIfEmpty}} {{::item.landed | date:'dd/MM/yyyy'}} diff --git a/modules/item/front/index/index.js b/modules/item/front/index/index.js index 915027c3c..d9e00305d 100644 --- a/modules/item/front/index/index.js +++ b/modules/item/front/index/index.js @@ -81,6 +81,8 @@ class Controller extends Section { return {'intr.description': value}; case 'name': return {'i.name': {like: `%${value}%`}}; + case 'producer': + return {'pr.name': {like: `%${value}%`}}; case 'id': case 'size': case 'subname':