Skip to content

Commit 8300321

Browse files
author
Keivan Vosoughi
committed
Revert "Dataset Details Page"
This reverts commit 55df312.
1 parent 5588218 commit 8300321

34 files changed

+48
-1830
lines changed

app/client/src/Container.tsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { Pages } from './types';
1010
import { QueryClient, QueryClientProvider } from 'react-query';
1111
import React, { useMemo } from 'react';
1212
import { GithubOutlined, MailOutlined } from '@ant-design/icons';
13-
import { Upgrade } from '@mui/icons-material';
14-
import UpgradeButton from './pages/Home/UpgradeButton';
1513

1614
const { Text } = Typography;
1715
const { Header, Content } = Layout;
@@ -40,7 +38,7 @@ const BrandingTitle = styled(Typography)`
4038
line-height: 0.75;
4139
letter-spacing: normal;
4240
text-align: left;
43-
color: rgba(255, 255, 255, 0.65);
41+
color: #fff;
4442
`
4543
const BrandingTextContainer = styled(Flex)`
4644
padding-top: 5px;
@@ -88,12 +86,7 @@ const pages: MenuItem[] = [
8886
<Button type="link" icon={<MailOutlined />}>
8987
<Text copyable={{ text: '[email protected]' }} style={{ color: '#1677ff' }}>[email protected]</Text>
9088
</Button>
91-
<div style={{ margin: 'auto' }}>
92-
<a type="link" target="_blank" rel="noopener noreferrer" href="https://github.com/cloudera/CAI_AMP_Synthetic_Data_Studio/discussions">
93-
<GithubOutlined />
94-
<span style={{ marginLeft: '4px' }}>Join the discussion on GitHub</span>
95-
</a>
96-
</div>
89+
<Button type="link" icon={<GithubOutlined target = "_blank" />} href="https://github.com/cloudera/CAI_AMP_Synthetic_Data_Studio/discussions">Join the discussion on GitHub</Button>
9790
</Flex>
9891
<br/>
9992
</div>
@@ -103,17 +96,10 @@ const pages: MenuItem[] = [
10396
<span style={{ color: 'rgba(255, 255, 255, 0.65)'}}>{LABELS[Pages.FEEDBACK]}</span>
10497
</Button>
10598
</Popover>
106-
)
107-
},
108-
{
109-
key: Pages.UPGRADE,
110-
label: (
111-
<UpgradeButton />
112-
)
99+
),
113100
}
114101
]
115102

116-
117103
const NotificationContext = React.createContext({messagePlacement: 'topRight'});
118104

119105
const Container = () => {
@@ -142,6 +128,7 @@ const Container = () => {
142128
disabledOverflow={true}
143129
items={pages}
144130
mode="horizontal"
131+
// onClick={handleMenuClick}
145132
selectable={false}
146133
selectedKeys={[location.pathname]}
147134
theme="dark"

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ const Parameters = () => {
8484
form.setFieldsValue({ model_parameters: { [field]: value }});
8585
};
8686

87-
// if (loadingDefaultParams) {
88-
// return <Spin/>
89-
// }
90-
87+
if (loadingDefaultParams) {
88+
return <Spin/>
89+
}
9190
return (
9291
<>
9392
<Divider />

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { Usecases, WorkflowType } from './types';
1414
import { useWizardCtx } from './utils';
1515
import { useDatasetSize, useGetPromptByUseCase } from './hooks';
1616
import CustomPromptButton from './CustomPromptButton';
17-
import get from 'lodash/get';
1817

1918
const { Title } = Typography;
2019

@@ -82,24 +81,14 @@ const Prompt = () => {
8281
// Page Bootstrap requests and useEffect
8382
const { data: defaultTopics, loading: topicsLoading } = usefetchTopics(useCase);
8483
const { data: defaultSchema, loading: schemaLoading } = useFetchDefaultSchema();
85-
const { data: dataset_size, isLoading: datasetSizeLoadin, isError, error } = useDatasetSize(
84+
const { data: dataset_size, isLoading: datasetSizeLoading } = useDatasetSize(
8685
workflow_type,
8786
doc_paths,
8887
input_key,
8988
input_value,
9089
output_key
9190
);
9291

93-
useEffect(() => {
94-
if (isError) {
95-
notification.error({
96-
message: 'Error fetching the dataset size',
97-
description: get(error, 'error'),
98-
});
99-
}
100-
101-
}, [error, isError]);
102-
10392
useEffect(() => {
10493
if (defaultTopics) {
10594
// customTopics is a client-side only fieldValue that persists custom topics added
Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModelProviders, ModelProvidersDropdownOpts } from './types';
1+
import { ModelProviders } from './types';
22

33
export const MODEL_PROVIDER_LABELS = {
44
[ModelProviders.BEDROCK]: 'AWS Bedrock',
@@ -8,35 +8,4 @@ export const MODEL_PROVIDER_LABELS = {
88
export const MIN_SEED_INSTRUCTIONS = 1
99
export const MAX_SEED_INSTRUCTIONS = 500;
1010
export const MAX_NUM_QUESTION = 100;
11-
export const DEMO_MODE_THRESHOLD = 25;
12-
13-
14-
export const USECASE_OPTIONS = [
15-
{ label: 'Code Generation', value: 'code_generation' },
16-
{ label: 'Text to SQL', value: 'text2sql' },
17-
{ label: 'Custom', value: 'custom' }
18-
];
19-
20-
export const WORKFLOW_OPTIONS = [
21-
{ label: 'Supervised Fine-Tuning', value: 'sft' },
22-
{ label: 'Custom Data Generation', value: 'custom' }
23-
];
24-
25-
export const MODEL_TYPE_OPTIONS: ModelProvidersDropdownOpts = [
26-
{ label: MODEL_PROVIDER_LABELS[ModelProviders.BEDROCK], value: ModelProviders.BEDROCK},
27-
{ label: MODEL_PROVIDER_LABELS[ModelProviders.CAII], value: ModelProviders.CAII },
28-
];
29-
30-
31-
export const getModelProvider = (provider: ModelProviders) => {
32-
return MODEL_PROVIDER_LABELS[provider];
33-
};
34-
35-
export const getWorkflowType = (value: string) => {
36-
return WORKFLOW_OPTIONS.find((option) => option.value === value)?.label;
37-
};
38-
39-
export const getUsecaseType = (value: string) => {
40-
return USECASE_OPTIONS.find((option) => option.value === value)?.label;
41-
};
42-
11+
export const DEMO_MODE_THRESHOLD = 25

app/client/src/pages/DataGenerator/hooks.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ export const useGetProjectFiles = (paths: string[]) => {
166166
},
167167
body: JSON.stringify(params),
168168
});
169-
if (resp.status !== 200) {
170-
const body_error = await resp.json();
171-
throw new Error('Error fetching dataset size' + get(body_error, 'error'));
172-
}
173169
const body = await resp.json();
174170
return get(body, 'dataset_size');
175171
}
@@ -201,7 +197,6 @@ export const useDatasetSize = (
201197
},
202198
);
203199

204-
console.log('--------------error', error);
205200
if (isError) {
206201
console.log('data', error);
207202
notification.error({

app/client/src/pages/DatasetDetails/ConfigurationTab.tsx

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)