Skip to content

Build your personal knowledge base with Trilium Notes

fix(views/table): inheritable checkbox not respected

Elian Doranbeb1c15fa511
diff --git a/apps/client/src/services/attributes.ts b/apps/client/src/services/attributes.ts
index 52ea8967af..370fd1ce1f 100644
--- a/apps/client/src/services/attributes.ts
+++ b/apps/client/src/services/attributes.ts
@@ -12,11 +12,12 @@ async function addLabel(noteId: string, name: string, value: string = "", isInhe
});
}
-export async function setLabel(noteId: string, name: string, value: string = "") {
+export async function setLabel(noteId: string, name: string, value: string = "", isInheritable = false) {
await server.put(`notes/${noteId}/set-attribute`, {
type: "label",
name: name,
- value: value
+ value: value,
+ isInheritable
});
}
diff --git a/apps/client/src/widgets/view_widgets/table_view/col_editing.ts b/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
index ac8c7e7409..cb3f90bc9a 100644
--- a/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
+++ b/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
@@ -45,7 +45,8 @@ export default class TableColumnEditing extends Component {
attr = {
type: "label",
name: `${type ?? "label"}:myLabel`,
- value: "promoted,single,text"
+ value: "promoted,single,text",
+ isInheritable: true
};
}
@@ -78,7 +79,7 @@ export default class TableColumnEditing extends Component {
return;
}
- const { name, value } = this.newAttribute;
+ const { name, value, isInheritable } = this.newAttribute;
this.api.blockRedraw();
try {
@@ -88,7 +89,7 @@ export default class TableColumnEditing extends Component {
await renameColumn(this.parentNote.noteId, type as "label" | "relation", oldName, newName);
}
- attributes.setLabel(this.parentNote.noteId, name, value);
+ attributes.setLabel(this.parentNote.noteId, name, value, isInheritable);
if (this.existingAttributeToEdit) {
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
}