Skip to content

Commit 0afd965

Browse files
authored
fix(compass-collection): Mock Data Generator QA items - CLOUDP-356791 (#7554)
* Mock Data Generator QA items * Update styling * cleanup
1 parent 3fbcb02 commit 0afd965

File tree

6 files changed

+20
-47
lines changed

6 files changed

+20
-47
lines changed

packages/compass-collection/src/components/mock-data-generator-modal/document-count-screen.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Body,
33
compactBytes,
44
css,
5-
palette,
5+
Description,
66
spacing,
77
TextInput,
88
} from '@mongodb-js/compass-components';
@@ -21,7 +21,6 @@ const titleStyles = css({
2121
});
2222

2323
const descriptionStyles = css({
24-
color: palette.gray.dark1,
2524
fontStyle: 'italic',
2625
});
2726

@@ -107,9 +106,9 @@ const DocumentCountScreen = ({
107106
<Body className={titleStyles}>
108107
Specify Number of Documents to Generate
109108
</Body>
110-
<Body className={descriptionStyles}>
109+
<Description className={descriptionStyles}>
111110
Indicate the amount of documents you want to generate below.
112-
</Body>
111+
</Description>
113112
<div className={inputContainerStyles}>
114113
<TextInput
115114
label="Documents to generate in current collection"

packages/compass-collection/src/components/mock-data-generator-modal/faker-mapping-selector.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
css,
77
Label,
88
Option,
9-
palette,
109
Select,
1110
spacing,
1211
} from '@mongodb-js/compass-components';
@@ -27,7 +26,6 @@ const fieldMappingSelectorsStyles = css({
2726
});
2827

2928
const labelStyles = css({
30-
color: palette.gray.dark1,
3129
fontWeight: 600,
3230
});
3331

packages/compass-collection/src/components/mock-data-generator-modal/faker-schema-editor-screen.tsx

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import {
2-
Body,
3-
Button,
4-
ButtonSize,
5-
ButtonVariant,
62
css,
3+
Description,
4+
H3,
75
Link,
8-
palette,
96
spacing,
107
SpinLoaderWithLabel,
118
} from '@mongodb-js/compass-components';
@@ -35,21 +32,12 @@ const innerEditorStyles = css({
3532
});
3633

3734
const titleStyles = css({
38-
color: palette.black,
3935
fontWeight: 600,
4036
fontSize: '16px',
4137
lineHeight: '20px',
4238
marginBottom: 0,
4339
});
4440

45-
const bodyStyles = css({
46-
color: palette.gray.dark1,
47-
});
48-
49-
const confirmMappingsButtonStyles = css({
50-
width: '200px',
51-
});
52-
5341
const schemaEditorLoaderStyles = css({
5442
display: 'flex',
5543
alignItems: 'center',
@@ -58,10 +46,8 @@ const schemaEditorLoaderStyles = css({
5846

5947
const FakerSchemaEditorContent = ({
6048
fakerSchema,
61-
onSchemaConfirmed,
6249
}: {
6350
fakerSchema: FakerSchema;
64-
onSchemaConfirmed: () => void;
6551
}) => {
6652
const track = useTelemetry();
6753
const [fakerSchemaFormValues, setFakerSchemaFormValues] =
@@ -176,38 +162,29 @@ const FakerSchemaEditorContent = ({
176162
/>
177163
)}
178164
</div>
179-
<Button
180-
size={ButtonSize.Small}
181-
className={confirmMappingsButtonStyles}
182-
variant={ButtonVariant.Primary}
183-
onClick={onSchemaConfirmed}
184-
>
185-
Confirm mappings
186-
</Button>
187165
</>
188166
);
189167
};
190168

191169
const FakerSchemaEditorScreen = ({
192-
onSchemaConfirmed,
193170
fakerSchemaGenerationState,
194171
}: {
195-
onSchemaConfirmed: () => void;
196172
fakerSchemaGenerationState: MockDataGeneratorState;
197173
}) => {
198174
return (
199175
<div data-testid="faker-schema-editor" className={containerStyles}>
200176
<div>
201-
<h3 className={titleStyles}>
177+
<H3 className={titleStyles}>
202178
Confirm Field to Faker Function Mappings
203-
</h3>
204-
<Body className={bodyStyles}>
205-
We have sampled your collection and created a schema based on your
206-
documents. That schema has been sent to an LLM and it has returned the
207-
following mapping between your schema fields and{' '}
208-
<Link href="https://fakerjs.dev/api/faker.html">faker functions</Link>
209-
.
210-
</Body>
179+
</H3>
180+
<Description>
181+
We analyzed a sample of your data and used generative AI to suggest
182+
the following mapping between your document fields and data simulation
183+
functions.{' '}
184+
<Link href="https://www.mongodb.com/docs/generative-ai-faq/?utm_source=compass&utm_medium=product">
185+
Learn more about MongoDB’s AI usage
186+
</Link>
187+
</Description>
211188
</div>
212189
{fakerSchemaGenerationState.status === 'in-progress' && (
213190
<div
@@ -220,7 +197,6 @@ const FakerSchemaEditorScreen = ({
220197
{fakerSchemaGenerationState.status === 'completed' && (
221198
<FakerSchemaEditorContent
222199
fakerSchema={fakerSchemaGenerationState.editedFakerSchema}
223-
onSchemaConfirmed={onSchemaConfirmed}
224200
/>
225201
)}
226202
</div>

packages/compass-collection/src/components/mock-data-generator-modal/mock-data-generator-modal.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ describe('MockDataGeneratorModal', () => {
725725
expect(screen.getByTestId('faker-schema-editor')).to.exist;
726726
});
727727

728-
userEvent.click(screen.getByText('Confirm mappings'));
728+
userEvent.click(screen.getByText('Next'));
729729

730730
await waitFor(() => {
731731
expect(screen.getByText('Specify Number of Documents to Generate')).to

packages/compass-collection/src/components/mock-data-generator-modal/mock-data-generator-modal.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ const MockDataGeneratorModal = ({
9696
case MockDataGeneratorStep.SCHEMA_EDITOR:
9797
return (
9898
<FakerSchemaEditorScreen
99-
onSchemaConfirmed={onNextStep}
10099
fakerSchemaGenerationState={fakerSchemaGenerationState}
101100
/>
102101
);
@@ -125,7 +124,6 @@ const MockDataGeneratorModal = ({
125124
fakerSchemaGenerationState,
126125
documentCount,
127126
onDocumentCountChange,
128-
onNextStep,
129127
]);
130128

131129
useTrackOnChange(

packages/compass-collection/src/components/mock-data-generator-modal/schema-field-selector.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ const activeStylesLight = css({
5050

5151
const activeStylesDark = css({
5252
color: palette.white,
53+
backgroundColor: palette.green.dark3,
54+
fontWeight: 600,
55+
5356
'&:active,&:focus': {
54-
backgroundColor: palette.gray.dark3,
57+
backgroundColor: palette.green.dark3,
5558
color: palette.white,
5659
},
5760
});
@@ -71,7 +74,6 @@ const hoverStylesDark = css({
7174
});
7275

7376
const labelStyles = css({
74-
color: palette.gray.dark1,
7577
fontWeight: 600,
7678
});
7779

0 commit comments

Comments
 (0)