fix(reactions): do not enable reaction picker when the current user does not have write access

This commit is contained in:
kolaente 2024-04-02 14:48:13 +02:00
parent 1558921f42
commit 95276ceebe
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 6 additions and 0 deletions

View File

@ -16,9 +16,11 @@ import {useColorScheme} from '@/composables/useColorScheme'
const { const {
entityKind, entityKind,
entityId, entityId,
disabled = false,
} = defineProps<{ } = defineProps<{
entityKind: ReactionKind, entityKind: ReactionKind,
entityId: number, entityId: number,
disabled?: boolean,
}>() }>()
const authStore = useAuthStore() const authStore = useAuthStore()
@ -143,11 +145,13 @@ async function toggleReaction(value: string) {
v-tooltip="getReactionTooltip(users, value)" v-tooltip="getReactionTooltip(users, value)"
class="reaction-button" class="reaction-button"
:class="{'current-user-has-reacted': hasCurrentUserReactedWithEmoji(value)}" :class="{'current-user-has-reacted': hasCurrentUserReactedWithEmoji(value)}"
:disabled
@click="toggleReaction(value)" @click="toggleReaction(value)"
> >
{{ value }} {{ users.length }} {{ value }} {{ users.length }}
</BaseButton> </BaseButton>
<BaseButton <BaseButton
v-if="!disabled"
ref="emojiPickerButtonRef" ref="emojiPickerButtonRef"
v-tooltip="$t('reaction.add')" v-tooltip="$t('reaction.add')"
class="reaction-button" class="reaction-button"

View File

@ -102,6 +102,7 @@
class="mt-2" class="mt-2"
entity-kind="comments" entity-kind="comments"
:entity-id="c.id" :entity-id="c.id"
:disabled="!canWrite"
/> />
</div> </div>
</div> </div>

View File

@ -328,6 +328,7 @@
entity-kind="tasks" entity-kind="tasks"
:entity-id="task.id" :entity-id="task.id"
class="details" class="details"
:disabled="!canWrite"
/> />
<!-- Attachments --> <!-- Attachments -->