You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/07/04 16:13:56 UTC

[incubator-streampipes] branch dev updated: [STREAMPIPES-554] Only reload data-explorer widget if configuration is changed

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 9162ffe67 [STREAMPIPES-554] Only reload data-explorer widget if configuration is changed
     new 3c5b3914d Merge pull request #97 from patrickraoulphilipp/dev
9162ffe67 is described below

commit 9162ffe6751db430090c33445d2736b5001bad79
Author: Patrick Philipp <ph...@fzi.de>
AuthorDate: Mon Jul 4 10:17:08 2022 +0200

    [STREAMPIPES-554] Only reload data-explorer widget if configuration is changed
---
 .../data-explorer-dashboard-panel.component.ts     | 36 +++++++++++++---------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
index 05c223bed..01de8c37e 100644
--- a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
+++ b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
@@ -98,22 +98,28 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
   ) { }
 
   public ngOnInit() {
-    combineLatest([this.route.params, this.route.queryParams, this.authService.user$]).subscribe(
-      ([params, qp, user]) => {
-        this.hasDataExplorerWritePrivileges = this.authService.hasRole(
-          UserPrivilege.PRIVILEGE_WRITE_DATA_EXPLORER_VIEW
-        );
-        this.hasDataExplorerDeletePrivileges = this.authService.hasRole(
-          UserPrivilege.PRIVILEGE_DELETE_DATA_EXPLORER_VIEW
-        );
-        if (qp.action === 'edit' && this.hasDataExplorerWritePrivileges) {
-          this.editMode = true;
-        }
-        const startTime = params.startTime;
-        const endTime = params.endTime;
-        this.getDashboard(params.id, startTime, endTime);
+
+
+    const params = this.route.snapshot.params;
+    const queryParams = this.route.snapshot.queryParams;
+
+    const startTime = params.startTime;
+    const endTime = params.endTime;
+  
+    this.getDashboard(params.id, startTime, endTime);
+
+
+    this.authService.user$.subscribe(user => {
+      this.hasDataExplorerWritePrivileges = this.authService.hasRole(
+        UserPrivilege.PRIVILEGE_WRITE_DATA_EXPLORER_VIEW
+      );
+      this.hasDataExplorerDeletePrivileges = this.authService.hasRole(
+        UserPrivilege.PRIVILEGE_DELETE_DATA_EXPLORER_VIEW
+      );
+      if (queryParams.action === 'edit' && this.hasDataExplorerWritePrivileges) {
+        this.editMode = true;
       }
-    );
+    });
   }
 
   triggerResize() {