From 6c5d591234696972a22b5fd4e228e37910c34ae7 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Sun, 15 Oct 2023 18:31:14 +0200 Subject: [PATCH 1/3] fix confirmation mail sending Signed-off-by: dartcafe --- lib/Service/MailService.php | 22 +++++-------------- .../modules/ActionSendConfirmedOptions.vue | 5 +++-- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php index 0b266fdde..8d48c9019 100644 --- a/lib/Service/MailService.php +++ b/lib/Service/MailService.php @@ -152,14 +152,14 @@ public function sendConfirmations(int $pollId): SentResult { foreach ($participants as $participant) { try { - $this->sendConfirmationMail($sentResult, $participant, $pollId); + $this->sendConfirmationMail($participant, $pollId); $sentResult->AddSentMail($participant); } catch (InvalidEmailAddress $e) { - $sentResult->AddAbortedMail($participant, SentResult::INVALID_EMAIL_ADDRESS); $this->logger->warning('Invalid or no email address for confirmation: ' . json_encode($participant)); + $sentResult->AddAbortedMail($participant, SentResult::INVALID_EMAIL_ADDRESS); } catch (\Exception $e) { - $sentResult->AddAbortedMail($participant); $this->logger->error('Error sending confirmation to ' . json_encode($participant)); + $sentResult->AddAbortedMail($participant); } } @@ -179,21 +179,9 @@ private function processSharesForAutoReminder(Poll $poll): void { } } - private function sendConfirmationMail(SentResult &$sentResult, UserBase $participant, int $pollId) : SentResult { + private function sendConfirmationMail(UserBase $participant, int $pollId): void { $confirmation = new ConfirmationMail($participant->getId(), $pollId); - - try { - $confirmation->send(); - $sentResult->AddSentMail($participant); - } catch (InvalidEmailAddress $e) { - $sentResult->AddAbortedMail($participant, SentResult::INVALID_EMAIL_ADDRESS); - $this->logger->warning('Invalid or no email address for confirmation: ' . json_encode($participant)); - } catch (\Exception $e) { - $sentResult->AddAbortedMail($participant); - $this->logger->error('Error sending confirmation to ' . json_encode($participant)); - } - - return $sentResult; + $confirmation->send(); } private function sendAutoReminderToRecipients(Share $share, Poll $poll): void { diff --git a/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue b/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue index 26f65b55e..8b2d59778 100644 --- a/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue +++ b/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue @@ -83,8 +83,9 @@ export default { try { const result = await PollsAPI.sendConfirmation(this.$route.params.id) this.confirmations = result.data.confirmations - - this.headerCaption = n('polls', 'Confirmations sent to {count} recipient', 'Confirmations sent to {count} recipients', { count: this.confirmations.countSentMails }) + console.log(this.confirmations) + console.log(this.confirmations.countSentMails) + this.headerCaption = n('polls', 'Confirmations sent to %n recipient', 'Confirmations sent to %n recipients', this.confirmations.countSentMails) this.confirmations.sentMails.forEach((confirmation) => { showSuccess(t('polls', 'Confirmation sent to {participant} ({emailAddress})', { participant: confirmation.displayName, emailAddress: confirmation.emailAddress })) }) From cccae7c33327736b237a1d2026462b76042b3c29 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Sun, 15 Oct 2023 21:06:25 +0200 Subject: [PATCH 2/3] move some ctas from vote page to cards Signed-off-by: dartcafe --- src/js/components/Actions/index.js | 2 +- .../Actions/modules/ActionSendConfirmed.vue | 113 +++++++++++++++ .../modules/ActionSendConfirmedOptions.vue | 129 ------------------ src/js/views/Vote.vue | 33 +++-- 4 files changed, 137 insertions(+), 140 deletions(-) create mode 100644 src/js/components/Actions/modules/ActionSendConfirmed.vue delete mode 100644 src/js/components/Actions/modules/ActionSendConfirmedOptions.vue diff --git a/src/js/components/Actions/index.js b/src/js/components/Actions/index.js index 3e745cdf9..4a29bbfc0 100644 --- a/src/js/components/Actions/index.js +++ b/src/js/components/Actions/index.js @@ -1,5 +1,5 @@ export { default as ActionChangeView } from './modules/ActionChangeView.vue' export { default as ActionDelete } from './modules/ActionDelete.vue' -export { default as ActionSendConfirmedOptions } from './modules/ActionSendConfirmedOptions.vue' +export { default as ActionSendConfirmed } from './modules/ActionSendConfirmed.vue' export { default as ActionSortOptions } from './modules/ActionSortOptions.vue' export { default as ActionToggleSidebar } from './modules/ActionToggleSidebar.vue' diff --git a/src/js/components/Actions/modules/ActionSendConfirmed.vue b/src/js/components/Actions/modules/ActionSendConfirmed.vue new file mode 100644 index 000000000..e3b4db508 --- /dev/null +++ b/src/js/components/Actions/modules/ActionSendConfirmed.vue @@ -0,0 +1,113 @@ + + + + + + + diff --git a/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue b/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue deleted file mode 100644 index 8b2d59778..000000000 --- a/src/js/components/Actions/modules/ActionSendConfirmedOptions.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index 91e1061a9..561918f0b 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -43,10 +43,28 @@ - + + {{ t('polls', 'You are asked to propose more options. ') }} +

+ {{ t('polls', 'The proposal period ends {timeRelative}', { timeRelative: proposalsExpireRelative }) }} +

+ + +
+ + {{ t('polls', 'This poll is closed. No further action is possible.') }} + + {{ t('polls', 'You have confirmed options. Inform your participants about the result via email.') }} + + + {{ lockedShareCardCaption }} @@ -55,13 +73,6 @@ -
- -
-
- -
-
@@ -115,12 +126,12 @@ import PollHeaderButtons from '../components/Poll/PollHeaderButtons.vue' import { CardDiv, HeaderBar } from '../components/Base/index.js' import DatePollIcon from 'vue-material-design-icons/CalendarBlank.vue' import TextPollIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue' -import { ActionSendConfirmedOptions } from '../components/Actions/index.js' +import { ActionSendConfirmed } from '../components/Actions/index.js' export default { name: 'Vote', components: { - ActionSendConfirmedOptions, + ActionSendConfirmed, NcAppContent, NcButton, NcEmptyContent, @@ -159,6 +170,8 @@ export default { viewMode: 'poll/viewMode', proposalsAllowed: 'poll/proposalsAllowed', proposalsOpen: 'poll/proposalsOpen', + proposalsExpirySet: 'poll/proposalsExpirySet', + proposalsExpireRelative: 'poll/proposalsExpireRelative', countHiddenParticipants: 'poll/countHiddenParticipants', safeTable: 'poll/safeTable', confirmedOptions: 'options/confirmed', From 033984493a02eb3cba7c7d717c51deead9a85d01 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Sun, 15 Oct 2023 21:24:43 +0200 Subject: [PATCH 3/3] Changelog and typo fix Signed-off-by: dartcafe --- CHANGELOG.md | 5 +++++ src/js/views/Vote.vue | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd597ac2c..ce3f4fb54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,17 @@ All notable changes to this project will be documented in this file. - Fixed granting admin rights to shares - Fixed a bug, where exports were prevented - Fixed a visually bug when using Nextcloud's Dark Mode + - Fixed result reporting about sent and failed confirmation mails ### New - Reveal hidden voters if hidden in case of performance concerns - Support better readability of vote page - Added revoking of shares - Shares can now be locked which works as a read only share mechanism. Locked shares can still enter the poll, but every interaction (voting and commenting) is disabled. - Deletion of locked shares deletes the users votes as well + - Moved request for option proposals to a card on top of the vote page + - Moved CTA for confirmation mails to card on top of the vote page + - Added a card with a more prominent hint for closed polls + ### Changes - Improved username check for public polls with a large number of groups in the backend ## [5.3.2] - 2023-09-11 diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index 561918f0b..ed1b8559e 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -46,7 +46,7 @@ {{ t('polls', 'You are asked to propose more options. ') }}

- {{ t('polls', 'The proposal period ends {timeRelative}', { timeRelative: proposalsExpireRelative }) }} + {{ t('polls', 'The proposal period ends {timeRelative}.', { timeRelative: proposalsExpireRelative }) }}