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