feat: implemented getWarningsBySeverity

ref: N25B-450
This commit is contained in:
JGerla
2026-01-14 16:59:28 +01:00
parent 1a8670ba13
commit e9acab456e

View File

@@ -76,7 +76,26 @@ export function editorWarningRegistry(get: ZustandGet, set: ZustandSet) : Editor
['WARNING', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()]
]),
getWarningsBySeverity: (_warningSeverity) => { return []},
getWarningsBySeverity: (warningSeverity) => {
const wRegistry = get().editorWarningRegistry;
const sIndex = get().severityIndex;
const warningKeys = sIndex.get(warningSeverity);
const warnings: EditorWarning[] = [];
warningKeys?.forEach(
({nodeId, warningKey}) => {
const warning = wRegistry.get(nodeId)?.get(warningKey);
if (warning) {
warnings.push(warning);
}
}
)
return warnings;
},
isProgramValid: () => { return true},