|
|
@ -77,7 +77,7 @@ const tempTitle = ref('') |
|
|
|
|
|
|
|
|
|
|
|
const activeBaseId = ref('') |
|
|
|
const activeBaseId = ref('') |
|
|
|
|
|
|
|
|
|
|
|
const isErdModalOpen = ref<Boolean>(false) |
|
|
|
const isErdModalOpen = ref<boolean>(false) |
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
@ -116,7 +116,7 @@ const showBaseOption = computed(() => { |
|
|
|
return ['airtableImport', 'csvImport', 'jsonImport', 'excelImport'].some((permission) => isUIAllowed(permission)) |
|
|
|
return ['airtableImport', 'csvImport', 'jsonImport', 'excelImport'].some((permission) => isUIAllowed(permission)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const enableEditMode = () => { |
|
|
|
function enableEditMode() { |
|
|
|
editMode.value = true |
|
|
|
editMode.value = true |
|
|
|
tempTitle.value = base.value.title! |
|
|
|
tempTitle.value = base.value.title! |
|
|
|
nextTick(() => { |
|
|
|
nextTick(() => { |
|
|
@ -126,7 +126,7 @@ const enableEditMode = () => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const updateProjectTitle = async () => { |
|
|
|
async function updateProjectTitle() { |
|
|
|
if (!tempTitle.value) return |
|
|
|
if (!tempTitle.value) return |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -146,7 +146,7 @@ const updateProjectTitle = async () => { |
|
|
|
|
|
|
|
|
|
|
|
const { copy } = useCopy(true) |
|
|
|
const { copy } = useCopy(true) |
|
|
|
|
|
|
|
|
|
|
|
const copyProjectInfo = async () => { |
|
|
|
async function copyProjectInfo() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
await copy( |
|
|
|
await copy( |
|
|
@ -168,7 +168,7 @@ defineExpose({ |
|
|
|
enableEditMode, |
|
|
|
enableEditMode, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const setIcon = async (icon: string, base: BaseType) => { |
|
|
|
async function setIcon(icon: string, base: BaseType) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const meta = { |
|
|
|
const meta = { |
|
|
|
...((base.meta as object) || {}), |
|
|
|
...((base.meta as object) || {}), |
|
|
@ -224,7 +224,8 @@ function openTableCreateDialog(sourceIndex?: number | undefined) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isAddNewProjectChildEntityLoading = ref(false) |
|
|
|
const isAddNewProjectChildEntityLoading = ref(false) |
|
|
|
const addNewProjectChildEntity = async () => { |
|
|
|
|
|
|
|
|
|
|
|
async function addNewProjectChildEntity() { |
|
|
|
if (isAddNewProjectChildEntityLoading.value) return |
|
|
|
if (isAddNewProjectChildEntityLoading.value) return |
|
|
|
|
|
|
|
|
|
|
|
isAddNewProjectChildEntityLoading.value = true |
|
|
|
isAddNewProjectChildEntityLoading.value = true |
|
|
@ -248,7 +249,7 @@ const addNewProjectChildEntity = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggleIsExpanded?: boolean) => { |
|
|
|
async function onProjectClick(base: NcProject, ignoreNavigation?: boolean, toggleIsExpanded?: boolean) { |
|
|
|
if (!base) { |
|
|
|
if (!base) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -347,17 +348,17 @@ onKeyStroke('Escape', () => { |
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const selectedProjectToDuplicate = ref() |
|
|
|
const selectedProjectToDuplicate = ref() |
|
|
|
|
|
|
|
|
|
|
|
const duplicateProject = (base: BaseType) => { |
|
|
|
function duplicateProject(base: BaseType) { |
|
|
|
selectedProjectToDuplicate.value = base |
|
|
|
selectedProjectToDuplicate.value = base |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const tableDelete = () => { |
|
|
|
function tableDelete() { |
|
|
|
isTableDeleteDialogVisible.value = true |
|
|
|
isTableDeleteDialogVisible.value = true |
|
|
|
$e('c:table:delete') |
|
|
|
$e('c:table:delete') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const projectDelete = () => { |
|
|
|
function projectDelete() { |
|
|
|
isProjectDeleteDialogVisible.value = true |
|
|
|
isProjectDeleteDialogVisible.value = true |
|
|
|
$e('c:project:delete') |
|
|
|
$e('c:project:delete') |
|
|
|
} |
|
|
|
} |
|
|
@ -396,21 +397,18 @@ const projectDelete = () => { |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
|
|
|
|
|
|
|
|
<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 v-e="['c:base:emojiSelect']" 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 |
|
|
|
<LazyGeneralEmojiPicker |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
:key="base.meta?.icon" |
|
|
|
:key="base.meta?.icon" |
|
|
|
v-e="['c:base:emojiSelect']" |
|
|
|
|
|
|
|
:emoji="base.meta?.icon" |
|
|
|
:emoji="base.meta?.icon" |
|
|
|
:readonly="true" |
|
|
|
:readonly="true" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
@emoji-selected="setIcon($event, base)" |
|
|
|
@emoji-selected="setIcon($event, base)" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #default> |
|
|
|
<GeneralProjectIcon :type="base.type" /> |
|
|
|
<GeneralProjectIcon :type="base.type" /> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</LazyGeneralEmojiPicker> |
|
|
|
</LazyGeneralEmojiPicker> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -460,24 +458,22 @@ const projectDelete = () => { |
|
|
|
@click="isOptionsOpen = false" |
|
|
|
@click="isOptionsOpen = false" |
|
|
|
> |
|
|
|
> |
|
|
|
<template v-if="!isSharedBase"> |
|
|
|
<template v-if="!isSharedBase"> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem v-if="isUIAllowed('baseRename')" data-testid="nc-sidebar-project-rename" @click="enableEditMode"> |
|
|
|
v-if="isUIAllowed('baseRename')" |
|
|
|
<div v-e="['c:base:rename']" class="flex gap-2 items-center"> |
|
|
|
v-e="['c:base:rename']" |
|
|
|
<GeneralIcon icon="edit" class="group-hover:text-black" /> |
|
|
|
data-testid="nc-sidebar-project-rename" |
|
|
|
{{ $t('general.rename') }} |
|
|
|
@click="enableEditMode" |
|
|
|
</div> |
|
|
|
> |
|
|
|
|
|
|
|
<GeneralIcon icon="edit" class="group-hover:text-black" /> |
|
|
|
|
|
|
|
{{ $t('general.rename') }} |
|
|
|
|
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('baseDuplicate', { roles: [stringifyRolesObj(orgRoles), baseRole].join() })" |
|
|
|
v-if="isUIAllowed('baseDuplicate', { roles: [stringifyRolesObj(orgRoles), baseRole].join() })" |
|
|
|
v-e="['c:base:duplicate']" |
|
|
|
|
|
|
|
data-testid="nc-sidebar-base-duplicate" |
|
|
|
data-testid="nc-sidebar-base-duplicate" |
|
|
|
@click="duplicateProject(base)" |
|
|
|
@click="duplicateProject(base)" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="duplicate" class="text-gray-700" /> |
|
|
|
<div v-e="['c:base:duplicate']" class="flex gap-2 items-center"> |
|
|
|
{{ $t('general.duplicate') }} |
|
|
|
<GeneralIcon icon="duplicate" class="text-gray-700" /> |
|
|
|
|
|
|
|
{{ $t('general.duplicate') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<NcDivider v-if="['baseDuplicate', 'baseRename'].some((permission) => isUIAllowed(permission))" /> |
|
|
|
<NcDivider v-if="['baseDuplicate', 'baseRename'].some((permission) => isUIAllowed(permission))" /> |
|
|
@ -486,30 +482,27 @@ const projectDelete = () => { |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="!isEeUI" |
|
|
|
v-if="!isEeUI" |
|
|
|
key="copy" |
|
|
|
key="copy" |
|
|
|
v-e="['c:base:copy-proj-info']" |
|
|
|
|
|
|
|
data-testid="nc-sidebar-base-copy-base-info" |
|
|
|
data-testid="nc-sidebar-base-copy-base-info" |
|
|
|
@click.stop="copyProjectInfo" |
|
|
|
@click.stop="copyProjectInfo" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="copy" class="group-hover:text-black" /> |
|
|
|
<div v-e="['c:base:copy-proj-info']" class="flex gap-2 items-center"> |
|
|
|
{{ $t('activity.account.projInfo') }} |
|
|
|
<GeneralIcon icon="copy" class="group-hover:text-black" /> |
|
|
|
|
|
|
|
{{ $t('activity.account.projInfo') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<!-- ERD View --> |
|
|
|
<!-- ERD View --> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem key="erd" data-testid="nc-sidebar-base-relations" @click="openErdView(base?.sources?.[0]!)"> |
|
|
|
key="erd" |
|
|
|
<div v-e="['c:base:erd']" class="flex gap-2 items-center"> |
|
|
|
v-e="['c:base:erd']" |
|
|
|
<GeneralIcon icon="erd" /> |
|
|
|
data-testid="nc-sidebar-base-relations" |
|
|
|
{{ $t('title.relations') }} |
|
|
|
@click="openErdView(base?.sources?.[0]!)" |
|
|
|
</div> |
|
|
|
> |
|
|
|
|
|
|
|
<GeneralIcon icon="erd" /> |
|
|
|
|
|
|
|
{{ $t('title.relations') }} |
|
|
|
|
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Swagger: Rest APIs --> |
|
|
|
<!-- Swagger: Rest APIs --> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('apiDocs')" |
|
|
|
v-if="isUIAllowed('apiDocs')" |
|
|
|
key="api" |
|
|
|
key="api" |
|
|
|
v-e="['c:base:api-docs']" |
|
|
|
|
|
|
|
data-testid="nc-sidebar-base-rest-apis" |
|
|
|
data-testid="nc-sidebar-base-rest-apis" |
|
|
|
@click.stop=" |
|
|
|
@click.stop=" |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -518,8 +511,10 @@ const projectDelete = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
" |
|
|
|
" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="snippet" class="group-hover:text-black !max-w-3.9" /> |
|
|
|
<div v-e="['c:base:api-docs']" class="flex gap-2 items-center"> |
|
|
|
{{ $t('activity.account.swagger') }} |
|
|
|
<GeneralIcon icon="snippet" class="group-hover:text-black !max-w-3.9" /> |
|
|
|
|
|
|
|
{{ $t('activity.account.swagger') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -533,13 +528,14 @@ const projectDelete = () => { |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('baseMiscSettings')" |
|
|
|
v-if="isUIAllowed('baseMiscSettings')" |
|
|
|
key="teamAndSettings" |
|
|
|
key="teamAndSettings" |
|
|
|
v-e="['c:base:settings']" |
|
|
|
|
|
|
|
data-testid="nc-sidebar-base-settings" |
|
|
|
data-testid="nc-sidebar-base-settings" |
|
|
|
class="nc-sidebar-base-base-settings" |
|
|
|
class="nc-sidebar-base-base-settings" |
|
|
|
@click="toggleDialog(true, 'teamAndAuth', undefined, base.id)" |
|
|
|
@click="toggleDialog(true, 'teamAndAuth', undefined, base.id)" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="settings" class="group-hover:text-black" /> |
|
|
|
<div v-e="['c:base:settings']" class="flex gap-2 items-center"> |
|
|
|
{{ $t('activity.settings') }} |
|
|
|
<GeneralIcon icon="settings" class="group-hover:text-black" /> |
|
|
|
|
|
|
|
{{ $t('activity.settings') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('baseDelete', { roles: [stringifyRolesObj(orgRoles), baseRole].join() })" |
|
|
|
v-if="isUIAllowed('baseDelete', { roles: [stringifyRolesObj(orgRoles), baseRole].join() })" |
|
|
@ -547,8 +543,10 @@ const projectDelete = () => { |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
@click="projectDelete" |
|
|
|
@click="projectDelete" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralIcon icon="delete" class="w-4" /> |
|
|
|
<div class="flex gap-2 items-center"> |
|
|
|
{{ $t('general.delete') }} |
|
|
|
<GeneralIcon icon="delete" class="w-4" /> |
|
|
|
|
|
|
|
{{ $t('general.delete') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenu> |
|
|
|
</NcMenu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -666,9 +664,11 @@ const projectDelete = () => { |
|
|
|
@click="isBasesOptionsOpen[source!.id!] = false" |
|
|
|
@click="isBasesOptionsOpen[source!.id!] = false" |
|
|
|
> |
|
|
|
> |
|
|
|
<!-- ERD View --> |
|
|
|
<!-- ERD View --> |
|
|
|
<NcMenuItem key="erd" v-e="['c:source:erd']" @click="openErdView(source)"> |
|
|
|
<NcMenuItem key="erd" @click="openErdView(source)"> |
|
|
|
<GeneralIcon icon="erd" /> |
|
|
|
<div v-e="['c:source:erd']" class="flex gap-2 items-center"> |
|
|
|
{{ $t('title.relations') }} |
|
|
|
<GeneralIcon icon="erd" /> |
|
|
|
|
|
|
|
{{ $t('title.relations') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<DashboardTreeViewBaseOptions v-if="showBaseOption" v-model:base="base" :source="source" /> |
|
|
|
<DashboardTreeViewBaseOptions v-if="showBaseOption" v-model:base="base" :source="source" /> |
|
|
@ -712,12 +712,8 @@ 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 |
|
|
|
<NcMenuItem v-if="isUIAllowed('tableRename')" @click="openRenameTableDialog(contextMenuTarget.value, true)"> |
|
|
|
v-if="isUIAllowed('tableRename')" |
|
|
|
<div v-e="['c:table:rename']" class="nc-base-option-item flex gap-2 items-center"> |
|
|
|
v-e="['c:table:rename']" |
|
|
|
|
|
|
|
@click="openRenameTableDialog(contextMenuTarget.value, true)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<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') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -725,17 +721,16 @@ const projectDelete = () => { |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('tableDuplicate') && (contextMenuBase?.is_meta || contextMenuBase?.is_local)" |
|
|
|
v-if="isUIAllowed('tableDuplicate') && (contextMenuBase?.is_meta || contextMenuBase?.is_local)" |
|
|
|
v-e="['c:table:duplicate']" |
|
|
|
|
|
|
|
@click="duplicateTable(contextMenuTarget.value)" |
|
|
|
@click="duplicateTable(contextMenuTarget.value)" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="nc-base-option-item"> |
|
|
|
<div v-e="['c:table:duplicate']" class="nc-base-option-item flex gap-2 items-center"> |
|
|
|
<GeneralIcon icon="duplicate" class="text-gray-700" /> |
|
|
|
<GeneralIcon icon="duplicate" class="text-gray-700" /> |
|
|
|
{{ $t('general.duplicate') }} |
|
|
|
{{ $t('general.duplicate') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcDivider /> |
|
|
|
<NcDivider /> |
|
|
|
<NcMenuItem v-if="isUIAllowed('table-delete')" class="!hover:bg-red-50" @click="tableDelete"> |
|
|
|
<NcMenuItem v-if="isUIAllowed('table-delete')" class="!hover:bg-red-50" @click="tableDelete"> |
|
|
|
<div class="nc-base-option-item text-red-600"> |
|
|
|
<div class="nc-base-option-item flex gap-2 items-center text-red-600"> |
|
|
|
<GeneralIcon icon="delete" /> |
|
|
|
<GeneralIcon icon="delete" /> |
|
|
|
{{ $t('general.delete') }} |
|
|
|
{{ $t('general.delete') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|