You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2025/08/26 07:57:16 UTC
(streampipes) 01/01: fix: Add time settings to query parameters in data explorer
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch add-data-view-time-to-query-params
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 82bca7c0f28060d954cca2951738ea5ce679290d
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Aug 26 09:56:50 2025 +0200
fix: Add time settings to query parameters in data explorer
---
.../chart-view/data-explorer-chart-view.component.ts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/ui/src/app/data-explorer/components/chart-view/data-explorer-chart-view.component.ts b/ui/src/app/data-explorer/components/chart-view/data-explorer-chart-view.component.ts
index 0e9c817d9d..62028c22ef 100644
--- a/ui/src/app/data-explorer/components/chart-view/data-explorer-chart-view.component.ts
+++ b/ui/src/app/data-explorer/components/chart-view/data-explorer-chart-view.component.ts
@@ -32,6 +32,7 @@ import {
import {
ActivatedRoute,
ActivatedRouteSnapshot,
+ Router,
RouterStateSnapshot,
} from '@angular/router';
import {
@@ -73,6 +74,7 @@ export class DataExplorerChartViewComponent
private dataExplorerSharedService = inject(DataExplorerSharedService);
private detectChangesService = inject(DataExplorerDetectChangesService);
private route = inject(ActivatedRoute);
+ private router = inject(Router);
private dialog = inject(MatDialog);
private routingService = inject(DataExplorerRoutingService);
private dataViewService = inject(ChartService);
@@ -123,6 +125,7 @@ export class DataExplorerChartViewComponent
const height = this.outerPanel.nativeElement.offsetHeight;
this.gridsterItemComponent = { width, height };
this.timeSelectionService.notify(this.timeSettings);
+ this.updateQueryParams(this.timeSettings);
});
}
@@ -230,6 +233,19 @@ export class DataExplorerChartViewComponent
updateDateRange(timeSettings: TimeSettings) {
this.timeSettings = timeSettings;
this.timeSelectionService.notify(timeSettings);
+ this.updateQueryParams(timeSettings);
+ }
+
+ updateQueryParams(timeSettings: TimeSettings) {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ startDate: timeSettings.startTime,
+ endDate: timeSettings.endTime,
+ },
+ queryParamsHandling: 'merge',
+ replaceUrl: true,
+ });
}
downloadDataAsFile() {