mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +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[]) {
|
export function buildColumnDefinitions(info: PromotedAttributeInformation[]) {
|
||||||
const columnDefs: GridOptions<TableData>["columnDefs"] = [
|
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 applyHeaderCustomization from "./header-customization.js";
|
||||||
import ViewModeStorage from "../view_mode_storage.js";
|
import ViewModeStorage from "../view_mode_storage.js";
|
||||||
import { type StateInfo } from "./storage.js";
|
import { type StateInfo } from "./storage.js";
|
||||||
|
import server from "../../../services/server.js";
|
||||||
|
|
||||||
ModuleRegistry.registerModules([ AllCommunityModule ]);
|
ModuleRegistry.registerModules([ AllCommunityModule ]);
|
||||||
|
|
||||||
@ -42,8 +43,13 @@ function setupEditing(): GridOptions<TableData> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { newValue } = event;
|
||||||
|
if (name === "title") {
|
||||||
|
// TODO: Deduplicate with note_title.
|
||||||
|
server.put(`notes/${noteId}/title`, { title: newValue });
|
||||||
|
}
|
||||||
|
|
||||||
if (name.startsWith("labels.")) {
|
if (name.startsWith("labels.")) {
|
||||||
const { newValue } = event;
|
|
||||||
const labelName = name.split(".", 2)[1];
|
const labelName = name.split(".", 2)[1];
|
||||||
setLabel(noteId, labelName, newValue);
|
setLabel(noteId, labelName, newValue);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user