Skip to content

Commit

Permalink
fix: webhooks help links (#907)
Browse files Browse the repository at this point in the history
* fix: webhooks help links

* fix: update links

---------

Co-authored-by: mortadarefd <m.mortada@refdapp.com>
  • Loading branch information
mortada-codes and mortadarefd authored Oct 30, 2023
1 parent 8233b07 commit b5c469b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {FC, Suspense} from 'react';

import {Form} from 'antd';

import {MonacoEditor} from '@atoms';
import {ExternalLink, MonacoEditor} from '@atoms';

import {notificationCall} from '@molecules';
import DefinitionSkeleton from '@molecules/Definition/DefinitionSkeleton';
Expand All @@ -13,6 +13,8 @@ import {Permissions, usePermission} from '@permissions/base';

import {useUpdateWebhookMutation} from '@services/webhooks';

import {externalLinks} from '@src/utils/externalLinks';

import {useWebhooksPick} from '@store/webhooks';

import {displayDefaultNotificationFlow} from '@utils/notification';
Expand Down Expand Up @@ -44,6 +46,14 @@ const CustomPayload: FC = () => {
initialValues={{payloadTemplate: current!.payloadTemplate || ''}}
disabled={!mayEdit}
onConfirm={onFinish}
footer={
<>
Learn more about{' '}
<ExternalLink href={`${externalLinks.notificationsAndWebhooks}/#webhook-payload`} target="_blank">
webhooks custom payload.
</ExternalLink>
</>
}
>
<Suspense fallback={<DefinitionSkeleton />}>
<Form.Item name="payloadTemplate">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {FC} from 'react';
import {DeleteOutlined} from '@ant-design/icons';
import {Form, Input} from 'antd';

import ExternalLink from '@atoms/ExternalLink';

import {Button, FormIconWrapper, FormItem, FormRow, FullWidthSpace} from '@custom-antd';

import {notificationCall} from '@molecules';
Expand All @@ -13,6 +15,8 @@ import {Permissions, usePermission} from '@permissions/base';

import {useUpdateWebhookMutation} from '@services/webhooks';

import {externalLinks} from '@src/utils/externalLinks';

import {useWebhooksPick} from '@store/webhooks';

import {requiredNoText} from '@utils/form';
Expand Down Expand Up @@ -48,6 +52,14 @@ const Headers: FC = () => {
initialValues={{headers: decomposeHeaders(current!.headers ?? {})}}
disabled={!mayEdit}
onConfirm={onFinish}
footer={
<>
Learn more about{' '}
<ExternalLink href={`${externalLinks.notificationsAndWebhooks}/#uri-and-http-headers`} target="_blank">
Webhook http headers.
</ExternalLink>
</>
}
>
<Form.List name="headers">
{(fields, {add, remove}) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {FC, useMemo} from 'react';

import {Form} from 'antd';

import {CreatableMultiSelect} from '@atoms';
import {CreatableMultiSelect, ExternalLink} from '@atoms';

import {FormItem} from '@custom-antd';

Expand All @@ -16,6 +16,8 @@ import {Permissions, usePermission} from '@permissions/base';

import {useUpdateWebhookMutation} from '@services/webhooks';

import {externalLinks} from '@src/utils/externalLinks';

import {useWebhooksPick} from '@store/webhooks';

import {requiredNoText} from '@utils/form';
Expand Down Expand Up @@ -68,6 +70,14 @@ const Condition: FC = () => {
initialValues={{events: initialEvents, labels: initialLabels}}
disabled={!mayEdit}
onConfirm={onFinish}
footer={
<>
Learn more about{' '}
<ExternalLink href={`${externalLinks.notificationsAndWebhooks}/#resource-selector-labels`} target="_blank">
Webhook condition.
</ExternalLink>
</>
}
>
<FormItem
name="labels"
Expand Down

0 comments on commit b5c469b

Please sign in to comment.