mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
fix(views/table): inheritable checkbox not respected
This commit is contained in:
parent
40a5eee211
commit
beb1c15fa5
@ -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`, {
|
await server.put(`notes/${noteId}/set-attribute`, {
|
||||||
type: "label",
|
type: "label",
|
||||||
name: name,
|
name: name,
|
||||||
value: value
|
value: value,
|
||||||
|
isInheritable
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ export default class TableColumnEditing extends Component {
|
|||||||
attr = {
|
attr = {
|
||||||
type: "label",
|
type: "label",
|
||||||
name: `${type ?? "label"}:myLabel`,
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { name, value } = this.newAttribute;
|
const { name, value, isInheritable } = this.newAttribute;
|
||||||
|
|
||||||
this.api.blockRedraw();
|
this.api.blockRedraw();
|
||||||
try {
|
try {
|
||||||
@ -88,7 +89,7 @@ export default class TableColumnEditing extends Component {
|
|||||||
await renameColumn(this.parentNote.noteId, type as "label" | "relation", oldName, newName);
|
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) {
|
if (this.existingAttributeToEdit) {
|
||||||
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
|
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user