|
|
@ -149,96 +149,91 @@ const isTableOpened = computed(() => { |
|
|
|
:class="[`nc-base-tree-tbl nc-base-tree-tbl-${table.title}`]" |
|
|
|
:class="[`nc-base-tree-tbl nc-base-tree-tbl-${table.title}`]" |
|
|
|
:data-active="openedTableId === table.id" |
|
|
|
:data-active="openedTableId === table.id" |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralTooltip |
|
|
|
<div |
|
|
|
class="nc-tree-item-inner nc-sidebar-node pl-11 pr-0.75 mb-0.25 rounded-md h-7.1 w-full group cursor-pointer hover:bg-gray-200" |
|
|
|
v-e="['a:table:open']" |
|
|
|
|
|
|
|
class="table-context flex items-center gap-1 h-full nc-tree-item-inner nc-sidebar-node pl-11 pr-0.75 mb-0.25 rounded-md h-7.1 w-full group cursor-pointer hover:bg-gray-200" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'hover:bg-gray-200': openedTableId !== table.id, |
|
|
|
'hover:bg-gray-200': openedTableId !== table.id, |
|
|
|
'pl-12 xs:(pl-14)': sourceIndex !== 0, |
|
|
|
'pl-12 xs:(pl-14)': sourceIndex !== 0, |
|
|
|
'pl-6.5': sourceIndex === 0, |
|
|
|
'pl-6.5': sourceIndex === 0, |
|
|
|
'!bg-primary-selected': isTableOpened, |
|
|
|
'!bg-primary-selected': isTableOpened, |
|
|
|
}" |
|
|
|
}" |
|
|
|
modifier-key="Alt" |
|
|
|
:data-testid="`nc-tbl-side-node-${table.title}`" |
|
|
|
|
|
|
|
@contextmenu="setMenuContext('table', table)" |
|
|
|
|
|
|
|
@click="onOpenTable" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #title>{{ table.table_name }}</template> |
|
|
|
<div class="flex flex-row h-full items-center"> |
|
|
|
<div |
|
|
|
<NcButton |
|
|
|
v-e="['a:table:open']" |
|
|
|
v-e="['c:table:toggle-expand']" |
|
|
|
class="table-context flex items-center gap-1 h-full" |
|
|
|
type="text" |
|
|
|
:data-testid="`nc-tbl-side-node-${table.title}`" |
|
|
|
size="xxsmall" |
|
|
|
@contextmenu="setMenuContext('table', table)" |
|
|
|
class="nc-sidebar-node-btn nc-sidebar-expand" |
|
|
|
@click="onOpenTable" |
|
|
|
@click.stop="onExpand" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex flex-row h-full items-center"> |
|
|
|
<GeneralLoader |
|
|
|
<NcButton |
|
|
|
v-if="table.isViewsLoading" |
|
|
|
v-e="['c:table:toggle-expand']" |
|
|
|
class="flex w-4 h-4 !text-gray-600 !mt-0.75" |
|
|
|
type="text" |
|
|
|
:class="{ |
|
|
|
size="xxsmall" |
|
|
|
'!visible': !isExpanded, |
|
|
|
class="nc-sidebar-node-btn nc-sidebar-expand" |
|
|
|
}" |
|
|
|
@click.stop="onExpand" |
|
|
|
/> |
|
|
|
|
|
|
|
<GeneralIcon |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
icon="triangleFill" |
|
|
|
|
|
|
|
class="nc-sidebar-source-node-btns group-hover:visible invisible cursor-pointer transform transition-transform duration-500 h-1.5 w-1.5 !text-gray-600 rotate-90" |
|
|
|
|
|
|
|
:class="{ '!rotate-180': isExpanded }" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</NcButton> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex w-auto" :data-testid="`tree-view-table-draggable-handle-${table.title}`"> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-e="['c:table:emoji-picker']" |
|
|
|
|
|
|
|
class="flex items-center nc-table-icon" |
|
|
|
|
|
|
|
:class="{ |
|
|
|
|
|
|
|
'pointer-events-none': !canUserEditEmote, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
@click.stop |
|
|
|
> |
|
|
|
> |
|
|
|
<GeneralLoader |
|
|
|
<LazyGeneralEmojiPicker |
|
|
|
v-if="table.isViewsLoading" |
|
|
|
:key="table.meta?.icon" |
|
|
|
class="flex w-4 h-4 !text-gray-600 !mt-0.75" |
|
|
|
:emoji="table.meta?.icon" |
|
|
|
:class="{ |
|
|
|
size="small" |
|
|
|
'!visible': !isExpanded, |
|
|
|
:readonly="!canUserEditEmote || isMobileMode" |
|
|
|
}" |
|
|
|
@emoji-selected="setIcon($event, table)" |
|
|
|
/> |
|
|
|
|
|
|
|
<GeneralIcon |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
icon="triangleFill" |
|
|
|
|
|
|
|
class="nc-sidebar-source-node-btns group-hover:visible invisible cursor-pointer transform transition-transform duration-500 h-1.5 w-1.5 !text-gray-600 rotate-90" |
|
|
|
|
|
|
|
:class="{ '!rotate-180': isExpanded }" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</NcButton> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex w-auto" :data-testid="`tree-view-table-draggable-handle-${table.title}`"> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-e="['c:table:emoji-picker']" |
|
|
|
|
|
|
|
class="flex items-center nc-table-icon" |
|
|
|
|
|
|
|
:class="{ |
|
|
|
|
|
|
|
'pointer-events-none': !canUserEditEmote, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
@click.stop |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<LazyGeneralEmojiPicker |
|
|
|
<template #default> |
|
|
|
:key="table.meta?.icon" |
|
|
|
<NcTooltip class="flex" placement="topLeft" hide-on-click :disabled="!canUserEditEmote"> |
|
|
|
:emoji="table.meta?.icon" |
|
|
|
<template #title> |
|
|
|
size="small" |
|
|
|
{{ $t('general.changeIcon') }} |
|
|
|
:readonly="!canUserEditEmote || isMobileMode" |
|
|
|
</template> |
|
|
|
@emoji-selected="setIcon($event, table)" |
|
|
|
|
|
|
|
> |
|
|
|
<component |
|
|
|
<template #default> |
|
|
|
:is="iconMap.table" |
|
|
|
<NcTooltip class="flex" placement="topLeft" hide-on-click :disabled="!canUserEditEmote"> |
|
|
|
v-if="table.type === 'table'" |
|
|
|
<template #title> |
|
|
|
class="flex w-5 !text-gray-500 text-sm" |
|
|
|
{{ $t('general.changeIcon') }} |
|
|
|
:class="{ |
|
|
|
</template> |
|
|
|
'group-hover:text-gray-500': isUIAllowed('tableSort', { roles: baseRole }), |
|
|
|
|
|
|
|
'!text-black': openedTableId === table.id, |
|
|
|
<component |
|
|
|
}" |
|
|
|
:is="iconMap.table" |
|
|
|
/> |
|
|
|
v-if="table.type === 'table'" |
|
|
|
|
|
|
|
class="flex w-5 !text-gray-500 text-sm" |
|
|
|
<MdiEye |
|
|
|
:class="{ |
|
|
|
v-else |
|
|
|
'group-hover:text-gray-500': isUIAllowed('tableSort', { roles: baseRole }), |
|
|
|
class="flex w-5 !text-gray-500 text-sm" |
|
|
|
'!text-black': openedTableId === table.id, |
|
|
|
:class="{ |
|
|
|
}" |
|
|
|
'group-hover:text-gray-500': isUIAllowed('tableSort', { roles: baseRole }), |
|
|
|
/> |
|
|
|
'!text-black': openedTableId === table.id, |
|
|
|
|
|
|
|
}" |
|
|
|
<MdiEye |
|
|
|
/> |
|
|
|
v-else |
|
|
|
</NcTooltip> |
|
|
|
class="flex w-5 !text-gray-500 text-sm" |
|
|
|
</template> |
|
|
|
:class="{ |
|
|
|
</LazyGeneralEmojiPicker> |
|
|
|
'group-hover:text-gray-500': isUIAllowed('tableSort', { roles: baseRole }), |
|
|
|
|
|
|
|
'!text-black': openedTableId === table.id, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</LazyGeneralEmojiPicker> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<NcTooltip class="nc-tbl-title nc-sidebar-node-title text-ellipsis w-full overflow-hidden select-none"> |
|
|
|
|
|
|
|
<template #title>{{ table.title }}</template> |
|
|
|
<span |
|
|
|
<span |
|
|
|
class="nc-tbl-title nc-sidebar-node-title text-ellipsis overflow-hidden select-none" |
|
|
|
|
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'text-black !font-medium': isTableOpened, |
|
|
|
'text-black !font-medium': isTableOpened, |
|
|
|
}" |
|
|
|
}" |
|
|
@ -247,73 +242,73 @@ const isTableOpened = computed(() => { |
|
|
|
> |
|
|
|
> |
|
|
|
{{ table.title }} |
|
|
|
{{ table.title }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<div class="flex flex-grow h-full"></div> |
|
|
|
</NcTooltip> |
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
<div class="flex flex-grow h-full"></div> |
|
|
|
<div |
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
v-if=" |
|
|
|
<div |
|
|
|
!isSharedBase && |
|
|
|
v-if=" |
|
|
|
(isUIAllowed('tableRename', { roles: baseRole }) || isUIAllowed('tableDelete', { roles: baseRole })) |
|
|
|
!isSharedBase && (isUIAllowed('tableRename', { roles: baseRole }) || isUIAllowed('tableDelete', { roles: baseRole })) |
|
|
|
" |
|
|
|
" |
|
|
|
v-e="['c:table:option']" |
|
|
|
v-e="['c:table:option']" |
|
|
|
> |
|
|
|
> |
|
|
|
<NcDropdown :trigger="['click']" class="nc-sidebar-node-btn" @click.stop> |
|
|
|
<NcDropdown :trigger="['click']" class="nc-sidebar-node-btn" @click.stop> |
|
|
|
<MdiDotsHorizontal |
|
|
|
<MdiDotsHorizontal |
|
|
|
data-testid="nc-sidebar-table-context-menu" |
|
|
|
data-testid="nc-sidebar-table-context-menu" |
|
|
|
class="min-w-5.75 min-h-5.75 mt-0.2 mr-0.25 px-0.5 !text-gray-600 transition-opacity opacity-0 group-hover:opacity-100 nc-tbl-context-menu outline-0 rounded-md hover:(bg-gray-500 bg-opacity-15 !text-black)" |
|
|
|
class="min-w-5.75 min-h-5.75 mt-0.2 mr-0.25 px-0.5 !text-gray-600 transition-opacity opacity-0 group-hover:opacity-100 nc-tbl-context-menu outline-0 rounded-md hover:(bg-gray-500 bg-opacity-15 !text-black)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('tableRename', { roles: baseRole })" |
|
|
|
v-if="isUIAllowed('tableRename', { roles: baseRole })" |
|
|
|
:data-testid="`sidebar-table-rename-${table.title}`" |
|
|
|
:data-testid="`sidebar-table-rename-${table.title}`" |
|
|
|
@click="openRenameTableDialog(table, base.sources[sourceIndex].id)" |
|
|
|
@click="openRenameTableDialog(table, base.sources[sourceIndex].id)" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-e="['c:table:rename']" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:table:rename']" class="flex gap-2 items-center"> |
|
|
|
<GeneralIcon icon="edit" class="text-gray-700" /> |
|
|
|
<GeneralIcon icon="edit" class="text-gray-700" /> |
|
|
|
{{ $t('general.rename') }} |
|
|
|
{{ $t('general.rename') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if=" |
|
|
|
v-if=" |
|
|
|
isUIAllowed('tableDuplicate') && |
|
|
|
isUIAllowed('tableDuplicate') && |
|
|
|
base.sources?.[sourceIndex] && |
|
|
|
base.sources?.[sourceIndex] && |
|
|
|
(base.sources[sourceIndex].is_meta || base.sources[sourceIndex].is_local) |
|
|
|
(base.sources[sourceIndex].is_meta || base.sources[sourceIndex].is_local) |
|
|
|
" |
|
|
|
" |
|
|
|
:data-testid="`sidebar-table-duplicate-${table.title}`" |
|
|
|
:data-testid="`sidebar-table-duplicate-${table.title}`" |
|
|
|
@click="duplicateTable(table)" |
|
|
|
@click="duplicateTable(table)" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-e="['c:table:duplicate']" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:table:duplicate']" class="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> |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('tableDelete', { roles: baseRole })" |
|
|
|
v-if="isUIAllowed('tableDelete', { roles: baseRole })" |
|
|
|
:data-testid="`sidebar-table-delete-${table.title}`" |
|
|
|
:data-testid="`sidebar-table-delete-${table.title}`" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
@click="isTableDeleteDialogVisible = true" |
|
|
|
@click="isTableDeleteDialogVisible = true" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-e="['c:table:delete']" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:table:delete']" class="flex gap-2 items-center"> |
|
|
|
<GeneralIcon icon="delete" /> |
|
|
|
<GeneralIcon icon="delete" /> |
|
|
|
{{ $t('general.delete') }} |
|
|
|
{{ $t('general.delete') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenu> |
|
|
|
</NcMenu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</NcDropdown> |
|
|
|
</NcDropdown> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<DlgTableDelete |
|
|
|
</div> |
|
|
|
v-if="table.id && base?.id" |
|
|
|
<DlgTableDelete |
|
|
|
v-model:visible="isTableDeleteDialogVisible" |
|
|
|
v-if="table.id && base?.id" |
|
|
|
:table-id="table.id" |
|
|
|
v-model:visible="isTableDeleteDialogVisible" |
|
|
|
:base-id="base.id" |
|
|
|
:table-id="table.id" |
|
|
|
/> |
|
|
|
:base-id="base.id" |
|
|
|
</GeneralTooltip> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<DashboardTreeViewViewsList v-if="isExpanded" :table-id="table.id" :base-id="base.id" /> |
|
|
|
<DashboardTreeViewViewsList v-if="isExpanded" :table-id="table.id" :base-id="base.id" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|