Skip to content

Commit

Permalink
🐛 Don't use "mvn://::" for an empty binary source in applications (#2015
Browse files Browse the repository at this point in the history
)

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.

Resolves: #2014 
Resolves: https://issues.redhat.com/browse/MTA-3238

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
  • Loading branch information
sjd78 authored Jul 15, 2024
1 parent 8ddf4f1 commit 646d3d6
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ 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 binaryValues = [
formValues.group,
formValues.artifact,
formValues.version,
formValues.packaging,
].filter(Boolean);

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

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

0 comments on commit 646d3d6

Please sign in to comment.