feat(views/table): refresh on attribute change

This commit is contained in:
Elian Doran 2025-06-27 22:50:27 +03:00
parent 0fb0be4ffc
commit 44ce6a5169
No known key found for this signature in database

View File

@ -8,7 +8,7 @@ import server from "../../../services/server.js";
import type { GridApi, GridState } from "ag-grid-community";
import SpacedUpdate from "../../../services/spaced_update.js";
import branches from "../../../services/branches.js";
import type { CommandListenerData } from "../../../components/app_context.js";
import type { CommandListenerData, EventData } from "../../../components/app_context.js";
import type { Attribute } from "../../../services/attribute_parser.js";
const TPL = /*html*/`
@ -184,5 +184,17 @@ export default class TableView extends ViewMode<StateInfo> {
console.log("Save attributes", this.newAttribute);
}
onEntitiesReloaded({ loadResults }: EventData<"entitiesReloaded">): boolean | void {
// Refresh if promoted attributes get changed.
if (loadResults.getAttributeRows().find(attr =>
attr.type === "label" &&
attr.name?.startsWith("label:") &&
attributes.isAffecting(attr, this.parentNote))) {
return true;
}
return false;
}
}