Skip to content

Commit

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

[release-4.14] OCPBUGS-24664: disable query link for non metric-based alerts
  • Loading branch information
openshift-merge-bot[bot] committed Dec 21, 2023
2 parents 8757197 + ef4676f commit a0a1b5a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/alerting.tsx
Expand Up @@ -1181,11 +1181,18 @@ const AlertRulesDetailsPage_: React.FC<AlertRulesDetailsPageProps> = ({ match })
)}
<dt>{t('Expression')}</dt>
<dd>
<Link to={queryBrowserURL(rule?.query, namespace)}>
{/* display a link only if its a metrics based alert */}
{!sourceId || sourceId === 'prometheus' ? (
<Link to={queryBrowserURL(rule?.query, namespace)}>
<CodeBlock>
<CodeBlockCode>{rule?.query}</CodeBlockCode>
</CodeBlock>
</Link>
) : (
<CodeBlock>
<CodeBlockCode>{rule?.query}</CodeBlockCode>
</CodeBlock>
</Link>
)}
</dd>
</dl>
</div>
Expand Down

0 comments on commit a0a1b5a

Please sign in to comment.