Skip to content

Commit 79d5c2e

Browse files
ref(settings): Use FieldGroup for permissions preview
Match the same pattern used in apiTokenDetails for displaying read-only scopes: FieldGroup with a div and comma-separated values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 120bae2 commit 79d5c2e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

static/app/views/settings/account/apiNewToken.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
addLoadingMessage,
1212
addSuccessMessage,
1313
} from 'sentry/actionCreators/indicator';
14-
import {TextareaField} from 'sentry/components/forms/fields/textareaField';
14+
import {FieldGroup} from 'sentry/components/forms/fieldGroup';
1515
import {Panel} from 'sentry/components/panels/panel';
1616
import {PanelBody} from 'sentry/components/panels/panelBody';
1717
import {PanelHeader} from 'sentry/components/panels/panelHeader';
@@ -65,7 +65,7 @@ function getPermissionsPreview(permissions: Permissions): string {
6565
return Object.entries(permissions)
6666
.filter(([, access]) => access !== 'no-access')
6767
.map(([resource, access]) => `${resource.toLowerCase()}:${access}`)
68-
.join('\n');
68+
.join(', ');
6969
}
7070

7171
export default function ApiNewToken() {
@@ -156,15 +156,12 @@ export default function ApiNewToken() {
156156
displayedPermissions={DISPLAYED_PERMISSIONS}
157157
/>
158158
</PanelBody>
159-
<TextareaField
160-
name="permissions-preview"
159+
<FieldGroup
161160
label={t('Permissions Preview')}
162161
help={t('Your token will have the following scopes.')}
163-
rows={3}
164-
autosize
165-
placeholder={permissionsPreview}
166-
disabled
167-
/>
162+
>
163+
<div>{permissionsPreview || '—'}</div>
164+
</FieldGroup>
168165
</Panel>
169166
<Flex justify="end" gap="md" padding="md">
170167
<Button onClick={handleGoBack}>{t('Cancel')}</Button>

0 commit comments

Comments
 (0)