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
Add product feedback page #17945
Merged
Merged
Add product feedback page #17945
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4e92f24
Add unstyled/prototype product feedback page
umpox ea43b4c
Update Product Feedback page styling
umpox 21874f3
Add logic for admins to allow admins to toggle the product reseearch …
umpox c0f7f6d
Add button icon
umpox 6788ce6
Open Sign up now link in new tab
umpox 6edda38
Add tests
umpox d25f9be
Gate correctly
umpox cd23795
Fix compiler error
umpox 27caee2
Merge branch 'main' into tr/product-feedback-page
umpox 0555049
Fix typo
umpox 1d026ed
Removed testing library types that are already bundled in
umpox 449cd89
Update naming, semantics and tests
umpox b3afc46
Merge branch 'main' into tr/product-feedback-page
umpox f3cc0b0
Naming
umpox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
client/web/src/user/settings/research/ProductResearch.test.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import { render, RenderResult } from '@testing-library/react' | ||
import { ProductResearchPage } from './ProductResearch' | ||
import { NOOP_TELEMETRY_SERVICE } from '../../../../../shared/src/telemetry/telemetryService' | ||
|
||
describe('ProductResearchPage', () => { | ||
let queries: RenderResult | ||
|
||
beforeEach(() => { | ||
queries = render( | ||
<ProductResearchPage | ||
telemetryService={NOOP_TELEMETRY_SERVICE} | ||
authenticatedUser={{ email: 'test@sourcegraph.com' }} | ||
/> | ||
) | ||
}) | ||
|
||
test('Renders page correctly', () => { | ||
expect(queries.getByText('Product research and feedback')).toBeVisible() | ||
}) | ||
|
||
test('renders sign up now link correctly', () => { | ||
expect(queries.getByText('Sign up now').closest('a')?.href).toMatchInlineSnapshot( | ||
'"https://share.hsforms.com/1tkScUc65Tm-Yu98zUZcLGw1n7ku?email=test%40sourcegraph.com"' | ||
) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useEffect } from 'react' | ||
import OpenInNewIcon from 'mdi-react/OpenInNewIcon' | ||
import { TelemetryService } from '../../../../../shared/src/telemetry/telemetryService' | ||
import { AuthenticatedUser } from '../../../auth' | ||
|
||
interface Props { | ||
telemetryService: TelemetryService | ||
authenticatedUser: Pick<AuthenticatedUser, 'email'> | ||
} | ||
|
||
const signUpForm = new URL('https://share.hsforms.com/1tkScUc65Tm-Yu98zUZcLGw1n7ku') | ||
|
||
export const ProductResearchPage: React.FunctionComponent<Props> = ({ telemetryService, authenticatedUser }) => { | ||
useEffect(() => { | ||
telemetryService.logViewEvent('UserSettingsProductResearch') | ||
}, [telemetryService]) | ||
|
||
signUpForm.searchParams.set('email', authenticatedUser.email) | ||
|
||
return ( | ||
<> | ||
umpox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<h2 className="mb-3">Product research and feedback</h2> | ||
<p> | ||
Our product team conducts occasional research to learn about how you use Sourcegraph and ask for | ||
feedback about upcoming ideas. Sign up to participate in our research and help us shape the future of | ||
our product! | ||
</p> | ||
<a href={signUpForm.href} className="btn btn-primary mt-2" target="_blank" rel="noopener noreferrer"> | ||
Sign up now <OpenInNewIcon className="icon-inline" /> | ||
</a> | ||
</> | ||
) | ||
} |
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
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
Oops, something went wrong.
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.
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.
Just noticed this: This feels a bit weird because this URL is mutated on every render but shared between all instances of a component. This could cause issues when rendering it multiple times, e.g. in tests
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.
This shouldn't cause issues as
set
will just override any previous values but I agree this is a bit weird, PR to fix: https://github.com/sourcegraph/sourcegraph/pull/18171