From 9f61806e06b90c08df9673dd8d7e858015c3ef5c Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 27 Aug 2024 07:56:58 +0200 Subject: [PATCH 1/2] feat: refs #7287 Added changes to use reason in log --- .../11199-blackEucalyptus/00-firstScript.sql | 23 +++++++++++++++++++ .../11199-blackEucalyptus/01-firstScript.sql | 5 ++++ front/salix/components/log/index.js | 6 +++-- loopback/common/models/log.json | 14 +++++++---- modules/ticket/back/models/ticket-log.json | 5 +++- 5 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 db/versions/11199-blackEucalyptus/00-firstScript.sql create mode 100644 db/versions/11199-blackEucalyptus/01-firstScript.sql diff --git a/db/versions/11199-blackEucalyptus/00-firstScript.sql b/db/versions/11199-blackEucalyptus/00-firstScript.sql new file mode 100644 index 000000000..8295d8edf --- /dev/null +++ b/db/versions/11199-blackEucalyptus/00-firstScript.sql @@ -0,0 +1,23 @@ +ALTER TABLE account.roleLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE account.userLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE srt.bufferLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE salix.ACLLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.entryLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.clientLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.itemLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.shelvingLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.workerLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.deviceProductionLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.zoneLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.rateLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.ticketLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.agencyLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.userLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.routeLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.claimLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.productionConfigLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.supplierLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.invoiceInLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.travelLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.packingSiteDeviceLog ADD reason varchar(255) DEFAULT NULL NULL; +ALTER TABLE vn.parkingLog ADD reason varchar(255) DEFAULT NULL NULL; diff --git a/db/versions/11199-blackEucalyptus/01-firstScript.sql b/db/versions/11199-blackEucalyptus/01-firstScript.sql new file mode 100644 index 000000000..186300b52 --- /dev/null +++ b/db/versions/11199-blackEucalyptus/01-firstScript.sql @@ -0,0 +1,5 @@ +ALTER TABLE vn.ticket + ADD motivation ENUM('clone', 'split') DEFAULT NULL NULL AFTER cmrFk; + +ALTER TABLE vn.sale + ADD motivation ENUM('priceFix', 'replaceItem') DEFAULT NULL NULL AFTER total; diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 854c57f00..5a0775af8 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -40,10 +40,11 @@ export default class Controller extends Section { 'oldInstance', 'newInstance', 'creationDate', + 'description', 'changedModel', 'changedModelId', 'changedModelValue', - 'description' + 'reason' ], include: [{ relation: 'user', @@ -290,7 +291,8 @@ export default class Controller extends Section { return {or: [ {oldJson: {like: `%${value}%`}}, {newJson: {like: `%${value}%`}}, - {description: {like: `%${value}%`}} + {description: {like: `%${value}%`}}, + {reason: {like: `%${value}%`}} ]}; case 'who': switch (value) { diff --git a/loopback/common/models/log.json b/loopback/common/models/log.json index 6d246371c..c7fdf94a1 100644 --- a/loopback/common/models/log.json +++ b/loopback/common/models/log.json @@ -18,6 +18,12 @@ "type": "string", "required": true }, + "creationDate": { + "type": "date" + }, + "description": { + "type": "string" + }, "changedModel": { "type": "string" }, @@ -35,16 +41,16 @@ "type": "String", "mysql": {"columnName": "newInstance"} }, - "creationDate": { - "type": "date" - }, "changedModelId": { "type": "string" }, "changedModelValue": { "type": "string" }, - "description": { + "summaryId": { + "type":"string" + }, + "reason": { "type": "string" } }, diff --git a/modules/ticket/back/models/ticket-log.json b/modules/ticket/back/models/ticket-log.json index 7b3f8b466..27a0ae9a5 100644 --- a/modules/ticket/back/models/ticket-log.json +++ b/modules/ticket/back/models/ticket-log.json @@ -43,6 +43,9 @@ }, "summaryId": { "type":"string" - } + }, + "reason": { + "type": "string" + } } } -- 2.40.1 From 99d867f1bab5fb72bc0605f43f712a84881ea979 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 27 Aug 2024 07:59:43 +0200 Subject: [PATCH 2/2] feat: refs #7287 Minor chnage --- front/salix/components/log/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 5a0775af8..668f197dd 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -43,8 +43,7 @@ export default class Controller extends Section { 'description', 'changedModel', 'changedModelId', - 'changedModelValue', - 'reason' + 'changedModelValue' ], include: [{ relation: 'user', @@ -291,8 +290,7 @@ export default class Controller extends Section { return {or: [ {oldJson: {like: `%${value}%`}}, {newJson: {like: `%${value}%`}}, - {description: {like: `%${value}%`}}, - {reason: {like: `%${value}%`}} + {description: {like: `%${value}%`}} ]}; case 'who': switch (value) { -- 2.40.1