RHIDP-12113: Support customization aggregated homepage scorecard card#2376
RHIDP-12113: Support customization aggregated homepage scorecard card#2376imykhno wants to merge 11 commits intoredhat-developer:mainfrom
Conversation
… "descriptions" for homepage aggregated KPIs Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
PR Compliance Guide 🔍(Compliance updated until commit cc26437)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 0f39f1a
Compliance check up to commit e373846
Compliance check up to commit 47a742b
Compliance check up to commit 712e1d5
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to cc26437
Previous suggestions✅ Suggestions up to commit 47a742b
✅ Suggestions up to commit 712e1d5
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Eswaraiahsapram
left a comment
There was a problem hiding this comment.
Thanks @imykhno, for this PR.
I added a few comments PTAL.
There was a problem hiding this comment.
It might be cleaner to compute cardTitle and cardDescription first and have a single return block to avoid duplication.
There was a problem hiding this comment.
Thank you, I updated the logic
| if (aggregatedScorecard.result?.total === 0) { | ||
| return ( | ||
| <EmptyStatePanel | ||
| metricId={metricId} | ||
| label={t('errors.noDataFound')} | ||
| tooltipContent={t('errors.noDataFoundMessage')} | ||
| /> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Since we are introducing customization for aggregated KPI title and description, should we also consider updating the EmptyStatePanel title and description accordingly?
API Response for Jira
{
"id": "jira.open_issues",
"status": "success",
"metadata": {
"title": "My Jira issues",
"description": "Custom description for Jira issues",
"type": "number",
"history": true,
"customized": true
},
"result": {
"values": [
{
"count": 0,
"name": "success"
},
{
"count": 0,
"name": "warning"
},
{
"count": 0,
"name": "error"
}
],
"total": 0,
"timestamp": "2026-02-24T05:35:52.273Z"
}
}
There was a problem hiding this comment.
Yes you are totally right, this behavior didn't work. Fixed with the final changes
| plugins: | ||
| jira: | ||
| open_issues: | ||
| homepage: |
There was a problem hiding this comment.
In theory, aggregated cards can be shown on any page, so maybe we don't need to bake in homepage.
But it is true that the component is named ScorecardHomepageCard 😁
There was a problem hiding this comment.
I agree with you. In theory, aggregated cards can be used on any page, so tying it to the homepage doesn’t feel ideal.
During the initial implementation, we somehow ended up naming it ScorecardHomepageCard. When we get some time, I think we should definitely consider renaming it to something more generic and future-proof.
There was a problem hiding this comment.
I would say, we need to support current "homepage" approach for now to make a code more consistent. Moreover, as @Eswaraiahsapram mentioned, when we have some time for renaming, I think, it would be much easier to rename rather than one part follows "homepage" pattern and another does not
There was a problem hiding this comment.
You could avoid the breaking change by for example using name: aggregations in app-config.
| jira: | ||
| open_issues: | ||
| homepage: | ||
| aggregatedMetric: |
There was a problem hiding this comment.
Could you please think about how this configuration might change when users will be able to specify also other aggregation scorecards like sum that is part of the feature? Because that will influence how the config can look like. For example, now if new Scorecard for sum aggregation is added, that needs a different title, there is no way to specify it in config.
I would also rather use name aggregatedScorecards.
There was a problem hiding this comment.
Could you please think about how this configuration might change when users will be able to specify also other aggregation scorecards like sum that is part of the feature?
I would say, that I expect to add some kind of type for the configuration. By default it will be "Sum", also user can provide the type as "Average" which affect the logic of aggregation and card on IU.
For example, now if new Scorecard for sum aggregation is added, that needs a different title, there is no way to specify it in config.
Sorry, I didn't understand what do you mean in this example. Currently supported only two cards and user can customize them, did you mean some third card?
I would also rather use name aggregatedScorecards.
As we already under the scorecard configuration I expect that all configuration inside will be affect the plugin, so I am not sure of tautology
I will be waiting for your response, thank you!
| description: metric.description, | ||
| type: metric.type, | ||
| history: metric.history, | ||
| customized, |
There was a problem hiding this comment.
You use isCustomized and customized, can you please unify it?
There was a problem hiding this comment.
Thank you, updated to isCustomized for all places
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…on-aggregated-KPI
…stomization handling Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…oduce route constants Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…anel Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
…I customization Signed-off-by: Ihor Mykhno <imykhno@redhat.com>
|
Eswaraiahsapram
left a comment
There was a problem hiding this comment.
Thanks @imykhno , I’ve added a few very minor comments to the PR. When you have a moment, could you please take another look?
| import Box from '@mui/material/Box'; | ||
| import CircularProgress from '@mui/material/CircularProgress'; | ||
|
|
||
| export const CardLoading = () => { |
There was a problem hiding this comment.
We can move this to a Common folder so that it can be reused in other places. we can pass height as prop.
| label={t('errors.metricDataUnavailable')} | ||
| tooltipContent={t('errors.userNotFoundInCatalogMessage')} | ||
| /> | ||
| const getPanelContent = () => { |
There was a problem hiding this comment.
Can we use useMemo and rename it to getErrorPanelContent?
|
The architecture for this task has changed. Therefore, I am closing this PR and will open a new one. The new PR will include the relevant code from this branch along with the new updates, and all previous comments will be taken into account. |






User description
Hey, I just made a Pull Request!
This PR enables the customization of title and descriptions for aggregated KPIs within the
scorecardplugin. This functionality allows Engineering and Product Managers to provide company-specific information, ensuring metrics are easily understood by end-users.The description logic operates as follows:
The
app-config.yamlfor the scorecard plugin has been expanded to include a homepage section. Here, system administrators can define custom values for each provider.Was expanded
app-config.yamlfor the scorecard plugin. Addedhomepagesection where system administrator can provide customized title and description for each providers.The example of customization at the
app-config.yamlfile:Additionally, the response object for
GET /metrics/:metricId/catalog/aggregationshas been updated. I have added acustomizedflag to themetadatato indicate whether the fields have been modified, preventing unnecessary translation attempts.New logic implemented for:
✔️ Checklist
How to test?
1. Aggregated KPI works as expected without customization
2. Aggregated KPI works as expected when customized names and descriptions were provided
3. Error will be thrown when customized only names OR descriptions
PR Type
Enhancement
Description
Enable customization of aggregated KPI card titles and descriptions via app-config.yaml
Add
customizedflag to API response metadata to disable translations for custom valuesValidate that both title and description are provided together, throwing InputError if incomplete
Update frontend to render custom titles/descriptions when customization is configured
Diagram Walkthrough
File Walkthrough
1 files
Add homepage aggregatedMetric config schema6 files
Pass config to router initializationAdd customized flag to AggregatedMetricResultIntegrate customization logic into aggregation endpointNew utility to extract and validate metric customizationAdd optional customized flag to AggregatedMetricResultRender custom titles/descriptions when customized flag set3 files
Comprehensive tests for customization validation logicAdd tests for customized metrics and error handlingTest custom title and description rendering4 files
Document aggregated KPI customization featureAdd example configuration for customizationUpdate API report with customized fieldAdd changeset for feature release