Skip to content

Commit 538ae42

Browse files
ref(ui): Move Allowed Domain examples to a hovercard (#97799)
We had some feedback that it's easy to miss the "separate multiple entries with a newline" since it comes right after giving examples as a comma separated list. <img alt="clipboard.png" width="583" src="https://i.imgur.com/rsr4utx.png" />
1 parent 79eccfc commit 538ae42

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

static/app/data/forms/projectGeneralSettings.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import styled from '@emotion/styled';
22
import {PlatformIcon} from 'platformicons';
33

44
import {hasEveryAccess} from 'sentry/components/acl/access';
5+
import {CodeSnippet} from 'sentry/components/codeSnippet';
6+
import {Button} from 'sentry/components/core/button';
57
import {createFilter} from 'sentry/components/forms/controls/reactSelectWrapper';
68
import type {Field} from 'sentry/components/forms/types';
9+
import {Hovercard} from 'sentry/components/hovercard';
710
import platforms from 'sentry/data/platforms';
811
import {t, tct, tn} from 'sentry/locale';
912
import {space} from 'sentry/styles/space';
@@ -140,9 +143,21 @@ export const fields = {
140143
rows: 1,
141144
placeholder: t('https://example.com or example.com'),
142145
label: t('Allowed Domains'),
143-
help: t(
144-
'Examples: https://example.com, *, *.example.com, *:80. Separate multiple entries with a newline'
145-
),
146+
help: tct('Separate multiple entries with a newline. [examples]', {
147+
examples: (
148+
<Hovercard
149+
body={
150+
<CodeSnippet hideCopyButton>
151+
{`https://example.com\n*.example.com\n*:80\n*`}
152+
</CodeSnippet>
153+
}
154+
>
155+
<Button priority="link" size="xs">
156+
{t('View Examples')}
157+
</Button>
158+
</Hovercard>
159+
),
160+
}),
146161
getValue: val => extractMultilineFields(val),
147162
setValue: val => convertMultilineFieldValue(val),
148163
},

0 commit comments

Comments
 (0)