|
|
@ -128,7 +128,7 @@ const saveCalendarRanges = async () => { |
|
|
|
|
|
|
|
|
|
|
|
await loadCalendarMeta() |
|
|
|
await loadCalendarMeta() |
|
|
|
await Promise.all([loadCalendarData(), loadSidebarData(), fetchActiveDates()]) |
|
|
|
await Promise.all([loadCalendarData(), loadSidebarData(), fetchActiveDates()]) |
|
|
|
calendarRangeDropdown.value = false |
|
|
|
// calendarRangeDropdown.value = false |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log(e) |
|
|
|
console.log(e) |
|
|
|
message.error('There was an error while updating view!') |
|
|
|
message.error('There was an error while updating view!') |
|
|
@ -143,9 +143,23 @@ const removeRange = async (id: number) => { |
|
|
|
await saveCalendarRanges() |
|
|
|
await saveCalendarRanges() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
const isDisabled = computed(() => { |
|
|
|
range.fk_to_column_id = value |
|
|
|
return ( |
|
|
|
await saveCalendarRanges() |
|
|
|
dateFieldOptions.value.find((f) => f.value === calendarRange.value[0]?.fk_from_column_id)?.uidt === UITypes.DateTime && |
|
|
|
|
|
|
|
!isRangeEnabled.value |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onValueChange = async () => { |
|
|
|
|
|
|
|
_calendar_ranges.value = _calendar_ranges.value.map((range, i) => { |
|
|
|
|
|
|
|
if (i === 0) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
fk_from_column_id: range.fk_from_column_id, |
|
|
|
|
|
|
|
fk_to_column_id: undefined, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return range |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
@ -198,7 +212,12 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
:placeholder="$t('placeholder.notSelected')" |
|
|
|
:placeholder="$t('placeholder.notSelected')" |
|
|
|
data-testid="nc-calendar-range-from-field-select" |
|
|
|
data-testid="nc-calendar-range-from-field-select" |
|
|
|
:disabled="isLocked" |
|
|
|
:disabled="isLocked" |
|
|
|
@change="saveCalendarRanges" |
|
|
|
@change=" |
|
|
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
onValueChange() |
|
|
|
|
|
|
|
saveCalendarRanges() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
> |
|
|
|
> |
|
|
|
<template #suffixIcon><GeneralIcon icon="arrowDown" class="text-gray-700" /></template> |
|
|
|
<template #suffixIcon><GeneralIcon icon="arrowDown" class="text-gray-700" /></template> |
|
|
@ -231,15 +250,14 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
|
|
|
|
<NcTooltip v-if="range.fk_to_column_id === null && isRangeEnabled" placement="left" :disabled="!isDisabled"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
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="w-23" |
|
|
|
class="w-23" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
:shadow="false" |
|
|
|
:shadow="false" |
|
|
|
:disabled="!isEeUI || isLocked" |
|
|
|
:disabled="!isEeUI || isLocked || isDisabled" |
|
|
|
@click="range.fk_to_column_id = undefined" |
|
|
|
@click="range.fk_to_column_id = undefined" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex gap-1 items-center"> |
|
|
|
<div class="flex gap-1 items-center"> |
|
|
@ -247,7 +265,10 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
{{ $t('activity.endDate') }} |
|
|
|
{{ $t('activity.endDate') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<template v-else-if="isEeUI && isRangeEnabled"> |
|
|
|
<template #title> Coming Soon!! Currently, range support is only available for Date field. </template> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-else-if="isEeUI"> |
|
|
|
<span> |
|
|
|
<span> |
|
|
|
{{ $t('activity.withEndDate') }} |
|
|
|
{{ $t('activity.withEndDate') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -256,7 +277,7 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => { |
|
|
|
v-model:value="range.fk_to_column_id" |
|
|
|
v-model:value="range.fk_to_column_id" |
|
|
|
class="!rounded-r-none nc-select-shadow w-full flex-1" |
|
|
|
class="!rounded-r-none nc-select-shadow w-full flex-1" |
|
|
|
allow-clear |
|
|
|
allow-clear |
|
|
|
:disabled="!range.fk_from_column_id || isLocked" |
|
|
|
:disabled="!range.fk_from_column_id || isLocked || isDisabled" |
|
|
|
:placeholder="$t('placeholder.notSelected')" |
|
|
|
:placeholder="$t('placeholder.notSelected')" |
|
|
|
data-testid="nc-calendar-range-to-field-select" |
|
|
|
data-testid="nc-calendar-range-to-field-select" |
|
|
|
dropdown-class-name="!rounded-lg" |
|
|
|
dropdown-class-name="!rounded-lg" |
|
|
|