Skip to content

Commit b3cf538

Browse files
committed
chore: update to markdow
1 parent c182791 commit b3cf538

File tree

5 files changed

+20
-35
lines changed

5 files changed

+20
-35
lines changed

frontend/src/container/FormAlertChannels/Settings/MsTeams.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Form, Input } from 'antd';
2+
import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer';
23
import React from 'react';
34
import { 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 },

frontend/src/container/FormAlertChannels/Settings/Opsgenie.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Form, Input } from 'antd';
2+
import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer';
23
import { useTranslation } from 'react-i18next';
34

45
import { 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 },

frontend/src/container/FormAlertChannels/Settings/Pager.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Form, Input } from 'antd';
2+
import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer';
23
import { Dispatch, SetStateAction } from 'react';
34
import { 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 },

frontend/src/container/FormAlertChannels/Settings/Slack.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Form, Input } from 'antd';
2+
import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer';
23
import { Dispatch, SetStateAction } from 'react';
34
import { 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 },

frontend/src/container/FormAlertChannels/Settings/Webhook.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Form, Input } from 'antd';
2+
import { MarkdownRenderer } from 'components/MarkdownRenderer/MarkdownRenderer';
23
import { Dispatch, SetStateAction } from 'react';
34
import { 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 },

0 commit comments

Comments
 (0)