Browse Source

refactor(gui): remove sort option from LTAR column

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4504/head
Pranav C 2 years ago
parent
commit
0c83506e7f
  1. 11
      packages/nc-gui/components/smartsheet/header/Menu.vue

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

@ -1,12 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk' import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk' import { RelationTypes, UITypes } from 'nocodb-sdk'
import { import {
ColumnInj, ColumnInj,
IsLockedInj, IsLockedInj,
MetaInj, MetaInj,
Modal, Modal,
ReloadViewDataHookInj, ReloadViewDataHookInj,
defineEmits,
defineProps,
extractSdkResponseErrorMsg, extractSdkResponseErrorMsg,
inject, inject,
message, message,
@ -156,11 +158,12 @@ const duplicateColumn = async () => {
await getMeta(meta!.value!.id!, true) await getMeta(meta!.value!.id!, true)
eventBus.emit(SmartsheetStoreEvents.FIELD_RELOAD) eventBus.emit(SmartsheetStoreEvents.FIELD_RELOAD)
} catch (e: any) { } catch (e) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} }
} }
// add column before or after current column
const addColumn = async (before = false) => { const addColumn = async (before = false) => {
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string) const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
@ -189,6 +192,7 @@ const addColumn = async (before = false) => {
}) })
} }
// hide the field in view
const hideField = async () => { const hideField = async () => {
const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string) const gridViewColumnList = await $api.dbViewColumn.list(view.value?.id as string)
@ -212,6 +216,7 @@ const hideField = async () => {
{{ $t('general.edit') }} {{ $t('general.edit') }}
</div> </div>
</a-menu-item> </a-menu-item>
<template v-if="column.uidt !== UITypes.LinkToAnotherRecord || column.colOptions.type !== RelationTypes.BELONGS_TO">
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<a-menu-item @click="sortByColumn('asc')"> <a-menu-item @click="sortByColumn('asc')">
<div class="nc-column-insert-after nc-header-menu-item"> <div class="nc-column-insert-after nc-header-menu-item">
@ -225,7 +230,7 @@ const hideField = async () => {
Sort Descending Sort Descending
</div> </div>
</a-menu-item> </a-menu-item>
</template>
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<a-menu-item @click="hideField"> <a-menu-item @click="hideField">
<div class="nc-column-insert-before nc-header-menu-item"> <div class="nc-column-insert-before nc-header-menu-item">

Loading…
Cancel
Save