mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
feat(book/table): support changing note title
This commit is contained in:
parent
168e224d3e
commit
c9b556160f
@ -25,10 +25,12 @@ export function buildData(info: PromotedAttributeInformation[], notes: FNote[])
|
||||
export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
|
||||
const columnDefs: GridOptions<TableData>["columnDefs"] = [
|
||||
{
|
||||
field: "noteId"
|
||||
field: "noteId",
|
||||
editable: false
|
||||
},
|
||||
{
|
||||
field: "title"
|
||||
field: "title",
|
||||
editable: true
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -6,6 +6,7 @@ import { setLabel } from "../../../services/attributes.js";
|
||||
import applyHeaderCustomization from "./header-customization.js";
|
||||
import ViewModeStorage from "../view_mode_storage.js";
|
||||
import { type StateInfo } from "./storage.js";
|
||||
import server from "../../../services/server.js";
|
||||
|
||||
ModuleRegistry.registerModules([ AllCommunityModule ]);
|
||||
|
||||
@ -42,8 +43,13 @@ function setupEditing(): GridOptions<TableData> {
|
||||
return;
|
||||
}
|
||||
|
||||
const { newValue } = event;
|
||||
if (name === "title") {
|
||||
// TODO: Deduplicate with note_title.
|
||||
server.put(`notes/${noteId}/title`, { title: newValue });
|
||||
}
|
||||
|
||||
if (name.startsWith("labels.")) {
|
||||
const { newValue } = event;
|
||||
const labelName = name.split(".", 2)[1];
|
||||
setLabel(noteId, labelName, newValue);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user