diff client/src/store/importschedule.js @ 5388:60bba8e6322b extented-report

Add import for updating stats. Rationale: Due to performance optimization it seems advised to decouple updating the stats for the DQL report from the actual consumption while generating the report. -- Therefore we have a new import kind "statsupdate" which is selectable for sysadmins only. It could be scheduled as any other import. The available names for which stats to update are dynamically queried from the backend.
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 02 Jul 2021 13:56:51 +0200
parents 1695e17c5a83
children 064ac1014713
line wrap: on
line diff
--- a/client/src/store/importschedule.js	Fri Jul 02 00:42:05 2021 +0200
+++ b/client/src/store/importschedule.js	Fri Jul 02 13:56:51 2021 +0200
@@ -32,7 +32,8 @@
   APPROVEDGAUGEMEASUREMENTS: "approvedgaugemeasurements",
   WATERWAYPROFILES: "waterwayprofiles",
   FAIRWAYMARKS: "fairwaymarks",
-  REPORT: "report"
+  REPORT: "report",
+  STATSUPDATE: "statsupdate"
 };
 
 const KINDIMPORTTYPE = {
@@ -46,7 +47,8 @@
   wg: "waterwaygauges",
   dmv: "distancemarksvirtual",
   dma: "distancemarksashore",
-  report: "report"
+  report: "report",
+  statsupdate: "statsupdate"
 };
 
 const IMPORTTYPEKIND = {
@@ -60,7 +62,8 @@
   waterwaygauges: "wg",
   distancemarksvirtual: "dmv",
   distancemarksashore: "dma",
-  report: "report"
+  report: "report",
+  statsupdate: "statsupdate"
 };
 
 const FAIRWAYMARKKINDS = {
@@ -113,7 +116,8 @@
     sourceOrganization: null,
     trys: null,
     waitRetry: null,
-    selectedMark: null
+    selectedMark: null,
+    statsUpdate: null
   };
 };
 
@@ -274,6 +278,10 @@
           sourceOrganization
         );
       }
+      if (kind === IMPORTTYPES.STATSUPDATE) {
+        const { name } = config;
+        Vue.set(state.currentSchedule, "statsUpdate", name);
+      }
     }
   },
   actions: {