mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 03:59:05 +01:00
fix(views/table): booleans not working
This commit is contained in:
parent
23cef0ab94
commit
b93a4a3e42
@ -159,7 +159,7 @@ export default class TableView extends ViewMode<StateInfo> {
|
|||||||
this.api!.on("cellEdited", async (cell) => {
|
this.api!.on("cellEdited", async (cell) => {
|
||||||
const noteId = cell.getRow().getData().noteId;
|
const noteId = cell.getRow().getData().noteId;
|
||||||
const field = cell.getField();
|
const field = cell.getField();
|
||||||
const newValue = cell.getValue();
|
let newValue = cell.getValue();
|
||||||
|
|
||||||
if (field === "title") {
|
if (field === "title") {
|
||||||
server.put(`notes/${noteId}/title`, { title: newValue });
|
server.put(`notes/${noteId}/title`, { title: newValue });
|
||||||
@ -169,6 +169,9 @@ export default class TableView extends ViewMode<StateInfo> {
|
|||||||
if (field.includes(".")) {
|
if (field.includes(".")) {
|
||||||
const [ type, name ] = field.split(".", 2);
|
const [ type, name ] = field.split(".", 2);
|
||||||
if (type === "labels") {
|
if (type === "labels") {
|
||||||
|
if (typeof newValue === "boolean") {
|
||||||
|
newValue = newValue ? "true" : "false";
|
||||||
|
}
|
||||||
setLabel(noteId, name, newValue);
|
setLabel(noteId, name, newValue);
|
||||||
} else if (type === "relations") {
|
} else if (type === "relations") {
|
||||||
const note = await froca.getNote(noteId);
|
const note = await froca.getNote(noteId);
|
||||||
|
|||||||
@ -24,8 +24,6 @@ export async function buildRowDefinitions(parentNote: FNote, notes: FNote[], inf
|
|||||||
for (const { name, type } of infos) {
|
for (const { name, type } of infos) {
|
||||||
if (type === "relation") {
|
if (type === "relation") {
|
||||||
relations[name] = note.getRelationValue(name);
|
relations[name] = note.getRelationValue(name);
|
||||||
} else if (type === "boolean") {
|
|
||||||
labels[name] = note.hasLabel(name);
|
|
||||||
} else {
|
} else {
|
||||||
labels[name] = note.getLabelValue(name);
|
labels[name] = note.getLabelValue(name);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user