Browse Source

feat(nc-gui): render kanban data in corresponding stacks

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

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

@ -30,15 +30,10 @@ const expandedFormDlg = ref(false)
const expandedFormRow = ref<RowType>() const expandedFormRow = ref<RowType>()
const expandedFormRowState = ref<Record<string, any>>() const expandedFormRowState = ref<Record<string, any>>()
const { const { loadData, paginationData, formattedKanbanData, loadKanbanData, kanbanData, changePage, addEmptyRow } = useViewData(
loadData, meta,
paginationData, view as any,
formattedData: data, )
loadKanbanData,
kanbanData,
changePage,
addEmptyRow,
} = useViewData(meta, view as any)
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
@ -120,18 +115,24 @@ openNewRecordFormHook?.on(async () => {
</script> </script>
<template> <template>
<div class="flex h-full"> <div v-if="formattedKanbanData" class="flex h-full">
<div class="nc-kanban-container flex grid gap-2 my-4 px-3"> <div class="nc-kanban-container flex grid gap-2 my-4 px-3">
<!-- TODO: v-for --> <!-- TODO: add loading component when formattedKanbanData is not ready -->
<a-card class="nc-kanban-stack" head-style="padding-bottom: 0px;" body-style="padding: 0px 20px;"> <!-- TODO: the whole stack should be draggable -->
<a-card
v-for="kanbanDataKey in Object.keys(formattedKanbanData)"
:key="kanbanDataKey"
class="nc-kanban-stack"
head-style="padding-bottom: 0px;"
body-style="padding: 0px 20px;"
>
<template #title> <template #title>
<div class="nc-kanban-stack-head"> <div class="nc-kanban-stack-head">
<!-- TODO: i18n --> {{ kanbanDataKey }}
Uncategorized
</div> </div>
</template> </template>
<div class="nc-kanban-list flex flex-col"> <div class="nc-kanban-list flex flex-col">
<div v-for="record in data" :key="`record-${record.row.id}`" class="py-2"> <div v-for="record in formattedKanbanData[kanbanDataKey]" :key="`record-${record.row.id}`" class="py-2">
<Row :row="record"> <Row :row="record">
<a-card <a-card
hoverable hoverable

Loading…
Cancel
Save