From b8a3814d52f20f09072af9de63539f37aa0aa548 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Tue, 17 Jun 2025 14:48:37 +0100 Subject: [PATCH] fix grafana-prometheus markup --- .../src/components/AnnotationQueryEditor.tsx | 27 +- .../src/components/PromCheatSheet.tsx | 2 +- .../src/components/PromExemplarField.tsx | 12 +- .../src/components/PromExploreExtraField.tsx | 28 +- .../src/components/PromQueryField.tsx | 5 +- .../src/components/VariableQueryEditor.tsx | 88 ++- .../metrics-browser/LabelSelector.tsx | 8 +- .../metrics-browser/MetricSelector.tsx | 12 +- .../metrics-browser/SelectorActions.tsx | 29 +- .../metrics-browser/ValueSelector.tsx | 16 +- .../AlertingSettingsOverhaul.tsx | 6 +- .../src/configuration/ConfigEditor.tsx | 8 +- .../DataSourceHttpSettingsOverhaul.tsx | 6 +- .../src/configuration/ExemplarSetting.tsx | 39 +- .../src/configuration/ExemplarsSettings.tsx | 6 +- .../src/configuration/PromSettings.tsx | 116 ++-- .../src/configuration/shared/utils.tsx | 4 +- .../src/locales/en-US/grafana-prometheus.json | 646 +++++++++--------- .../src/querybuilder/QueryPattern.tsx | 29 +- .../src/querybuilder/QueryPatternsModal.tsx | 25 +- .../components/LabelFilterItem.tsx | 8 +- .../querybuilder/components/LabelFilters.tsx | 6 +- .../components/MetricCombobox.tsx | 17 +- .../querybuilder/components/NestedQuery.tsx | 13 +- .../components/PromQueryBuilderOptions.tsx | 24 +- .../PromQueryCodeEditorAutocompleteInfo.tsx | 4 +- .../components/PromQueryEditorSelector.tsx | 10 +- .../components/PromQueryLegendEditor.tsx | 6 +- .../metrics-modal/AdditionalSettings.tsx | 6 +- .../components/metrics-modal/FeedbackLink.tsx | 4 +- .../components/metrics-modal/MetricsModal.tsx | 29 +- .../components/metrics-modal/ResultsTable.tsx | 10 +- .../src/querybuilder/parsing.ts | 10 +- .../querybuilder/shared/OperationEditor.tsx | 6 +- .../querybuilder/shared/OperationHeader.tsx | 9 +- .../shared/OperationInfoButton.tsx | 10 +- .../src/querybuilder/shared/OperationList.tsx | 6 +- .../shared/OperationParamEditorRegistry.tsx | 8 +- .../querybuilder/shared/QueryBuilderHints.tsx | 2 +- .../querybuilder/shared/QueryEditorHints.tsx | 2 +- .../src/querybuilder/shared/RawQuery.tsx | 2 +- 41 files changed, 741 insertions(+), 563 deletions(-) diff --git a/packages/grafana-prometheus/src/components/AnnotationQueryEditor.tsx b/packages/grafana-prometheus/src/components/AnnotationQueryEditor.tsx index cff87f522fa..41021c4a913 100644 --- a/packages/grafana-prometheus/src/components/AnnotationQueryEditor.tsx +++ b/packages/grafana-prometheus/src/components/AnnotationQueryEditor.tsx @@ -33,7 +33,7 @@ export const AnnotationQueryEditor = memo(function AnnotationQueryEditor(props: if (!annotation || !onAnnotationChange) { return (

- + Annotation data load error!

@@ -78,10 +78,10 @@ export const AnnotationQueryEditor = memo(function AnnotationQueryEditor(props: An additional lower limit for the step parameter of the Prometheus query and for the{' '} @@ -92,10 +92,10 @@ export const AnnotationQueryEditor = memo(function AnnotationQueryEditor(props: handleMinStepChange(e.currentTarget.value)} @@ -107,9 +107,9 @@ export const AnnotationQueryEditor = memo(function AnnotationQueryEditor(props: - + diff --git a/packages/grafana-prometheus/src/components/PromCheatSheet.tsx b/packages/grafana-prometheus/src/components/PromCheatSheet.tsx index aaab3dcc48c..78e44947550 100644 --- a/packages/grafana-prometheus/src/components/PromCheatSheet.tsx +++ b/packages/grafana-prometheus/src/components/PromCheatSheet.tsx @@ -37,7 +37,7 @@ export const PromCheatSheet = (props: QueryEditorHelpProps) => { return (

- PromQL Cheat Sheet + PromQL Cheat Sheet

{CHEAT_SHEET_ITEMS.map((item, index) => (
diff --git a/packages/grafana-prometheus/src/components/PromExemplarField.tsx b/packages/grafana-prometheus/src/components/PromExemplarField.tsx index 093737e0b28..c4a18a0cf00 100644 --- a/packages/grafana-prometheus/src/components/PromExemplarField.tsx +++ b/packages/grafana-prometheus/src/components/PromExemplarField.tsx @@ -49,13 +49,19 @@ export function PromExemplarField({ datasource, onChange, query, ...rest }: Prop
- Exemplars + Exemplars @@ -69,10 +72,13 @@ export const PromExploreExtraField = memo(({ query, datasource, onChange, onRunQ flexWrap: 'nowrap', }) )} - aria-label={t('components.prom-explore-extra-field.aria-label-query-type-field', 'Query type field')} + aria-label={t( + 'grafana-prometheus.components.prom-explore-extra-field.aria-label-query-type-field', + 'Query type field' + )} > - Query type + Query type - Min step + Min step { onChange={onChangeQuery} onRunQuery={onRunQuery} initialValue={query.expr ?? ''} - placeholder={t('components.prom-query-field.placeholder-enter-a-prom-ql-query', 'Enter a PromQL query…')} + placeholder={t( + 'grafana-prometheus.components.prom-query-field.placeholder-enter-a-prom-ql-query', + 'Enter a PromQL query…' + )} datasource={datasource} timeRange={range ?? getDefaultTimeRange()} /> diff --git a/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx b/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx index 043e54139fb..8a05059cdb6 100644 --- a/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx +++ b/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx @@ -260,19 +260,25 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: <> - + The Prometheus data source plugin provides the following query types for template variables.
} > { setLabelNamesMatch(event.currentTarget.value); @@ -357,12 +369,12 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: {qryType === QueryType.MetricNames && ( - + Returns a list of metrics matching the specified metric regex.
@@ -370,8 +382,14 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: > { setMetric(e.currentTarget.value); @@ -390,12 +408,12 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: {qryType === QueryType.VarQueryResult && ( Returns a list of Prometheus query results for the query. This can include Prometheus functions, i.e. @@ -406,8 +424,14 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: >