Skip to content

Search: link to main project in subproject results #7880

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

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jan 28, 2021

I'm checking for urls stating with /projects/ only, since we don't want to go back to link to the full URL again...

Closes #7487

@stsewd stsewd requested a review from ericholscher January 28, 2021 19:34
@ramirezfranciscof
Copy link

@stsewd @ericholscher Hey, thanks for taking care of this. Would you have an estimate on when you would be able to merge and deploy this?

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This seems like a good fix for now, sorry for the delay here 👍

@@ -70,6 +70,11 @@ function attach_elastic_search_query_sphinx(data) {
}

var link = result.path + "?highlight=" + $.urlencode(query);
// If we aren't on the main domain of the subproject, link to it.
// TODO: we should always redirect to the main domain instead.
if (result.path.startsWith('/projects/') && !window.location.href.startsWith(result.domain)) {
Copy link
Member

Choose a reason for hiding this comment

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

I think on .com we allow users to customize this path, so we probably need something smarter here in the future, but this should work for 99% of users for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, I think redirecting to the main project should fix all this, but that's a bigger change in proxito

@stsewd stsewd merged commit a72b662 into master Feb 22, 2021
@stsewd stsewd deleted the link-to-main-project branch February 22, 2021 17:15
@stsewd
Copy link
Member Author

stsewd commented Feb 22, 2021

@ramirezfranciscof this should be live by tomorrow afternoon

@ltalirz
Copy link

ltalirz commented Feb 24, 2021

Thanks a lot, guys! I confirm that this has fixed the issue for us.

@ramirezfranciscof
Copy link

Indeed, all works great now, thanks!

stsewd added a commit that referenced this pull request May 17, 2021
Closes #7881
We can revert #7880
after releasing this.
stsewd added a commit that referenced this pull request May 19, 2021
Closes #7881
We can revert #7880
after releasing this.
stsewd added a commit that referenced this pull request May 25, 2021
Revert #7880
since we now always redirect to the subproject domain.
stsewd added a commit that referenced this pull request Jun 15, 2021
Revert #7880
since we now always redirect to the subproject domain.
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.

subprojects: Search returns broken links when used from subproject subdomain
4 participants