|
|
@ -1,6 +1,6 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import Draggable from 'vuedraggable' |
|
|
|
import Draggable from 'vuedraggable' |
|
|
|
import { UITypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { UITypes, ViewTypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveViewInj, |
|
|
|
ActiveViewInj, |
|
|
|
FieldsInj, |
|
|
|
FieldsInj, |
|
|
@ -89,8 +89,6 @@ const fields = inject(FieldsInj, ref([])) |
|
|
|
|
|
|
|
|
|
|
|
const kanbanContainerRef = ref() |
|
|
|
const kanbanContainerRef = ref() |
|
|
|
|
|
|
|
|
|
|
|
let isMounted = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isRowEmpty = (record: any, col: any) => { |
|
|
|
const isRowEmpty = (record: any, col: any) => { |
|
|
|
const val = record.row[col.title] |
|
|
|
const val = record.row[col.title] |
|
|
|
if (!val) return true |
|
|
|
if (!val) return true |
|
|
@ -245,24 +243,26 @@ openNewRecordFormHook?.on(async (stackTitle) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
onMounted(async () => { |
|
|
|
// reset state to avoid from showing the previous stacks when switching kanban views |
|
|
|
|
|
|
|
groupingFieldColOptions.value = [] |
|
|
|
|
|
|
|
formattedData.value = {} |
|
|
|
|
|
|
|
// load kanban meta |
|
|
|
|
|
|
|
await loadKanbanMeta() |
|
|
|
await loadKanbanMeta() |
|
|
|
// load kanban data |
|
|
|
|
|
|
|
await loadKanbanData() |
|
|
|
await loadKanbanData() |
|
|
|
// update isMounted for below watcher |
|
|
|
|
|
|
|
isMounted = true |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
// reset context menu target on hide |
|
|
|
() => shouldScrollToRight.value, |
|
|
|
watch(contextMenu, () => { |
|
|
|
() => { |
|
|
|
if (!contextMenu.value) { |
|
|
|
// use `isMounted` to avoid scrolling from switching from other views |
|
|
|
contextMenuTarget.value = null |
|
|
|
// i.e. scroll only when a new option is added within kanban view |
|
|
|
} |
|
|
|
if (isMounted && shouldScrollToRight.value) { |
|
|
|
}) |
|
|
|
// horizontally scroll to the end of the kanban container |
|
|
|
|
|
|
|
|
|
|
|
watch(view, async (nextView) => { |
|
|
|
|
|
|
|
if (nextView?.type === ViewTypes.KANBAN) { |
|
|
|
|
|
|
|
// load kanban meta |
|
|
|
|
|
|
|
await loadKanbanMeta() |
|
|
|
|
|
|
|
// load kanban data |
|
|
|
|
|
|
|
await loadKanbanData() |
|
|
|
|
|
|
|
// horizontally scroll to the end of the kanban container |
|
|
|
|
|
|
|
// when a new option is added within kanban view |
|
|
|
|
|
|
|
if (shouldScrollToRight.value) { |
|
|
|
kanbanContainerRef.value.scrollTo({ |
|
|
|
kanbanContainerRef.value.scrollTo({ |
|
|
|
left: kanbanContainerRef.value.scrollWidth, |
|
|
|
left: kanbanContainerRef.value.scrollWidth, |
|
|
|
behavior: 'smooth', |
|
|
|
behavior: 'smooth', |
|
|
@ -270,13 +270,6 @@ watch( |
|
|
|
// reset shouldScrollToRight |
|
|
|
// reset shouldScrollToRight |
|
|
|
shouldScrollToRight.value = false |
|
|
|
shouldScrollToRight.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reset context menu target on hide |
|
|
|
|
|
|
|
watch(contextMenu, () => { |
|
|
|
|
|
|
|
if (!contextMenu.value) { |
|
|
|
|
|
|
|
contextMenuTarget.value = null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|