remove "organizations aren't supported" page on dotcom (#63932)

We want to support orgs on dotcom for grouping prompts in the Prompt
Library. Note that creating orgs was never actually disabled in the API,
so this was ineffectual anyway.


## Test plan

View the user settings area sidebar in dotcom mode and ensure the new
org button is shown.
This commit is contained in:
Quinn Slack 2024-07-19 01:20:56 -07:00 committed by GitHub
parent 6616eb1635
commit 6f0c1358e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 16 additions and 107 deletions

View File

@ -1713,8 +1713,6 @@ ts_project(
"src/user/settings/ScimAlert.tsx",
"src/user/settings/UserSettingsArea.tsx",
"src/user/settings/UserSettingsSidebar.tsx",
"src/user/settings/aboutOrganization/AboutOrganizationPage.tsx",
"src/user/settings/aboutOrganization/index.ts",
"src/user/settings/accessTokens/UserSettingsCreateAccessTokenCallbackPage.tsx",
"src/user/settings/accessTokens/UserSettingsCreateAccessTokenPage.tsx",
"src/user/settings/accessTokens/UserSettingsTokensArea.tsx",
@ -2473,7 +2471,6 @@ ts_project(
"src/team/new/NewTeamPage.story.tsx",
"src/tour/components/Tour/Tour.story.tsx",
"src/user/profile/UserProfile.story.tsx",
"src/user/settings/aboutOrganization/AboutOrganizationPage.story.tsx",
],
tags = [TAG_SEARCHSUITE],
tsconfig = ":tsconfig",

View File

@ -1,9 +1,9 @@
import { type FC, useState, useCallback } from 'react'
import { type FC, useCallback, useState } from 'react'
import { mdiMenu, mdiPlus } from '@mdi/js'
import classNames from 'classnames'
import { ProductStatusBadge, Button, Link, Icon, type ProductStatusType, Tooltip } from '@sourcegraph/wildcard'
import { Button, Icon, Link, ProductStatusBadge, type ProductStatusType, Tooltip } from '@sourcegraph/wildcard'
import type { AuthenticatedUser } from '../../auth'
import type { BatchChangesProps } from '../../batches'
@ -94,25 +94,20 @@ export const UserSettingsSidebar: FC<UserSettingsSidebarProps> = props => {
</Tooltip>
</SidebarNavItem>
))}
{!siteAdminViewingOtherUser &&
(window.context.sourcegraphDotComMode ? (
<SidebarNavItem to="./about-organizations" onClick={collapseMobileSidebar}>
About organizations
</SidebarNavItem>
) : (
<div className={styles.newOrgBtnWrapper}>
<Button
to="/organizations/new"
variant="secondary"
outline={true}
size="sm"
as={Link}
onClick={collapseMobileSidebar}
>
<Icon aria-hidden={true} svgPath={mdiPlus} /> New organization
</Button>
</div>
))}
{!siteAdminViewingOtherUser && (
<div className={styles.newOrgBtnWrapper}>
<Button
to="/organizations/new"
variant="secondary"
outline={true}
size="sm"
as={Link}
onClick={collapseMobileSidebar}
>
<Icon aria-hidden={true} svgPath={mdiPlus} /> New organization
</Button>
</div>
)}
</SidebarGroup>
)}
<SidebarGroup>

View File

@ -1,3 +0,0 @@
.self-hosted-cta-content {
font-size: 1rem;
}

View File

@ -1,21 +0,0 @@
import type { Decorator, Meta } from '@storybook/react'
import { noOpTelemetryRecorder } from '@sourcegraph/shared/src/telemetry'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { WebStory } from '../../../components/WebStory'
import { AboutOrganizationPage } from './AboutOrganizationPage'
const decorator: Decorator = story => <WebStory>{() => <div className="container mt-3">{story()}</div>}</WebStory>
const config: Meta = {
title: 'web/Organizations/AboutOrganizationPage',
decorators: [decorator],
}
export default config
export const Basic = (): JSX.Element => (
<AboutOrganizationPage telemetryService={NOOP_TELEMETRY_SERVICE} telemetryRecorder={noOpTelemetryRecorder} />
)

View File

@ -1,47 +0,0 @@
import React, { useEffect } from 'react'
import type { TelemetryV2Props } from '@sourcegraph/shared/src/telemetry'
import type { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { PageHeader, Text } from '@sourcegraph/wildcard'
import { PageTitle } from '../../../components/PageTitle'
import { SelfHostedCta } from '../../../components/SelfHostedCta'
import styles from './AboutOrganizationPage.module.scss'
interface AboutOrganizationPageProps extends TelemetryProps, TelemetryV2Props {}
export const AboutOrganizationPage: React.FunctionComponent<React.PropsWithChildren<AboutOrganizationPageProps>> = ({
telemetryService,
telemetryRecorder,
}) => {
useEffect(() => {
telemetryService.logViewEvent('AboutOrg')
telemetryRecorder.recordEvent('settings.aboutOrganizations', 'view')
}, [telemetryService, telemetryRecorder])
return (
<>
<PageTitle title="Organizations" />
<PageHeader
headingElement="h2"
path={[{ text: 'Organizations' }]}
description="Support for organizations is not currently available on Sourcegraph.com."
className="mb-3"
/>
<SelfHostedCta
contentClassName={styles.selfHostedCtaContent}
page="organizations"
telemetryService={telemetryService}
telemetryRecorder={telemetryRecorder}
>
<Text className="mb-2">
<strong>Need more enterprise features? Run Sourcegraph self-hosted</strong>
</Text>
<Text className="mb-2">
For additional code hosts and enterprise only features, install Sourcegraph self-hosted.
</Text>
</SelfHostedCta>
</>
)
}

View File

@ -1 +0,0 @@
export * from './AboutOrganizationPage'

View File

@ -30,11 +30,6 @@ const UserSettingsSecurityPage = lazyComponent(
'UserSettingsSecurityPage'
)
const AboutOrganizationPage = lazyComponent(
() => import('./aboutOrganization/AboutOrganizationPage'),
'AboutOrganizationPage'
)
const shouldRenderBatchChangesPage = ({
batchChangesEnabled,
user: { viewerCanAdminister },
@ -79,12 +74,6 @@ export const userSettingsAreaRoutes: readonly UserSettingsAreaRoute[] = [
render: lazyComponent(() => import('./research/ProductResearch'), 'ProductResearchPage'),
condition: () => window.context.productResearchPageEnabled,
},
{
path: 'about-organizations',
render: props => (
<AboutOrganizationPage {...props} telemetryRecorder={props.platformContext.telemetryRecorder} />
),
},
{
path: 'permissions',
render: lazyComponent(