[
https://issues.apache.org/jira/browse/AMBARI-26646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Himanshu Maurya updated AMBARI-26646:
-------------------------------------
Description:
h2. Summary
Opening a Host Summary page by clicking a component count on the Hosts List
page (or a service's component-count link, or a stack version's host-count
link) could leave the Host Summary page stuck without its host components
listed, or with a stale/unfiltered view. Root cause: these links used URL-param
routes ({{{}/main/hosts/component/:componentName{}}},
{{{}/main/hosts/version/:versionName/:versionStatus{}}}) that remounted the
Hosts List component on every navigation, discarding in-flight state and racing
the data fetch against the route change. Several related bugs stemmed from the
same remount and stale-closure issues.
h2. Changes
* Replaced the URL-param-based filter routes with a new
{{useHostsFilterNavigation}} hook that sets the Hosts List filter via the
shared filter context and navigates to the plain {{/main/hosts}} route (no
route params, no remount). All component-count and stack-version-count links
across the service summary views and the Stack Versions page now use this hook
instead of building a {{/main/hosts/component/...}} or
{{/main/hosts/version/...}} URL.
* Removed the now-unused {{hosts/component/:componentName}} and
{{hosts/version/:versionName/:versionStatus}} routes.
* Fixed a stale-closure bug in {{{}useHostConfigUpdater{}}}: WebSocket-driven
host/component/decommission updates read host models from a snapshot ref that
could be one render behind, occasionally overwriting fresh data with stale
data. Updates are now applied via functional {{setState}} so they always merge
into the latest committed state.
* Fixed the Host Summary page's loading spinner staying stuck: it was gated on
the cluster-wide component poll (which can lag on a large cluster) instead of
on the host's own loaded data.
* Fixed the Hosts List filter search bar silently wiping filters that were set
by another page: it was echoing its local filter state back into the shared
setter on every render, which could stomp a filter that had just been seeded by
a deep link.
* Fixed the Hosts List query no longer sending an unfiltered request on first
render when filters were already restored from a previous page.
h2. Impact
Component-count and version-count links from service summaries and the Stack
Versions page now reliably open a correctly filtered, fully-populated Hosts
List / Host Summary page, with no stale data or missed component listings
caused by the previous remount-based navigation.
was:
h2. Summary
Aligns Hosts List filter and host-selection behavior with the classic Ember UI:
filters applied on the Hosts List page were lost whenever the user navigated to
a Host Summary page and back, and selected hosts did not survive a page
refresh. Also fixes an incorrect pagination count shown when a filtered result
set is empty.
h2. Changes
* Introduced a new {{HostsListStateProvider}} (shared React context) holding
{{selectedFilters}} and {{selectedHosts}} above the route tree, so this state
survives the component unmount that happens when navigating from the Hosts List
to a Host Summary page and back — filters no longer reset on that round-trip.
* Host selection is now also mirrored into the browser's local storage under
the same key the classic UI uses
({{{}app.tables.selectedItems.mainHostController{}}}), so the selected hosts
checkbox state survives a hard page refresh, matching Ember behavior.
* The Hosts List page now initializes its filter bar and query string directly
from any already-restored filters on mount, instead of starting empty and
briefly issuing an unfiltered request before catching up.
* Deep links into the Hosts List (e.g. from a service's component count, or a
stack version's host count) still seed filters from the URL on first load, but
no longer keep overwriting user-added filters on every subsequent poll refresh.
* Resetting filters via the search bar now also clears the deep-link URL
parameters (component/version), so a URL-seeded filter doesn't immediately
reapply itself after being cleared.
* Fixed the pagination footer showing "1-0 of 0 items" instead of "0-0 of 0
items" when a filter matches no hosts.
h2. Impact
Matches the classic Ember UI's persistence behavior for the Hosts List page,
removing a UX regression where filters silently reset on navigation and host
selections were lost on refresh.
> Ambari Web React: Fix Host Summary page not listing host components when
> opened via the Hosts List page
> -------------------------------------------------------------------------------------------------------
>
> Key: AMBARI-26646
> URL: https://issues.apache.org/jira/browse/AMBARI-26646
> Project: Ambari
> Issue Type: Story
> Reporter: Himanshu Maurya
> Assignee: Himanshu Maurya
> Priority: Major
> Fix For: 3.1.0
>
>
> h2. Summary
> Opening a Host Summary page by clicking a component count on the Hosts List
> page (or a service's component-count link, or a stack version's host-count
> link) could leave the Host Summary page stuck without its host components
> listed, or with a stale/unfiltered view. Root cause: these links used
> URL-param routes ({{{}/main/hosts/component/:componentName{}}},
> {{{}/main/hosts/version/:versionName/:versionStatus{}}}) that remounted the
> Hosts List component on every navigation, discarding in-flight state and
> racing the data fetch against the route change. Several related bugs stemmed
> from the same remount and stale-closure issues.
> h2. Changes
> * Replaced the URL-param-based filter routes with a new
> {{useHostsFilterNavigation}} hook that sets the Hosts List filter via the
> shared filter context and navigates to the plain {{/main/hosts}} route (no
> route params, no remount). All component-count and stack-version-count links
> across the service summary views and the Stack Versions page now use this
> hook instead of building a {{/main/hosts/component/...}} or
> {{/main/hosts/version/...}} URL.
> * Removed the now-unused {{hosts/component/:componentName}} and
> {{hosts/version/:versionName/:versionStatus}} routes.
> * Fixed a stale-closure bug in {{{}useHostConfigUpdater{}}}:
> WebSocket-driven host/component/decommission updates read host models from a
> snapshot ref that could be one render behind, occasionally overwriting fresh
> data with stale data. Updates are now applied via functional {{setState}} so
> they always merge into the latest committed state.
> * Fixed the Host Summary page's loading spinner staying stuck: it was gated
> on the cluster-wide component poll (which can lag on a large cluster) instead
> of on the host's own loaded data.
> * Fixed the Hosts List filter search bar silently wiping filters that were
> set by another page: it was echoing its local filter state back into the
> shared setter on every render, which could stomp a filter that had just been
> seeded by a deep link.
> * Fixed the Hosts List query no longer sending an unfiltered request on
> first render when filters were already restored from a previous page.
> h2. Impact
> Component-count and version-count links from service summaries and the Stack
> Versions page now reliably open a correctly filtered, fully-populated Hosts
> List / Host Summary page, with no stale data or missed component listings
> caused by the previous remount-based navigation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]