diff --git a/frontend/src/components/layouts/model-creation-layout.tsx b/frontend/src/components/layouts/model-creation-layout.tsx index b04fb84e..c70a8f60 100644 --- a/frontend/src/components/layouts/model-creation-layout.tsx +++ b/frontend/src/components/layouts/model-creation-layout.tsx @@ -26,43 +26,43 @@ const pages: { icon: React.ElementType; path: string; }[] = [ - { - id: 1, - title: MODEL_CREATION_CONTENT.progressStepper.modelDetails, - icon: TagsIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL, - }, - { - id: 2, - title: MODEL_CREATION_CONTENT.progressStepper.trainingDataset, - icon: DatabaseIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_DATASET, - }, - { - id: 3, - title: MODEL_CREATION_CONTENT.progressStepper.trainingArea, - icon: SquareShadowIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_AREA, - }, - { - id: 4, - title: MODEL_CREATION_CONTENT.progressStepper.trainingSettings, - icon: SettingsIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_SETTINGS, - }, - { - id: 5, - title: MODEL_CREATION_CONTENT.progressStepper.submitModel, - icon: CloudIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL_SUMMARY, - }, - { - id: 6, - title: MODEL_CREATION_CONTENT.progressStepper.confirmation, - icon: StarIcon, - path: APPLICATION_ROUTES.CREATE_NEW_MODEL_CONFIRMATION, - }, - ]; + { + id: 1, + title: MODEL_CREATION_CONTENT.progressStepper.modelDetails, + icon: TagsIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL, + }, + { + id: 2, + title: MODEL_CREATION_CONTENT.progressStepper.trainingDataset, + icon: DatabaseIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_DATASET, + }, + { + id: 3, + title: MODEL_CREATION_CONTENT.progressStepper.trainingArea, + icon: SquareShadowIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_AREA, + }, + { + id: 4, + title: MODEL_CREATION_CONTENT.progressStepper.trainingSettings, + icon: SettingsIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL_TRAINING_SETTINGS, + }, + { + id: 5, + title: MODEL_CREATION_CONTENT.progressStepper.submitModel, + icon: CloudIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL_SUMMARY, + }, + { + id: 6, + title: MODEL_CREATION_CONTENT.progressStepper.confirmation, + icon: StarIcon, + path: APPLICATION_ROUTES.CREATE_NEW_MODEL_CONFIRMATION, + }, +]; const ModelCreationLayout = () => { const { pathname } = useLocation(); diff --git a/frontend/src/features/model-creation/api/update-models.ts b/frontend/src/features/model-creation/api/update-models.ts new file mode 100644 index 00000000..43417ef6 --- /dev/null +++ b/frontend/src/features/model-creation/api/update-models.ts @@ -0,0 +1,21 @@ +import { API_ENDPOINTS, apiClient } from "@/services"; +import { TModel } from "@/types"; + +export type TUpdateModelArgs = { + description: string; + name: string; + modelId: string; +}; + +export const updateModel = async ({ + name, + description, + modelId, +}: TUpdateModelArgs): Promise => { + return await ( + await apiClient.patch(`${API_ENDPOINTS.UPDATE_MODEL(modelId)}`, { + name, + description, + }) + ).data; +}; diff --git a/frontend/src/features/model-creation/components/creation-success-confirmation.tsx b/frontend/src/features/model-creation/components/creation-success-confirmation.tsx index 509ce7f8..0eea6097 100644 --- a/frontend/src/features/model-creation/components/creation-success-confirmation.tsx +++ b/frontend/src/features/model-creation/components/creation-success-confirmation.tsx @@ -30,10 +30,17 @@ const ModelCreationSuccessConfirmation = () => { title={MODEL_CREATION_CONTENT.confirmation.buttons.goToModel} nativeAnchor={false} > - + - - + + diff --git a/frontend/src/features/model-creation/components/dialogs/file-upload-dialog.tsx b/frontend/src/features/model-creation/components/dialogs/file-upload-dialog.tsx index 2f487e1e..3cd9bda6 100644 --- a/frontend/src/features/model-creation/components/dialogs/file-upload-dialog.tsx +++ b/frontend/src/features/model-creation/components/dialogs/file-upload-dialog.tsx @@ -190,8 +190,18 @@ const FileUploadDialog: React.FC = ({

Drop the files here ...

) : ( <> -

{MODEL_CREATION_CONTENT.trainingArea.fileUploadDialog.mainInstruction}

- {MODEL_CREATION_CONTENT.trainingArea.fileUploadDialog.subInstruction} +

+ { + MODEL_CREATION_CONTENT.trainingArea.fileUploadDialog + .mainInstruction + } +

+ + { + MODEL_CREATION_CONTENT.trainingArea.fileUploadDialog + .subInstruction + } + )} diff --git a/frontend/src/features/model-creation/components/index.ts b/frontend/src/features/model-creation/components/index.ts index e1e87a2d..3c397149 100644 --- a/frontend/src/features/model-creation/components/index.ts +++ b/frontend/src/features/model-creation/components/index.ts @@ -1,6 +1,6 @@ export { default as ProgressBar } from "./progress-bar"; export { default as StepHeading } from "./step-heading"; -export { default as ModelDetailsForm } from "./model-details"; +export { default as ModelDetailsForm } from "./model-details/model-details"; export { default as TrainingDatasetForm } from "./training-dataset/training-dataset"; export { default as TrainingAreaForm } from "./training-area/training-area"; export { default as TrainingSettingsStep } from "./training-settings/training-settings"; diff --git a/frontend/src/features/model-creation/components/model-details.tsx b/frontend/src/features/model-creation/components/model-details.tsx deleted file mode 100644 index bf150b75..00000000 --- a/frontend/src/features/model-creation/components/model-details.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { - FORM_VALIDATION_CONFIG, - MODEL_CREATION_FORM_NAME, - useModelFormContext, -} from "@/app/providers/model-creation-provider"; -import { Input, Select, TextArea } from "@/components/ui/form"; -import { BASE_MODELS } from "@/enums"; -import { StepHeading } from "@/features/model-creation/components/"; -import { MODEL_CREATION_CONTENT } from "@/utils"; - -const baseModelOptions = [ - { - name: BASE_MODELS.RAMP, - value: "RAMP", - }, - { - name: BASE_MODELS.YOLOV8_V1, - value: "YOLO_V8_V1", - }, - { - name: BASE_MODELS.YOLOV8_V2, - value: "YOLO_V8_V2", - }, -]; - -const ModelDetailsForm = () => { - const { formData, handleChange } = useModelFormContext(); - return ( -
- -
- - handleChange(MODEL_CREATION_FORM_NAME.MODEL_NAME, e.target.value) - } - value={formData.modelName} - toolTipContent={ - MODEL_CREATION_CONTENT.modelDetails.form.modelName.toolTip - } - label={MODEL_CREATION_CONTENT.modelDetails.form.modelName.label} - labelWithTooltip - placeholder={ - MODEL_CREATION_CONTENT.modelDetails.form.modelName.placeholder - } - showBorder - helpText={MODEL_CREATION_CONTENT.modelDetails.form.modelName.helpText} - required - maxLength={ - FORM_VALIDATION_CONFIG[MODEL_CREATION_FORM_NAME.MODEL_NAME] - .maxLength - } - minLength={ - FORM_VALIDATION_CONFIG[MODEL_CREATION_FORM_NAME.MODEL_NAME] - .minLength - } - /> -