多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.3 KiB

Nc Refactor: Kanban view (#8689) * fix(nc-gui): update kanban view stack ui * feat(nc-gui): add collapse all stack option * fix(nc-gui): add empty stack placeholder * fix(nc-gui): add loading state support for ncSwitch * fix(nc-gui): swap edit card and stacked by toolbar menu * fix(nc-gui): update stacked by toolbar menu * fix(nc-gui): update kanban view height * fix(nc-gui): add stack bg color * feat(nc-gui): add support to hide empty stack * fix(nc-gui): stack loader issue * fix(nc-gui): checkbox alignment in kanban view * fix(nc-gui): update stack drag handler and hide it if user does not have permission * fix(nc-gui): stack title overflow issue * fix(nc-gui): allow inline rename stack * fix(nc-gui): advance color picker tab warnings * fix(nc-gui): rename stack option issues * fix(nc-gui): small changes * fix(nc-gui): review changes * feat(nc-gui): add new stack support * fix(nc-gui): small changes * fix(nc-gui): add loading state for rename & add new stack * fix(nc-gui): reduce width of stack * fix(nc-gui): make ncSwitch placement prop optional * fix(nc-gui): some review changes * fix(nc-gui): remove only from test * fix(nc-gui): add error handling part in kanban stack update * fix(nc-gui): update localstate while updating kanban stack meta * fix(nc-gui): some review changes * fix(nc-gui): add expand all stack option * fix(nc-gui): add condition to append new stack obj * fix(nc-gui): update card field label style * fix(nc-gui): remove top & bottom padding from stack * fix(nc-gui): drag stack test update * fix(nc-gui): console warning issues * text(nc-gui): update kanban view test * fix(nc-gui): remove last added empty row from stack if it is not saved * fix(nc-gui): duplicate column insert issue on rename stack * fix(nc-gui): update field menu * fix(nc-gui): add new stack duplicate issue * feat(nc-gui): add expand record option in context menu of gallery * fix(nc-gui): delete record fail issue #3111 * fix(nc-gui): hide grouping field by default in kanban view * chore(nc-gui): lint * fix(nc-gui): ui review changes * fix(nc-gui): select option focus issue in edit state * fix(nc-gui): add bottom border for stack * fix(nc-gui): ui review changes * fix(nc-gui): update color picker btn text from select option * fix(nc-gui): delete default value stack #8212 * fix(nc-gui): stack data offset an drag card issue * chore(nc-gui): lint
6 months ago
<script lang="ts" setup>
import type { ColumnType } from 'nocodb-sdk'
const props = defineProps<{
column: ColumnType
optionId?: string
isNewStack?: boolean
}>()
const emit = defineEmits(['submit', 'cancel'])
const { column, optionId, isNewStack } = toRefs(props)
const meta = inject(MetaInj, ref())
const { formState, addOrUpdate } = useProvideColumnCreateStore(meta, column, undefined, undefined, undefined, ref(true))
const { getMeta } = useMetas()
const reloadMetaAndData = async () => {
await getMeta(meta.value?.id as string, true)
}
async function onSubmit(
submit: boolean = false,
saveChanges: boolean = true,
payload: Partial<{ color: string; title: string; [key: string]: any }>,
) {
if (!saveChanges && submit) {
emit('submit')
return
}
const saved = await addOrUpdate(reloadMetaAndData)
if (submit && saved) {
emit('submit', true, payload)
}
}
</script>
<template>
<a-form
v-model="formState"
no-style
name="column-create-or-edit"
layout="vertical"
data-testid="add-or-edit-column"
class="w-full flex"
>
<SmartsheetColumnSelectOptions
v-model:value="formState"
is-kanban-stack
:option-id="optionId"
:is-new-stack="isNewStack"
@save-changes="onSubmit"
/>
</a-form>
</template>