Browse Source

refactor: move expanded form icons to menu

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5271/head
Pranav C 2 years ago
parent
commit
cf4381e388
  1. 2
      packages/nc-gui/components/cell/TextArea.vue
  2. 55
      packages/nc-gui/components/smartsheet/expanded-form/Header.vue

2
packages/nc-gui/components/cell/TextArea.vue

@ -21,7 +21,7 @@ const focus: VNodeRef = (el) => (el as HTMLTextAreaElement)?.focus()
<template> <template>
<textarea <textarea
v-if="true || editEnabled" v-if="editEnabled"
:ref="focus" :ref="focus"
v-model="vModel" v-model="vModel"
rows="4" rows="4"

55
packages/nc-gui/components/smartsheet/expanded-form/Header.vue

@ -102,7 +102,7 @@ const onConfirmDeleteRowClick = async () => {
<div class="flex-1" /> <div class="flex-1" />
<a-tooltip placement="bottom"> <!-- <a-tooltip placement="bottom">
<template #title> <template #title>
<div class="text-center w-full">{{ $t('general.reload') }}</div> <div class="text-center w-full">{{ $t('general.reload') }}</div>
</template> </template>
@ -111,10 +111,10 @@ const onConfirmDeleteRowClick = async () => {
class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 min-w-4" class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 min-w-4"
@click="loadRow" @click="loadRow"
/> />
</a-tooltip> </a-tooltip> -->
<a-tooltip placement="bottom"> <!-- <a-tooltip placement="bottom">
<template #title> <template #title>
<!-- todo: i18n --> &lt;!&ndash; todo: i18n &ndash;&gt;
<div class="text-center w-full">Copy record URL</div> <div class="text-center w-full">Copy record URL</div>
</template> </template>
<mdi-link <mdi-link
@ -122,7 +122,7 @@ const onConfirmDeleteRowClick = async () => {
class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 nc-copy-row-url min-w-4" class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 nc-copy-row-url min-w-4"
@click="copyRecordUrl" @click="copyRecordUrl"
/> />
</a-tooltip> </a-tooltip> -->
<a-tooltip v-if="!isSqlView" placement="bottom"> <a-tooltip v-if="!isSqlView" placement="bottom">
<!-- Toggle comments draw --> <!-- Toggle comments draw -->
@ -138,7 +138,7 @@ const onConfirmDeleteRowClick = async () => {
</a-tooltip> </a-tooltip>
<a-tooltip v-if="!isSqlView" placement="bottom"> <a-tooltip v-if="!isSqlView" placement="bottom">
<!-- Duplicate row --> &lt;!&ndash; Duplicate row &ndash;&gt;
<template #title> <template #title>
<div class="text-center w-full">{{ $t('activity.duplicateRow') }}</div> <div class="text-center w-full">{{ $t('activity.duplicateRow') }}</div>
</template> </template>
@ -150,8 +150,9 @@ const onConfirmDeleteRowClick = async () => {
/> />
</a-tooltip> </a-tooltip>
<a-tooltip v-if="!isSqlView" placement="bottom"> <!--
<!-- Delete row --> <!-- <a-tooltip v-if="!isSqlView" placement="bottom">
&lt;!&ndash; Delete row &ndash;&gt;
<template #title> <template #title>
<div class="text-center w-full">{{ $t('activity.deleteRow') }}</div> <div class="text-center w-full">{{ $t('activity.deleteRow') }}</div>
</template> </template>
@ -161,7 +162,7 @@ const onConfirmDeleteRowClick = async () => {
class="nc-icon-transition cursor-pointer select-none nc-delete-row text-gray-500 mx-1 min-w-4" class="nc-icon-transition cursor-pointer select-none nc-delete-row text-gray-500 mx-1 min-w-4"
@click="!isNew && onDeleteRowClick()" @click="!isNew && onDeleteRowClick()"
/> />
</a-tooltip> </a-tooltip> -->
<a-dropdown-button class="nc-expand-form-save-btn" type="primary" :disabled="!isUIAllowed('tableRowUpdate')" @click="save"> <a-dropdown-button class="nc-expand-form-save-btn" type="primary" :disabled="!isUIAllowed('tableRowUpdate')" @click="save">
<template #icon><MdiMenuDown /></template> <template #icon><MdiMenuDown /></template>
@ -192,6 +193,41 @@ const onConfirmDeleteRowClick = async () => {
</div> </div>
</a-dropdown-button> </a-dropdown-button>
<a-dropdown>
<MdiDotsVertical class="nc-icon-transition" />
<template #overlay>
<a-menu>
<a-menu-item v-if="!isNew" @click="loadRow">
<div v-e="['c:row-expand:reload']" class="py-2 flex gap-2 items-center">
<mdi-reload class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 min-w-4" />
{{ $t('general.reload') }}
</div>
</a-menu-item>
<a-menu-item v-if="!isNew" @click="loadRow">
<div v-e="['c:row-expand:reload']" class="py-2 flex gap-2 items-center">
<mdi-link
class="nc-icon-transition cursor-pointer select-none text-gray-500 mx-1 nc-copy-row-url min-w-4"
@click="copyRecordUrl"
/>
Copy record URL
</div>
</a-menu-item>
<a-menu-item v-if="isUIAllowed('xcDatatableEditable') && !isNew" @click="!isNew && emit('duplicateRow')">
<div v-e="['c:row-expand:duplicate']" class="py-2 flex gap-2 a">
<MdiContentCopy class="nc-icon-transition cursor-pointer select-none nc-duplicate-row text-gray-500 mx-1 min-w-4" />
{{ $t('activity.duplicateRow') }}
</div>
</a-menu-item>
<a-menu-item v-if="isUIAllowed('xcDatatableEditable') && !isNew" @click="!isNew && onDeleteRowClick()">
<div v-e="['c:row-expand:delete']" class="py-2 flex gap-2 items-center">
<MdiDeleteOutline class="nc-icon-transition cursor-pointer select-none nc-delete-row text-gray-500 mx-1 min-w-4" />
{{ $t('activity.deleteRow') }}
</div>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip placement="bottom"> <a-tooltip placement="bottom">
<!-- Close --> <!-- Close -->
<template #title> <template #title>
@ -202,6 +238,7 @@ const onConfirmDeleteRowClick = async () => {
@click="emit('cancel')" @click="emit('cancel')"
/> />
</a-tooltip> </a-tooltip>
-->
<a-modal v-model:visible="showDeleteRowModal" title="Delete row?" @ok="onConfirmDeleteRowClick"> <a-modal v-model:visible="showDeleteRowModal" title="Delete row?" @ok="onConfirmDeleteRowClick">
<p>Are you sure you want to delete this row?</p> <p>Are you sure you want to delete this row?</p>

Loading…
Cancel
Save