Skip to content

Commit 60072e3

Browse files
author
Keivan Vosoughi
committed
Test
1 parent fce1b3c commit 60072e3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

app/client/src/pages/DataGenerator/DataGenerator.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,15 @@ const DataGenerator: FunctionComponent<Props> = () => {
9393
if (generate_file_name && !mutation.data) {
9494
mutation.mutate(generate_file_name);
9595
}
96-
console.log('mutation.data', mutation.data);
9796

9897
if (mutation.data && mutation?.data?.dataset) {
99-
console.log('setting form values', {
100-
...initialData,
101-
...(mutation?.data?.dataset as any)
102-
});
98+
const dataset = mutation?.data?.dataset as any;
10399
form.setFieldsValue({
104100
...initialData,
105-
...(mutation?.data?.dataset as any)
101+
...dataset,
102+
workflow_type: dataset.technique === 'freeform' ?
103+
WorkflowType.FREE_FORM_DATA_GENERATION : WorkflowType.CUSTOM_DATA_GENERATION
106104
});
107-
console.log('------> form', form.getFieldsValue());
108105
}
109106

110107
}, [generate_file_name]);

app/client/src/pages/DataGenerator/Examples.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const StyledContainer = styled.div`
5050
5151
`;
5252

53+
5354
const Examples: FunctionComponent = () => {
5455
const form = Form.useFormInstance();
5556
const { generate_file_name } = useParams();
@@ -68,9 +69,13 @@ const Examples: FunctionComponent = () => {
6869
});
6970

7071
useEffect(() => {
71-
const useCase = form.getFieldValue('use_case');
72-
restore_mutation.mutate(useCase);
73-
}, [form.getFieldValue('use_case')]);
72+
if (isEmpty(generate_file_name)) {
73+
const useCase = form.getFieldValue('use_case');
74+
restore_mutation.mutate(useCase);
75+
} else {
76+
setRecords(form.getFieldValue('examples'));
77+
}
78+
}, [form.getFieldValue('use_case'), generate_file_name]);
7479

7580

7681
useEffect(() => {

0 commit comments

Comments
 (0)