From 142230639bd55219c1c955d2103c7431f64d82ca Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Wed, 4 Jun 2025 06:55:15 +0200 Subject: [PATCH 1/2] ref(settings): Rename auth tokens and merge nav sections --- .../sidebar/sidebarDropdown/index.tsx | 2 +- static/app/gettingStartedDocs/java/java.tsx | 2 +- static/app/gettingStartedDocs/java/log4j2.tsx | 2 +- .../app/gettingStartedDocs/java/logback.tsx | 2 +- .../gettingStartedDocs/java/spring-boot.tsx | 2 +- static/app/gettingStartedDocs/java/spring.tsx | 2 +- .../app/gettingStartedDocs/kotlin/kotlin.tsx | 2 +- static/app/routes.tsx | 12 +++---- static/app/types/hooks.tsx | 8 +---- .../views/settings/account/apiNewToken.tsx | 6 ++-- .../settings/account/apiTokenDetails.tsx | 8 ++--- .../app/views/settings/account/apiTokens.tsx | 4 +-- .../account/navigationConfiguration.tsx | 10 ++---- .../organization/navigationConfiguration.tsx | 6 ++-- .../userOrgNavigationConfiguration.tsx | 35 ++++++------------- .../organizationApiKeysList.tsx | 2 +- .../authTokenDetails.tsx | 8 ++--- .../organizationAuthTokens/index.spec.tsx | 2 +- .../settings/organizationAuthTokens/index.tsx | 11 +++--- .../newAuthToken.spec.tsx | 8 ++--- .../organizationAuthTokens/newAuthToken.tsx | 16 ++++----- static/app/views/settings/settingsIndex.tsx | 4 +-- 22 files changed, 66 insertions(+), 88 deletions(-) diff --git a/static/app/components/sidebar/sidebarDropdown/index.tsx b/static/app/components/sidebar/sidebarDropdown/index.tsx index 43e947fa520a8c..32de6c1e8ebcec 100644 --- a/static/app/components/sidebar/sidebarDropdown/index.tsx +++ b/static/app/components/sidebar/sidebarDropdown/index.tsx @@ -154,7 +154,7 @@ export default function SidebarDropdown({orientation, collapsed, hideOrgLinks}: {t('User settings')} - {t('User auth tokens')} + {t('Personal Tokens')} {hasOrganization && ( = { configurations: [ { description: tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/gettingStartedDocs/java/log4j2.tsx b/static/app/gettingStartedDocs/java/log4j2.tsx index e1fe672625ad76..055a25e13ac91b 100644 --- a/static/app/gettingStartedDocs/java/log4j2.tsx +++ b/static/app/gettingStartedDocs/java/log4j2.tsx @@ -219,7 +219,7 @@ const onboarding: OnboardingConfig = { configurations: [ { description: tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/gettingStartedDocs/java/logback.tsx b/static/app/gettingStartedDocs/java/logback.tsx index 24f6839134274a..ed851cbac9fbef 100644 --- a/static/app/gettingStartedDocs/java/logback.tsx +++ b/static/app/gettingStartedDocs/java/logback.tsx @@ -224,7 +224,7 @@ const onboarding: OnboardingConfig = { configurations: [ { description: tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/gettingStartedDocs/java/spring-boot.tsx b/static/app/gettingStartedDocs/java/spring-boot.tsx index d4f6cc31924ee5..bcea6d5484ef63 100644 --- a/static/app/gettingStartedDocs/java/spring-boot.tsx +++ b/static/app/gettingStartedDocs/java/spring-boot.tsx @@ -192,7 +192,7 @@ const onboarding: OnboardingConfig = { configurations: [ { description: tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/gettingStartedDocs/java/spring.tsx b/static/app/gettingStartedDocs/java/spring.tsx index 85e1f08ef91256..cf33dd9afbc2a2 100644 --- a/static/app/gettingStartedDocs/java/spring.tsx +++ b/static/app/gettingStartedDocs/java/spring.tsx @@ -236,7 +236,7 @@ const onboarding: OnboardingConfig = { description: (

{tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/gettingStartedDocs/kotlin/kotlin.tsx b/static/app/gettingStartedDocs/kotlin/kotlin.tsx index 94fafbfeb1351e..8551a25f1f5610 100644 --- a/static/app/gettingStartedDocs/kotlin/kotlin.tsx +++ b/static/app/gettingStartedDocs/kotlin/kotlin.tsx @@ -160,7 +160,7 @@ const onboarding: OnboardingConfig = { configurations: [ { description: tct( - 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', + 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } diff --git a/static/app/routes.tsx b/static/app/routes.tsx index af6b3737ad5ffe..b9c69ab9fc98b3 100644 --- a/static/app/routes.tsx +++ b/static/app/routes.tsx @@ -415,18 +415,18 @@ function buildRoutes() { /> - + import('sentry/views/settings/account/apiTokens'))} /> import('sentry/views/settings/account/apiNewToken'))} /> import('sentry/views/settings/account/apiTokenDetails') )} @@ -983,20 +983,20 @@ function buildRoutes() { )} /> - + import('sentry/views/settings/organizationAuthTokens'))} /> import('sentry/views/settings/organizationAuthTokens/newAuthToken') )} /> import('sentry/views/settings/organizationAuthTokens/authTokenDetails') )} diff --git a/static/app/types/hooks.tsx b/static/app/types/hooks.tsx index 71055c0bf7afa9..c837a9e7d827ae 100644 --- a/static/app/types/hooks.tsx +++ b/static/app/types/hooks.tsx @@ -10,7 +10,7 @@ import type SelectorItems from 'sentry/components/timeRangeSelector/selectorItem import type {TitleableModuleNames} from 'sentry/views/insights/common/components/modulePageProviders'; import type {OrganizationStatsProps} from 'sentry/views/organizationStats'; import type {RouteAnalyticsContext} from 'sentry/views/routeAnalyticsContextProvider'; -import type {NavigationItem, NavigationSection} from 'sentry/views/settings/types'; +import type {NavigationSection} from 'sentry/views/settings/types'; import type {Integration, IntegrationProvider} from './integrations'; import type { @@ -284,7 +284,6 @@ type OnboardingHooks = { * Settings navigation hooks. */ type SettingsHooks = { - 'settings:api-navigation-config': SettingsItemsHook; 'settings:organization-navigation': OrganizationSettingsHook; 'settings:organization-navigation-config': SettingsConfigHook; }; @@ -455,11 +454,6 @@ type OrganizationSettingsHook = (organization: Organization) => React.ReactEleme */ type SettingsConfigHook = (organization: Organization) => NavigationSection; -/** - * Provides additional setting navigation items - */ -type SettingsItemsHook = (organization?: Organization) => NavigationItem[]; - /** * Each sidebar label is wrapped with this hook, to allow sidebar item * augmentation. diff --git a/static/app/views/settings/account/apiNewToken.tsx b/static/app/views/settings/account/apiNewToken.tsx index c8a8084af085c7..829a1677038ac7 100644 --- a/static/app/views/settings/account/apiNewToken.tsx +++ b/static/app/views/settings/account/apiNewToken.tsx @@ -52,12 +52,12 @@ export default function ApiNewToken() { ); return ( - +

- + {t( - "Authentication tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." + "Personal tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." )} diff --git a/static/app/views/settings/account/apiTokenDetails.tsx b/static/app/views/settings/account/apiTokenDetails.tsx index 97eae05e27c9e8..c4163de50766a1 100644 --- a/static/app/views/settings/account/apiTokenDetails.tsx +++ b/static/app/views/settings/account/apiTokenDetails.tsx @@ -116,8 +116,8 @@ function ApiTokenDetails({params}: Props) { return (
- - + + {t( @@ -133,12 +133,12 @@ function ApiTokenDetails({params}: Props) { )} - {t('User Auth Token Details')} + {t('Personal Token Details')} {isError && ( )} diff --git a/static/app/views/settings/account/apiTokens.tsx b/static/app/views/settings/account/apiTokens.tsx index 653a660b008241..86c7317b594492 100644 --- a/static/app/views/settings/account/apiTokens.tsx +++ b/static/app/views/settings/account/apiTokens.tsx @@ -24,7 +24,7 @@ import ApiTokenRow from 'sentry/views/settings/account/apiTokenRow'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; -const PAGE_TITLE = t('User Auth Tokens'); +const PAGE_TITLE = t('Personal Tokens'); const API_TOKEN_QUERY_KEY = ['/api-tokens/'] as const; function ApiTokens() { @@ -111,7 +111,7 @@ function ApiTokens() { {t( - "Authentication tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." + "Personal tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." )} diff --git a/static/app/views/settings/account/navigationConfiguration.tsx b/static/app/views/settings/account/navigationConfiguration.tsx index c98c0d36e2667a..c0006c0039c11c 100644 --- a/static/app/views/settings/account/navigationConfiguration.tsx +++ b/static/app/views/settings/account/navigationConfiguration.tsx @@ -1,5 +1,4 @@ import {t} from 'sentry/locale'; -import HookStore from 'sentry/stores/hookStore'; import type {Organization} from 'sentry/types/organization'; import {prefersStackedNav} from 'sentry/views/nav/prefersStackedNav'; import {getUserOrgNavigationConfiguration} from 'sentry/views/settings/organization/userOrgNavigationConfiguration'; @@ -13,7 +12,7 @@ type ConfigParams = { function getConfiguration({organization}: ConfigParams): NavigationSection[] { if (organization && prefersStackedNav(organization)) { - return getUserOrgNavigationConfiguration({organization}); + return getUserOrgNavigationConfiguration(); } return [ @@ -84,14 +83,11 @@ function getConfiguration({organization}: ConfigParams): NavigationSection[] { }, { path: `${pathPrefix}/api/auth-tokens/`, - title: t('User Auth Tokens'), + title: t('Personal Tokens'), description: t( - "Authentication tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." + "Personal tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." ), }, - ...HookStore.get('settings:api-navigation-config').flatMap(cb => - cb(organization) - ), ], }, ]; diff --git a/static/app/views/settings/organization/navigationConfiguration.tsx b/static/app/views/settings/organization/navigationConfiguration.tsx index 3b74bb49cae633..9533b099d35018 100644 --- a/static/app/views/settings/organization/navigationConfiguration.tsx +++ b/static/app/views/settings/organization/navigationConfiguration.tsx @@ -17,7 +17,7 @@ export function getOrganizationNavigationConfiguration({ organization: incomingOrganization, }: ConfigParams): NavigationSection[] { if (incomingOrganization && prefersStackedNav(incomingOrganization)) { - return getUserOrgNavigationConfiguration({organization: incomingOrganization}); + return getUserOrgNavigationConfiguration(); } return [ @@ -162,8 +162,8 @@ export function getOrganizationNavigationConfiguration({ items: [ { path: `${organizationSettingsPathPrefix}/auth-tokens/`, - title: t('Auth Tokens'), - description: t('Manage organization auth tokens'), + title: t('Organization Tokens'), + description: t('Manage organization tokens'), id: 'auth-tokens', }, { diff --git a/static/app/views/settings/organization/userOrgNavigationConfiguration.tsx b/static/app/views/settings/organization/userOrgNavigationConfiguration.tsx index 1eebabbd8584bd..e7a7b5e778b20a 100644 --- a/static/app/views/settings/organization/userOrgNavigationConfiguration.tsx +++ b/static/app/views/settings/organization/userOrgNavigationConfiguration.tsx @@ -1,18 +1,12 @@ import {FeatureBadge} from 'sentry/components/core/badge/featureBadge'; import {t} from 'sentry/locale'; -import HookStore from 'sentry/stores/hookStore'; -import type {Organization} from 'sentry/types/organization'; import {hasDynamicSamplingCustomFeature} from 'sentry/utils/dynamicSampling/features'; import type {NavigationSection} from 'sentry/views/settings/types'; const organizationSettingsPathPrefix = '/settings/:orgId'; const userSettingsPathPrefix = '/settings/account'; -export function getUserOrgNavigationConfiguration({ - organization: incomingOrganization, -}: { - organization: Organization; -}): NavigationSection[] { +export function getUserOrgNavigationConfiguration(): NavigationSection[] { return [ { id: 'settings-account', @@ -191,37 +185,28 @@ export function getUserOrgNavigationConfiguration({ items: [ { path: `${organizationSettingsPathPrefix}/auth-tokens/`, - title: t('Auth Tokens'), - description: t('Manage organization auth tokens'), + title: t('Organization Tokens'), + description: t('Manage organization tokens'), id: 'auth-tokens', }, + { + path: `${userSettingsPathPrefix}/api/auth-tokens/`, + title: t('Personal Tokens'), + description: t( + "Personal tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." + ), + }, { path: `${organizationSettingsPathPrefix}/developer-settings/`, title: t('Custom Integrations'), description: t('Manage custom integrations'), id: 'developer-settings', }, - ], - }, - { - id: 'settings-api', - name: t('API'), - items: [ { path: `${userSettingsPathPrefix}/api/applications/`, title: t('Applications'), description: t('Add and configure OAuth2 applications'), }, - { - path: `${userSettingsPathPrefix}/api/auth-tokens/`, - title: t('User Auth Tokens'), - description: t( - "Authentication tokens allow you to perform actions against the Sentry API on behalf of your account. They're the easiest way to get started using the API." - ), - }, - ...HookStore.get('settings:api-navigation-config').flatMap(cb => - cb(incomingOrganization) - ), ], }, ]; diff --git a/static/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx b/static/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx index 780e773fe3ed99..f60d74d22ae1cf 100644 --- a/static/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx +++ b/static/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx @@ -75,7 +75,7 @@ function OrganizationApiKeysList({ {tct( - 'Until Sentry supports OAuth, you might want to switch to using [tokens:User Auth Tokens] instead.', + 'Until Sentry supports OAuth, you might want to switch to using [tokens:Personal Tokens] instead.', { tokens: , } diff --git a/static/app/views/settings/organizationAuthTokens/authTokenDetails.tsx b/static/app/views/settings/organizationAuthTokens/authTokenDetails.tsx index 6d441d8b4065e0..9db0881a548325 100644 --- a/static/app/views/settings/organizationAuthTokens/authTokenDetails.tsx +++ b/static/app/views/settings/organizationAuthTokens/authTokenDetails.tsx @@ -199,8 +199,8 @@ function OrganizationAuthTokensDetails({params, organization}: Props) { return (
- - + + {t( @@ -216,12 +216,12 @@ function OrganizationAuthTokensDetails({params, organization}: Props) { )} - {t('Auth Token Details')} + {t('Organization Token Details')} {isError && ( )} diff --git a/static/app/views/settings/organizationAuthTokens/index.spec.tsx b/static/app/views/settings/organizationAuthTokens/index.spec.tsx index 23f1cf9bc00cfd..d24af90dee53f6 100644 --- a/static/app/views/settings/organizationAuthTokens/index.spec.tsx +++ b/static/app/views/settings/organizationAuthTokens/index.spec.tsx @@ -143,7 +143,7 @@ describe('OrganizationAuthTokensIndex', function () { render(); expect(await screen.findByTestId('loading-error')).toHaveTextContent( - 'Failed to load auth tokens for the organization.' + 'Failed to load organization tokens.' ); expect(screen.queryByTestId('loading-indicator')).not.toBeInTheDocument(); expect(screen.queryByTestId('empty-state')).not.toBeInTheDocument(); diff --git a/static/app/views/settings/organizationAuthTokens/index.tsx b/static/app/views/settings/organizationAuthTokens/index.tsx index 3e7b0b75354598..7cce79bbcf2a97 100644 --- a/static/app/views/settings/organizationAuthTokens/index.tsx +++ b/static/app/views/settings/organizationAuthTokens/index.tsx @@ -160,12 +160,15 @@ export function OrganizationAuthTokensIndex({ {({hasAccess}) => ( - - + + {t( - 'Organization Auth Tokens can be used in many places to interact with Sentry programatically. For example, they can be used for sentry-cli, bundler plugins or similar uses cases.' + 'Organization Tokens can be used in many places to interact with Sentry programatically. For example, they can be used for sentry-cli, bundler plugins or similar uses cases.' )} @@ -183,7 +186,7 @@ export function OrganizationAuthTokensIndex({ loader={ isError ? ( ) : undefined diff --git a/static/app/views/settings/organizationAuthTokens/newAuthToken.spec.tsx b/static/app/views/settings/organizationAuthTokens/newAuthToken.spec.tsx index be7a1eae75ab10..9feade0e789c86 100644 --- a/static/app/views/settings/organizationAuthTokens/newAuthToken.spec.tsx +++ b/static/app/views/settings/organizationAuthTokens/newAuthToken.spec.tsx @@ -34,7 +34,7 @@ describe('OrganizationAuthTokensNewAuthToken', function () { expect(screen.queryByLabelText('Generated token')).not.toBeInTheDocument(); await userEvent.type(screen.getByLabelText('Name'), 'My Token'); - await userEvent.click(screen.getByRole('button', {name: 'Create Auth Token'})); + await userEvent.click(screen.getByRole('button', {name: 'Create Token'})); expect(await screen.findByLabelText('Generated token')).toHaveValue('sntrys_XXXXXXX'); @@ -63,12 +63,12 @@ describe('OrganizationAuthTokensNewAuthToken', function () { expect(screen.queryByLabelText('Generated token')).not.toBeInTheDocument(); await userEvent.type(screen.getByLabelText('Name'), 'My Token'); - await userEvent.click(screen.getByRole('button', {name: 'Create Auth Token'})); + await userEvent.click(screen.getByRole('button', {name: 'Create Token'})); expect(screen.queryByLabelText('Generated token')).not.toBeInTheDocument(); expect(indicators.addErrorMessage).toHaveBeenCalledWith( - 'Failed to create a new auth token.' + 'Failed to create a new organization token.' ); expect(mock).toHaveBeenCalledWith( @@ -96,7 +96,7 @@ describe('OrganizationAuthTokensNewAuthToken', function () { expect(screen.queryByLabelText('Generated token')).not.toBeInTheDocument(); await userEvent.type(screen.getByLabelText('Name'), 'My Token'); - await userEvent.click(screen.getByRole('button', {name: 'Create Auth Token'})); + await userEvent.click(screen.getByRole('button', {name: 'Create Token'})); expect(screen.queryByLabelText('Generated token')).not.toBeInTheDocument(); diff --git a/static/app/views/settings/organizationAuthTokens/newAuthToken.tsx b/static/app/views/settings/organizationAuthTokens/newAuthToken.tsx index e684fa4426ce5f..d3d14c0f3a4aa9 100644 --- a/static/app/views/settings/organizationAuthTokens/newAuthToken.tsx +++ b/static/app/views/settings/organizationAuthTokens/newAuthToken.tsx @@ -72,7 +72,7 @@ function AuthTokenCreateForm({ }, onSuccess: (token: OrgAuthTokenWithToken) => { - addSuccessMessage(t('Created auth token.')); + addSuccessMessage(t('Created organization token.')); queryClient.invalidateQueries({ queryKey: makeFetchOrgAuthTokensForOrgQueryKey({orgSlug: organization.slug}), @@ -89,7 +89,7 @@ function AuthTokenCreateForm({ ? t( 'You have to configure `system.url-prefix` in your Sentry instance in order to generate tokens.' ) - : t('Failed to create a new auth token.'); + : t('Failed to create a new organization token.'); handleXhrErrorResponse(message, error); addErrorMessage(message); }, @@ -104,7 +104,7 @@ function AuthTokenCreateForm({ submitToken({name}); }} onCancel={handleGoBack} - submitLabel={t('Create Auth Token')} + submitLabel={t('Create Token')} requireChanges submitDisabled={isPending} > @@ -117,7 +117,7 @@ function AuthTokenCreateForm({
org:ci
@@ -139,12 +139,12 @@ export default function OrganizationAuthTokensNewAuthToken() { return (
- - + + {t( - 'Organization Auth Tokens can be used in many places to interact with Sentry programmatically. For example, they can be used for sentry-cli, bundler plugins or similar uses cases.' + 'Organization tokens can be used in many places to interact with Sentry programmatically. For example, they can be used for sentry-cli, bundler plugins or similar uses cases.' )} @@ -156,7 +156,7 @@ export default function OrganizationAuthTokensNewAuthToken() { )} - {t('Create New Auth Token')} + {t('Create New Organization Token')} - {t('Organization Auth Tokens')} + {t('Organization Tokens')} )}
  • - {t('User Auth Tokens')} + {t('Personal Tokens')}
  • {organizationSettingsUrl && (
  • From bea2c595b1bb2922843701d7a1346dc5355de6ab Mon Sep 17 00:00:00 2001 From: Arthur Knaus Date: Wed, 4 Jun 2025 09:49:38 +0200 Subject: [PATCH 2/2] ref(org-token): Rename table header --- static/app/views/settings/organizationAuthTokens/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/settings/organizationAuthTokens/index.tsx b/static/app/views/settings/organizationAuthTokens/index.tsx index 7cce79bbcf2a97..d1282b81cbc60d 100644 --- a/static/app/views/settings/organizationAuthTokens/index.tsx +++ b/static/app/views/settings/organizationAuthTokens/index.tsx @@ -192,7 +192,7 @@ export function OrganizationAuthTokensIndex({ ) : undefined } emptyMessage={t("You haven't created any authentication tokens yet.")} - headers={[t('Auth token'), t('Created'), t('Last access'), '']} + headers={[t('Token'), t('Created'), t('Last access'), '']} > {!isError && !isPending && !!tokenList?.length && (