CloudWatch: fix duplicated IDs (#42658) (#42662)

(cherry picked from commit e061cbd25b)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-12-02 16:29:29 +01:00
committed by GitHub
co-authored by Andres Martinez Gotor
parent 57c4d4e69b
commit 4dcbc475a8
2 changed files with 5 additions and 5 deletions
@@ -66,7 +66,7 @@ export function MetricStatEditor({
<EditorField label="Statistic" width={16}>
<Select
inputId="metric-stat-editor-select-statistic"
inputId={`${query.refId}-metric-stat-editor-select-statistic`}
allowCustomValue
value={toOption(query.statistic ?? datasource.standardStatistics[0])}
options={appendTemplateVariables(
@@ -109,7 +109,7 @@ export function MetricStatEditor({
tooltip="Only show metrics that exactly match all defined dimension names."
>
<Switch
id="cloudwatch-match-exact"
id={`${query.refId}-cloudwatch-match-exact`}
value={!!query.matchExact}
onChange={(e) => {
onQueryChange({
@@ -59,7 +59,7 @@ const SQLBuilderSelectRow: React.FC<SQLBuilderSelectRowProps> = ({ datasource, q
<EditorField label="Namespace" width={16}>
<Select
value={namespace ? toOption(namespace) : null}
inputId="cloudwatch-sql-namespace"
inputId={`${query.refId}-cloudwatch-sql-namespace`}
options={namespaceOptions}
allowCustomValue
onChange={({ value }) => value && onQueryChange(setNamespace(query, value))}
@@ -69,7 +69,7 @@ const SQLBuilderSelectRow: React.FC<SQLBuilderSelectRowProps> = ({ datasource, q
<EditorField label="With schema">
<Switch
id="cloudwatch-sql-withSchema"
id={`${query.refId}-cloudwatch-sql-withSchema`}
value={withSchemaEnabled}
onChange={(ev) =>
ev.target instanceof HTMLInputElement && onQueryChange(setWithSchema(query, ev.target.checked))
@@ -80,7 +80,7 @@ const SQLBuilderSelectRow: React.FC<SQLBuilderSelectRowProps> = ({ datasource, q
{withSchemaEnabled && (
<EditorField label="Schema labels">
<Select
id="cloudwatch-sql-schema-label-keys"
id={`${query.refId}-cloudwatch-sql-schema-label-keys`}
width="auto"
isMulti={true}
disabled={!namespace}