-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: adding branch in url for search entities #36938
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,9 +138,23 @@ function EntitySearchBar(props: any) { | |
| const defaultPage = searchedApplication?.pages.find( | ||
| (page: PageDefaultMeta) => page.isDefault === true, | ||
| ); | ||
| const viewURL = viewerURL({ | ||
| basePageId: defaultPage.baseId, | ||
| }); | ||
|
|
||
| const isGitEnabled = searchedApplication?.gitApplicationMetadata; | ||
| let viewURL = null; | ||
|
|
||
| if (isGitEnabled) { | ||
| const defaultBranch = | ||
| searchedApplication?.gitApplicationMetadata?.defaultBranchName; | ||
|
|
||
| viewURL = viewerURL({ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brayn003 Out of curiosity, shouldn't the routeBuilder have taken care of this routing? This way, we would have been sure that all instances of this route builder are routing accurately and are taking the Git default branch into account. Can you help me understand why that is either not possible, or complicated? |
||
| basePageId: defaultPage.baseId, | ||
| branch: defaultBranch, | ||
| }); | ||
| } else { | ||
| viewURL = viewerURL({ | ||
| basePageId: defaultPage.baseId, | ||
| }); | ||
| } | ||
|
brayn003 marked this conversation as resolved.
|
||
|
|
||
| window.location.href = `${viewURL}`; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.