|
@@ -2,6 +2,7 @@ import {Component} from 'react';
|
|
import {browserHistory} from 'react-router';
|
|
import {browserHistory} from 'react-router';
|
|
|
|
|
|
import ApiForm from 'sentry/components/forms/apiForm';
|
|
import ApiForm from 'sentry/components/forms/apiForm';
|
|
|
|
+import TextField from 'sentry/components/forms/fields/textField';
|
|
import ExternalLink from 'sentry/components/links/externalLink';
|
|
import ExternalLink from 'sentry/components/links/externalLink';
|
|
import Panel from 'sentry/components/panels/panel';
|
|
import Panel from 'sentry/components/panels/panel';
|
|
import PanelBody from 'sentry/components/panels/panelBody';
|
|
import PanelBody from 'sentry/components/panels/panelBody';
|
|
@@ -18,6 +19,7 @@ import PermissionSelection from 'sentry/views/settings/organizationDeveloperSett
|
|
|
|
|
|
const API_INDEX_ROUTE = '/settings/account/api/auth-tokens/';
|
|
const API_INDEX_ROUTE = '/settings/account/api/auth-tokens/';
|
|
type State = {
|
|
type State = {
|
|
|
|
+ name: string | null;
|
|
newToken: NewInternalAppApiToken | null;
|
|
newToken: NewInternalAppApiToken | null;
|
|
permissions: Permissions;
|
|
permissions: Permissions;
|
|
};
|
|
};
|
|
@@ -26,6 +28,7 @@ export default class ApiNewToken extends Component<{}, State> {
|
|
constructor(props: {}) {
|
|
constructor(props: {}) {
|
|
super(props);
|
|
super(props);
|
|
this.state = {
|
|
this.state = {
|
|
|
|
+ name: null,
|
|
permissions: {
|
|
permissions: {
|
|
Event: 'no-access',
|
|
Event: 'no-access',
|
|
Team: 'no-access',
|
|
Team: 'no-access',
|
|
@@ -75,12 +78,11 @@ export default class ApiNewToken extends Component<{}, State> {
|
|
handleGoBack={this.handleGoBack}
|
|
handleGoBack={this.handleGoBack}
|
|
/>
|
|
/>
|
|
) : (
|
|
) : (
|
|
- <Panel>
|
|
|
|
- <PanelHeader>{t('Permissions')}</PanelHeader>
|
|
|
|
|
|
+ <div>
|
|
<ApiForm
|
|
<ApiForm
|
|
apiMethod="POST"
|
|
apiMethod="POST"
|
|
apiEndpoint="/api-tokens/"
|
|
apiEndpoint="/api-tokens/"
|
|
- initialData={{scopes: []}}
|
|
|
|
|
|
+ initialData={{scopes: [], name: ''}}
|
|
onSubmitSuccess={response => {
|
|
onSubmitSuccess={response => {
|
|
this.setState({newToken: response});
|
|
this.setState({newToken: response});
|
|
}}
|
|
}}
|
|
@@ -94,17 +96,33 @@ export default class ApiNewToken extends Component<{}, State> {
|
|
)}
|
|
)}
|
|
submitLabel={t('Create Token')}
|
|
submitLabel={t('Create Token')}
|
|
>
|
|
>
|
|
- <PanelBody>
|
|
|
|
- <PermissionSelection
|
|
|
|
- appPublished={false}
|
|
|
|
- permissions={permissions}
|
|
|
|
- onChange={value => {
|
|
|
|
- this.setState({permissions: value});
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- </PanelBody>
|
|
|
|
|
|
+ <Panel>
|
|
|
|
+ <PanelHeader>{t('General')}</PanelHeader>
|
|
|
|
+ <PanelBody>
|
|
|
|
+ <TextField
|
|
|
|
+ name="name"
|
|
|
|
+ label={t('Name')}
|
|
|
|
+ help={t('A name to help you identify this token.')}
|
|
|
|
+ onChange={value => {
|
|
|
|
+ this.setState({name: value});
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </PanelBody>
|
|
|
|
+ </Panel>
|
|
|
|
+ <Panel>
|
|
|
|
+ <PanelHeader>{t('Permissions')}</PanelHeader>
|
|
|
|
+ <PanelBody>
|
|
|
|
+ <PermissionSelection
|
|
|
|
+ appPublished={false}
|
|
|
|
+ permissions={permissions}
|
|
|
|
+ onChange={value => {
|
|
|
|
+ this.setState({permissions: value});
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </PanelBody>
|
|
|
|
+ </Panel>
|
|
</ApiForm>
|
|
</ApiForm>
|
|
- </Panel>
|
|
|
|
|
|
+ </div>
|
|
)}
|
|
)}
|
|
</div>
|
|
</div>
|
|
</SentryDocumentTitle>
|
|
</SentryDocumentTitle>
|