fix: Application page "permission denied" when navigating between applications in different namespaces #17800
+3
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a proposed bugfix for a navigation bug which happens when navigating through the application-searchbar on top of the application-details page. When navigating to an application that is in another namespace on the kubernetes cluster, it will use the wrong url (
/applications/xxxx
instead of/applications/namespace/xxxx
). With the fix to the ApplicationsDetailsAppDropdown, it navigates to the correct browser URL. Although the URL is correct it only loads the page after physically refreshing due to the next observation I came across.In addition to the browser URLs being incorrectly constructed, I found that when navigating, the ApplicationDetails constructor does NOT run before the render function starts building the ObservableQuery. This means it keeps using the
this.appNamespace
from the previous page (it is not getting updated) to retrieve the application data. I'm very new to React so I have not been able to find out why. A workaround for this was to use thethis.props.match.params.name
directly instead of relying on the constructor to update thethis.appNamespace
. There must be a nicer way to do this? Any suggestions are welcome!Checklist:
Fixes #17781