diff --git a/packages/nc-gui/components.d.ts b/packages/nc-gui/components.d.ts index 18d80347a9..e9ea1978af 100644 --- a/packages/nc-gui/components.d.ts +++ b/packages/nc-gui/components.d.ts @@ -190,6 +190,8 @@ declare module '@vue/runtime-core' { MdiSort: typeof import('~icons/mdi/sort')['default'] MdiStar: typeof import('~icons/mdi/star')['default'] MdiStarOutline: typeof import('~icons/mdi/star-outline')['default'] + MdiStorefrontOutline: typeof import('~icons/mdi/storefront-outline')['default'] + MdiStorefrontSutline: typeof import('~icons/mdi/storefront-sutline')['default'] MdiTable: typeof import('~icons/mdi/table')['default'] MdiTableArrowRight: typeof import('~icons/mdi/table-arrow-right')['default'] MdiTableLarge: typeof import('~icons/mdi/table-large')['default'] diff --git a/packages/nc-gui/components/dashboard/settings/Modal.vue b/packages/nc-gui/components/dashboard/settings/Modal.vue index ac42ee69c6..6b775a87bb 100644 --- a/packages/nc-gui/components/dashboard/settings/Modal.vue +++ b/packages/nc-gui/components/dashboard/settings/Modal.vue @@ -56,40 +56,42 @@ const tabsInfo: TabGroup = { subTabs: { ...(isUIAllowed('userMgmtTab') ? { - usersManagement: { - // Users Management - title: t('title.userMgmt'), - body: UserManagement, - }, - } + usersManagement: { + // Users Management + title: t('title.userMgmt'), + body: UserManagement, + }, + } : {}), ...(isUIAllowed('apiTokenTab') ? { - apiTokenManagement: { - // API Tokens Management - title: t('title.apiTokenMgmt'), - body: ApiTokenManagement, - }, - } + apiTokenManagement: { + // API Tokens Management + title: t('title.apiTokenMgmt'), + body: ApiTokenManagement, + }, + } : {}), }, onClick: () => { $e('c:settings:team-auth') }, - }, ...(isUIAllowed('appStore') + }, + ...(isUIAllowed('appStore') ? { - appStore: { - // App Store - title: t('title.appStore'), - icon: StoreFrontOutline, - subTabs: { - new: { - title: 'Apps', - body: AppStore, + appStore: { + // App Store + title: t('title.appStore'), + icon: StoreFrontOutline, + subTabs: { + new: { + title: 'Apps', + body: AppStore, + }, + }, + onClick: () => { + $e('c:settings:appstore') }, - }, - onClick: () => { - $e('c:settings:appstore') }, } : {}), diff --git a/packages/nc-gui/composables/useUIPermission/index.ts b/packages/nc-gui/composables/useUIPermission/index.ts index ee2bc2796f..e3fb3aba54 100644 --- a/packages/nc-gui/composables/useUIPermission/index.ts +++ b/packages/nc-gui/composables/useUIPermission/index.ts @@ -11,13 +11,12 @@ const hasPermission = (role: Role | ProjectRole, hasRole: boolean, permission: P if (isString(rolePermission) && rolePermission === '*') return true - // todo: type correction - if('include' in rolePermission[permission as keyof typeof rolePermission]){ - return rolePermission[permission as keyof typeof rolePermission].include[permission] + if ('include' in rolePermission) { + return rolePermission.include[permission] } - if('exclude' in rolePermission[permission as keyof typeof rolePermission]){ - return !rolePermission[permission as keyof typeof rolePermission].exclude[permission] + if ('exclude' in rolePermission) { + return !rolePermission.exclude[permission] } return rolePermission[permission as keyof typeof rolePermission] diff --git a/packages/nc-gui/layouts/base.vue b/packages/nc-gui/layouts/base.vue index dab22ba952..715f128d16 100644 --- a/packages/nc-gui/layouts/base.vue +++ b/packages/nc-gui/layouts/base.vue @@ -13,6 +13,8 @@ const hasSider = ref(false) const sidebar = ref() +const { isUIAllowed } = useUIPermission() + const logout = () => { signOut() navigateTo('/signin') @@ -87,6 +89,19 @@ hooks.hook('page:finish', () => { + + + +   + + {{ $t('title.appStore') }} + + + diff --git a/packages/nc-gui/pages/index/apps.vue b/packages/nc-gui/pages/index/apps.vue index 286fdb93d2..169a67bfd5 100644 --- a/packages/nc-gui/pages/index/apps.vue +++ b/packages/nc-gui/pages/index/apps.vue @@ -9,8 +9,8 @@ definePageMeta({