From 5af961ac69d1ae5d30d1711863c19d77838a223d Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 09:53:21 +0200 Subject: [PATCH 1/4] fix: maneja si se elimina la sale --- .../back/methods/ticket-log/getChanges.js | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/modules/ticket/back/methods/ticket-log/getChanges.js b/modules/ticket/back/methods/ticket-log/getChanges.js index d020a0957..7a6de49e8 100644 --- a/modules/ticket/back/methods/ticket-log/getChanges.js +++ b/modules/ticket/back/methods/ticket-log/getChanges.js @@ -30,35 +30,47 @@ module.exports = Self => { const ticketLogs = await models.TicketLog.find( { where: { - and: [ - {originFk: id}, - {action: 'update'}, - {changedModel: 'Sale'} + or: [ + { + and: [ + {originFk: id}, + {action: 'update'}, + {changedModel: 'Sale'} + ] + }, + { + and: [ + {originFk: id}, + {action: 'delete'}, + {changedModel: 'Sale'} + ] + } ] }, fields: [ 'oldInstance', 'newInstance', - 'changedModelId' + 'changedModelId', + 'changedModelValue' ], }, myOptions); const changes = []; - for (const ticketLog of ticketLogs) { - const oldQuantity = ticketLog.oldInstance.quantity; - const newQuantity = ticketLog.newInstance.quantity; + + for (const log of ticketLogs) { + const oldQuantity = log.oldInstance.quantity; + const newQuantity = log.newInstance?.quantity || 0; if (oldQuantity || newQuantity) { - const sale = await models.Sale.findById(ticketLog.changedModelId, null, myOptions); - const message = $t('Change quantity', { - concept: sale.concept, - oldQuantity: oldQuantity || 0, - newQuantity: newQuantity || 0, - }); - - changes.push(message); + const changeMessage = $t('Change quantity', { + concept: log.changedModelValue, + oldQuantity: oldQuantity || 0, + newQuantity: newQuantity || 0, + }); + changes.push(changeMessage); } - } + } + return changes.join('\n'); }; }; From 4c6b4ea6c8083db67326b6a3bb4c7f9ca268c2d1 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 10:15:00 +0200 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20eliminada=20la=20doble=20pagina?= =?UTF-8?q?ci=C3=B3n=20en=20los=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/salix/components/log/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 79dfcef8c..05abe84c0 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -66,7 +66,6 @@ - From 83f71cdd369b2d733daf123379ece56751b62657 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 10:31:23 +0200 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20mostrar=20en=20columnas=20visib?= =?UTF-8?q?les=20'Fr=C3=A1gil'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/monitor/front/index/tickets/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 539d4b3cb..bdd4e76ff 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -68,7 +68,9 @@ State - + + Fragile + Zone From a725ee90cf374152f5a1d4d0503999ff4a335e98 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 11:50:07 +0200 Subject: [PATCH 4/4] update backTest timeout --- back/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/tests.js b/back/tests.js index 8f7cfd3d4..a377011d3 100644 --- a/back/tests.js +++ b/back/tests.js @@ -53,7 +53,7 @@ async function test() { const JunitReporter = require('jasmine-reporters'); jasmine.addReporter(new JunitReporter.JUnitXmlReporter()); - jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; + jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000; jasmine.exitOnCompletion = true; }