Skip to content

Commit 85ae7bd

Browse files
heiskrCopilot
andauthored
Render webhook reference HTML via RenderedHTML (#6619) (#61959)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bfd94cf commit 85ae7bd

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/webhooks/components/Webhook.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ParameterTable } from '@/automated-pipelines/components/parameter-table
1313
import { HighlightedCode } from '@/frame/components/HighlightedCode'
1414

1515
import styles from './WebhookPayloadExample.module.scss'
16+
import { RenderedHTML } from '@/frame/components/ui/RenderedHTML/RenderedHTML'
1617

1718
type Props = {
1819
webhook: WebhookAction
@@ -162,11 +163,10 @@ export function Webhook({ webhook }: Props) {
162163
{currentWebhookAction.category}
163164
</HeadingLink>
164165
<div>
165-
<div dangerouslySetInnerHTML={{ __html: currentWebhookAction.summaryHtml }}></div>
166-
<h3
167-
dangerouslySetInnerHTML={{
168-
__html: t('availability').replace('{{ WebhookName }}', currentWebhookAction.category),
169-
}}
166+
<RenderedHTML as="div" html={currentWebhookAction.summaryHtml} />
167+
<RenderedHTML
168+
as="h3"
169+
html={t('availability').replace('{{ WebhookName }}', currentWebhookAction.category)}
170170
/>
171171
<ul>
172172
{currentWebhookAction.availability.map((availability) => {
@@ -179,13 +179,12 @@ export function Webhook({ webhook }: Props) {
179179
)
180180
})}
181181
</ul>
182-
<h3
183-
dangerouslySetInnerHTML={{
184-
__html: t('webhook_payload_object').replace(
185-
'{{ WebhookName }}',
186-
currentWebhookAction.category,
187-
),
188-
}}
182+
<RenderedHTML
183+
as="h3"
184+
html={t('webhook_payload_object').replace(
185+
'{{ WebhookName }}',
186+
currentWebhookAction.category,
187+
)}
189188
/>
190189
{error && (
191190
<Flash className="mb-5" variant="danger">
@@ -219,10 +218,11 @@ export function Webhook({ webhook }: Props) {
219218
</div>
220219
</div>
221220
)}
222-
<div
221+
<RenderedHTML
222+
as="div"
223223
className="mb-4 f5 color-fg-muted"
224-
dangerouslySetInnerHTML={{ __html: currentWebhookAction.descriptionHtml }}
225-
></div>
224+
html={currentWebhookAction.descriptionHtml}
225+
/>
226226
<div>
227227
<ParameterTable
228228
slug={slug(`${currentWebhookAction.category}-${selectedWebhookActionType}`)}

0 commit comments

Comments
 (0)