CloudWatch: fix duplicated IDs (#42658)

pull/42665/head
Andres Martinez Gotor 4 years ago committed by GitHub
parent ec994c3e1f
commit e061cbd25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
  2. 6
      public/app/plugins/datasource/cloudwatch/components/SQLBuilderEditor/SQLBuilderSelectRow.tsx

@ -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}

Loading…
Cancel
Save