Skip to content
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

feat: force dataType to TABULAR #7

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: force dataType to TABULAR
  • Loading branch information
Luca Tagliabue committed Jun 20, 2024
commit bd63d14f2557d2a225d6ec59259bddcab93d5936
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useMemo,
useState,
} from 'react';
import { ModelTypeEnum } from '@Src/store/state/models/constants';
import { DataTypeEnum, ModelTypeEnum } from '@State/models/constants';
import schemaStepFour from './step-four/schema';
import schemaStepOne from './step-one/schema';
import schemaStepThree from './step-three/schema';
Expand All @@ -18,7 +18,7 @@ function ModalContextProvider({ children }) {
const [isMaximize, setIsMaximize] = useState(false);

const useFormbitStepOne = useFormbit({
initialValues: { modelType: ModelTypeEnum.BINARY_CLASSIFICATION },
initialValues: { modelType: ModelTypeEnum.BINARY_CLASSIFICATION, dataType: DataTypeEnum.TABULAR },
yup: schemaStepOne,
});

Expand Down
14 changes: 2 additions & 12 deletions ui/src/components/modals/add-new-model/step-one/form-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ function ModelType() {

function DataType() {
const { useFormbit } = useModalContext();
const { form, error, write } = useFormbit;

const handleOnChange = (value) => {
write('dataType', value);
};
const { error } = useFormbit;

return (
<FormField label="Data type" message={error('dataType')} modifier="w-full" required>
<Select onChange={handleOnChange} value={form.dataType}>
{Object.values(DataTypeEnum).map((value) => (
<Select.Option key={value}>
{DataTypeEnumLabel[value]}
</Select.Option>
))}
</Select>
{DataTypeEnumLabel[DataTypeEnum.TABULAR]}
</FormField>
);
}
Expand Down