Drop fields

This commit is contained in:
shamoon
2025-10-12 21:39:53 -07:00
parent 8361378a89
commit 1d110d7ff9
2 changed files with 26 additions and 21 deletions

View File

@@ -11,7 +11,13 @@ export const buildHighlightConfig = (globalConfig, widgetConfig) => {
...(widgetConfig?.levels || {}),
};
const fields = widgetConfig?.fields || {};
const { levels: _levels, ...fields } = widgetConfig || {};
Object.keys(fields).forEach((key) => {
if (fields[key] === null || fields[key] === undefined) {
delete fields[key];
}
});
const hasLevels = Object.values(levels).some(Boolean);
const hasFields = Object.keys(fields).length > 0;