diff client/src/store/imports.js @ 1791:0f98ef2531a5

importschedule: frontend for waterway gauges etd
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 14 Jan 2019 12:09:34 +0100
parents 4a7aa3f57efe
children f1ac917ec4a0
line wrap: on
line diff
--- a/client/src/store/imports.js	Mon Jan 14 11:09:10 2019 +0100
+++ b/client/src/store/imports.js	Mon Jan 14 12:09:34 2019 +0100
@@ -29,7 +29,8 @@
   GAUGEMEASUREMENT: "gaugemeasurement",
   FAIRWAYAVAILABILITY: "fairwayavailability",
   WATERWAYAREA: "waterwayarea",
-  FAIRWAYDIMENSIONS: "fd"
+  FAIRWAYDIMENSIONS: "fd",
+  WATERWAYGAUGES: "wg"
 };
 
 const SCHEDULES = {
@@ -43,7 +44,8 @@
   gaugemeasurement: "gm",
   waterwayaxis: "wx",
   waterwayarea: "wa",
-  fairwaydimensions: "fd"
+  fairwaydimensions: "fd",
+  waterwaygauges: "wg"
 };
 
 const KINDIMPORTTYPE = {
@@ -52,7 +54,8 @@
   gm: "gaugemeasurement",
   wx: "waterwayaxis",
   wa: "waterwayarea",
-  fd: "fairwaydimensions"
+  fd: "fairwaydimensions",
+  wg: "waterwaygauges"
 };
 
 const initializeCurrentSchedule = () => {
@@ -65,7 +68,7 @@
     eMailNotification: false,
     scheduled: false,
     easyCron: true,
-    cronString: null,
+    cronString: "* * * * ",
     cronMode: "",
     minutes: null,
     month: null,
@@ -75,8 +78,11 @@
     simple: null,
     url: null,
     insecure: false,
+    triggerActive: true,
     featureType: null,
-    sortBy: null
+    sortBy: null,
+    username: "",
+    password: ""
   };
 };
 
@@ -151,7 +157,7 @@
         Vue.set(state.currentSchedule, "url", url);
       }
       if (attributes) {
-        let { insecure } = attributes;
+        let { insecure, username, password } = attributes;
         let sortBy = attributes["sort-by"];
         const featureType = attributes["feature-type"];
         insecure = insecure == "true";
@@ -164,6 +170,12 @@
         if (sortBy) {
           Vue.set(state.currentSchedule, "sortBy", sortBy);
         }
+        if (username) {
+          Vue.set(state.currentSchedule, "username", username);
+        }
+        if (password) {
+          Vue.set(state.currentSchedule, "password", password);
+        }
       }
     }
   },
@@ -288,4 +300,11 @@
   }
 };
 
-export { imports, STATES, SCHEDULES, IMPORTTYPES, IMPORTTYPEKIND };
+export {
+  imports,
+  STATES,
+  SCHEDULES,
+  IMPORTTYPES,
+  IMPORTTYPEKIND,
+  initializeCurrentSchedule
+};