chore(views/table): bring back editing attributes

This commit is contained in:
Elian Doran
2025-06-28 23:23:29 +03:00
parent 9a6a8580de
commit 09b800b9ad
2 changed files with 7 additions and 21 deletions

View File

@@ -69,7 +69,7 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
columnDefs.push({ columnDefs.push({
field: `labels.${name}`, field: `labels.${name}`,
title: title ?? name, title: title ?? name,
editable: true editor: "input"
// cellDataType: mapDataType(type), // cellDataType: mapDataType(type),
}); });
} }

View File

@@ -117,30 +117,16 @@ export default class TableView extends ViewMode<StateInfo> {
const field = cell.getField(); const field = cell.getField();
const newValue = cell.getValue(); const newValue = cell.getValue();
console.log("Cell edited", field, newValue);
if (field === "title") { if (field === "title") {
server.put(`notes/${noteId}/title`, { title: newValue }); server.put(`notes/${noteId}/title`, { title: newValue });
return;
}
if (field.startsWith("labels.")) {
const labelName = field.split(".", 2)[1];
setLabel(noteId, labelName, newValue);
} }
}); });
// return {
// onCellValueChanged(event) {
// if (event.type !== "cellValueChanged") {
// return;
// }
// const noteId = event.data.noteId;
// const name = event.colDef.field;
// if (!name) {
// return;
// }
// if (name.startsWith("labels.")) {
// const labelName = name.split(".", 2)[1];
// setLabel(noteId, labelName, newValue);
// }
// }
// }
} }
private setupDragging() { private setupDragging() {