Browse Source

refactor(gui-v2): move to GeneralShareBaseButton

pull/3157/head
Wing-Kam Wong 2 years ago
parent
commit
cac5cec6c7
  1. 33
      packages/nc-gui-v2/components/general/ShareBaseButton.vue
  2. 26
      packages/nc-gui-v2/layouts/base.vue

33
packages/nc-gui-v2/components/general/ShareBaseButton.vue

@ -0,0 +1,33 @@
<script setup lang="ts">
import { useRoute } from '#imports'
const route = useRoute()
const showUserModal = $ref(false)
const { isUIAllowed } = useUIPermission()
</script>
<template>
<div class="flex items-center mr-4">
<a-button
v-if="
isUIAllowed('newUser') &&
route.name !== 'index' &&
route.name !== 'project-index-create' &&
route.name !== 'project-index-create-external' &&
route.name !== 'index-user-index'
"
size="middle"
type="primary"
class="!bg-white !text-primary rounded"
@click="showUserModal = true"
>
<div class="flex items-center space-x-1">
<mdi-account-supervisor-outline class="mr-1" />
<div>{{ $t('activity.share') }}</div>
</div>
</a-button>
<TabsAuthUserManagementUsersModal :key="showUserModal" :show="showUserModal" @closed="showUserModal = false" />
</div>
</template>

26
packages/nc-gui-v2/layouts/base.vue

@ -10,10 +10,6 @@ const route = useRoute()
const email = computed(() => user.value?.email ?? '---')
const { isUIAllowed } = useUIPermission()
const showUserModal = $ref(false)
const logout = () => {
signOut()
navigateTo('/signin')
@ -47,27 +43,7 @@ const logout = () => {
<div class="flex-1" />
<div class="flex items-center mr-4">
<a-button
v-if="
isUIAllowed('newUser') &&
route.name !== 'index' &&
route.name !== 'project-index-create' &&
route.name !== 'project-index-create-external' &&
route.name !== 'index-user-index'
"
size="middle"
type="primary"
class="!bg-white !text-primary rounded"
@click="showUserModal = true"
>
<div class="flex items-center space-x-1">
<mdi-account-supervisor-outline class="mr-1" />
<div>{{ $t('activity.share') }}</div>
</div>
</a-button>
<TabsAuthUserManagementUsersModal :key="showUserModal" :show="showUserModal" @closed="showUserModal = false" />
</div>
<GeneralShareBaseButton />
<a-tooltip placement="bottom">
<template #title> Switch language </template>

Loading…
Cancel
Save