Alerting: List V2 - datasource icons for rules #109033
Merged
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.
This pull request introduces changes to enhance the display of metadata in alerting rule list items by adding support for data source icons and improving the visual layout. The most important changes include the addition of
QuerySourceIconsto display queried data sources, updates to theListItemcomponent for better metadata separation, and the introduction of a reusableDataSourceLogocomponent.Enhancements to Metadata Display:
QuerySourceIconscomponent to display icons for queried data sources in the metadata section. This component deduplicates data source UIDs and uses tooltips to show data source names. ([public/app/features/alerting/unified/rule-list/components/AlertRuleListItem.tsxR307-R329](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R307-R329))querySourceUIDsas a new prop inAlertRuleListItemPropsandRecordingRuleListItemProps, allowing metadata to display queried data sources when provided. ([[1]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R52),[[2]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R79),[[3]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R99-R102),[[4]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R188),[[5]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R205-R208))Visual Improvements:
ListItemcomponent to use a pipe (|) separator instead of a dot (·) for better visual distinction between metadata items. ([public/app/features/alerting/unified/rule-list/components/ListItem.tsxL75-R75](https://github.com/grafana/grafana/pull/109033/files#diff-cf3f32cce00fda0d4bb7b0b303ca2b1904b791dba7f522a63fe53d9d803d091cL75-R75))ListItemmetadata stack to improve readability. ([public/app/features/alerting/unified/rule-list/components/ListItem.tsxL42-R42](https://github.com/grafana/grafana/pull/109033/files#diff-cf3f32cce00fda0d4bb7b0b303ca2b1904b791dba7f522a63fe53d9d803d091cL42-R42))Reusable Components:
DataSourceLogocomponent to render data source logos with consistent styling, including support for light and dark themes. ([public/app/features/alerting/unified/rule-list/components/AlertRuleListItem.tsxR454-R483](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82R454-R483))Codebase Refinements:
cx,DataSourceInstanceSettings, andgetDataSourceByUid) to support the new functionality. ([[1]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82L1-R5),[[2]](https://github.com/grafana/grafana/pull/109033/files#diff-8173c287466af2530acb215830e6e8fb6b94d9525eaadffd9ddc6e61fbb58b82L16-R16))