File tree Expand file tree Collapse file tree 5 files changed +20
-35
lines changed
frontend/src/container/FormAlertChannels/Settings Expand file tree Collapse file tree 5 files changed +20
-35
lines changed Original file line number Diff line number Diff line change 11import { Form , Input } from 'antd' ;
2+ import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer' ;
23import React from 'react' ;
34import { useTranslation } from 'react-i18next' ;
45
@@ -14,13 +15,9 @@ function MsTeams({ setSelectedConfig }: MsTeamsProps): JSX.Element {
1415 label = { t ( 'field_webhook_url' ) }
1516 tooltip = { {
1617 title : (
17- < div
18- dangerouslySetInnerHTML = { {
19- __html : t ( 'tooltip_ms_teams_url' ) . replace (
20- / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g,
21- '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>' ,
22- ) ,
23- } }
18+ < MarkdownRenderer
19+ markdownContent = { t ( 'tooltip_ms_teams_url' ) }
20+ variables = { { } }
2421 />
2522 ) ,
2623 overlayInnerStyle : { maxWidth : 400 } ,
Original file line number Diff line number Diff line change 11import { Form , Input } from 'antd' ;
2+ import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer' ;
23import { useTranslation } from 'react-i18next' ;
34
45import { OpsgenieChannel } from '../../CreateAlertChannels/config' ;
@@ -24,13 +25,9 @@ function OpsgenieForm({ setSelectedConfig }: OpsgenieFormProps): JSX.Element {
2425 label = { t ( 'field_opsgenie_api_key' ) }
2526 tooltip = { {
2627 title : (
27- < div
28- dangerouslySetInnerHTML = { {
29- __html : t ( 'tooltip_opsgenie_api_key' ) . replace (
30- / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g,
31- '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>' ,
32- ) ,
33- } }
28+ < MarkdownRenderer
29+ markdownContent = { t ( 'tooltip_opsgenie_api_key' ) }
30+ variables = { { } }
3431 />
3532 ) ,
3633 overlayInnerStyle : { maxWidth : 400 } ,
Original file line number Diff line number Diff line change 11import { Form , Input } from 'antd' ;
2+ import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer' ;
23import { Dispatch , SetStateAction } from 'react' ;
34import { useTranslation } from 'react-i18next' ;
45
@@ -15,13 +16,9 @@ function PagerForm({ setSelectedConfig }: PagerFormProps): JSX.Element {
1516 label = { t ( 'field_pager_routing_key' ) }
1617 tooltip = { {
1718 title : (
18- < div
19- dangerouslySetInnerHTML = { {
20- __html : t ( 'tooltip_pager_routing_key' ) . replace (
21- / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g,
22- '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>' ,
23- ) ,
24- } }
19+ < MarkdownRenderer
20+ markdownContent = { t ( 'tooltip_pager_routing_key' ) }
21+ variables = { { } }
2522 />
2623 ) ,
2724 overlayInnerStyle : { maxWidth : 400 } ,
Original file line number Diff line number Diff line change 11import { Form , Input } from 'antd' ;
2+ import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer' ;
23import { Dispatch , SetStateAction } from 'react' ;
34import { useTranslation } from 'react-i18next' ;
45
@@ -16,13 +17,9 @@ function Slack({ setSelectedConfig }: SlackProps): JSX.Element {
1617 label = { t ( 'field_webhook_url' ) }
1718 tooltip = { {
1819 title : (
19- < div
20- dangerouslySetInnerHTML = { {
21- __html : t ( 'tooltip_slack_url' ) . replace (
22- / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g,
23- '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>' ,
24- ) ,
25- } }
20+ < MarkdownRenderer
21+ markdownContent = { t ( 'tooltip_slack_url' ) }
22+ variables = { { } }
2623 />
2724 ) ,
2825 overlayInnerStyle : { maxWidth : 400 } ,
Original file line number Diff line number Diff line change 11import { Form , Input } from 'antd' ;
2+ import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer' ;
23import { Dispatch , SetStateAction } from 'react' ;
34import { useTranslation } from 'react-i18next' ;
45
@@ -14,13 +15,9 @@ function WebhookSettings({ setSelectedConfig }: WebhookProps): JSX.Element {
1415 label = { t ( 'field_webhook_url' ) }
1516 tooltip = { {
1617 title : (
17- < div
18- dangerouslySetInnerHTML = { {
19- __html : t ( 'tooltip_webhook_url' ) . replace (
20- / \[ ( [ ^ \] ] + ) \] \( ( [ ^ ) ] + ) \) / g,
21- '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>' ,
22- ) ,
23- } }
18+ < MarkdownRenderer
19+ markdownContent = { t ( 'tooltip_webhook_url' ) }
20+ variables = { { } }
2421 />
2522 ) ,
2623 overlayInnerStyle : { maxWidth : 400 } ,
You can’t perform that action at this time.
0 commit comments