Browse Source

fix(gui-v2): disable drag-n-drop for required column only if dragging to hidden list

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

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

@ -2,7 +2,7 @@
import type { ColumnType } from 'nocodb-sdk'
import { ColumnInj, IsFormInj, inject, provide, ref, toRef, useUIPermission } from '#imports'
const props = defineProps<{ column: ColumnType & { meta: any }; required?: boolean; hideMenu?: boolean }>()
const props = defineProps<{ column: ColumnType & { meta: any }; required?: boolean | number; hideMenu?: boolean }>()
const hideMenu = toRef(props, 'hideMenu')

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

@ -15,7 +15,7 @@ import {
useVirtualCell,
} from '#imports'
const props = defineProps<{ column: ColumnType & { meta: any }; hideMenu?: boolean; required?: boolean }>()
const props = defineProps<{ column: ColumnType & { meta: any }; hideMenu?: boolean; required?: boolean | number }>()
const column = toRef(props, 'column')

5
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -58,7 +58,7 @@ reloadEventHook.on(async () => {
const { showAll, hideAll, saveOrUpdate } = useViewColumns(view, meta as any, async () => reloadEventHook.trigger())
const { syncLTARRefs } = useProvideSmartsheetRowStore(
const { syncLTARRefs, row } = useProvideSmartsheetRowStore(
meta,
ref({
row: formState,
@ -150,7 +150,7 @@ function isDbRequired(column: Record<string, any>) {
}
function onMoveCallback(event: any) {
if (shouldSkipColumn(event.draggedContext.element)) {
if (event.from !== event.to && shouldSkipColumn(event.draggedContext.element)) {
return false
}
}
@ -630,6 +630,7 @@ onMounted(async () => {
>
<SmartsheetVirtualCell
v-model="formState[element.title]"
:row="row"
class="nc-input"
:class="`nc-form-input-${element.title.replaceAll(' ', '')}`"
:column="element"

Loading…
Cancel
Save