|
|
@ -2,7 +2,7 @@ |
|
|
|
import { nextTick } from '@vue/runtime-core' |
|
|
|
import { nextTick } from '@vue/runtime-core' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { stringifyRolesObj } from 'nocodb-sdk' |
|
|
|
import { stringifyRolesObj } from 'nocodb-sdk' |
|
|
|
import type { SourceType, BaseType, TableType } from 'nocodb-sdk' |
|
|
|
import type { BaseType, SourceType, TableType } from 'nocodb-sdk' |
|
|
|
import { LoadingOutlined } from '@ant-design/icons-vue' |
|
|
|
import { LoadingOutlined } from '@ant-design/icons-vue' |
|
|
|
import { useTitle } from '@vueuse/core' |
|
|
|
import { useTitle } from '@vueuse/core' |
|
|
|
import { |
|
|
|
import { |
|
|
@ -10,10 +10,27 @@ import { |
|
|
|
ProjectInj, |
|
|
|
ProjectInj, |
|
|
|
ProjectRoleInj, |
|
|
|
ProjectRoleInj, |
|
|
|
ToggleDialogInj, |
|
|
|
ToggleDialogInj, |
|
|
|
|
|
|
|
TreeViewInj, |
|
|
|
|
|
|
|
computed, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
|
|
|
|
h, |
|
|
|
|
|
|
|
inject, |
|
|
|
|
|
|
|
navigateTo, |
|
|
|
openLink, |
|
|
|
openLink, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
resolveComponent, |
|
|
|
storeToRefs, |
|
|
|
storeToRefs, |
|
|
|
|
|
|
|
useBase, |
|
|
|
useBases, |
|
|
|
useBases, |
|
|
|
|
|
|
|
useCopy, |
|
|
|
|
|
|
|
useDialog, |
|
|
|
|
|
|
|
useGlobal, |
|
|
|
|
|
|
|
useI18n, |
|
|
|
|
|
|
|
useRoles, |
|
|
|
|
|
|
|
useRouter, |
|
|
|
|
|
|
|
useTablesStore, |
|
|
|
|
|
|
|
useTabs, |
|
|
|
|
|
|
|
useToggle, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
import type { NcProject } from '#imports' |
|
|
|
import type { NcProject } from '#imports' |
|
|
|
import { useNuxtApp } from '#app' |
|
|
|
import { useNuxtApp } from '#app' |
|
|
@ -27,10 +44,10 @@ const indicator = h(LoadingOutlined, { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const router = useRouter() |
|
|
|
|
|
|
|
|
|
|
|
const route = router.currentRoute |
|
|
|
const route = router.currentRoute |
|
|
|
|
|
|
|
|
|
|
|
const { isSharedBase } = storeToRefs(useBase()) |
|
|
|
const { isSharedBase } = storeToRefs(useBase()) |
|
|
|
const { projectUrl } = useBase() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { setMenuContext, openRenameTableDialog, duplicateTable, contextMenuTarget } = inject(TreeViewInj)! |
|
|
|
const { setMenuContext, openRenameTableDialog, duplicateTable, contextMenuTarget } = inject(TreeViewInj)! |
|
|
|
|
|
|
|
|
|
|
@ -41,9 +58,11 @@ const basesStore = useBases() |
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const { loadProject, loadProjects, createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore |
|
|
|
const { loadProject, loadProjects, createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore |
|
|
|
|
|
|
|
|
|
|
|
const { bases } = storeToRefs(basesStore) |
|
|
|
const { bases } = storeToRefs(basesStore) |
|
|
|
|
|
|
|
|
|
|
|
const { loadProjectTables } = useTablesStore() |
|
|
|
const { loadProjectTables } = useTablesStore() |
|
|
|
|
|
|
|
|
|
|
|
const { activeTable } = storeToRefs(useTablesStore()) |
|
|
|
const { activeTable } = storeToRefs(useTablesStore()) |
|
|
|
|
|
|
|
|
|
|
|
const { appInfo, navigateToProject } = useGlobal() |
|
|
|
const { appInfo, navigateToProject } = useGlobal() |
|
|
@ -424,17 +443,13 @@ const projectDelete = () => { |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center mr-1" @click="onProjectClick(base)"> |
|
|
|
<div class="flex items-center mr-1" @click="onProjectClick(base)"> |
|
|
|
<div class="flex items-center select-none w-6 h-full"> |
|
|
|
<div class="flex items-center select-none w-6 h-full"> |
|
|
|
<a-spin |
|
|
|
<a-spin v-if="base.isLoading" class="!ml-1.25 !flex !flex-row !items-center !my-0.5 w-8" :indicator="indicator" /> |
|
|
|
v-if="base.isLoading" |
|
|
|
|
|
|
|
class="!ml-1.25 !flex !flex-row !items-center !my-0.5 w-8" |
|
|
|
|
|
|
|
:indicator="indicator" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<LazyGeneralEmojiPicker |
|
|
|
<LazyGeneralEmojiPicker |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
:key="base.meta?.icon" |
|
|
|
:key="base.meta?.icon" |
|
|
|
:emoji="base.meta?.icon" |
|
|
|
|
|
|
|
v-e="['c:base:emojiSelect']" |
|
|
|
v-e="['c:base:emojiSelect']" |
|
|
|
|
|
|
|
:emoji="base.meta?.icon" |
|
|
|
:readonly="true" |
|
|
|
:readonly="true" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
@emoji-selected="setIcon($event, base)" |
|
|
|
@emoji-selected="setIcon($event, base)" |
|
|
@ -517,8 +532,8 @@ const projectDelete = () => { |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="!isEeUI" |
|
|
|
v-if="!isEeUI" |
|
|
|
key="copy" |
|
|
|
key="copy" |
|
|
|
data-testid="nc-sidebar-base-copy-base-info" |
|
|
|
|
|
|
|
v-e="['c:base:copy-proj-info']" |
|
|
|
v-e="['c:base:copy-proj-info']" |
|
|
|
|
|
|
|
data-testid="nc-sidebar-base-copy-base-info" |
|
|
|
@click.stop="copyProjectInfo" |
|
|
|
@click.stop="copyProjectInfo" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="copy" class="group-hover:text-black" /> |
|
|
|
<GeneralIcon icon="copy" class="group-hover:text-black" /> |
|
|
@ -622,8 +637,8 @@ const projectDelete = () => { |
|
|
|
<a-collapse |
|
|
|
<a-collapse |
|
|
|
v-else-if="source && source.enabled" |
|
|
|
v-else-if="source && source.enabled" |
|
|
|
v-model:activeKey="activeKey" |
|
|
|
v-model:activeKey="activeKey" |
|
|
|
class="!mx-0 !px-0 nc-sidebar-source-node" |
|
|
|
|
|
|
|
v-e="['c:source:toggle-expand']" |
|
|
|
v-e="['c:source:toggle-expand']" |
|
|
|
|
|
|
|
class="!mx-0 !px-0 nc-sidebar-source-node" |
|
|
|
:class="[{ hidden: searchActive && !!filterQuery }]" |
|
|
|
:class="[{ hidden: searchActive && !!filterQuery }]" |
|
|
|
expand-icon-position="left" |
|
|
|
expand-icon-position="left" |
|
|
|
:bordered="false" |
|
|
|
:bordered="false" |
|
|
@ -743,7 +758,11 @@ const projectDelete = () => { |
|
|
|
<template v-else-if="contextMenuTarget.type === 'source'"></template> |
|
|
|
<template v-else-if="contextMenuTarget.type === 'source'"></template> |
|
|
|
|
|
|
|
|
|
|
|
<template v-else-if="contextMenuTarget.type === 'table'"> |
|
|
|
<template v-else-if="contextMenuTarget.type === 'table'"> |
|
|
|
<NcMenuItem v-if="isUIAllowed('tableRename')" v-e="['c:table:rename']" @click="openRenameTableDialog(contextMenuTarget.value, true)"> |
|
|
|
<NcMenuItem |
|
|
|
|
|
|
|
v-if="isUIAllowed('tableRename')" |
|
|
|
|
|
|
|
v-e="['c:table:rename']" |
|
|
|
|
|
|
|
@click="openRenameTableDialog(contextMenuTarget.value, true)" |
|
|
|
|
|
|
|
> |
|
|
|
<div class="nc-base-option-item"> |
|
|
|
<div class="nc-base-option-item"> |
|
|
|
<GeneralIcon icon="edit" class="text-gray-700" /> |
|
|
|
<GeneralIcon icon="edit" class="text-gray-700" /> |
|
|
|
{{ $t('general.rename') }} |
|
|
|
{{ $t('general.rename') }} |
|
|
|