Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHM-8309: prepend web app name to the returnUrl #235

Merged
merged 2 commits into from
Feb 4, 2025
Merged

UHM-8309: prepend web app name to the returnUrl #235

merged 2 commits into from
Feb 4, 2025

Conversation

cioan
Copy link
Member

@cioan cioan commented Feb 3, 2025

No description provided.

@@ -55,6 +55,9 @@ class BreadCrumb extends Component {
familyName = patientHeaderDetail.person.personName.familyName;
}
let outputBreadcrumb;
const contextPath = window.location.href.split('/')[3];
const url = localStorage.getItem('returnUrl');
const returnUrl = `/${contextPath}/${url}`;
Copy link
Member

Choose a reason for hiding this comment

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

We may not care if this is not widely used, but generally I've seen code try to make this a bit more resilient to different configurations, specifically I would only add a "/" between the context path and the url if the url does not start with a "/".

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @mseaton ! I will remove the potentially extra "/".

Just FYI, besides the aesthetic aspect of the URL, the extra "/" are harmless, the browser ignores them, the following two URLs produce the same result with no errors or warnings:

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

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

Looks good to me assuming it works. See my comment / suggestion.

@cioan cioan requested a review from mogoodrich February 3, 2025 21:52
@cioan cioan merged commit 50956de into master Feb 4, 2025
1 check failed
@cioan cioan deleted the UHM-8309 branch February 4, 2025 20:37
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.

2 participants