diff --git a/client/src/app/pages/applications/components/application-form/application-form.tsx b/client/src/app/pages/applications/components/application-form/application-form.tsx index e3568cf6eb..ab3a5cb7c3 100644 --- a/client/src/app/pages/applications/components/application-form/application-form.tsx +++ b/client/src/app/pages/applications/components/application-form/application-form.tsx @@ -113,7 +113,12 @@ export const useApplicationFormHook = ({ application: Application | null, fieldName: string ) => { - const fieldList = application?.binary?.split(":") || []; + const binaryString = application?.binary?.startsWith("mvn://") + ? application.binary.substring(6) + : application?.binary; + + const fieldList = binaryString?.split(":") || []; + switch (fieldName) { case "group": return fieldList[0] || ""; @@ -258,6 +263,13 @@ export const useApplicationFormHook = ({ }); const onValidSubmit = (formValues: FormValues) => { + let binaryValue = formValues.packaging + ? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}` + : `${formValues.group}:${formValues.artifact}:${formValues.version}`; + if (!binaryValue.startsWith("mvn://")) { + binaryValue = `mvn://${binaryValue}`; + } + const payload: New = { name: formValues.name.trim(), description: formValues.description.trim(), @@ -282,10 +294,7 @@ export const useApplicationFormHook = ({ path: formValues.rootPath.trim(), } : undefined, - - binary: formValues.packaging - ? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}` - : `${formValues.group}:${formValues.artifact}:${formValues.version}`, + binary: binaryValue, // Values not editable on the form but still need to be passed through identities: application?.identities ?? undefined,