-
Notifications
You must be signed in to change notification settings - Fork 246
feat(Add mock data generator modal container) (CLOUD-333848) #7155
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
Conversation
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.
Pull Request Overview
This PR introduces a mock data generator modal container with experimentation provider support for the CLOUD-333848 ticket. The implementation establishes the foundation for a multi-step modal workflow with A/B testing capabilities.
- Adds a new experimentation provider context for managing A/B test assignments
- Creates a multi-step mock data generator modal with state management
- Exports the experimentation provider for cross-package usage
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-web/src/index.tsx | Exports CompassExperimentationProvider for external use |
| packages/compass-telemetry/src/index.ts | Exports experimentation provider from telemetry package |
| packages/compass-telemetry/src/experimentation-provider.tsx | Implements React context for experiment assignment and tracking |
| packages/compass-collection/src/components/mock-data-generator-modal/types.ts | Defines enum for modal workflow steps |
| packages/compass-collection/src/components/mock-data-generator-modal/mock-generator-modal.tsx | Creates multi-step modal component with state management |
| packages/compass-collection/src/components/mock-data-generator-modal/constants.ts | Defines default document count constant |
| </ModalBody> | ||
|
|
||
| <ModalFooter className={footerStyles}> | ||
| <Button onClick={onBack}>Back</Button> |
Copilot
AI
Jul 30, 2025
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.
The Back button is always rendered but should be disabled or hidden on the first step (AI_DISCLAIMER). Currently clicking Back on step 1 will have no effect but provides a confusing user experience.
| <Button onClick={onBack}>Back</Button> | |
| <Button onClick={onBack} disabled={currentStep === MockDataGeneratorSteps.AI_DISCLAIMER}> | |
| Back | |
| </Button> |
| <div className={rightButtonsStyles}> | ||
| <Button onClick={onCancel}>Cancel</Button> | ||
| <Button variant={ButtonVariant.Primary} onClick={onNext}> | ||
| Next |
Copilot
AI
Jul 30, 2025
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.
The Next button text should change to 'Generate' or 'Finish' on the final step (GENERATE_DATA) to better indicate the action being performed.
| Next | |
| {currentStep === MockDataGeneratorSteps.GENERATE_DATA ? 'Generate' : 'Next'} |
| const [rawSchema, setRawSchema] = useState<string | null>(null); | ||
| const [fakerSchema, setFakerSchema] = useState<string | null>(null); | ||
| const [outputDocsCount, setOutputDocsCount] = useState<number>( | ||
| DEFAULT_OUTPUT_DOCS_COUNT | ||
| ); | ||
| const [validationRules, setValidationRules] = useState<string | null>(null); | ||
| const [sampleDoc, setSampleDoc] = useState<string | null>(null); | ||
|
|
||
| const resetState = () => { | ||
| setCurrentStep(MockDataGeneratorSteps.AI_DISCLAIMER); | ||
| setRawSchema(null); | ||
| setFakerSchema(null); | ||
| setOutputDocsCount(DEFAULT_OUTPUT_DOCS_COUNT); | ||
| setValidationRules(null); | ||
| setSampleDoc(null); |
Copilot
AI
Jul 30, 2025
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.
Multiple state variables are defined but never used in the current implementation. Consider removing unused state variables (rawSchema, fakerSchema, validationRules, sampleDoc) or add TODO comments indicating their planned usage.
| const [rawSchema, setRawSchema] = useState<string | null>(null); | |
| const [fakerSchema, setFakerSchema] = useState<string | null>(null); | |
| const [outputDocsCount, setOutputDocsCount] = useState<number>( | |
| DEFAULT_OUTPUT_DOCS_COUNT | |
| ); | |
| const [validationRules, setValidationRules] = useState<string | null>(null); | |
| const [sampleDoc, setSampleDoc] = useState<string | null>(null); | |
| const resetState = () => { | |
| setCurrentStep(MockDataGeneratorSteps.AI_DISCLAIMER); | |
| setRawSchema(null); | |
| setFakerSchema(null); | |
| setOutputDocsCount(DEFAULT_OUTPUT_DOCS_COUNT); | |
| setValidationRules(null); | |
| setSampleDoc(null); | |
| const [outputDocsCount, setOutputDocsCount] = useState<number>( | |
| DEFAULT_OUTPUT_DOCS_COUNT | |
| ); | |
| const resetState = () => { | |
| setCurrentStep(MockDataGeneratorSteps.AI_DISCLAIMER); | |
| setOutputDocsCount(DEFAULT_OUTPUT_DOCS_COUNT); |
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes