Browse Source

feat(gui-v2): confirm before delete

pull/2837/head
braks 2 years ago
parent
commit
e1e2e93dc2
  1. 17
      packages/nc-gui-v2/components/smartsheet/Sidebar.vue
  2. 10
      packages/nc-gui-v2/nuxt.config.ts
  3. 5
      packages/nc-gui-v2/tsconfig.json

17
packages/nc-gui-v2/components/smartsheet/Sidebar.vue

@ -211,13 +211,6 @@ async function onDelete(index: number) {
$e('a:view:delete', { view: view.type }) $e('a:view:delete', { view: view.type })
} }
onMounted(() => {
notification.open({
message: 'Welcome to the View Manager',
duration: 3,
})
})
/** Rename a view */ /** Rename a view */
async function onRename(index: number) { async function onRename(index: number) {
// todo: validate if title is unique and not empty // todo: validate if title is unique and not empty
@ -309,13 +302,21 @@ function onStopEdit() {
<MdiContentCopy class="hidden group-hover:block text-gray-500" @click.stop="onDuplicate(i)" /> <MdiContentCopy class="hidden group-hover:block text-gray-500" @click.stop="onDuplicate(i)" />
</a-tooltip> </a-tooltip>
<a-popconfirm
placement="left"
:title="$t('msg.info.deleteProject')"
:ok-text="$t('general.yes')"
:cancel-text="$t('general.no')"
@confirm="onDelete(i)"
>
<a-tooltip placement="left"> <a-tooltip placement="left">
<template #title> <template #title>
{{ $t('activity.deleteView') }} {{ $t('activity.deleteView') }}
</template> </template>
<MdiTrashCan class="hidden group-hover:block text-red-500" @click.stop="onDelete(i)" /> <MdiTrashCan class="hidden group-hover:block text-red-500" @click.stop />
</a-tooltip> </a-tooltip>
</a-popconfirm>
</div> </div>
</div> </div>
</a-menu-item> </a-menu-item>

10
packages/nc-gui-v2/nuxt.config.ts

@ -87,4 +87,14 @@ export default defineNuxtConfig({
reactivityTransform: true, reactivityTransform: true,
viteNode: false, viteNode: false,
}, },
typescript: {
typeCheck: true,
strict: true,
tsConfig: {
compilerOptions: {
types: ['@intlify/vite-plugin-vue-i18n/client', 'vue-i18n', 'unplugin-icons/types/vue', 'nuxt-windicss'],
},
},
},
}) })

5
packages/nc-gui-v2/tsconfig.json

@ -12,16 +12,11 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"types": [ "types": [
"@intlify/vite-plugin-vue-i18n/client", "@intlify/vite-plugin-vue-i18n/client",
"vue/macro",
"vue-i18n", "vue-i18n",
"unplugin-icons/types/vue", "unplugin-icons/types/vue",
"nuxt-windicss" "nuxt-windicss"
] ]
}, },
"files": [
"nuxt-shim.d.ts",
"windi.config.ts"
],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"dist", "dist",

Loading…
Cancel
Save