import {RouteComponentProps} from 'react-router'; import {addErrorMessage} from 'sentry/actionCreators/indicator'; import Form from 'sentry/components/forms/form'; import FormField from 'sentry/components/forms/formField'; import JsonForm from 'sentry/components/forms/jsonForm'; import {Panel, PanelBody, PanelHeader} from 'sentry/components/panels'; import TextCopyInput from 'sentry/components/textCopyInput'; import apiApplication from 'sentry/data/forms/apiApplication'; import {t} from 'sentry/locale'; import ConfigStore from 'sentry/stores/configStore'; import {ApiApplication} from 'sentry/types'; import getDynamicText from 'sentry/utils/getDynamicText'; import AsyncView from 'sentry/views/asyncView'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; type Props = RouteComponentProps<{appId: string}, {}>; type State = { app: ApiApplication; } & AsyncView['state']; class ApiApplicationsDetails extends AsyncView { getEndpoints(): ReturnType { return [['app', `/api-applications/${this.props.params.appId}/`]]; } getTitle() { return t('Application Details'); } renderBody() { const urlPrefix = ConfigStore.get('urlPrefix'); return (
addErrorMessage('Unable to save change')} > {t('Credentials')} {({value}) => (
{getDynamicText({value, fixed: 'CI_CLIENT_ID'})}
)}
{({value}) => value ? ( {getDynamicText({value, fixed: 'CI_CLIENT_SECRET'})} ) : ( hidden ) } {() => {`${urlPrefix}/oauth/authorize/`}} {() => {`${urlPrefix}/oauth/token/`}}
); } } export default ApiApplicationsDetails;