Browse Source

feat(gui-v2): hide menu within form

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3025/head
Pranav C 2 years ago
parent
commit
3f10da7849
  1. 5
      packages/nc-gui-v2/components/smartsheet-header/Cell.vue
  2. 5
      packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue

5
packages/nc-gui-v2/components/smartsheet-header/Cell.vue

@ -2,7 +2,7 @@
import type { ColumnType, TableType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { inject, toRef } from 'vue'
import { ColumnInj, MetaInj } from '~/context'
import { ColumnInj, IsFormInj, MetaInj } from '~/context'
import { useProvideColumnCreateStore } from '#imports'
const props = defineProps<{ column: ColumnType & { meta: any }; hideMenu?: boolean }>()
@ -11,6 +11,7 @@ const hideMenu = toRef(props, 'hideMenu')
provide(ColumnInj, column)
const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false)
// instantiate column update store
useProvideColumnCreateStore(meta as Ref<TableType>, column)
@ -23,7 +24,7 @@ useProvideColumnCreateStore(meta as Ref<TableType>, column)
<template v-if="!hideMenu">
<div class="flex-1" />
<SmartsheetHeaderMenu />
<SmartsheetHeaderMenu v-if="!isForm" />
</template>
</div>
</template>

5
packages/nc-gui-v2/components/smartsheet-header/VirtualCell.vue

@ -5,7 +5,7 @@ import { toRef } from 'vue'
import { $computed } from 'vue/macros'
import type { Ref } from 'vue'
import { useMetas } from '~/composables'
import { ColumnInj, MetaInj } from '~/context'
import { ColumnInj, IsFormInj, MetaInj } from '~/context'
import { provide, useProvideColumnCreateStore } from '#imports'
const props = defineProps<{ column: ColumnType & { meta: any }; hideMenu?: boolean }>()
@ -15,6 +15,7 @@ const hideMenu = toRef(props, 'hideMenu')
provide(ColumnInj, column)
const { metas } = useMetas()
const meta = inject(MetaInj)
const isForm = inject(IsFormInj, false)
const { isLookup, isBt, isRollup, isMm, isHm, isFormula } = useVirtualCell(column)
@ -100,7 +101,7 @@ useProvideColumnCreateStore(meta as Ref<TableType>, column)
<template v-if="!hideMenu">
<v-spacer />
<SmartsheetHeaderMenu :virtual="true" />
<SmartsheetHeaderMenu v-if="!isForm" :virtual="true" />
</template>
</div>
</template>

Loading…
Cancel
Save