Skip to content

Commit

Permalink
🐛 Application form handle manual tags w/o source attribute (#1446)
Browse files Browse the repository at this point in the history
Follow up: #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 <sdickers@redhat.com>
Co-authored-by: Ian Bolton <ibolton@redhat.com>
  • Loading branch information
sjd78 and ibolton336 authored Oct 9, 2023
1 parent a372862 commit 15b5c84
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 15b5c84

Please sign in to comment.