Browse Source

fix: update dialog

pull/9831/head
DarkPhoenix2704 2 days ago
parent
commit
c13cb01048
  1. 43
      packages/nc-gui/components/dlg/ViewCreate.vue
  2. 27
      packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue

43
packages/nc-gui/components/dlg/ViewCreate.vue

@ -977,10 +977,10 @@ const getPluralName = (name: string) => {
/> />
</a-form-item> </a-form-item>
<template v-if="form.type === ViewTypes.CALENDAR && !form.copy_from_id"> <template v-if="form.type === ViewTypes.CALENDAR && !form.copy_from_id">
<div v-for="(range, index) in form.calendar_range" :key="`range-${index}`" class="flex w-full items-center gap-2"> <div v-for="(range, index) in form.calendar_range" :key="`range-${index}`" class="flex flex-col w-full gap-2">
<span class="text-gray-800"> <div class="text-gray-800">
{{ $t('labels.organiseBy') }} {{ $t('labels.organiseBy') }}
</span> </div>
<NcSelect <NcSelect
v-model:value="range.fk_from_column_id" v-model:value="range.fk_from_column_id"
:disabled="isMetaLoading" :disabled="isMetaLoading"
@ -1017,14 +1017,19 @@ const getPluralName = (name: string) => {
</div> </div>
</a-select-option> </a-select-option>
</NcSelect> </NcSelect>
<div
v-if="range.fk_to_column_id === null && isEeUI" <NcButton
class="cursor-pointer flex items-center text-gray-800 gap-1" v-if="range.fk_to_column_id === null"
size="small"
class="!border-none w-28"
type="secondary"
:disabled="!isEeUI"
@click="range.fk_to_column_id = undefined" @click="range.fk_to_column_id = undefined"
> >
<component :is="iconMap.plus" class="h-4 w-4" /> <component :is="iconMap.plus" class="h-4 w-4" />
{{ $t('activity.addEndDate') }} {{ $t('activity.addEndDate') }}
</div> </NcButton>
<template v-else-if="isEeUI"> <template v-else-if="isEeUI">
<span> <span>
{{ $t('activity.withEndDate') }} {{ $t('activity.withEndDate') }}
@ -1036,7 +1041,7 @@ const getPluralName = (name: string) => {
:disabled="isMetaLoading" :disabled="isMetaLoading"
:loading="isMetaLoading" :loading="isMetaLoading"
:placeholder="$t('placeholder.notSelected')" :placeholder="$t('placeholder.notSelected')"
class="!rounded-r-none ct" class="nc-to-select flex-1"
> >
<a-select-option <a-select-option
v-for="(option, id) in [...viewSelectFieldOptions].filter((f) => { v-for="(option, id) in [...viewSelectFieldOptions].filter((f) => {
@ -1046,7 +1051,7 @@ const getPluralName = (name: string) => {
const firstRange = viewSelectFieldOptions.find( const firstRange = viewSelectFieldOptions.find(
(f) => f.value === form.calendar_range[0].fk_from_column_id, (f) => f.value === form.calendar_range[0].fk_from_column_id,
) )
return firstRange?.uidt === f.uidt return firstRange?.uidt === f.uidt && f.value !== range.fk_from_column_id
})" })"
:key="id" :key="id"
:value="option.value" :value="option.value"
@ -1435,7 +1440,6 @@ const getPluralName = (name: string) => {
.nc-input-text-area { .nc-input-text-area {
padding-block: 8px !important; padding-block: 8px !important;
} }
.ant-form-item-required { .ant-form-item-required {
@apply !text-gray-800 font-medium; @apply !text-gray-800 font-medium;
&:before { &:before {
@ -1443,14 +1447,6 @@ const getPluralName = (name: string) => {
} }
} }
.nc-from-select .ant-select-selector {
@apply !mr-2;
}
.nc-to-select .ant-select-selector {
@apply !rounded-r-none;
}
.ant-form-item { .ant-form-item {
@apply !mb-0; @apply !mb-0;
} }
@ -1471,10 +1467,12 @@ const getPluralName = (name: string) => {
@apply content-[''] m-0; @apply content-[''] m-0;
} }
} }
:deep(.ant-select) { :not(.nc-to-select) {
:deep(.ant-select) {
.ant-select-selector { .ant-select-selector {
@apply !rounded-lg; @apply !rounded-lg;
} }
}
} }
.nc-nocoai-footer { .nc-nocoai-footer {
@ -1510,4 +1508,11 @@ const getPluralName = (name: string) => {
@apply !rounded-5; @apply !rounded-5;
} }
} }
:deep(.nc-to-select) {
.ant-select-selector {
@apply !rounded-r-none;
border-radius-right: 0rem !important;
}
}
</style> </style>

27
packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue

@ -138,11 +138,11 @@ const removeRange = async (id: number) => {
_calendar_ranges.value = _calendar_ranges.value.filter((_, i) => i !== id) _calendar_ranges.value = _calendar_ranges.value.filter((_, i) => i !== id)
await saveCalendarRanges() await saveCalendarRanges()
} }
/*
const saveCalendarRange = async (range: CalendarRangeType, value?) => { const saveCalendarRange = async (range: CalendarRangeType, value?) => {
range.fk_to_column_id = value range.fk_to_column_id = value
await saveCalendarRanges() await saveCalendarRanges()
} */ }
</script> </script>
<template> <template>
@ -176,11 +176,11 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => {
</NcTooltip> </NcTooltip>
<template #overlay> <template #overlay>
<div v-if="calendarRangeDropdown" class="w-138 space-y-6 rounded-2xl p-6" data-testid="nc-calendar-range-menu" @click.stop> <div v-if="calendarRangeDropdown" class="w-108 space-y-6 rounded-2xl p-6" data-testid="nc-calendar-range-menu" @click.stop>
<div <div
v-for="(range, id) in _calendar_ranges" v-for="(range, id) in _calendar_ranges"
:key="id" :key="id"
class="flex w-full gap-2 mb-2 items-center" class="flex flex-col w-full gap-2 mb-2"
data-testid="nc-calendar-range-option" data-testid="nc-calendar-range-option"
> >
<span> <span>
@ -222,15 +222,18 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => {
</a-select-option> </a-select-option>
</NcSelect> </NcSelect>
<div <NcButton
v-if="range.fk_to_column_id === null && isEeUI" v-if="range.fk_to_column_id === null"
class="flex cursor-pointer flex text-gray-800 items-center gap-1" size="small"
data-testid="nc-calendar-range-add-end-date" data-testid="nc-calendar-range-add-end-date"
@click="saveCalendarRange(range, undefined)" class="!border-none w-28"
type="secondary"
:disabled="!isEeUI"
@click="range.fk_to_column_id = undefined"
> >
<component :is="iconMap.plus" class="h-4 w-4" /> <component :is="iconMap.plus" class="h-4 w-4" />
{{ $t('activity.addEndDate') }} {{ $t('activity.addEndDate') }}
</div> </NcButton>
<template v-else-if="isEeUI"> <template v-else-if="isEeUI">
<span> <span>
{{ $t('activity.withEndDate') }} {{ $t('activity.withEndDate') }}
@ -240,14 +243,14 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => {
v-model:value="range.fk_to_column_id" v-model:value="range.fk_to_column_id"
:disabled="!range.fk_from_column_id" :disabled="!range.fk_from_column_id"
:placeholder="$t('placeholder.notSelected')" :placeholder="$t('placeholder.notSelected')"
class="!rounded-r-none nc-to-select" class="!rounded-r-none flex-1 nc-to-select"
data-testid="nc-calendar-range-to-field-select" data-testid="nc-calendar-range-to-field-select"
@change="saveCalendarRanges" @change="saveCalendarRanges"
> >
<a-select-option <a-select-option
v-for="(option, opId) in [...dateFieldOptions].filter((f) => { v-for="(option, opId) in [...dateFieldOptions].filter((f) => {
const firstRange = dateFieldOptions.find((f) => f.value === calendarRange[0].fk_from_column_id) const firstRange = dateFieldOptions.find((f) => f.value === calendarRange[0].fk_from_column_id)
return firstRange?.uidt === f.uidt return firstRange?.uidt === f.uidt && f.value !== range.fk_from_column_id
})" })"
:key="opId" :key="opId"
:value="option.value" :value="option.value"
@ -294,7 +297,7 @@ const saveCalendarRange = async (range: CalendarRangeType, value?) => {
</NcDropdown> </NcDropdown>
</template> </template>
<style lang="scss" scoped> <style lang="scss">
.nc-to-select .ant-select-selector { .nc-to-select .ant-select-selector {
@apply !rounded-r-none; @apply !rounded-r-none;
} }

Loading…
Cancel
Save