Skip to content

Commit 731c763

Browse files
committed
🐛 Don't use "mvn://::" for an empty binary source in applications
When creating an application, if the "Binary (Java)" source is not specified, we want to store an empty string as the `binary` value and not `"mvn://::`. This also applied to editing an existing application. Signed-off-by: Scott J Dickerson <[email protected]>
1 parent 8ddf4f1 commit 731c763

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

client/src/app/pages/applications/components/application-form/application-form.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ export const useApplicationFormHook = ({
263263
});
264264

265265
const onValidSubmit = (formValues: FormValues) => {
266-
let binaryValue = formValues.packaging
267-
? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}`
268-
: `${formValues.group}:${formValues.artifact}:${formValues.version}`;
269-
if (!binaryValue.startsWith("mvn://")) {
270-
binaryValue = `mvn://${binaryValue}`;
271-
}
266+
const binaryValues = [
267+
formValues.group,
268+
formValues.artifact,
269+
formValues.version,
270+
formValues.packaging,
271+
].filter(Boolean);
272272

273273
const payload: New<Application> = {
274274
name: formValues.name.trim(),
@@ -294,7 +294,8 @@ export const useApplicationFormHook = ({
294294
path: formValues.rootPath.trim(),
295295
}
296296
: undefined,
297-
binary: binaryValue,
297+
binary:
298+
binaryValues.length > 0 ? `mvn://${binaryValues.join(":")}` : undefined,
298299

299300
// Values not editable on the form but still need to be passed through
300301
identities: application?.identities ?? undefined,

0 commit comments

Comments
 (0)