Skip to content

Redirect to Public Catalog for multi-button scenarios#62

Merged
jsavell merged 2 commits intomainfrom
multi-redirect
Dec 3, 2025
Merged

Redirect to Public Catalog for multi-button scenarios#62
jsavell merged 2 commits intomainfrom
multi-redirect

Conversation

@jsavell
Copy link
Member

@jsavell jsavell commented Dec 3, 2025

When using the redirect endpoint and there are multiple GIFM options, redirect to the public catalog so the user can select the appropriate option.

This has been thoroughly tested in pre-production by the Discovery and GIFM teams over the last three months.

@jsavell jsavell merged commit 6a543d5 into main Dec 3, 2025
1 check passed
@jsavell jsavell deleted the multi-redirect branch December 3, 2025 21:58
Copy link
Contributor

@kaladay kaladay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like github No longer allows it to be approved with comments?

Oh...the PR got merged while I was reviewing.

hasCushing = true;
}
//when the user wants Cushing, grab the url of the first button that is for Cushing
if(redirectUrl == null && isCushing && wantsCushing && linkHref != null ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a suggestion.

These if conditon blocks could probably be combined, kind of like this:

                        // When the user wants Cushing, grab the url of the first button that is for Cushing.
                        // When the user doesn't want Cushing, grab the first button that isn't Cushing.
                        if (redirectUrl == null && linkHref != null && (!isCushing && !wantsCushing || isCushing && wantsCushing)) {
                            redirectUrl = buildRedirectUrl(linkHref);
                            break;
                        }

Comment on lines +161 to +166
boolean bibIdIsUUID = true;
try {
bibIdIsUUID = (UUID.fromString(bibId).toString().equals(bibId));
} catch (IllegalArgumentException e) {
bibIdIsUUID = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a suggestion.

The initialization is meaningless here.
Why not just default it to false and then the catch can be empty?

            boolean bibIdIsUUID = false;
            try {
                bibIdIsUUID = (UUID.fromString(bibId).toString().equals(bibId));
            } catch (IllegalArgumentException e) {
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants