|
|
@ -43,10 +43,7 @@ export function useKanbanViewData( |
|
|
|
rowMeta: {}, |
|
|
|
rowMeta: {}, |
|
|
|
})) |
|
|
|
})) |
|
|
|
|
|
|
|
|
|
|
|
async function loadKanbanData(params: Parameters<Api<any>['dbViewRow']['list']>[4] = {}) { |
|
|
|
async function loadKanbanData() { |
|
|
|
// each stack only loads 25 records -> scroll to load more (to be integrated with infinite scroll)
|
|
|
|
|
|
|
|
// TODO: integrate with infinite scroll
|
|
|
|
|
|
|
|
// TODO: handle share view case
|
|
|
|
|
|
|
|
if ((!project?.value?.id || !meta?.value?.id || !viewMeta?.value?.id) && !isPublic.value) return |
|
|
|
if ((!project?.value?.id || !meta?.value?.id || !viewMeta?.value?.id) && !isPublic.value) return |
|
|
|
|
|
|
|
|
|
|
|
// reset formattedData to avoid storing previous data after changing grouping field
|
|
|
|
// reset formattedData to avoid storing previous data after changing grouping field
|
|
|
@ -59,7 +56,6 @@ export function useKanbanViewData( |
|
|
|
where = `(${groupingField.value},is,null)` |
|
|
|
where = `(${groupingField.value},is,null)` |
|
|
|
} |
|
|
|
} |
|
|
|
const response = await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, { |
|
|
|
const response = await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, { |
|
|
|
...params, |
|
|
|
|
|
|
|
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), |
|
|
|
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), |
|
|
|
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), |
|
|
|
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), |
|
|
|
where, |
|
|
|
where, |
|
|
@ -69,6 +65,20 @@ export function useKanbanViewData( |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function loadMoreKanbanData(stackTitle: string, params: Parameters<Api<any>['dbViewRow']['list']>[4] = {}) { |
|
|
|
|
|
|
|
let where = `(${groupingField.value},eq,${stackTitle})` |
|
|
|
|
|
|
|
if (stackTitle === 'Uncategorized') { |
|
|
|
|
|
|
|
where = `(${groupingField.value},is,null)` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const response = await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, { |
|
|
|
|
|
|
|
...params, |
|
|
|
|
|
|
|
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), |
|
|
|
|
|
|
|
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), |
|
|
|
|
|
|
|
where, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
formattedData.value[stackTitle] = [...formattedData.value[stackTitle], ...formatData(response.list)] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function loadKanbanMeta() { |
|
|
|
async function loadKanbanMeta() { |
|
|
|
if (!viewMeta?.value?.id) return |
|
|
|
if (!viewMeta?.value?.id) return |
|
|
|
kanbanMetaData.value = await $api.dbView.kanbanRead(viewMeta.value.id) |
|
|
|
kanbanMetaData.value = await $api.dbView.kanbanRead(viewMeta.value.id) |
|
|
@ -215,6 +225,7 @@ export function useKanbanViewData( |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
loadKanbanData, |
|
|
|
loadKanbanData, |
|
|
|
|
|
|
|
loadMoreKanbanData, |
|
|
|
loadKanbanMeta, |
|
|
|
loadKanbanMeta, |
|
|
|
updateKanbanMeta, |
|
|
|
updateKanbanMeta, |
|
|
|
kanbanMetaData, |
|
|
|
kanbanMetaData, |
|
|
|