Skip to content

Commit

Permalink
Application form handle manual tags w/o source attribute
Browse files Browse the repository at this point in the history
Follow up: konveyor#1438

Api changed and if a tag's source is empty, the field is not sent.
Change the tag filtering test to consider `source === undefined` and
`source === ""` as manual tags.

Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 committed Oct 6, 2023
1 parent 73f375f commit a7dca46
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ export const ApplicationForm: React.FC<ApplicationFormProps> = ({
};
});

const manualTags = application?.tags?.filter((t) => t.source === "") ?? [];
const manualTags =
application?.tags?.filter((t) => t?.source ?? "" === "") ?? [];

const nonManualTags = application?.tags?.filter((t) => t.source !== "") ?? [];
const nonManualTags =
application?.tags?.filter((t) => t?.source ?? "" !== "") ?? [];

// Allow all tags to be selected manually, even if they are included from another source
const allowedManualTags = tags;
Expand Down

0 comments on commit a7dca46

Please sign in to comment.