Skip to content

Commit

Permalink
feat: force dataType to TABULAR (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Tagliabue <[email protected]>
  • Loading branch information
lucataglia and Luca Tagliabue authored Jun 21, 2024
1 parent 1e1df8b commit c9c37ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
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

0 comments on commit c9c37ff

Please sign in to comment.