Browse Source

refactor(gui): rearrange header buttons and menu

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

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

@ -135,54 +135,31 @@ const onConfirmDeleteRowClick = async () => {
/> />
</a-tooltip> </a-tooltip>
<a-button class="!text mx-1 nc-expand-form-close-btn" @click="emit('cancel')"> <a-tooltip v-if="!isSqlView" placement="bottom">
<div class="flex items-center"> <!-- Duplicate row -->
<MdiCloseCircleOutline class="mr-1" /> <template #title>
<!-- Close --> <div class="text-center w-full">{{ $t('activity.duplicateRow') }}</div>
{{ $t('general.close') }} </template>
</div> <MdiContentCopy
</a-button> v-if="isUIAllowed('xcDatatableEditable') && !isNew"
v-e="['c:row-expand:duplicate']"
<a-dropdown> class="cursor-pointer select-none nc-duplicate-row text-gray-500 mx-1 min-w-4"
<a-button v-e="['c:actions']" class="nc-actions-menu-btn nc-toolbar-btn"> @click="!isNew && emit('duplicateRow')"
<div class="flex gap-1 items-center"> />
<!-- More --> </a-tooltip>
<span class="!text-sm font-weight-medium">{{ $t('general.more') }}</span>
<MdiMenuDown class="text-grey" />
</div>
</a-button>
<template #overlay>
<div class="bg-gray-50 py-2 shadow-lg !border">
<div>
<div
v-e="['a:actions:duplicate-row']"
class="nc-menu-item"
:class="{ disabled: isNew }"
@click="!isNew && emit('duplicateRow')"
>
<MdiContentCopy class="text-gray-500" />
{{ $t('activity.duplicateRow') }}
</div>
<a-modal v-model:visible="showDeleteRowModal" title="Delete row?" @ok="onConfirmDeleteRowClick"> <a-tooltip v-if="!isSqlView" placement="bottom">
<p>Are you sure you want to delete this row?</p> <!-- Delete row -->
</a-modal> <template #title>
<div class="text-center w-full">{{ $t('activity.deleteRow') }}</div>
<div
v-e="['a:actions:delete-row']"
class="nc-menu-item"
:class="{ disabled: isNew }"
@click="!isNew && onDeleteRowClick()"
>
<MdiDelete class="text-gray-500" />
{{ $t('activity.deleteRow') }}
</div>
</div>
</div>
</template> </template>
</a-dropdown> <MdiDeleteOutline
v-if="isUIAllowed('xcDatatableEditable') && !isNew"
v-e="['c:row-expand:delete']"
class="cursor-pointer select-none nc-delete-row text-gray-500 mx-1 min-w-4"
@click="!isNew && onDeleteRowClick()"
/>
</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>
@ -212,5 +189,20 @@ const onConfirmDeleteRowClick = async () => {
{{ $t('activity.saveAndStay') }} {{ $t('activity.saveAndStay') }}
</div> </div>
</a-dropdown-button> </a-dropdown-button>
<a-tooltip placement="bottom">
<!-- Close -->
<template #title>
<div class="text-center w-full">{{ $t('general.close') }}</div>
</template>
<MdiCloseCircleOutline
class="cursor-pointer select-none nc-toggle-comments text-gray-500 mx-1 min-w-4"
@click="emit('cancel')"
/>
</a-tooltip>
<a-modal v-model:visible="showDeleteRowModal" title="Delete row?" @ok="onConfirmDeleteRowClick">
<p>Are you sure you want to delete this row?</p>
</a-modal>
</div> </div>
</template> </template>

Loading…
Cancel
Save