Skip to content

Commit 45ae8d9

Browse files
authored
ref(settings): Remove getDynamicText from settings (#97807)
Removes dynamic text values from the settings pages. No longer needed now that we don't have screenshot testing
1 parent 73d312e commit 45ae8d9

File tree

12 files changed

+30
-161
lines changed

12 files changed

+30
-161
lines changed

static/app/views/settings/account/apiApplications/details.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import apiApplication from 'sentry/data/forms/apiApplication';
2121
import {t} from 'sentry/locale';
2222
import ConfigStore from 'sentry/stores/configStore';
2323
import type {ApiApplication} from 'sentry/types/user';
24-
import getDynamicText from 'sentry/utils/getDynamicText';
2524
import {
2625
useApiQuery,
2726
useMutation,
@@ -116,11 +115,7 @@ function ApiApplicationsDetails() {
116115

117116
<PanelBody>
118117
<FormField name="clientID" label="Client ID" flexibleControlStateSize>
119-
{({value}: any) => (
120-
<TextCopyInput>
121-
{getDynamicText({value, fixed: 'CI_CLIENT_ID'})}
122-
</TextCopyInput>
123-
)}
118+
{({value}: any) => <TextCopyInput>{value}</TextCopyInput>}
124119
</FormField>
125120

126121
<FormField
@@ -132,9 +127,7 @@ function ApiApplicationsDetails() {
132127
>
133128
{({value}: any) =>
134129
value ? (
135-
<TextCopyInput>
136-
{getDynamicText({value, fixed: 'CI_CLIENT_SECRET'})}
137-
</TextCopyInput>
130+
<TextCopyInput>{value}</TextCopyInput>
138131
) : (
139132
<ClientSecret>
140133
<HiddenSecret>{t('hidden')}</HiddenSecret>

static/app/views/settings/account/apiApplications/row.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {IconDelete} from 'sentry/icons';
1414
import {t} from 'sentry/locale';
1515
import {space} from 'sentry/styles/space';
1616
import type {ApiApplication} from 'sentry/types/user';
17-
import getDynamicText from 'sentry/utils/getDynamicText';
1817
import useApi from 'sentry/utils/useApi';
1918

2019
const ROUTE_PREFIX = '/settings/account/api/';
@@ -52,11 +51,9 @@ function Row({app, onRemove}: Props) {
5251
<StyledPanelItem>
5352
<ApplicationNameWrapper>
5453
<ApplicationName to={`${ROUTE_PREFIX}applications/${app.id}/`}>
55-
{getDynamicText({value: app.name, fixed: 'CI_APPLICATION_NAME'})}
54+
{app.name}
5655
</ApplicationName>
57-
<ClientId>
58-
{getDynamicText({value: app.clientID, fixed: 'CI_CLIENT_ID'})}
59-
</ClientId>
56+
<ClientId>{app.clientID}</ClientId>
6057
</ApplicationNameWrapper>
6158

6259
<ConfirmDelete

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {DateTime} from 'sentry/components/dateTime';
99
import {IconDelete} from 'sentry/icons';
1010
import {t} from 'sentry/locale';
1111
import type {InternalAppApiToken} from 'sentry/types/user';
12-
import getDynamicText from 'sentry/utils/getDynamicText';
1312
import {tokenPreview} from 'sentry/views/settings/organizationAuthTokens';
1413

1514
type Props = {
@@ -32,13 +31,7 @@ function ApiTokenRow({
3231
<div>
3332
{token.name}
3433
<TokenPreview aria-label={t('Token preview')}>
35-
{tokenPreview(
36-
getDynamicText({
37-
value: token.tokenLastCharacters,
38-
fixed: 'ABCD',
39-
}),
40-
tokenPrefix
41-
)}
34+
{tokenPreview(token.tokenLastCharacters, tokenPrefix)}
4235
</TokenPreview>
4336
</div>
4437
<div>

static/app/views/settings/organizationAuthTokens/authTokenRow.tsx

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {space} from 'sentry/styles/space';
1313
import type {Organization} from 'sentry/types/organization';
1414
import type {Project} from 'sentry/types/project';
1515
import type {OrgAuthToken} from 'sentry/types/user';
16-
import getDynamicText from 'sentry/utils/getDynamicText';
1716
import {tokenPreview} from 'sentry/views/settings/organizationAuthTokens';
1817

1918
function LastUsed({
@@ -29,14 +28,7 @@ function LastUsed({
2928
return (
3029
<Fragment>
3130
{tct('[date] in project [project]', {
32-
date: (
33-
<TimeSince
34-
date={getDynamicText({
35-
value: dateLastUsed,
36-
fixed: new Date(1508208080000), // National Pasta Day
37-
})}
38-
/>
39-
),
31+
date: <TimeSince date={dateLastUsed} />,
4032
project: (
4133
<Link to={`/settings/${organization.slug}/projects/${projectLastUsed.slug}/`}>
4234
{projectLastUsed.name}
@@ -50,12 +42,7 @@ function LastUsed({
5042
if (dateLastUsed) {
5143
return (
5244
<Fragment>
53-
<TimeSince
54-
date={getDynamicText({
55-
value: dateLastUsed,
56-
fixed: new Date(1508208080000), // National Pasta Day
57-
})}
58-
/>
45+
<TimeSince date={dateLastUsed} />
5946
</Fragment>
6047
);
6148
}
@@ -103,13 +90,7 @@ export function OrganizationAuthTokensAuthTokenRow({
10390

10491
{token.tokenLastCharacters && (
10592
<TokenPreview aria-label={t('Token preview')}>
106-
{tokenPreview(
107-
getDynamicText({
108-
value: token.tokenLastCharacters,
109-
fixed: 'ABCD',
110-
}),
111-
'sntrys_'
112-
)}
93+
{tokenPreview(token.tokenLastCharacters, 'sntrys_')}
11394
</TokenPreview>
11495
)}
11596
</div>
@@ -119,12 +100,7 @@ export function OrganizationAuthTokensAuthTokenRow({
119100
<Placeholder height="1.25em" />
120101
) : (
121102
<Fragment>
122-
<TimeSince
123-
date={getDynamicText({
124-
value: token.dateCreated,
125-
fixed: new Date(1508208080000), // National Pasta Day
126-
})}
127-
/>
103+
<TimeSince date={token.dateCreated} />
128104
</Fragment>
129105
)}
130106
</DateTime>

static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import type {Avatar, Scope} from 'sentry/types/core';
4141
import type {SentryApp, SentryAppAvatar} from 'sentry/types/integrations';
4242
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
4343
import type {InternalAppApiToken, NewInternalAppApiToken} from 'sentry/types/user';
44-
import getDynamicText from 'sentry/utils/getDynamicText';
4544
import {
4645
setApiQueryData,
4746
useApiQuery,
@@ -462,11 +461,7 @@ export default function SentryApplicationDetails(props: Props) {
462461
<PanelBody>
463462
{app.status !== 'internal' && (
464463
<FormField name="clientId" label="Client ID">
465-
{({value, id}: any) => (
466-
<TextCopyInput id={id}>
467-
{getDynamicText({value, fixed: 'CI_CLIENT_ID'})}
468-
</TextCopyInput>
469-
)}
464+
{({value, id}: any) => <TextCopyInput id={id}>{value}</TextCopyInput>}
470465
</FormField>
471466
)}
472467
<FormField
@@ -485,9 +480,7 @@ export default function SentryApplicationDetails(props: Props) {
485480
'Only Manager or Owner can view these credentials, or the permissions for this integration exceed those of your role.'
486481
)}
487482
>
488-
<TextCopyInput id={id}>
489-
{getDynamicText({value, fixed: 'CI_CLIENT_SECRET'})}
490-
</TextCopyInput>
483+
<TextCopyInput id={id}>{value}</TextCopyInput>
491484
</Tooltip>
492485
) : (
493486
<ClientSecret>

static/app/views/settings/project/projectKeys/details/loaderSettings.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SelectField from 'sentry/components/forms/fields/selectField';
1313
import TextCopyInput from 'sentry/components/textCopyInput';
1414
import {t, tct} from 'sentry/locale';
1515
import type {Project, ProjectKey} from 'sentry/types/project';
16-
import getDynamicText from 'sentry/utils/getDynamicText';
1716
import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse';
1817
import type RequestError from 'sentry/utils/requestError/requestError';
1918
import useApi from 'sentry/utils/useApi';
@@ -57,10 +56,7 @@ export function LoaderSettings({keyId, orgSlug, project, data, updateData}: Prop
5756
: [];
5857

5958
const apiEndpoint = `/projects/${orgSlug}/${project.slug}/keys/${keyId}/`;
60-
const loaderLink = getDynamicText({
61-
value: data.dsn.cdn,
62-
fixed: '__JS_SDK_LOADER_URL__',
63-
});
59+
const loaderLink = data.dsn.cdn;
6460

6561
const updateLoaderOption = useCallback(
6662
async (changes: {

static/app/views/settings/project/projectKeys/list/loaderScript.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ import {t, tct} from 'sentry/locale';
99
import {space} from 'sentry/styles/space';
1010
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
1111
import type {ProjectKey} from 'sentry/types/project';
12-
import getDynamicText from 'sentry/utils/getDynamicText';
1312
import recreateRoute from 'sentry/utils/recreateRoute';
1413

1514
type Props = {
1615
projectKey: ProjectKey;
1716
} & Pick<RouteComponentProps, 'routes' | 'location' | 'params'>;
1817

1918
export function LoaderScript({projectKey, routes, params, location}: Props) {
20-
const loaderLink = getDynamicText({
21-
value: projectKey.dsn.cdn,
22-
fixed: '__JS_SDK_LOADER_URL__',
23-
});
19+
const loaderLink = projectKey.dsn.cdn;
2420

2521
const editUrl = recreateRoute(`${projectKey.id}/`, {routes, params, location});
2622

static/app/views/settings/project/projectKeys/projectKeyCredentials.tsx

Lines changed: 11 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import TextCopyInput from 'sentry/components/textCopyInput';
77
import {t, tct} from 'sentry/locale';
88
import {space} from 'sentry/styles/space';
99
import type {ProjectKey} from 'sentry/types/project';
10-
import getDynamicText from 'sentry/utils/getDynamicText';
1110

1211
type Props = {
1312
data: ProjectKey;
@@ -53,12 +52,7 @@ function ProjectKeyCredentials({
5352
) : null,
5453
})}
5554
>
56-
<TextCopyInput aria-label={t('DSN URL')}>
57-
{getDynamicText({
58-
value: data.dsn.public,
59-
fixed: '__DSN__',
60-
})}
61-
</TextCopyInput>
55+
<TextCopyInput aria-label={t('DSN URL')}>{data.dsn.public}</TextCopyInput>
6256
{showDeprecatedDsn && (
6357
<StyledField
6458
label={null}
@@ -68,12 +62,7 @@ function ProjectKeyCredentials({
6862
inline={false}
6963
flexibleControlStateSize
7064
>
71-
<TextCopyInput>
72-
{getDynamicText({
73-
value: data.dsn.secret,
74-
fixed: '__DSN_DEPRECATED__',
75-
})}
76-
</TextCopyInput>
65+
<TextCopyInput>{data.dsn.secret}</TextCopyInput>
7766
</StyledField>
7867
)}
7968
</FieldGroup>
@@ -89,12 +78,7 @@ function ProjectKeyCredentials({
8978
inline={false}
9079
flexibleControlStateSize
9180
>
92-
<TextCopyInput>
93-
{getDynamicText({
94-
value: data.dsn.secret,
95-
fixed: '__DSN_DEPRECATED__',
96-
})}
97-
</TextCopyInput>
81+
<TextCopyInput>{data.dsn.secret}</TextCopyInput>
9882
</FieldGroup>
9983
)}
10084

@@ -107,10 +91,7 @@ function ProjectKeyCredentials({
10791
flexibleControlStateSize
10892
>
10993
<TextCopyInput aria-label={t('OTLP Traces Endpoint')}>
110-
{getDynamicText({
111-
value: data.dsn.otlp_traces,
112-
fixed: '__OTLP_ENDPOINT__',
113-
})}
94+
{data.dsn.otlp_traces}
11495
</TextCopyInput>
11596
</FieldGroup>
11697

@@ -121,10 +102,7 @@ function ProjectKeyCredentials({
121102
flexibleControlStateSize
122103
>
123104
<TextCopyInput aria-label={t('OTLP Traces Endpoint Headers')}>
124-
{getDynamicText({
125-
value: `x-sentry-auth=sentry sentry_key=${data.public}`,
126-
fixed: '__OTLP_ENDPOINT_HEADERS__',
127-
})}
105+
{`x-sentry-auth=sentry sentry_key=${data.public}`}
128106
</TextCopyInput>
129107
</FieldGroup>
130108
</Fragment>
@@ -144,10 +122,7 @@ function ProjectKeyCredentials({
144122
flexibleControlStateSize
145123
>
146124
<TextCopyInput aria-label={t('Security Header Endpoint URL')}>
147-
{getDynamicText({
148-
value: data.dsn.security,
149-
fixed: '__SECURITY_HEADER_ENDPOINT__',
150-
})}
125+
{data.dsn.security}
151126
</TextCopyInput>
152127
</FieldGroup>
153128
)}
@@ -169,10 +144,7 @@ function ProjectKeyCredentials({
169144
flexibleControlStateSize
170145
>
171146
<TextCopyInput aria-label={t('Minidump Endpoint URL')}>
172-
{getDynamicText({
173-
value: data.dsn.minidump,
174-
fixed: '__MINIDUMP_ENDPOINT__',
175-
})}
147+
{data.dsn.minidump}
176148
</TextCopyInput>
177149
</FieldGroup>
178150
)}
@@ -185,44 +157,26 @@ function ProjectKeyCredentials({
185157
flexibleControlStateSize
186158
>
187159
<TextCopyInput aria-label={t('Unreal Engine Endpoint URL')}>
188-
{getDynamicText({
189-
value: data.dsn.unreal || '',
190-
fixed: '__UNREAL_ENDPOINT__',
191-
})}
160+
{data.dsn.unreal || ''}
192161
</TextCopyInput>
193162
</FieldGroup>
194163
)}
195164

196165
{showPublicKey && (
197166
<FieldGroup label={t('Public Key')} inline flexibleControlStateSize>
198-
<TextCopyInput>
199-
{getDynamicText({
200-
value: data.public,
201-
fixed: '__PUBLICKEY__',
202-
})}
203-
</TextCopyInput>
167+
<TextCopyInput>{data.public}</TextCopyInput>
204168
</FieldGroup>
205169
)}
206170

207171
{showSecretKey && (
208172
<FieldGroup label={t('Secret Key')} inline flexibleControlStateSize>
209-
<TextCopyInput>
210-
{getDynamicText({
211-
value: data.secret,
212-
fixed: '__SECRETKEY__',
213-
})}
214-
</TextCopyInput>
173+
<TextCopyInput>{data.secret}</TextCopyInput>
215174
</FieldGroup>
216175
)}
217176

218177
{showProjectId && (
219178
<FieldGroup label={t('Project ID')} inline flexibleControlStateSize>
220-
<TextCopyInput>
221-
{getDynamicText({
222-
value: projectId,
223-
fixed: '__PROJECTID__',
224-
})}
225-
</TextCopyInput>
179+
<TextCopyInput>{projectId}</TextCopyInput>
226180
</FieldGroup>
227181
)}
228182

static/app/views/settings/project/projectReleaseTracking.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {t, tct} from 'sentry/locale';
1818
import type {Plugin} from 'sentry/types/integrations';
1919
import type {Organization} from 'sentry/types/organization';
2020
import type {Project} from 'sentry/types/project';
21-
import getDynamicText from 'sentry/utils/getDynamicText';
2221
import {
2322
setApiQueryData,
2423
useApiQuery,
@@ -220,21 +219,9 @@ function ProjectReleaseTracking({organization, project, plugins}: Props) {
220219
)}
221220
</p>
222221

223-
{getDynamicText({
224-
value: (
225-
<AutoSelectText>
226-
<pre>{getReleaseWebhookIntructions()}</pre>
227-
</AutoSelectText>
228-
),
229-
fixed: (
230-
<pre>
231-
{`curl __WEBHOOK_URL__ \\
232-
-X POST \\
233-
-H 'Content-Type: application/json' \\
234-
-d \'{"version": "abcdefg"}\'`}
235-
</pre>
236-
),
237-
})}
222+
<AutoSelectText>
223+
<pre>{getReleaseWebhookIntructions()}</pre>
224+
</AutoSelectText>
238225
</PanelBody>
239226
</Panel>
240227

0 commit comments

Comments
 (0)