From 4d91b26537c9b9747df777a1e27bf4c80f31dc9b Mon Sep 17 00:00:00 2001 From: bernat Date: Fri, 20 Nov 2020 13:35:01 +0100 Subject: [PATCH 1/2] checkinbox moved to worker --- back/model-config.json | 6 ------ back/models/worker-time-control-params.js | 3 --- .../back/methods/worker-time-control-mail}/checkInbox.js | 4 ++++ modules/worker/back/model-config.json | 6 ++++++ modules/worker/back/models/worker-time-control-mail.js | 3 +++ .../worker/back}/models/worker-time-control-mail.json | 0 .../worker/back}/models/worker-time-control-params.json | 0 7 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 back/models/worker-time-control-params.js rename {back/methods/imap-time-control => modules/worker/back/methods/worker-time-control-mail}/checkInbox.js (97%) create mode 100644 modules/worker/back/models/worker-time-control-mail.js rename {back => modules/worker/back}/models/worker-time-control-mail.json (100%) rename {back => modules/worker/back}/models/worker-time-control-params.json (100%) diff --git a/back/model-config.json b/back/model-config.json index da9feaa1f..f0032edab 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -76,12 +76,6 @@ }, "UserLog": { "dataSource": "vn" - }, - "WorkerTimeControlParams": { - "dataSource": "vn" - }, - "WorkerTimeControlMail": { - "dataSource": "vn" } } diff --git a/back/models/worker-time-control-params.js b/back/models/worker-time-control-params.js deleted file mode 100644 index c71d4c237..000000000 --- a/back/models/worker-time-control-params.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Self => { - require('../methods/imap-time-control/checkInbox')(Self); -}; diff --git a/back/methods/imap-time-control/checkInbox.js b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js similarity index 97% rename from back/methods/imap-time-control/checkInbox.js rename to modules/worker/back/methods/worker-time-control-mail/checkInbox.js index 9411b95e5..fa42f8135 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js @@ -35,6 +35,10 @@ module.exports = Self => { imap.once('ready', function() { openInbox(function(err, box) { if (err) throw err; + const totalMessages = box.messages.total; + if (totalMessages == 0) + imap.end(); + let f = imap.seq.fetch('1:*', { bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], struct: true diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 7a498fce7..e35e39721 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -55,6 +55,12 @@ }, "WorkerLog": { "dataSource": "vn" + }, + "WorkerTimeControlParams": { + "dataSource": "vn" + }, + "WorkerTimeControlMail": { + "dataSource": "vn" } } diff --git a/modules/worker/back/models/worker-time-control-mail.js b/modules/worker/back/models/worker-time-control-mail.js new file mode 100644 index 000000000..36f3851b6 --- /dev/null +++ b/modules/worker/back/models/worker-time-control-mail.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/worker-time-control-mail/checkInbox')(Self); +}; diff --git a/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json similarity index 100% rename from back/models/worker-time-control-mail.json rename to modules/worker/back/models/worker-time-control-mail.json diff --git a/back/models/worker-time-control-params.json b/modules/worker/back/models/worker-time-control-params.json similarity index 100% rename from back/models/worker-time-control-params.json rename to modules/worker/back/models/worker-time-control-params.json From 3acc943d85a68ff071401e2b6365d4dd48b6e862 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 23 Nov 2020 11:10:16 +0100 Subject: [PATCH 2/2] =?UTF-8?q?2639=20-=20Permisos=20para=20a=C3=B1adir=20?= =?UTF-8?q?greuge=20con=20rol=20claimManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/client/front/greuge/index/index.html | 2 +- modules/client/front/routes.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index 463ac6303..73216a9b1 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -52,7 +52,7 @@ icon="add" ui-sref="client.card.greuge.create" vn-tooltip="New greuge" - vn-acl="salesAssistant" + vn-acl="salesAssistant,claimManager" vn-acl-action="remove" vn-bind="+" fixed-bottom-right> diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json index a3ee4dd86..a2d559645 100644 --- a/modules/client/front/routes.json +++ b/modules/client/front/routes.json @@ -185,7 +185,7 @@ "state": "client.card.greuge.create", "component": "vn-client-greuge-create", "description": "New greuge", - "acl": ["salesAssistant"], + "acl": ["salesAssistant", "claimManager"], "params": { "client": "$ctrl.client" }