Skip to content
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

fix: minor updates to explorer field accessors #2416

Merged
merged 7 commits into from
Sep 27, 2023
Merged
Changes from 2 commits
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 @@ -11,7 +11,7 @@ import {
import { Filter, FilterAttribute, ToggleItem } from '@hypertrace/components';
import { isEmpty, isNil } from 'lodash-es';
import { concat, EMPTY, Observable, Subject } from 'rxjs';
import { map, take } from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { CartesianSeriesVisualizationType } from '../../shared/components/cartesian/chart';
import {
ExploreOrderBy,
Expand Down Expand Up @@ -156,7 +156,7 @@ export class ExplorerComponent {

public constructor(
private readonly metadataService: MetadataService,
private readonly navigationService: NavigationService,
protected readonly navigationService: NavigationService,
private readonly timeDurationService: TimeDurationService,
private readonly preferenceService: PreferenceService,
@Inject(EXPLORER_DASHBOARD_BUILDER_FACTORY) explorerDashboardBuilderFactory: ExplorerDashboardBuilderFactory,
Expand All @@ -167,10 +167,7 @@ export class ExplorerComponent {
this.resultsExpanded$ = this.preferenceService.get(ExplorerComponent.RESULTS_EXPANDED_PREFERENCE, true);
this.resultsDashboard$ = this.explorerDashboardBuilder.resultsDashboard$;
this.vizDashboard$ = this.explorerDashboardBuilder.visualizationDashboard$;
this.initialState$ = activatedRoute.queryParamMap.pipe(
take(1),
map(paramMap => this.mapToInitialState(paramMap))
);
this.initialState$ = activatedRoute.queryParamMap.pipe(map(paramMap => this.mapToInitialState(paramMap)));
Copy link
Contributor

Choose a reason for hiding this comment

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

have you verified this doesn't lead to any cycles that would need to be handled (applying initial state updates the url, which applies state again)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checked using tap on the observable. There are no cycles as such, only thing is that as initialState$ is subscribed at the outermost div on the template, it re-renders all the components everytime we apply a new query instead of updating just the states.

this.currentContext$ = concat(
this.initialState$.pipe(map(value => value.contextToggle.value.dashboardContext)),
this.contextChangeSubject
Expand Down Expand Up @@ -398,12 +395,15 @@ export const enum ScopeQueryParam {
EndpointTraces = 'endpoint-traces',
Spans = 'spans'
}
const enum ExplorerQueryParam {

export const enum ExplorerQueryParam {
Scope = 'scope',
Interval = 'interval',
Group = 'group',
OtherGroup = 'other',
GroupLimit = 'limit',
Series = 'series',
Order = 'order'
Order = 'order',
// eslint-disable-next-line @typescript-eslint/no-shadow
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does the linter think this is shadowing? If it actually is, please adjust name rather than ignoring linter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to Filters

Filter = 'filter'
}