mirror of
https://github.com/docmost/docmost.git
synced 2026-07-27 03:24:45 +10:00
feat(bases): open detail modal for cards created via per-column '+ New'
This commit is contained in:
@@ -129,7 +129,7 @@ export function BaseKanban({
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleAddCard = (columnKey: string) => {
|
const handleAddCard = async (columnKey: string) => {
|
||||||
if (!groupByPropertyId) return;
|
if (!groupByPropertyId) return;
|
||||||
const cells =
|
const cells =
|
||||||
columnKey === NO_VALUE_CHOICE_ID
|
columnKey === NO_VALUE_CHOICE_ID
|
||||||
@@ -137,11 +137,16 @@ export function BaseKanban({
|
|||||||
: { [groupByPropertyId]: columnKey };
|
: { [groupByPropertyId]: columnKey };
|
||||||
const column = columns.find((c) => c.key === columnKey);
|
const column = columns.find((c) => c.key === columnKey);
|
||||||
const afterRowId = column?.rows[column.rows.length - 1]?.id;
|
const afterRowId = column?.rows[column.rows.length - 1]?.id;
|
||||||
createRowMutation.mutate({
|
try {
|
||||||
pageId: base.id,
|
const newRow = await createRowMutation.mutateAsync({
|
||||||
cells,
|
pageId: base.id,
|
||||||
afterRowId,
|
cells,
|
||||||
});
|
afterRowId,
|
||||||
|
});
|
||||||
|
onCardClick(newRow.id);
|
||||||
|
} catch {
|
||||||
|
// mutation already shows an error toast.
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleColumnReorder = useCallback(
|
const handleColumnReorder = useCallback(
|
||||||
|
|||||||
Reference in New Issue
Block a user