Browse Source

fix: primary value column menu operations

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5060/head
mertmit 2 years ago
parent
commit
33285716a1
  1. 7
      packages/nc-gui/components/smartsheet/header/Menu.vue

7
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -156,6 +156,7 @@ const duplicateColumn = async () => {
await $api.dbTableColumn.create(meta!.value!.id!, { await $api.dbTableColumn.create(meta!.value!.id!, {
...columnCreatePayload, ...columnCreatePayload,
pv: false,
column_order: { column_order: {
order: newColumnOrder, order: newColumnOrder,
view_id: view.value?.id as string, view_id: view.value?.id as string,
@ -243,7 +244,7 @@ const hideField = async () => {
</a-menu-item> </a-menu-item>
</template> </template>
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<a-menu-item @click="hideField"> <a-menu-item v-if="!column?.pv" @click="hideField">
<div v-e="['a:field:hide']" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:hide']" class="nc-column-insert-before nc-header-menu-item">
<MdiEyeOffOutline class="text-primary" /> <MdiEyeOffOutline class="text-primary" />
<!-- Hide Field --> <!-- Hide Field -->
@ -270,7 +271,7 @@ const hideField = async () => {
{{ t('general.insertAfter') }} {{ t('general.insertAfter') }}
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item @click="addColumn(true)"> <a-menu-item v-if="!column?.pv" @click="addColumn(true)">
<div v-e="['a:field:insert:before']" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:insert:before']" class="nc-column-insert-before nc-header-menu-item">
<MdiTableColumnPlusBefore class="text-primary" /> <MdiTableColumnPlusBefore class="text-primary" />
<!-- Insert Before --> <!-- Insert Before -->
@ -289,7 +290,7 @@ const hideField = async () => {
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item @click="deleteColumn"> <a-menu-item v-if="!column?.pv" @click="deleteColumn">
<div class="nc-column-delete nc-header-menu-item"> <div class="nc-column-delete nc-header-menu-item">
<MdiDeleteOutline class="text-error" /> <MdiDeleteOutline class="text-error" />
<!-- Delete --> <!-- Delete -->

Loading…
Cancel
Save