Browse Source

fix(gui-v2): add missing isSharedBase

pull/3234/head
Wing-Kam Wong 2 years ago
parent
commit
9aa8f9e506
  1. 4
      packages/nc-gui-v2/components/dashboard/TreeView.vue
  2. 12
      packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue
  3. 2
      packages/nc-gui-v2/layouts/base.vue
  4. 15
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index.vue

4
packages/nc-gui-v2/components/dashboard/TreeView.vue

@ -202,7 +202,7 @@ const activeTable = computed(() => {
<div class="nc-tbl-title flex-1">{{ table.title }}</div>
<a-dropdown
v-if="!isLocked && (isUIAllowed('table-rename') || isUIAllowed('table-delete'))"
v-if="!isSharedBase && !isLocked && (isUIAllowed('table-rename') || isUIAllowed('table-delete'))"
:trigger="['click']"
@click.stop
>
@ -244,7 +244,7 @@ const activeTable = computed(() => {
</div>
</div>
<template v-if="!isLocked" #overlay>
<template v-if="!isLocked && !isSharedBase" #overlay>
<a-menu class="cursor-pointer">
<template v-if="contextMenuTarget.type === 'table'">
<a-menu-item

12
packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue

@ -4,8 +4,7 @@ import { ViewTypes } from 'nocodb-sdk'
import { computed } from 'vue'
import { message } from 'ant-design-vue'
import { useNuxtApp } from '#app'
import { useSmartsheetStoreOrThrow } from '#imports'
import { extractSdkResponseErrorMsg } from '~/utils'
import { extractSdkResponseErrorMsg, useProject, useSmartsheetStoreOrThrow } from '#imports'
import MdiOpenInNewIcon from '~icons/mdi/open-in-new'
import MdiCopyIcon from '~icons/mdi/content-copy'
@ -19,6 +18,8 @@ const { dashboardUrl } = useDashboard()
const { isUIAllowed } = useUIPermission()
const { isSharedBase } = useProject()
let showShareModel = $ref(false)
let passwordProtected = $ref(false)
@ -118,7 +119,12 @@ onMounted(() => {
<template>
<div>
<a-button v-if="isUIAllowed('share-view')" v-t="['c:view:share']" outlined class="nc-btn-share-view nc-toolbar-btn">
<a-button
v-if="isUIAllowed('share-view') && !isSharedBase"
v-t="['c:view:share']"
outlined
class="nc-btn-share-view nc-toolbar-btn"
>
<div class="flex align-center gap-1" @click="genShareLink">
<MdiOpenInNewIcon />
<!-- Share View -->

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

@ -48,7 +48,7 @@ const logout = () => {
<GeneralReleaseInfo />
<GeneralShareBaseButton />
<GeneralShareBaseButton v-if="!isSharedBase" />
<a-tooltip placement="bottom">
<template #title> Switch language</template>

15
packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index.vue

@ -1,7 +1,7 @@
<script setup lang="ts">
import type { TabItem } from '~/composables'
import { TabType } from '~/composables'
import { TabMetaInj, useTabs, useUIPermission } from '#imports'
import { TabMetaInj, useProject, useTabs, useUIPermission } from '#imports'
import MdiAirTableIcon from '~icons/mdi/table-large'
import MdiView from '~icons/mdi/eye-circle-outline'
import MdiAccountGroup from '~icons/mdi/account-group'
@ -10,10 +10,16 @@ const { tabs, activeTabIndex, activeTab, closeTab } = useTabs()
const { isUIAllowed } = useUIPermission()
const { isSharedBase } = useProject()
const tableCreateDialog = ref(false)
const airtableImportDialog = ref(false)
const quickImportDialog = ref(false)
const importType = ref('')
const currentMenu = ref<string[]>(['addORImport'])
provide(TabMetaInj, activeTab)
@ -50,7 +56,12 @@ const icon = (tab: TabItem) => {
</a-tab-pane>
<template #leftExtra>
<a-menu v-if="isUIAllowed('addOrImport')" v-model:selectedKeys="currentMenu" class="border-0" mode="horizontal">
<a-menu
v-if="isUIAllowed('addOrImport') && !isSharedBase"
v-model:selectedKeys="currentMenu"
class="border-0"
mode="horizontal"
>
<a-sub-menu key="addORImport">
<template #title>
<div class="text-sm flex items-center gap-2 pt-[8px] pb-3">

Loading…
Cancel
Save