import {Component} from 'react'; import {addSuccessMessage} from 'sentry/actionCreators/indicator'; import Form from 'sentry/components/forms/form'; import JsonForm from 'sentry/components/forms/jsonForm'; import type {Field} from 'sentry/components/forms/types'; import {t} from 'sentry/locale'; import type {Integration, Organization} from 'sentry/types'; type Props = { integration: Integration; onUpdate: () => void; organization: Organization; }; type State = { integration: Integration; }; class IntegrationMainSettings extends Component { state: State = { integration: this.props.integration, }; handleSubmitSuccess = (data: Integration) => { addSuccessMessage(t('Integration updated.')); this.props.onUpdate(); this.setState({integration: data}); }; get initialData() { const {integration} = this.props; return { name: integration.name, domain: integration.domainName || '', }; } get formFields(): Field[] { const fields: any[] = [ { name: 'name', type: 'string', required: false, label: t('Integration Name'), }, { name: 'domain', type: 'string', required: false, label: t('Full URL'), }, ]; return fields; } render() { const {integration} = this.state; const {organization} = this.props; return (
); } } export default IntegrationMainSettings;