Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import { NavItemLinkConfig, NavViewStyle } from '../navigation.config';
`
})
export class NavItemComponent {
private static readonly QUERY_PARAM_HANDLING_STRATEGY = 'merge';
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we considered fixing nav service rather than the particular call? Do we know of use cases in nav service where we'd not want this behavior? seems like a bug to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Specifically I'm referring to changing

        queryParams: params?.queryParams ?? this.buildQueryParam(),
        queryParamsHandling: params?.queryParamsHandling,

to something like

        queryParams: {...this.buildQueryParam(), ...(params?.queryParams ?? {})
        queryParamsHandling: params?.queryParamsHandling,

The idea being that assuming we're doing in app navigation, we never want to remove the global query params that are preserved by the buildQueryParam() call.

Copy link
Contributor

Choose a reason for hiding this comment

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

The more that I think about it, I think the current PR would have more issues. Take the scenario where you navigate away from a page that has its own query params - e.g. explorer or anything with tables or filters. Merging query params would send all of explorer's query params to the new page.


@Input()
public config!: NavItemLinkConfig;

Expand All @@ -68,6 +70,7 @@ export class NavItemComponent {
if (this.config.pageLevelTimeRangeIsEnabled && this.config.timeRangeResolver) {
return {
...navParams,
queryParamsHandling: NavItemComponent.QUERY_PARAM_HANDLING_STRATEGY,
queryParams: this.timeRangeService.toQueryParams(this.config.timeRangeResolver(), true)
};
}
Expand Down