Browse Source

fix(nc-gui): runtime directive warnings in TableNode.vue

pull/6954/head
աɨռɢӄաօռɢ 12 months ago
parent
commit
35e8a53622
  1. 120
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue

120
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -167,21 +167,19 @@ const isTableOpened = computed(() => {
@click="onOpenTable" @click="onOpenTable"
> >
<div class="flex flex-row h-full items-center"> <div class="flex flex-row h-full items-center">
<NcButton <div v-e="['c:table:toggle-expand']">
v-e="['c:table:toggle-expand']" <NcButton type="text" size="xxsmall" class="nc-sidebar-node-btn nc-sidebar-expand" @click.stop="onExpand">
type="text" <GeneralIcon
size="xxsmall" icon="triangleFill"
class="nc-sidebar-node-btn nc-sidebar-expand" 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"
@click.stop="onExpand" :class="{ '!rotate-180': isExpanded }"
> />
<GeneralIcon </NcButton>
icon="triangleFill" </div>
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 class="flex w-auto" :data-testid="`tree-view-table-draggable-handle-${table.title}`">
<div <div
v-e="['c:table:emoji-picker']"
class="flex items-center nc-table-icon" class="flex items-center nc-table-icon"
:class="{ :class="{
'pointer-events-none': !canUserEditEmote, 'pointer-events-none': !canUserEditEmote,
@ -190,7 +188,6 @@ const isTableOpened = computed(() => {
> >
<LazyGeneralEmojiPicker <LazyGeneralEmojiPicker
:key="table.meta?.icon" :key="table.meta?.icon"
v-e="['c:table:emoji-picker']"
:emoji="table.meta?.icon" :emoji="table.meta?.icon"
size="small" size="small"
:readonly="!canUserEditEmote || isMobileMode" :readonly="!canUserEditEmote || isMobileMode"
@ -239,60 +236,59 @@ const isTableOpened = computed(() => {
</span> </span>
<div class="flex flex-grow h-full"></div> <div class="flex flex-grow h-full"></div>
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
<NcDropdown <div
v-if=" v-if="
!isSharedBase && !isSharedBase &&
(isUIAllowed('tableRename', { roles: baseRole }) || isUIAllowed('tableDelete', { roles: baseRole })) (isUIAllowed('tableRename', { roles: baseRole }) || isUIAllowed('tableDelete', { roles: baseRole }))
" "
v-e="['c:table:option']" v-e="['c:table:option']"
:trigger="['click']"
class="nc-sidebar-node-btn"
@click.stop
> >
<MdiDotsHorizontal <NcDropdown :trigger="['click']" class="nc-sidebar-node-btn" @click.stop>
data-testid="nc-sidebar-table-context-menu" <MdiDotsHorizontal
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)" 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)"
/>
<template #overlay>
<NcMenu> <template #overlay>
<NcMenuItem <NcMenu>
v-if="isUIAllowed('tableRename', { roles: baseRole })" <div v-if="isUIAllowed('tableRename', { roles: baseRole })" v-e="['c:table:rename']">
v-e="['c:table:rename']" <NcMenuItem
: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)"
> >
<GeneralIcon icon="edit" class="text-gray-700" /> <GeneralIcon icon="edit" class="text-gray-700" />
{{ $t('general.rename') }} {{ $t('general.rename') }}
</NcMenuItem> </NcMenuItem>
</div>
<NcMenuItem
v-if=" <div
isUIAllowed('tableDuplicate') && v-if="
base.sources?.[sourceIndex] && isUIAllowed('tableDuplicate') &&
(base.sources[sourceIndex].is_meta || base.sources[sourceIndex].is_local) base.sources?.[sourceIndex] &&
" (base.sources[sourceIndex].is_meta || base.sources[sourceIndex].is_local)
v-e="['c:table:duplicate']" "
:data-testid="`sidebar-table-duplicate-${table.title}`" v-e="['c:table:duplicate']"
@click="duplicateTable(table)" >
> <NcMenuItem :data-testid="`sidebar-table-duplicate-${table.title}`" @click="duplicateTable(table)">
<GeneralIcon icon="duplicate" class="text-gray-700" /> <GeneralIcon icon="duplicate" class="text-gray-700" />
{{ $t('general.duplicate') }} {{ $t('general.duplicate') }}
</NcMenuItem> </NcMenuItem>
</div>
<NcMenuItem
v-if="isUIAllowed('tableDelete', { roles: baseRole })" <div v-if="isUIAllowed('tableDelete', { roles: baseRole })" v-e="['c:table:delete']">
v-e="['c:table:delete']" <NcMenuItem
: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"
> >
<GeneralIcon icon="delete" /> <GeneralIcon icon="delete" />
{{ $t('general.delete') }} {{ $t('general.delete') }}
</NcMenuItem> </NcMenuItem>
</NcMenu> </div>
</template> </NcMenu>
</NcDropdown> </template>
</NcDropdown>
</div>
</div> </div>
</div> </div>
<DlgTableDelete <DlgTableDelete

Loading…
Cancel
Save