From 8d6dd3e03a9684dc3cbf058275032447dcad275a Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 18 Jan 2021 14:17:01 +0100 Subject: [PATCH] minor refactors --- .../back/methods/client/updateAddress.js | 4 +- modules/item/back/methods/item/new.js | 1 - modules/item/back/models/item.json | 67 ++++++++++--------- modules/item/front/tags/index.html | 2 +- .../back/methods/ticket-request/filter.js | 7 +- modules/ticket/front/locale/es.yml | 2 +- print/core/filters/zerofill.js | 1 - 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/modules/client/back/methods/client/updateAddress.js b/modules/client/back/methods/client/updateAddress.js index db8ed38d6..27f9faf1c 100644 --- a/modules/client/back/methods/client/updateAddress.js +++ b/modules/client/back/methods/client/updateAddress.js @@ -5,7 +5,7 @@ module.exports = function(Self) { description: 'Updates a client address updating default address', accepts: [{ arg: 'ctx', - type: 'Object', + type: 'object', http: {source: 'context'} }, { @@ -70,7 +70,7 @@ module.exports = function(Self) { }], returns: { root: true, - type: 'Object' + type: 'object' }, http: { verb: 'patch', diff --git a/modules/item/back/methods/item/new.js b/modules/item/back/methods/item/new.js index 1d3f6f230..e6288aede 100644 --- a/modules/item/back/methods/item/new.js +++ b/modules/item/back/methods/item/new.js @@ -60,7 +60,6 @@ module.exports = Self => { query = `SET @isTriggerDisabled = FALSE`; await Self.rawSql(query, null, options); - query = `CALL vn.itemRefreshTags(?)`; await Self.rawSql(query, [item.id], options); await tx.commit(); diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 66c32933e..17d52064d 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -12,116 +12,116 @@ }, "properties": { "id": { - "type": "Number", + "type": "number", "id": true, "description": "Id" }, "name": { - "type": "String", + "type": "string", "description": "Name" }, "size": { - "type": "Number", + "type": "number", "description": "Size" }, "category": { - "type": "String", + "type": "string", "description": "Category" }, "typeFk": { - "type": "Number", + "type": "number", "description": "Type", "required": true }, "stems": { - "type": "Number", + "type": "number", "description": "Stems" }, "description": { - "type": "String", + "type": "string", "description": "Description" }, "isOnOffer": { - "type": "Boolean", + "type": "boolean", "description": "Offer" }, "isBargain": { - "type": "Boolean", + "type": "boolean", "description": "Bargain" }, "isActive": { - "type": "Boolean", + "type": "boolean", "description": "Active" }, "comment": { - "type": "String", + "type": "string", "description": "Comment" }, "relevancy": { - "type": "Number", + "type": "number", "description": "Relevancy" }, "density": { - "type": "Number", + "type": "number", "description": "Density" }, "image": { - "type": "String", + "type": "string", "description": "Image" }, "longName": { - "type": "String", + "type": "string", "description": "Long name" }, "subName": { - "type": "String", + "type": "string", "description": "Subname" }, "tag5": { - "type": "String" + "type": "string" }, "value5": { - "type": "String" + "type": "string" }, "tag6": { - "type": "String" + "type": "string" }, "value6": { - "type": "String" + "type": "string" }, "tag7": { - "type": "String" + "type": "string" }, "value7": { - "type": "String" + "type": "string" }, "tag8": { - "type": "String" + "type": "string" }, "value8": { - "type": "String" + "type": "string" }, "tag9": { - "type": "String" + "type": "string" }, "value9": { - "type": "String" + "type": "string" }, "tag10": { - "type": "String" + "type": "string" }, "value10": { - "type": "String" + "type": "string" }, "compression": { - "type": "Number" + "type": "number" }, "hasKgPrice": { - "type": "Boolean", + "type": "boolean", "description": "Price per Kg" }, "expenseFk": { - "type": "Number", + "type": "number", "mysql": { "columnName": "expenceFk" } @@ -129,8 +129,11 @@ "minPrice": { "type": "number" }, + "hasMinPrice": { + "type": "boolean" + }, "isFragile": { - "type": "Boolean" + "type": "boolean" } }, "relations": { diff --git a/modules/item/front/tags/index.html b/modules/item/front/tags/index.html index 0dca863fd..3775526be 100644 --- a/modules/item/front/tags/index.html +++ b/modules/item/front/tags/index.html @@ -27,8 +27,8 @@ initial-data="itemTag.tag" ng-model="itemTag.tagFk" data="tags" - on-change="$ctrl.getSourceTable(tag)" show-field="name" + on-change="itemTag.value = null" rule> { }, { arg: 'attenderFk', type: 'Number', - description: `Search requests atended by the given worker` + description: `Search requests attended by a given worker id` }, { arg: 'mine', type: 'Boolean', - description: `Search requests attended by the connected worker` + description: `Search requests attended by the current user` }, { arg: 'from', type: 'Date', @@ -62,10 +62,9 @@ module.exports = Self => { Self.filter = async(ctx, filter) => { let conn = Self.dataSource.connector; let userId = ctx.req.accessToken.userId; - let worker = await Self.app.models.Worker.findOne({where: {userFk: userId}}); if (ctx.args.mine) - ctx.args.attenderFk = worker.id; + ctx.args.attenderFk = userId; let where = buildFilter(ctx.args, (param, value) => { switch (param) { diff --git a/modules/ticket/front/locale/es.yml b/modules/ticket/front/locale/es.yml index 73d7ec5c2..02cab50ed 100644 --- a/modules/ticket/front/locale/es.yml +++ b/modules/ticket/front/locale/es.yml @@ -21,7 +21,7 @@ Discount: Descuento Employee : Empleado Import: Importe Is checked: Comprobado -Item: Articulo +Item: Artículo Landing: Llegada Landed: F. entrega More: Más diff --git a/print/core/filters/zerofill.js b/print/core/filters/zerofill.js index c7df519b0..c3d18079b 100644 --- a/print/core/filters/zerofill.js +++ b/print/core/filters/zerofill.js @@ -1,4 +1,3 @@ -const {KeyValueModel} = require('loopback'); const Vue = require('vue'); const zerofill = function(value, pad) {