Browse Source

fix(gui-v2): abort renaming view on failed validation

pull/3094/head
braks 2 years ago
parent
commit
52c3372ef9
  1. 4
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue
  2. 2
      packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue

4
packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue

@ -148,12 +148,14 @@ async function onRename(view: ViewType) {
message: valid,
duration: 2,
})
return
}
try {
await api.dbView.update(view.id!, {
title: view.title,
order: view.order,
order: String(view.order),
})
notification.success({

2
packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue

@ -8,11 +8,11 @@ interface Props {
}
interface Emits {
(event: 'openModal', data: { type: ViewTypes; title?: string }): void
(event: 'update:view', data: Record<string, any>): void
(event: 'changeView', view: Record<string, any>): void
(event: 'rename', view: Record<string, any>): void
(event: 'delete', view: Record<string, any>): void
(event: 'openModal', data: { type: ViewTypes; title?: string; copyViewId?: string }): void
}
const props = defineProps<Props>()

Loading…
Cancel
Save