Browse Source

fix(gui-v2): add i18n & isUIAllowed to modal

pull/3087/head
Wing-Kam Wong 2 years ago
parent
commit
4a3d4e3d88
  1. 29
      packages/nc-gui-v2/components/dashboard/settings/Modal.vue

29
packages/nc-gui-v2/components/dashboard/settings/Modal.vue

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { FunctionalComponent, SVGAttributes } from 'vue' import type { FunctionalComponent, SVGAttributes } from 'vue'
import { useI18n } from 'vue-i18n'
import AuditTab from './AuditTab.vue' import AuditTab from './AuditTab.vue'
import AppStore from './AppStore.vue' import AppStore from './AppStore.vue'
import Metadata from './Metadata.vue' import Metadata from './Metadata.vue'
@ -10,7 +11,7 @@ import StoreFrontOutline from '~icons/mdi/storefront-outline'
import TeamFillIcon from '~icons/ri/team-fill' import TeamFillIcon from '~icons/ri/team-fill'
import MultipleTableIcon from '~icons/mdi/table-multiple' import MultipleTableIcon from '~icons/mdi/table-multiple'
import NootbookOutline from '~icons/mdi/notebook-outline' import NootbookOutline from '~icons/mdi/notebook-outline'
import { useVModel, watch } from '#imports' import { useVModel, useUIPermission, watch } from '#imports'
interface Props { interface Props {
modelValue: boolean modelValue: boolean
@ -38,19 +39,29 @@ const emits = defineEmits(['update:modelValue'])
const vModel = useVModel(props, 'modelValue', emits) const vModel = useVModel(props, 'modelValue', emits)
const { isUIAllowed } = useUIPermission()
const { t } = useI18n()
const tabsInfo: TabGroup = { const tabsInfo: TabGroup = {
teamAndAuth: { teamAndAuth: {
title: 'Team and Auth', title: 'Team and Auth',
icon: TeamFillIcon, icon: TeamFillIcon,
subTabs: { subTabs: {
usersManagement: { ...(isUIAllowed('userMgmtTab') && {
title: 'Users Management', usersManagement: {
body: UserManagement, // Users Management
}, title: t('title.userMgmt'),
apiTokenManagement: { body: UserManagement,
title: 'API Token Management', },
body: ApiTokenManagement, }),
}, ...(isUIAllowed('apiTokenTab') && {
apiTokenManagement: {
// API Tokens Management
title: t('title.apiTokenMgmt'),
body: ApiTokenManagement,
},
}),
}, },
}, },
appStore: { appStore: {

Loading…
Cancel
Save