Skip to content

Commit

Permalink
Merge pull request #3635 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3592-to-release-4.3

[release-4.3] Bug 1777178: Query Browser: Fix Switch to enable when inserting example query
  • Loading branch information
openshift-merge-robot committed Dec 3, 2019
2 parents b1db901 + 71bd933 commit f6ca8dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/public/components/monitoring/metrics.tsx
Expand Up @@ -813,6 +813,7 @@ const Query_: React.FC<QueryProps> = ({
patchQuery,
toggleIsEnabled,
}) => {
const switchKey = `${id}-${isEnabled}`;
const switchLabel = `${isEnabled ? 'Disable' : 'Enable'} query`;

const toggleIsExpanded = () => patchQuery({ isExpanded: !isExpanded });
Expand All @@ -829,9 +830,9 @@ const Query_: React.FC<QueryProps> = ({
<div title={switchLabel}>
<Switch
aria-label={switchLabel}
id={id}
id={switchKey}
isChecked={isEnabled}
key={id}
key={switchKey}
onChange={toggleIsEnabled}
/>
</div>
Expand Down

0 comments on commit f6ca8dd

Please sign in to comment.