fix(views/table): inheritable checkbox not respected

This commit is contained in:
Elian Doran 2025-07-19 13:25:54 +03:00
parent 40a5eee211
commit beb1c15fa5
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View file

@ -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
});
}

View file

@ -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);
}