From 3a47508d551503b70fc22cb96f5510853e4b48f6 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 12 Aug 2022 12:15:31 +0800 Subject: [PATCH] fix(gui-v2): add isUIAllowed('projectCreate', true) & $e to page index --- packages/nc-gui-v2/pages/index/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui-v2/pages/index/index.vue b/packages/nc-gui-v2/pages/index/index.vue index b3e26a021c..9139a4a3ac 100644 --- a/packages/nc-gui-v2/pages/index/index.vue +++ b/packages/nc-gui-v2/pages/index/index.vue @@ -15,6 +15,8 @@ const { $e } = useNuxtApp() const { api, isLoading } = useApi() +const { isUIAllowed } = useUIPermission() + useSidebar({ hasSidebar: true, isOpen: true }) const filterQuery = ref('') @@ -34,6 +36,7 @@ const filteredProjects = computed( ) const deleteProject = (project: ProjectType) => { + $e('c:project:delete') Modal.confirm({ title: `Do you want to delete '${project.title}' project?`, okText: 'Yes', @@ -41,8 +44,8 @@ const deleteProject = (project: ProjectType) => { cancelText: 'No', async onOk() { try { - $e('c:project:delete') await api.project.delete(project.id as string) + $e('a:project:delete') return projects.value?.splice(projects.value.indexOf(project), 1) } catch (e: any) { return notification.error({ @@ -80,7 +83,7 @@ onMounted(() => { >
- +
{{ $t('title.newProj') }} @@ -128,7 +131,7 @@ onMounted(() => { :data-source="filteredProjects" :pagination="{ position: ['bottomCenter'] }" > - + - +