-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Blacklisting webhooks #17421
feat: Blacklisting webhooks #17421
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,20 +2,37 @@ import { useEffect, useState } from 'react' | |
import { useActions, useValues } from 'kea' | ||
import { teamLogic } from 'scenes/teamLogic' | ||
import { webhookIntegrationLogic } from './webhookIntegrationLogic' | ||
import { LemonButton, LemonInput } from '@posthog/lemon-ui' | ||
import { LemonButton, LemonInput, Link } from '@posthog/lemon-ui' | ||
import { featureFlagLogic } from 'lib/logic/featureFlagLogic' | ||
import { FEATURE_FLAGS } from 'lib/constants' | ||
import { supportLogic } from 'lib/components/Support/supportLogic' | ||
|
||
export function WebhookIntegration(): JSX.Element { | ||
const [webhook, setWebhook] = useState('') | ||
const { testWebhook, removeWebhook } = useActions(webhookIntegrationLogic) | ||
const { loading } = useValues(webhookIntegrationLogic) | ||
const { currentTeam } = useValues(teamLogic) | ||
const { featureFlags } = useValues(featureFlagLogic) | ||
const { openSupportForm } = useActions(supportLogic) | ||
|
||
useEffect(() => { | ||
if (currentTeam?.slack_incoming_webhook) { | ||
setWebhook(currentTeam?.slack_incoming_webhook) | ||
} | ||
}, [currentTeam]) | ||
|
||
const webhooks_blacklisted = featureFlags[FEATURE_FLAGS.WEBHOOKS_BLACKLISTED] | ||
if (webhooks_blacklisted) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related nit: probably good to align the variable name with the feature flag (or just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. merged cause I didn't want to wait for tests again 😅 |
||
return ( | ||
<div> | ||
<p> | ||
Webhooks are currently not available for your organization.{' '} | ||
<Link onClick={() => openSupportForm('support', 'apps')}>Contact support</Link> | ||
</p> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div> | ||
<p> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense calling this a denylist