|
|
@ -22,14 +22,18 @@ const { loadViewColumns } = useViewColumnsOrThrow() |
|
|
|
const { loadCalendarMeta, loadCalendarData, loadSidebarData, fetchActiveDates, updateCalendarMeta, viewMetaProperties } = |
|
|
|
const { loadCalendarMeta, loadCalendarData, loadSidebarData, fetchActiveDates, updateCalendarMeta, viewMetaProperties } = |
|
|
|
useCalendarViewStoreOrThrow() |
|
|
|
useCalendarViewStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isFeatureEnabled } = useBetaFeatureToggle() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isRangeEnabled = computed(() => isFeatureEnabled(FEATURE_FLAG.CALENDAR_VIEW_RANGE)) |
|
|
|
|
|
|
|
|
|
|
|
const calendarRangeDropdown = ref(false) |
|
|
|
const calendarRangeDropdown = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const hideWeekends = computed({ |
|
|
|
const showWeekends = computed({ |
|
|
|
get: () => viewMetaProperties.value?.hide_weekend ?? false, |
|
|
|
get: () => !viewMetaProperties.value?.hide_weekend, |
|
|
|
set: (newValue) => { |
|
|
|
set: (newValue) => { |
|
|
|
updateCalendarMeta({ |
|
|
|
updateCalendarMeta({ |
|
|
|
meta: { |
|
|
|
meta: { |
|
|
|
hide_weekend: newValue, |
|
|
|
hide_weekend: !newValue, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -183,7 +187,7 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
class="flex flex-col w-full gap-2 mb-2" |
|
|
|
class="flex flex-col w-full gap-2 mb-2" |
|
|
|
data-testid="nc-calendar-range-option" |
|
|
|
data-testid="nc-calendar-range-option" |
|
|
|
> |
|
|
|
> |
|
|
|
<span> |
|
|
|
<span class="text-gray-800"> |
|
|
|
{{ $t('labels.organiseBy') }} |
|
|
|
{{ $t('labels.organiseBy') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<NcSelect |
|
|
|
<NcSelect |
|
|
@ -223,7 +227,7 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
</NcSelect> |
|
|
|
</NcSelect> |
|
|
|
|
|
|
|
|
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-if="range.fk_to_column_id === null" |
|
|
|
v-if="range.fk_to_column_id === null && isRangeEnabled" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
data-testid="nc-calendar-range-add-end-date" |
|
|
|
data-testid="nc-calendar-range-add-end-date" |
|
|
|
class="!border-none w-28" |
|
|
|
class="!border-none w-28" |
|
|
@ -231,10 +235,12 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
:disabled="!isEeUI" |
|
|
|
:disabled="!isEeUI" |
|
|
|
@click="range.fk_to_column_id = undefined" |
|
|
|
@click="range.fk_to_column_id = undefined" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<div class="flex gap-2 items-center"> |
|
|
|
<component :is="iconMap.plus" class="h-4 w-4" /> |
|
|
|
<component :is="iconMap.plus" class="h-4 w-4" /> |
|
|
|
{{ $t('activity.addEndDate') }} |
|
|
|
{{ $t('activity.endDate') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<template v-else-if="isEeUI"> |
|
|
|
<template v-else-if="isEeUI && isRangeEnabled"> |
|
|
|
<span> |
|
|
|
<span> |
|
|
|
{{ $t('activity.withEndDate') }} |
|
|
|
{{ $t('activity.withEndDate') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -281,9 +287,9 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<NcSwitch v-model:checked="hideWeekends" :disabled="isLocked"> |
|
|
|
<NcSwitch v-model:checked="showWeekends" :disabled="isLocked"> |
|
|
|
<span class="text-gray-800"> |
|
|
|
<span class="text-gray-800 font-semibold"> |
|
|
|
{{ $t('activity.hideWeekends') }} |
|
|
|
{{ $t('activity.showSaturdaysAndSundays') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</NcSwitch> |
|
|
|
</NcSwitch> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|