feat(frontend): added a support for the self-hosted sentry (#2890)

This commit is contained in:
Alexander 2024-12-18 10:49:33 +01:00 committed by GitHub
parent 8882a18c0d
commit 129ab734f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,12 +12,14 @@ import { toast } from 'react-toastify';
import DocLink from 'Shared/DocLink/DocLink';
interface SentryConfig {
url: string;
organization_slug: string;
project_slug: string;
token: string;
}
const initialValues = {
url: 'https://sentry.io',
organization_slug: '',
project_slug: '',
token: '',
@ -39,6 +41,9 @@ function SentryForm({
removeMutation,
} = useIntegration<SentryConfig>('sentry', siteId, initialValues);
const { values, errors, handleChange, hasErrors, checkErrors, } = useForm(data, {
url: {
required: false,
},
organization_slug: {
required: true,
},
@ -95,12 +100,19 @@ function SentryForm({
/>
<Loader loading={isPending}>
<FormField
label="URL"
name="url"
value={values.url}
onChange={handleChange}
errors={errors.url}
/>
<FormField
label="Organization Slug"
name="organization_slug"
value={values.organization_slug}
onChange={handleChange}
errors={errors.url}
errors={errors.organization_slug}
autoFocus
/>
<FormField