Browse Source

feat(nc-gui): preset grouping field value in expanded form

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
8f0ecd07e5
  1. 19
      packages/nc-gui/components/smartsheet/Kanban.vue

19
packages/nc-gui/components/smartsheet/Kanban.vue

@ -195,8 +195,12 @@ const renameStack = () => {
// TODO: // TODO:
} }
openNewRecordFormHook?.on(async () => { openNewRecordFormHook?.on(async (stackTitle) => {
const newRow = await addEmptyRow() const newRow = await addEmptyRow()
// preset the grouping field value
newRow.row = {
[groupingField.value]: stackTitle,
}
expandForm(newRow) expandForm(newRow)
}) })
</script> </script>
@ -234,7 +238,7 @@ openNewRecordFormHook?.on(async () => {
</div> </div>
<template #overlay> <template #overlay>
<a-menu class="ml-6 !text-sm !px-0 !py-2 !rounded"> <a-menu class="ml-6 !text-sm !px-0 !py-2 !rounded">
<a-menu-item @click="openNewRecordFormHook.trigger()"> <a-menu-item @click="openNewRecordFormHook.trigger(stack.title)">
<div class="py-2 flex gap-2 items-center"> <div class="py-2 flex gap-2 items-center">
<mdi-plus class="text-gray-500" /> <mdi-plus class="text-gray-500" />
<!-- TODO: i18n --> <!-- TODO: i18n -->
@ -354,7 +358,10 @@ openNewRecordFormHook?.on(async () => {
</a-layout-content> </a-layout-content>
<a-layout-footer> <a-layout-footer>
<div v-if="formattedData[stack.title] && countByStack[stack.title] >= 0" class="mt-5 text-center"> <div v-if="formattedData[stack.title] && countByStack[stack.title] >= 0" class="mt-5 text-center">
<mdi-plus class="text-pint-500 text-lg text-primary cursor-pointer" @click="openNewRecordFormHook.trigger()" /> <mdi-plus
class="text-pint-500 text-lg text-primary cursor-pointer"
@click="openNewRecordFormHook.trigger(stack.title)"
/>
<div class="nc-kanban-data-count"> <div class="nc-kanban-data-count">
<!-- TODO: fix current count for Uncategorized --> <!-- TODO: fix current count for Uncategorized -->
{{ formattedData[stack.title].length }} / {{ countByStack[stack.title] }} {{ formattedData[stack.title].length }} / {{ countByStack[stack.title] }}
@ -376,11 +383,7 @@ openNewRecordFormHook?.on(async () => {
:state="expandedFormRowState" :state="expandedFormRowState"
:meta="meta" :meta="meta"
/> />
<a-modal <a-modal v-model:visible="deleteStackVModel" class="!top-[35%]" wrap-class-name="nc-modal-view-create">
v-model:visible="deleteStackVModel"
class="!top-[35%]"
wrap-class-name="nc-modal-view-create"
>
<template #title> <template #title>
<!-- TODO: i18n --> <!-- TODO: i18n -->
Delete stack? Delete stack?

Loading…
Cancel
Save