This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(plg): Cody Pro routes conditions & add links to the user nav dropdown #63378
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vdavid
approved these changes
Jun 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, it looks completely right to me.
taras-yemets
added a commit
that referenced
this pull request
Jun 21, 2024
…nav dropdown (#63378) (#63424) This reverts commit 5cf81e0 (https://github.com/sourcegraph/sourcegraph/pull/63378). This PR intorduced a call to the SSC backend via proxy on the Sourcegraph backend (see `cmd/frontend/internal/ssc/ssc_proxy.go`). It appeared that proxy is not properly configured on dotcom, causing requests to fail with 503 "proxy not configured" errors. Reverting this PR until we fix the configuration. <!-- 💡 To write a useful PR description, make sure that your description covers: - WHAT this PR is changing: - How was it PREVIOUSLY. - How it will be from NOW on. - WHY this PR is needed. - CONTEXT, i.e. to which initiative, project or RFC it belongs. The structure of the description doesn't matter as much as covering these points, so use your best judgement based on your context. Learn how to write good pull request description: https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4 --> ## Test plan - CI <!-- All pull requests REQUIRE a test plan: https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles --> ## Changelog <!-- 1. Ensure your pull request title is formatted as: $type($domain): $what 2. Add bullet list items for each additional detail you want to cover (see example below) 3. You can edit this after the pull request was merged, as long as release shipping it hasn't been promoted to the public. 4. For more information, please see this how-to https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c? Audience: TS/CSE > Customers > Teammates (in that order). Cheat sheet: $type = chore|fix|feat $domain: source|search|ci|release|plg|cody|local|... --> <!-- Example: Title: fix(search): parse quotes with the appropriate context Changelog section: ## Changelog - When a quote is used with regexp pattern type, then ... - Refactored underlying code. -->
taras-yemets
added a commit
that referenced
this pull request
Jun 25, 2024
…down (#63378) Closes https://github.com/sourcegraph/sourcegraph/issues/63264 1. Adds Cody Pro section to the user nav dropdown on dotcom: - team admins have links to "cody/subscription/manage" and "cody/team/manage" pages - team members have only link only to the "cody/team/manage" page 2. Makes subscription management page only available for team admins. If team members try to navigate this page by changing the URL, they will be redirected to the "/cody/manage" page. - Makes "Manage subscription" link on the "/cody/manage" available only for the team admins (previously - any Pro user) 3. Lifts `QueryClientProvider` (wrapper around react-query `ClientProvider` higher in the component tree so that Cody Pro API query and mutations can be used not only on the Cody Pro routes. [Design](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5351-19126&t=LfNQR7vUCJhlNvyT-4) | Role | Screenshot | |--|--| |Admin|<img width="1605" alt="Screenshot 2024-06-20 at 12 57 13" src="https://github.com/sourcegraph/sourcegraph/assets/25318659/e7b995fd-4322-4f7f-86bb-c7027cacd644"><img width="1605" alt="Screenshot 2024-06-20 at 13 10 28" src="https://github.com/sourcegraph/sourcegraph/assets/25318659/84be111c-76e2-4b14-9b73-ebdd5f8cbb9a">| |Member|<img width="1605" alt="Screenshot 2024-06-20 at 12 56 50" src="https://github.com/sourcegraph/sourcegraph/assets/25318659/aefd8b3b-29fe-4957-87ee-b493eb489922"><img width="1605" alt="Screenshot 2024-06-20 at 13 09 51" src="https://github.com/sourcegraph/sourcegraph/assets/25318659/8209e7a0-4deb-4681-9f6b-3cfde8110842">| <!-- 💡 To write a useful PR description, make sure that your description covers: - WHAT this PR is changing: - How was it PREVIOUSLY. - How it will be from NOW on. - WHY this PR is needed. - CONTEXT, i.e. to which initiative, project or RFC it belongs. The structure of the description doesn't matter as much as covering these points, so use your best judgement based on your context. Learn how to write good pull request description: https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4 --> ## Test plan - Start Sourcegraph instance in dotcom mode - sign in as a Cody Pro team admin - ensure that "Manage subscription" and "Manage team" links are present in the user nav dropdown - ensure "/cody/manage" page has "Manage subscription" link - sign in as a Cody Pro team member (not admin) - ensure "Manage team" link is present in the user nav dropdown - navigate to "/cody/subscription/manage/ page by changing the URL - ensure you've been redirected to the "/cody/manage" page - ensure "/cody/manage" page doesn't have "Manage subscription" link - start Sourcegraph in the enterprise mode - ensure the mentioned links are not rendered <!-- All pull requests REQUIRE a test plan: https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles --> ## Changelog <!-- 1. Ensure your pull request title is formatted as: $type($domain): $what 2. Add bullet list items for each additional detail you want to cover (see example below) 3. You can edit this after the pull request was merged, as long as release shipping it hasn't been promoted to the public. 4. For more information, please see this how-to https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c? Audience: TS/CSE > Customers > Teammates (in that order). Cheat sheet: $type = chore|fix|feat $domain: source|search|ci|release|plg|cody|local|... --> <!-- Example: Title: fix(search): parse quotes with the appropriate context Changelog section: ## Changelog - When a quote is used with regexp pattern type, then ... - Refactored underlying code. -->
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/sourcegraph/sourcegraph/issues/63264
QueryClientProvider
(wrapper around react-queryClientProvider
higher in the component tree so that Cody Pro API query and mutations can be used not only on the Cody Pro routes.Design
Test plan
Changelog