Browse Source

feat(gui): add appstore in navbar menu

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3796/head
Pranav C 2 years ago
parent
commit
2be20c5ee2
  1. 2
      packages/nc-gui/components.d.ts
  2. 4
      packages/nc-gui/components/dashboard/settings/Modal.vue
  3. 9
      packages/nc-gui/composables/useUIPermission/index.ts
  4. 15
      packages/nc-gui/layouts/base.vue
  5. 4
      packages/nc-gui/pages/index/apps.vue

2
packages/nc-gui/components.d.ts vendored

@ -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']

4
packages/nc-gui/components/dashboard/settings/Modal.vue

@ -76,7 +76,8 @@ const tabsInfo: TabGroup = {
onClick: () => {
$e('c:settings:team-auth')
},
}, ...(isUIAllowed('appStore')
},
...(isUIAllowed('appStore')
? {
appStore: {
// App Store
@ -91,6 +92,7 @@ const tabsInfo: TabGroup = {
onClick: () => {
$e('c:settings:appstore')
},
},
}
: {}),
projMetaData: {

9
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]

15
packages/nc-gui/layouts/base.vue

@ -13,6 +13,8 @@ const hasSider = ref(false)
const sidebar = ref<HTMLDivElement>()
const { isUIAllowed } = useUIPermission()
const logout = () => {
signOut()
navigateTo('/signin')
@ -87,6 +89,19 @@ hooks.hook('page:finish', () => {
</nuxt-link>
</a-menu-item>
<a-menu-divider class="!m-0" />
<a-menu-item v-if="isUIAllowed('appStore')" key="0" class="!rounded-t">
<nuxt-link
v-e="['c:settings:appstore', { page: true }]"
class="nc-project-menu-item group !no-underline"
to="/apps"
>
<MdiStorefrontOutline class="mt-1 group-hover:text-accent" />&nbsp;
<span class="prose group-hover:text-primary">{{ $t('title.appStore') }}</span>
</nuxt-link>
</a-menu-item>
<a-menu-divider class="!m-0" />
<a-menu-item key="1" class="!rounded-b group">

4
packages/nc-gui/pages/index/apps.vue

@ -9,8 +9,8 @@ definePageMeta({
</script>
<template>
<div class="p-4 h-full overflow-auto">
<h1>{{ $t('label.appStore') }}</h1>
<div class="p-10 h-full overflow-auto">
<h1 class="text-3xl text-center mb-11">{{ $t('title.appStore') }}</h1>
<AppStore />
</div>
</template>

Loading…
Cancel
Save