mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 01:52:43 +08: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;
|
||||
const cells =
|
||||
columnKey === NO_VALUE_CHOICE_ID
|
||||
@@ -137,11 +137,16 @@ export function BaseKanban({
|
||||
: { [groupByPropertyId]: columnKey };
|
||||
const column = columns.find((c) => c.key === columnKey);
|
||||
const afterRowId = column?.rows[column.rows.length - 1]?.id;
|
||||
createRowMutation.mutate({
|
||||
pageId: base.id,
|
||||
cells,
|
||||
afterRowId,
|
||||
});
|
||||
try {
|
||||
const newRow = await createRowMutation.mutateAsync({
|
||||
pageId: base.id,
|
||||
cells,
|
||||
afterRowId,
|
||||
});
|
||||
onCardClick(newRow.id);
|
||||
} catch {
|
||||
// mutation already shows an error toast.
|
||||
}
|
||||
};
|
||||
|
||||
const handleColumnReorder = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user