diff --git a/packages/nc-gui-v2/components/cell/TimePicker.vue b/packages/nc-gui-v2/components/cell/TimePicker.vue index 09763085f2..65a50421cc 100644 --- a/packages/nc-gui-v2/components/cell/TimePicker.vue +++ b/packages/nc-gui-v2/components/cell/TimePicker.vue @@ -79,7 +79,7 @@ watch( :allow-clear="!readOnlyMode" :input-read-only="true" :open="readOnlyMode ? false : open" - :dropdown-class-name="randomClass" + :popup-class-name="randomClass" @click="open = !open" @ok="open = !open" > diff --git a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue index 592a5a7e43..7e60afc173 100644 --- a/packages/nc-gui-v2/components/smartsheet-header/Cell.vue +++ b/packages/nc-gui-v2/components/smartsheet-header/Cell.vue @@ -5,7 +5,7 @@ import { inject, toRef } from 'vue' import { ColumnInj, IsFormInj, MetaInj } from '~/context' import { useProvideColumnCreateStore } from '#imports' -const props = defineProps<{ column: ColumnType & { meta: any }; required: boolean; hideMenu?: boolean }>() +const props = defineProps<{ column: ColumnType & { meta: any }; required?: boolean; hideMenu?: boolean }>() const hideMenu = toRef(props, 'hideMenu') diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue index cb1fa51686..1ee2300dfc 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue @@ -61,12 +61,12 @@ function markItem(id: string) { } /** validate view title */ -function validate(value?: string) { - if (!value || value.trim().length < 0) { +function validate(view: Record) { + if (!view.title || view.title.trim().length < 0) { return 'View name is required' } - if (views.value.every((v1) => v1.title !== value)) { + if (views.value.some((v) => v.title === view.title && v.id !== view.id)) { return 'View name should be unique' } @@ -141,19 +141,10 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi /** Rename a view */ async function onRename(view: ViewType) { - const valid = validate(view.title) - - if (valid !== true) { - notification.error({ - message: valid, - duration: 2, - }) - } - try { await api.dbView.update(view.id!, { title: view.title, - order: view.order, + order: String(view.order), }) notification.success({ @@ -193,6 +184,7 @@ function onDeleted() { :id="view.id" :key="view.id" :view="view" + :on-validate="validate" class="transition-all ease-in duration-300" :class="[ isMarked === view.id ? 'bg-gray-200' : '', diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue index d28ad94026..1e9186be49 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue @@ -1,18 +1,20 @@