From 469c544536d6b7ebea66e1227790a6622232c236 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 9 Nov 2021 11:47:54 +0100 Subject: [PATCH] item.index default columns and filter with like --- .../10380-allsaints/00-defaultViewConfig.sql | 8 ++- front/core/components/smart-table/index.js | 8 ++- modules/item/front/index/index.html | 60 +++++++++---------- modules/item/front/index/index.js | 13 +++- 4 files changed, 54 insertions(+), 35 deletions(-) diff --git a/db/changes/10380-allsaints/00-defaultViewConfig.sql b/db/changes/10380-allsaints/00-defaultViewConfig.sql index 6f66bd6eb..2e1c55288 100644 --- a/db/changes/10380-allsaints/00-defaultViewConfig.sql +++ b/db/changes/10380-allsaints/00-defaultViewConfig.sql @@ -3,4 +3,10 @@ CREATE TABLE `salix`.`defaultViewConfig` tableCode VARCHAR(25) not null, columns JSON not null ) -comment 'The default configuration of columns for views'; \ No newline at end of file +comment 'The default configuration of columns for views'; + +INSERT INTO `salix`.`defaultViewConfig` (tableCode, columns) + VALUES ( + 'itemIndex', + '{"id":true,"grouping":true,"packing":true,"name":true,"stems":true,"size":true,"typeFk":true,"category":true,"intrastat":false,"origin":true,"buyerFk":true,"density":false,"stemMultiplier":false,"active":false,"landed":true}' + ); \ No newline at end of file diff --git a/front/core/components/smart-table/index.js b/front/core/components/smart-table/index.js index bfeab63ce..918bbca18 100644 --- a/front/core/components/smart-table/index.js +++ b/front/core/components/smart-table/index.js @@ -37,9 +37,8 @@ export default class SmartTable extends Component { set model(value) { this._model = value; - if (value) { + if (value) this.$.model = value; - } } get viewConfigId() { @@ -239,6 +238,11 @@ export default class SmartTable extends Component { if (columnOptions) options = columnOptions.find(column => column.field == field); + if (options && options.searchable == false) { + searchRow.appendChild(cell); + continue; + } + if (options && options.autocomplete) { let props = ``; diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 6fa3ae8c2..75de5733c 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -12,49 +12,49 @@ - - Id + + Identifier - + Grouping - + Packing Description - + Stems - + Size - + Type - + Category - + Intrastat - + Origin - + Buyer - + Density - + Multiplier - + Active - + Landed @@ -66,22 +66,22 @@ state: 'item.card.summary', params: {id: item.id} }"> - + - + {{::item.id}} - {{::item.grouping | dashIfEmpty}} - {{::item.packing | dashIfEmpty}} + {{::item.grouping | dashIfEmpty}} + {{::item.packing | dashIfEmpty}}
{{::item.name}} @@ -95,35 +95,35 @@ tabindex="-1"> - {{::item.stems}} - {{::item.size}} - + {{::item.stems}} + {{::item.size}} + {{::item.typeName}} - + {{::item.category}} - + {{::item.intrastat}} - {{::item.origin}} - + {{::item.origin}} + {{::item.userName}} - {{::item.density}} - {{::item.stemMultiplier}} - + {{::item.density}} + {{::item.stemMultiplier}} + {{::item.landed | date:'dd/MM/yyyy'}} - +