-
Notifications
You must be signed in to change notification settings - Fork 245
feat: setting up early indexes experimentation and experiment viewed event CLOUDP-311776 #6860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
61384ae
setting up experimentation file + receiving data from mms
rubydong 4a08032
update modal title, size, and description
rubydong fda1d08
simplifiedexperiment viewed func
rubydong 1c42217
Merge branch 'main' into cloudp-311776
rubydong 2b288bb
moved growth-experiments to telemetry folder + updated hook name
rubydong 22fd8f6
Merge remote-tracking branch 'origin/main' into cloudp-311776
rubydong b10c782
Merge branch 'cloudp-311776' of https://github.com/mongodb-js/compass…
rubydong a3990c3
Merge remote-tracking branch 'origin/main' into cloudp-311776
rubydong da566de
moved func to provider
rubydong 18168b9
created a CreateIndexModalHeader component
rubydong 07c902d
added unit tests for create-index-modal-header
rubydong 31b419d
fire EV if modal is open + removed preferences from AtlasOrgPreferences
rubydong 5fa1a06
remove extra space in modal-header
rubydong 8001399
resolve merge conflicts
rubydong 349d10e
remove extra h3 and body export
rubydong 0307155
updated styling
rubydong 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
27 changes: 27 additions & 0 deletions
27
...ages/compass-indexes/src/components/create-index-modal/create-index-modal-header.spec.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, screen } from '@mongodb-js/testing-library-compass'; | ||
| import CreateIndexModalHeader from './create-index-modal-header'; | ||
| import { expect } from 'chai'; | ||
|
|
||
| describe('CreateIndexModalHeader', () => { | ||
| it('renders the modal title', () => { | ||
| render(<CreateIndexModalHeader />); | ||
| const title = screen.getByTestId('create-index-modal-header-title'); | ||
|
|
||
| expect(title.textContent).to.be.equal('Create Index'); | ||
| }); | ||
|
|
||
| it('renders the subtitle text', () => { | ||
| render(<CreateIndexModalHeader />); | ||
| const subtitle = screen.getByTestId('create-index-modal-header-subtitle'); | ||
| expect(subtitle).to.exist; | ||
| }); | ||
|
|
||
| it('renders the link to the Index Strategies Documentation', () => { | ||
| render(<CreateIndexModalHeader />); | ||
| const link = screen.getByRole('link', { | ||
| name: /Index Strategies Documentation/i, | ||
| }); | ||
| expect(link).to.exist; | ||
| }); | ||
| }); |
45 changes: 45 additions & 0 deletions
45
packages/compass-indexes/src/components/create-index-modal/create-index-modal-header.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,45 @@ | ||
| import { | ||
| H3, | ||
| Body, | ||
| spacing, | ||
| css, | ||
| palette, | ||
| Link, | ||
| } from '@mongodb-js/compass-components'; | ||
| import React from 'react'; | ||
|
|
||
| const headerStyle = css({ | ||
| padding: spacing[800], | ||
| paddingBottom: 0, | ||
| }); | ||
|
|
||
| const subtitleStyle = css({ | ||
| color: palette.gray.dark1, | ||
| }); | ||
|
|
||
| const CreateIndexModalHeader = () => { | ||
| return ( | ||
| <div className={headerStyle}> | ||
| <H3 data-testid="create-index-modal-header-title">Create Index</H3> | ||
|
|
||
| <Body | ||
| data-testid="create-index-modal-header-subtitle" | ||
| className={subtitleStyle} | ||
| > | ||
| The best indexes for your application should consider a number of | ||
| factors, such as your data model, and the queries you use most often. To | ||
| learn more about indexing best practices, read the{' '} | ||
| <Link | ||
| href="https://docs.mongodb.com/manual/applications/indexes/" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| Index Strategies Documentation | ||
| </Link> | ||
| . | ||
| </Body> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default CreateIndexModalHeader; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export enum TestName { | ||
| earlyJourneyIndexesGuidance = 'EARLY_JOURNEY_INDEXES_GUIDANCE_20250328', | ||
| } |
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.
Maybe I'm understanding this wrong, should this be
showIndexesGuidanceVariantand notenableInIndexesGuidanceExp?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.
nope this should fire for when user is in the control as well so it should be
enableInIndexesGuidanceExpThere 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.
Should we track that they're in the control then? Or is there already a way we differentiate that they are shown/not shown the new experience?
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 tracks if they are in the control as well, if they are in the experiment
enableInIndexesGuidanceExpis true. i need to confirm once i get the latest into our mms but i think by default we have code set up to send down whether user is in the variant or controlThere 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.
Would it make things easier if we track if they're in the control or shown the experience here as some metadata for the tracking event? If it's on the mms side I suppose we don't need to since we'll be able to correlate them anyway. Feel free to resolve!