[BUGFIX] fix cellSettings not applied for columns with no data in any query#700
Open
rajusem wants to merge 1 commit into
Open
[BUGFIX] fix cellSettings not applied for columns with no data in any query#700rajusem wants to merge 1 commit into
rajusem wants to merge 1 commit into
Conversation
… query When a column is defined in columnSettings but no query returns data for it (e.g. cpu_request_hard when no ResourceQuotas exist), the column key is absent from the keys array. This prevents keysAsObj from extending rows with undefined for that column, so the cellSettings null condition is never evaluated and the column shows blank instead of N/A. Fix: include column names from columnSettings in the keys array so that columns with no data are still evaluated for cellSettings conditions. Signed-off-by: Raj Zalavadia <rzalavad@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
cellSettingsconditional formatting (e.g., showing "N/A" for null values) not being applied for columns where no query returns any data — such ascpu_request_hardormemory_request_hardwhen no ResourceQuotas exist on the cluster.Root cause
The
keysarray is computed only from data rows. When a query returns no data at all (emptyseries), its column key (e.g.,value #5) never appears in any row and is therefore absent fromkeys. ThekeysAsObjextension then never addsundefinedfor that column, so thecellSettingsnull condition is never evaluated — resulting in blank cells instead of "N/A".This is distinct from the filtering bug fixed in #688, where the column key existed in some rows but cellConfig indices were misaligned after filtering.
Fix
Include column names from
columnSettingsin thekeysarray, so that columns defined in the panel spec are always extended withundefinedinkeysAsObjand evaluated forcellSettingsconditions — even when no query produces data for them.How to reproduce (before fix)
kube_resourcequotawhen no ResourceQuotas exist)columnSettings(e.g.,value #5as "CPU Request Hard")cellSettingswith aMisc/nullcondition (text: "N/A")Tests added
columnSettingsbut with completely empty query data shows N/A for all rowsMOCK_MULTI_QUERY_DATA_EMPTY(empty series) to simulate the real-world scenarioUses ARIA role-based selectors per UI guidelines.
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.