Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# Changelog
All notable changes to this project will be documented in this file.

## [8.4.5] 2025-09-04
### KNOWN BUGS
- Reorderung of options of a textpoll is broken
## [8.4.6] - tbd
### Fixed
- Ordering options in text polls was broken
- Menu showed invalid actions in text poll

## [8.4.5] - 2025-09-04
### Fixed
- Fixed display of one day event on days with a daylight saving change

Expand Down
8 changes: 6 additions & 2 deletions src/components/Options/OptionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const confirmAllowed = computed(
() => !option.deleted && pollStore.isClosed && pollStore.permissions.edit,
)
const cloneAllowed = computed(
() => !option.deleted && !pollStore.isClosed && pollStore.permissions.edit,
() =>
pollStore.type === 'datePoll'
&& !option.deleted
&& !pollStore.isClosed
&& pollStore.permissions.edit,
)

/**
Expand Down Expand Up @@ -124,7 +128,7 @@ function confirmOption() {
<NcActionButton
v-if="useSort && pollStore.permissions.edit"
close-after-click
:name="t('polls', 'Sort')"
:name="t('polls', 'Sort by answers of this option')"
@click="votesStore.setSort({ optionId: option.id })">
<template #icon>
<OptionSortIcon />
Expand Down
67 changes: 6 additions & 61 deletions src/components/Options/OptionsText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,11 @@ import { nextTick, useTemplateRef } from 'vue'
import { useSortable } from '@vueuse/integrations/useSortable'

import { t } from '@nextcloud/l10n'
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'

import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue'
import RestoreIcon from 'vue-material-design-icons/RecycleVariant.vue'
import TextPollIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue'
import ConfirmIcon from 'vue-material-design-icons/CheckboxBlankOutline.vue'
import UnconfirmIcon from 'vue-material-design-icons/CheckboxMarkedOutline.vue'

import OptionItem from './OptionItem.vue'
import OptionsTextAdd from './OptionsTextAdd.vue'
import { usePollStore } from '../../stores/poll'
import { useOptionsStore } from '../../stores/options'
import OptionMenu from './OptionMenu.vue'

const pollStore = usePollStore()
const optionsStore = useOptionsStore()
Expand Down Expand Up @@ -60,8 +51,7 @@ function onSort(event: { oldIndex: number; newIndex: number }) {
</script>

<template>
<OptionsTextAdd v-if="!pollStore.isClosed" />
<div v-if="optionsStore.options.length" ref="list" :style="cssVar">
<div ref="list" :style="cssVar">
<div
v-for="option in optionsStore.options"
:key="option.id"
Expand All @@ -71,59 +61,14 @@ function onSort(event: { oldIndex: number; newIndex: number }) {
:option="option"
:draggable="true"
show-owner>
<template v-if="pollStore.permissions.edit" #actions>
<NcActions v-if="!pollStore.isClosed" class="action">
<NcActionButton
v-if="!option.deleted"
:name="t('polls', 'Delete option')"
:aria-label="t('polls', 'Delete option')"
@click="optionsStore.delete({ option })">
<template #icon>
<DeleteIcon />
</template>
</NcActionButton>
<NcActionButton
v-if="option.deleted"
:name="t('polls', 'Restore option')"
:aria-label="t('polls', 'Restore option')"
@click="optionsStore.restore({ option })">
<template #icon>
<RestoreIcon />
</template>
</NcActionButton>
<NcActionButton
v-if="!option.deleted && !pollStore.isClosed"
:name="
option.confirmed
? t('polls', 'Unconfirm option')
: t('polls', 'Confirm option')
"
:aria-label="
option.confirmed
? t('polls', 'Unconfirm option')
: t('polls', 'Confirm option')
"
type="tertiary"
@click="optionsStore.confirm({ option })">
<template #icon>
<UnconfirmIcon v-if="option.confirmed" />
<ConfirmIcon v-else />
</template>
</NcActionButton>
</NcActions>
<template #actions>
<OptionMenu
v-if="pollStore.permissions.edit || option.isOwner"
:option="option" />
</template>
</OptionItem>
</div>
</div>

<NcEmptyContent
v-else
:name="t('polls', 'No vote options')"
:description="t('polls', 'Add some!')">
<template #icon>
<TextPollIcon />
</template>
</NcEmptyContent>
</template>

<style lang="scss">
Expand Down
15 changes: 14 additions & 1 deletion src/components/SideBar/SideBarTabOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import TextOptionsIcon from 'vue-material-design-icons/FormatListBulletedSquare.
import OptionsTextAddBulk from '../Options/OptionsTextAddBulk.vue'
import ActionAddOption from '../Actions/modules/ActionAddOption.vue'
import { Event } from '../../Types'
import OptionsTextAdd from '../Options/OptionsTextAdd.vue'
import { NcEmptyContent } from '@nextcloud/vue'

const optionsStore = useOptionsStore()
const pollStore = usePollStore()
Expand Down Expand Up @@ -100,7 +102,18 @@ onUnmounted(() => {
<TextOptionsIcon />
</template>

<OptionsText />
<OptionsTextAdd v-if="!pollStore.isClosed" />

<OptionsText v-if="optionsStore.options.length" />

<NcEmptyContent
v-else
:name="t('polls', 'No vote options')"
:description="t('polls', 'Add some!')">
<template #icon>
<TextOptionsIcon />
</template>
</NcEmptyContent>

<template #actions>
<OptionsTextAddBulk v-if="!pollStore.isClosed" />
Expand Down