Frontend: Add hostdetails BackLink fallback path (#9262)

# Addresses #9141 

# Fixes
- 'Back to all hosts' link on Host Details page was navigating
incorrectly when the user had previously navigated directly with the
browser URL. This prevents this bug by adding a fallback path for that
BackLink to the default Manage Hosts path.

https://www.loom.com/share/579501365f514ac488f86eacadb2fd07

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA for all new/changed functionality

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling 2023-01-16 12:10:01 -08:00 committed by GitHub
parent 3bdbce10c6
commit 7ed9334ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,3 @@
- Made the 'Back to all hosts' link on the host details page fall back to the default path to the
manage hosts page. This addresses a bug in this functionality when the user navigates directly
with the URL

View File

@ -627,7 +627,10 @@ const HostDetailsPage = ({
<MainContent className={baseClass}>
<div className={`${baseClass}__wrapper`}>
<div className={`${baseClass}__header-links`}>
<BackLink text="Back to all hosts" path={filteredHostsPath} />
<BackLink
text="Back to all hosts"
path={filteredHostsPath || PATHS.MANAGE_HOSTS}
/>
</div>
<HostSummaryCard
statusClassName={statusClassName}