Skip to content

Commit

Permalink
do not show Feedback in global nav for unauthed users (sourcegraph#47860
Browse files Browse the repository at this point in the history
)

To give feedback, users on Sourcegraph.com need to sign in. (Other
instances don't support unauthenticated users, so this only pertains to
Sourcegraph.com.) This declutters the global nav.




## Test plan

Confirm that no "Feedback" global nav item shows up for unauthed users.
  • Loading branch information
sqs committed Feb 22, 2023
1 parent a4098c5 commit 65922bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
26 changes: 2 additions & 24 deletions client/web/src/nav/GlobalNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import { buildGetStartedURL, buildCloudTrialURL } from '@sourcegraph/shared/src/util/url'
import { Button, Link, ButtonLink, useWindowSize, FeedbackPrompt, PopoverTrigger } from '@sourcegraph/wildcard'
import { Button, Link, ButtonLink, useWindowSize } from '@sourcegraph/wildcard'

import { AuthenticatedUser } from '../auth'
import { BatchChangesProps } from '../batches'
Expand All @@ -29,7 +29,7 @@ import { BrandLogo } from '../components/branding/BrandLogo'
import { getFuzzyFinderFeatureFlags } from '../components/fuzzyFinder/FuzzyFinderFeatureFlag'
import { WebCommandListPopoverButton } from '../components/shared'
import { useFeatureFlag } from '../featureFlags/useFeatureFlag'
import { useHandleSubmitFeedback, useRoutesMatch } from '../hooks'
import { useRoutesMatch } from '../hooks'
import { CodeInsightsProps } from '../insights/types'
import { isCodeInsightsEnabled } from '../insights/utils/is-code-insights-enabled'
import { NotebookProps } from '../notebooks'
Expand Down Expand Up @@ -146,9 +146,6 @@ export const GlobalNavbar: React.FunctionComponent<React.PropsWithChildren<Globa
const location = useLocation()

const routeMatch = useRoutesMatch(props.routes)
const { handleSubmitFeedback } = useHandleSubmitFeedback({
routeMatch,
})

const onNavbarQueryChange = useNavbarQueryState(state => state.setQueryState)
// Search context management is still enabled on .com
Expand Down Expand Up @@ -275,25 +272,6 @@ export const GlobalNavbar: React.FunctionComponent<React.PropsWithChildren<Globa
</Link>
</NavAction>
)}

<NavAction className="d-sm-flex d-none">
<FeedbackPrompt
onSubmit={handleSubmitFeedback}
productResearchEnabled={true}
authenticatedUser={props.authenticatedUser}
>
<PopoverTrigger
as={Button}
aria-label="Feedback"
variant="secondary"
outline={true}
size="sm"
className={styles.feedbackTrigger}
>
<span>Feedback</span>
</PopoverTrigger>
</FeedbackPrompt>
</NavAction>
</>
)}
{props.authenticatedUser && isSourcegraphDotCom && (
Expand Down
14 changes: 0 additions & 14 deletions client/web/src/nav/__snapshots__/GlobalNavbar.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65922bf

Please sign in to comment.