From 6382325280e4d19de7593d02d0da64ae476f285d Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 8 Dec 2022 22:19:00 +0100 Subject: [PATCH 1/2] feat(TestSubstep): put some space between info and test output --- packages/web/src/components/TestSubstep/index.tsx | 6 ++++-- packages/web/src/components/WebhookUrlInfo/index.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/web/src/components/TestSubstep/index.tsx b/packages/web/src/components/TestSubstep/index.tsx index 09a5f0c7..b7c3c764 100644 --- a/packages/web/src/components/TestSubstep/index.tsx +++ b/packages/web/src/components/TestSubstep/index.tsx @@ -108,7 +108,7 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement { {!!error?.graphQLErrors?.length && ( {serializeErrors(error.graphQLErrors).map((error: any) => (
{error.message}
@@ -116,7 +116,9 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement {
)} - {step.webhookUrl && } + {step.webhookUrl && ( + + )} {hasNoOutput && ( diff --git a/packages/web/src/components/WebhookUrlInfo/index.tsx b/packages/web/src/components/WebhookUrlInfo/index.tsx index cc5ca10d..82a1a3c1 100644 --- a/packages/web/src/components/WebhookUrlInfo/index.tsx +++ b/packages/web/src/components/WebhookUrlInfo/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import Typography from '@mui/material/Typography'; +import type { AlertProps } from '@mui/material/Alert'; import { generateExternalLink } from '../../helpers/translation-values'; import { WEBHOOK_DOCS } from '../../config/urls'; @@ -9,13 +10,13 @@ import { Alert } from './style'; type WebhookUrlInfoProps = { webhookUrl: string; -}; +} & AlertProps; function WebhookUrlInfo(props: WebhookUrlInfoProps): React.ReactElement { - const { webhookUrl } = props; + const { webhookUrl, ...alertProps } = props; return ( - + From 03368e2ccad2a4197a38dcb76dfe57b5d2944cbb Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 8 Dec 2022 22:19:45 +0100 Subject: [PATCH 2/2] fix(webhook): correct internal ID for GET requests --- packages/backend/src/controllers/webhooks/handler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/controllers/webhooks/handler.ts b/packages/backend/src/controllers/webhooks/handler.ts index 48717696..ed8684dd 100644 --- a/packages/backend/src/controllers/webhooks/handler.ts +++ b/packages/backend/src/controllers/webhooks/handler.ts @@ -45,6 +45,7 @@ export default async (request: IRequest, response: Response) => { // in case trigger type is 'webhook' let payload = request.body; + let rawInternalId: string | Buffer = request.rawBody; // in case it's our built-in generic webhook trigger if (isWebhookApp) { @@ -53,12 +54,14 @@ export default async (request: IRequest, response: Response) => { body: request.body, query: request.query, } + + rawInternalId = JSON.stringify(payload); } const triggerItem: ITriggerItem = { raw: payload, meta: { - internalId: await bcrypt.hash(request.rawBody, 1), + internalId: await bcrypt.hash(rawInternalId, 1), }, };