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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 87bd428b81 Fix assignment of last modified date for existing 
dashboards (#3574)
87bd428b81 is described below

commit 87bd428b8107d698aaa9085c5c55e220fb5350eb
Author: Dominik Riemer <dominik.rie...@gmail.com>
AuthorDate: Tue Apr 22 17:05:43 2025 +0200

    Fix assignment of last modified date for existing dashboards (#3574)
---
 ui/src/app/dashboard/components/panel/dashboard-panel.component.ts   | 5 +++++
 .../components/chart-view/data-explorer-chart-view.component.ts      | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts 
b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
index ca0bfb05b0..ed0a33d410 100644
--- a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
+++ b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
@@ -157,6 +157,11 @@ export class DashboardPanelComponent
 
     persistDashboardChanges() {
         this.dashboard.dashboardGeneralSettings.defaultViewMode = 
this.viewMode;
+        this.dashboard.metadata ??= {
+            createdAtEpochMs: undefined,
+            lastModifiedEpochMs: undefined,
+        };
+        this.dashboard.metadata.lastModifiedEpochMs = Date.now();
         this.dashboardService
             .updateDashboard(this.dashboard)
             .subscribe(result => {
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 5690b66998..3e27ab7404 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
@@ -156,6 +156,10 @@ export class DataExplorerChartViewComponent
 
     saveDataView(): void {
         this.dataView.timeSettings = this.timeSettings;
+        this.dataView.metadata ??= {
+            lastModifiedEpochMs: undefined,
+            createdAtEpochMs: undefined,
+        };
         this.dataView.metadata.lastModifiedEpochMs = Date.now();
         const observable =
             this.dataView.elementId !== undefined

Reply via email to