Skip to content

Commit 7592758

Browse files
authored
Merge pull request #4220 from nextcloud/enh/comment-config
Move comments config to comment tab
2 parents 35a4677 + ab46306 commit 7592758

7 files changed

Lines changed: 37 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ If you experience update problems, please refer to [this article](https://github
2424
- Separated the commands in more granular index and database commands
2525
- Adjust icon style
2626
- Adjust CSS Vars
27+
- Moved comment config to comment tab
28+
- Make comments available to owner and delegated poll administration if commenting is disabled
29+
- Add hint, if commenting is disabled
2730

2831
## [8.2.2] - 2025-08-03
2932
### Added

lib/Db/Poll.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,11 @@ public function getIsPollOwner(): bool {
841841
* Checks, if user is allowed to see and write comments
842842
**/
843843
private function getAllowCommenting(): bool {
844+
if ($this->getAllowEditPoll()) {
845+
// users with edit rights are allowed to comment
846+
return true;
847+
}
848+
844849
// user has no access right to this poll
845850
if (!$this->getAllowAccessPoll()) {
846851
return false;

src/components/Configuration/AutoReminderInformation.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { t } from '@nextcloud/l10n'
1414
t('polls', 'The automatic reminder is sent to all shares via email:')
1515
}}
1616
</h1>
17-
<h2>{{ t('polls', 'For polls with expiration:') }}</h2>
17+
<h2>{{ t('polls', 'For polls with expiration') }}</h2>
1818
<ul>
1919
<li>
2020
{{
@@ -33,7 +33,7 @@ import { t } from '@nextcloud/l10n'
3333
}}
3434
</li>
3535
</ul>
36-
<h2>{{ t('polls', 'For date polls without expiration:') }}</h2>
36+
<h2>{{ t('polls', 'For date polls without expiration') }}</h2>
3737
<ul>
3838
<li>
3939
{{
@@ -52,7 +52,7 @@ import { t } from '@nextcloud/l10n'
5252
}}
5353
</li>
5454
</ul>
55-
<h2>{{ t('polls', 'No reminder is sent:') }}</h2>
55+
<h2>{{ t('polls', 'No reminder is sent') }}</h2>
5656
<ul>
5757
<li>{{ t('polls', 'For text polls without expiration.') }}</li>
5858
<li>

src/components/Configuration/ConfigAutoReminder.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const pollStore = usePollStore()
2929
@update:model-value="emit('change')">
3030
{{ t('polls', 'Use Autoreminder') }}
3131
</NcCheckboxRadioSwitch>
32-
<NcPopover :focus-trap="false">
32+
<NcPopover no-focus-trap close-on-click-outside>
3333
<template #trigger>
3434
<NcActions>
3535
<NcActionButton

src/components/SideBar/SideBarTabComments.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import CommentsIcon from 'vue-material-design-icons/CommentProcessing.vue'
1616
1717
import { usePollStore } from '../../stores/poll'
1818
import { useCommentsStore } from '../../stores/comments'
19+
import ConfigAllowComment from '../Configuration/ConfigAllowComment.vue'
20+
import ConfigForceConfidentialComments from '../Configuration/ConfigForceConfidentialComments.vue'
21+
import ConfigBox from '../Base/modules/ConfigBox.vue'
22+
import PollConfigIcon from 'vue-material-design-icons/Wrench.vue'
23+
import CardDiv from '../Base/modules/CardDiv.vue'
1924
2025
const pollStore = usePollStore()
2126
const commentsStore = useCommentsStore()
@@ -49,6 +54,24 @@ watch(
4954

5055
<template>
5156
<div class="comments">
57+
<ConfigBox
58+
v-if="pollStore.permissions.edit"
59+
:name="t('polls', 'Configuration')">
60+
<template #icon>
61+
<PollConfigIcon />
62+
</template>
63+
<ConfigAllowComment @change="pollStore.write" />
64+
<ConfigForceConfidentialComments @change="pollStore.write" />
65+
<CardDiv v-if="!pollStore.configuration.allowComment" type="warning">
66+
{{
67+
t(
68+
'polls',
69+
'Comments are disabled, except for owner and delegated poll administration.',
70+
)
71+
}}
72+
</CardDiv>
73+
</ConfigBox>
74+
5275
<CommentAdd v-if="pollStore.permissions.comment" />
5376
<Comments v-if="!showEmptyContent" />
5477
<NcEmptyContent v-else v-bind="emptyContentProps">

src/components/SideBar/SideBarTabConfiguration.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import ShowResultsNeverIcon from 'vue-material-design-icons/MonitorOff.vue'
1818
1919
import CardDiv from '../Base/modules/CardDiv.vue'
2020
import ConfigBox from '../Base/modules/ConfigBox.vue'
21-
import ConfigAllowComment from '../Configuration/ConfigAllowComment.vue'
2221
import ConfigAllowMayBe from '../Configuration/ConfigAllowMayBe.vue'
2322
import ConfigAnonymous from '../Configuration/ConfigAnonymous.vue'
2423
import ConfigAutoReminder from '../Configuration/ConfigAutoReminder.vue'
@@ -33,7 +32,6 @@ import ConfigVoteLimit from '../Configuration/ConfigVoteLimit.vue'
3332
import { usePollStore } from '../../stores/poll'
3433
import { useVotesStore } from '../../stores/votes'
3534
import ConfigDangerArea from '../Configuration/ConfigDangerArea.vue'
36-
import ConfigForceConfidentialComments from '../Configuration/ConfigForceConfidentialComments.vue'
3735
3836
const pollStore = usePollStore()
3937
const votesStore = useVotesStore()
@@ -63,14 +61,10 @@ const votesStore = useVotesStore()
6361
<ConfigDescription @change="pollStore.write" />
6462
</ConfigBox>
6563

66-
<ConfigBox :name="t('polls', 'Poll configurations')">
64+
<ConfigBox :name="t('polls', 'Poll configuration')">
6765
<template #icon>
6866
<PollConfigIcon />
6967
</template>
70-
<ConfigAllowComment @change="pollStore.write" />
71-
<ConfigForceConfidentialComments
72-
v-if="pollStore.configuration.allowComment"
73-
@change="pollStore.write" />
7468
<ConfigAllowMayBe @change="pollStore.write" />
7569
<ConfigUseNo @change="pollStore.write" />
7670
<ConfigAnonymous @change="pollStore.write" />

src/components/VoteTable/VoteTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function isVotable(participant: User, option: Option) {
125125
<CalendarPeek
126126
v-if="showCalendarPeek"
127127
:id="`peek-${option.id}`"
128-
:focus-trap="false"
128+
no-focus-trap
129129
:option="option" />
130130

131131
<OptionMenu :option="option" use-sort />

0 commit comments

Comments
 (0)