From 05be19de2dd65ccd528615df179c8866f544a65b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 22 Mar 2022 10:03:56 +0100 Subject: [PATCH 1/5] fix(zone_delivery-days): agencyModeName and defaulter pagination --- modules/client/back/methods/defaulter/filter.js | 1 + modules/zone/front/delivery-days/index.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 095b9b1c1..813d63d3f 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -80,6 +80,7 @@ module.exports = Self => { stmt.merge(conn.makeWhere(filter.where)); stmt.merge(`GROUP BY d.clientFk`); stmt.merge(conn.makeOrderBy(filter.order)); + stmt.merge(conn.makeLimit(filter)); const itemsIndex = stmts.push(stmt) - 1; const sql = ParameterizedSQL.join(stmts, ';'); diff --git a/modules/zone/front/delivery-days/index.html b/modules/zone/front/delivery-days/index.html index 1c1a9b1b3..a3bed71d0 100644 --- a/modules/zone/front/delivery-days/index.html +++ b/modules/zone/front/delivery-days/index.html @@ -78,7 +78,7 @@ class="clickable search-result"> {{::zone.id}} {{::zone.name}} - {{::zone.agencyMode.name}} + {{::zone.agencyModeName}} {{::zone.hour | date: 'HH:mm'}} {{::zone.price | currency: 'EUR':2}} From 7a8dbdfb1693b825ddeb14c355457ec984595a76 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 5 Apr 2022 09:56:39 +0200 Subject: [PATCH 2/5] Updated SQL files --- db/changes/10420-valentines/00-ImportTicketAcl.sql | 2 +- db/changes/10420-valentines/00-aclCollection.sql | 2 +- db/changes/10420-valentines/00-aclDocuware.sql | 2 +- db/changes/10420-valentines/00-defaultViewConfig.sql | 2 +- db/changes/10430-ash/00-aclAgency.sql | 2 +- db/changes/10430-ash/00-aclAgencyTerm.sql | 2 +- db/changes/10430-ash/00-deliveryBoss.sql | 4 +--- package.json | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/db/changes/10420-valentines/00-ImportTicketAcl.sql b/db/changes/10420-valentines/00-ImportTicketAcl.sql index 98192a39c..df61fd5b8 100644 --- a/db/changes/10420-valentines/00-ImportTicketAcl.sql +++ b/db/changes/10420-valentines/00-ImportTicketAcl.sql @@ -1,2 +1,2 @@ -DELETE FROM salix.ACL +DELETE FROM `salix`.`ACL` WHERE model = 'ClaimEnd' AND property = 'importTicketSales'; diff --git a/db/changes/10420-valentines/00-aclCollection.sql b/db/changes/10420-valentines/00-aclCollection.sql index 81e53049c..57774ba29 100644 --- a/db/changes/10420-valentines/00-aclCollection.sql +++ b/db/changes/10420-valentines/00-aclCollection.sql @@ -1,3 +1,3 @@ -INSERT INTO salix.ACL +INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) VALUES('Collection', 'setSaleQuantity', '*', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file diff --git a/db/changes/10420-valentines/00-aclDocuware.sql b/db/changes/10420-valentines/00-aclDocuware.sql index 21ed66c4c..c2d47d4ea 100644 --- a/db/changes/10420-valentines/00-aclDocuware.sql +++ b/db/changes/10420-valentines/00-aclDocuware.sql @@ -1,3 +1,3 @@ -INSERT INTO salix.ACL +INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) VALUES('Docuware', '*', '*', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file diff --git a/db/changes/10420-valentines/00-defaultViewConfig.sql b/db/changes/10420-valentines/00-defaultViewConfig.sql index c65c1f403..e0d75e9d4 100644 --- a/db/changes/10420-valentines/00-defaultViewConfig.sql +++ b/db/changes/10420-valentines/00-defaultViewConfig.sql @@ -1,3 +1,3 @@ -UPDATE salix.defaultViewConfig +UPDATE `salix`.`defaultViewConfig` SET `columns`='{"intrastat":false,"stemMultiplier":false,"landed":false,"producer":false}' WHERE tableCode ='itemsIndex'; diff --git a/db/changes/10430-ash/00-aclAgency.sql b/db/changes/10430-ash/00-aclAgency.sql index 2134285cb..88afd53fe 100644 --- a/db/changes/10430-ash/00-aclAgency.sql +++ b/db/changes/10430-ash/00-aclAgency.sql @@ -1,2 +1,2 @@ -INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId) +INSERT INTO `salix`.`ACL` (id, model, property, accessType, permission, principalType, principalId) VALUES(301, 'Agency', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); diff --git a/db/changes/10430-ash/00-aclAgencyTerm.sql b/db/changes/10430-ash/00-aclAgencyTerm.sql index d3e11e53e..c43965ed0 100644 --- a/db/changes/10430-ash/00-aclAgencyTerm.sql +++ b/db/changes/10430-ash/00-aclAgencyTerm.sql @@ -1,2 +1,2 @@ -INSERT INTO salix.ACL (model,property,accessType,principalId) +INSERT INTO `salix`.`ACL` (model,property,accessType,principalId) VALUES ('AgencyTerm','*','*','administrative'); diff --git a/db/changes/10430-ash/00-deliveryBoss.sql b/db/changes/10430-ash/00-deliveryBoss.sql index a4bcdcd0c..ac07bfa31 100644 --- a/db/changes/10430-ash/00-deliveryBoss.sql +++ b/db/changes/10430-ash/00-deliveryBoss.sql @@ -1,3 +1 @@ -UPDATE `account`.`user` -SET `role` = 57 -WHERE id IN (2294, 4365, 7294); \ No newline at end of file +UPDATE `account`.`user` SET `role` = 57 WHERE id IN (2294, 4365, 7294); \ No newline at end of file diff --git a/package.json b/package.json index e5b817e20..935147d88 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "test": "jest --watch", "back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back", "lint": "eslint ./ --cache --ignore-pattern .gitignore", - "docker": "docker build -t salix-db ./db" + "docker": "docker build --progress=plain -t salix-db ./db" }, "jest": { "projects": [ From 4be3f9c00f9eaf6e85d424a350325c118d6ea88a Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 5 Apr 2022 09:58:15 +0200 Subject: [PATCH 3/5] Open client summary --- modules/client/front/notification/index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/client/front/notification/index.html b/modules/client/front/notification/index.html index f503c95c8..49e4e3c3f 100644 --- a/modules/client/front/notification/index.html +++ b/modules/client/front/notification/index.html @@ -67,7 +67,7 @@ {{::client.id}} @@ -83,7 +83,9 @@ - + +
@@ -153,3 +155,6 @@ + + \ No newline at end of file From cd098235bbbb11490935a9318e5b7d13928805d2 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 6 Apr 2022 13:44:11 +0200 Subject: [PATCH 4/5] fix(sms): send response when de recipient is the same as the emisor --- back/methods/chat/send.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/back/methods/chat/send.js b/back/methods/chat/send.js index 67e0dbb87..9429c935c 100644 --- a/back/methods/chat/send.js +++ b/back/methods/chat/send.js @@ -32,6 +32,8 @@ module.exports = Self => { if (sender.name != recipient) return sendMessage(sender, to, message); + + return false; }; async function sendMessage(sender, channel, message) { From 3ed116d6146906aa7404217fb2f9c60d445cae97 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 6 Apr 2022 14:06:53 +0200 Subject: [PATCH 5/5] Always return a value instead of a promise --- back/methods/chat/send.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/back/methods/chat/send.js b/back/methods/chat/send.js index 9429c935c..e9f1a87ca 100644 --- a/back/methods/chat/send.js +++ b/back/methods/chat/send.js @@ -30,8 +30,11 @@ module.exports = Self => { const sender = await models.Account.findById(accessToken.userId); const recipient = to.replace('@', ''); - if (sender.name != recipient) - return sendMessage(sender, to, message); + if (sender.name != recipient) { + await sendMessage(sender, to, message); + + return true; + } return false; };