From 87265403424f9331da5d83ebdb2cf3c264c7ef5a Mon Sep 17 00:00:00 2001 From: jgallego Date: Mon, 17 Dec 2018 14:15:39 +0100 Subject: [PATCH] refactor item --- client/item/src/data/index.html | 35 +++++++----- client/item/src/data/locale/es.yml | 3 +- client/item/src/locale/es.yml | 5 +- client/item/src/summary/index.html | 57 ++++++++++++------- .../loopback/common/methods/item/clone.js | 1 + .../common/methods/item/getSummary.js | 1 + services/loopback/common/models/item.json | 3 + 7 files changed, 70 insertions(+), 35 deletions(-) diff --git a/client/item/src/data/index.html b/client/item/src/data/index.html index 8b2fe80d7f..e088385183 100644 --- a/client/item/src/data/index.html +++ b/client/item/src/data/index.html @@ -19,9 +19,7 @@ field="$ctrl.item.longName" info="Full name calculates based on tags 1-3. Is not recommended to change it manually"> - - - + + {{::description}} - - - - - - - - + + + + + + + + + + + + + + + diff --git a/client/item/src/data/locale/es.yml b/client/item/src/data/locale/es.yml index cfac5303e4..84cfa08f7e 100644 --- a/client/item/src/data/locale/es.yml +++ b/client/item/src/data/locale/es.yml @@ -3,4 +3,5 @@ Full name calculates based on tags 1-3. Is not recommended to change it manually El nombre completo se calcula basado en los tags 1-3. No se recomienda cambiarlo manualmente -Is active: Activo \ No newline at end of file +Is active: Activo +Expence: Gasto diff --git a/client/item/src/locale/es.yml b/client/item/src/locale/es.yml index 280bf790fa..8c42b742f2 100644 --- a/client/item/src/locale/es.yml +++ b/client/item/src/locale/es.yml @@ -2,7 +2,7 @@ Item: Artículo View item: Ver artículo Category: Categoría Description: Descripción -Size: Tamaño +Size: Medida Type: Tipo Name: Nombre Full name: Nombre completo @@ -41,6 +41,9 @@ Available: Disponible Create: Crear Client card: Ficha del cliente Shipped: F. envio +stems: Tallos +Compression: Compresión +Density: Densidad #Sections Items: Artículos diff --git a/client/item/src/summary/index.html b/client/item/src/summary/index.html index d0bbe21dab..92e3b6d63f 100644 --- a/client/item/src/summary/index.html +++ b/client/item/src/summary/index.html @@ -25,7 +25,7 @@ -
Basic data
+
Basic data (I)
@@ -35,20 +35,14 @@ - - - - - + - + @@ -56,20 +50,45 @@
- -
Tax
- + +
Basic data (II)
+ + + + + + + + + + + + + + +
+ + +
Tags
+
- -
Tags
- + +
Tax
+
diff --git a/services/loopback/common/methods/item/clone.js b/services/loopback/common/methods/item/clone.js index 90ba1820e1..b8b2fd5c13 100644 --- a/services/loopback/common/methods/item/clone.js +++ b/services/loopback/common/methods/item/clone.js @@ -39,6 +39,7 @@ module.exports = Self => { delete copy.itemTag; delete copy.description; delete copy.image; + delete copy.comment; let newItem = await Self.create(copy); let promises = []; diff --git a/services/loopback/common/methods/item/getSummary.js b/services/loopback/common/methods/item/getSummary.js index 0ed76e134b..3cbb8bcab0 100644 --- a/services/loopback/common/methods/item/getSummary.js +++ b/services/loopback/common/methods/item/getSummary.js @@ -67,6 +67,7 @@ module.exports = Self => { where: { itemFk: id }, + order: 'priority', include: { relation: 'tag' } diff --git a/services/loopback/common/models/item.json b/services/loopback/common/models/item.json index 08cefab2ee..12dff25eb3 100644 --- a/services/loopback/common/models/item.json +++ b/services/loopback/common/models/item.json @@ -43,6 +43,9 @@ "relevancy": { "type": "Number" }, + "density": { + "type": "Number" + }, "image": { "type": "String" },