changeset 2978:d6dd158b8071 unified_import

unified_import: reorganizing files
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 09 Apr 2019 13:42:44 +0200
parents ab26fb7a76f6
children 8f266dc8b4e3
files client/src/components/importconfiguration/ImportApprovedGaugeMeasurement.vue client/src/components/importconfiguration/ImportDetails.vue client/src/components/importconfiguration/ImportSoundingresults.vue client/src/components/importconfiguration/ImportWaterwayProfiles.vue client/src/components/importconfiguration/types/ApprovedGaugeMeasurement.vue client/src/components/importconfiguration/types/Soundingresults.vue client/src/components/importconfiguration/types/WaterwayProfiles.vue
diffstat 7 files changed, 657 insertions(+), 657 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/ImportApprovedGaugeMeasurement.vue	Tue Apr 09 12:38:23 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-<template>
-  <div>
-    <div class="d-flex flex-column text-left w-25">
-      <label class="text-nowrap" for="originator">
-        <small class="text-muted"
-          >{{ $options.ORIGINATOR }} / {{ $options.FROM }}</small
-        >
-      </label>
-      <input
-        type="text"
-        v-model="originator"
-        class="form-control"
-        id="originator"
-      />
-      <span class="text-left text-danger">
-        <small v-if="!originator">
-          <translate>Please enter an originator</translate>
-        </small>
-      </span>
-    </div>
-    <div class="mt-4 flex-column w-100">
-      <div class="custom-file">
-        <input
-          accept=".csv"
-          type="file"
-          @change="fileSelected"
-          class="custom-file-input"
-          id="uploadFile"
-        />
-        <label class="pointer custom-file-label" for="uploadFile">
-          {{ uploadLabel }}
-        </label>
-      </div>
-    </div>
-    <div class="d-flex flex-row-reverse w-100 mt-3">
-      <button :key="1" @click="back()" class="btn btn-warning">
-        Back
-      </button>
-      <button
-        :key="2"
-        type="submit"
-        @click="submit"
-        class="shadow-sm btn btn-info submit-button  mr-3"
-      >
-        <translate>Submit</translate>
-      </button>
-    </div>
-  </div>
-</template>
-
-<script>
-/* This is Free Software under GNU Affero General Public License v >= 3.0
- * without warranty, see README.md and license for details.
- *
- * SPDX-License-Identifier: AGPL-3.0-or-later
- * License-Filename: LICENSES/AGPL-3.0.txt
- *
- * Copyright (C) 2018 by via donau
- *   – Österreichische Wasserstraßen-Gesellschaft mbH
- * Software engineering by Intevation GmbH
- *
- * Author(s):
- * Thomas Junk <thomas.junk@intevation.de>
- */
-
-import { HTTP } from "@/lib/http";
-import { displayError, displayInfo } from "@/lib/errors.js";
-import app from "@/main";
-
-export default {
-  name: "importapprovedgaugemeasurements",
-  data() {
-    return {
-      disableUploadButton: false,
-      uploadLabel: this.$gettext("choose file to upload"),
-      uploadFile: null,
-      originator: "viadonau"
-    };
-  },
-  computed: {
-    importGaugmeasurmentLabel() {
-      return this.$gettext("Import approved gaugemeasurements");
-    }
-  },
-  methods: {
-    back() {
-      this.uploadLabel = this.$gettext("choose file to upload");
-      this.uploadFile = null;
-      this.originator = "viadonau";
-      this.$store.commit("importschedule/setListMode");
-    },
-    fileSelected(e) {
-      const files = e.target.files || e.dataTransfer.files;
-      if (!files) return;
-      this.uploadLabel = files[0].name;
-      this.uploadFile = files[0];
-    },
-    submit() {
-      if (!this.originator || !this.uploadFile) return;
-      let formData = new FormData();
-      formData.append("agm", this.uploadFile);
-      formData.append("originator", this.originator);
-      HTTP.post("/imports/agm", formData, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token"),
-          "Content-Type": "multipart/form-data"
-        }
-      })
-        .then(() => {
-          displayInfo({
-            title: this.$gettext("Import"),
-            message: this.$gettext(
-              "Starting import of Approved Gauge Measurements"
-            )
-          });
-          this.back();
-        })
-        .catch(error => {
-          const { status, data } = error.response;
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: `${status}: ${data.message || data}`
-          });
-        });
-    }
-  },
-  ORIGINATOR: app.$gettext("originator"),
-  FROM: app.$gettext("from")
-};
-</script>
-
-<style lang="scss" scoped></style>
--- a/client/src/components/importconfiguration/ImportDetails.vue	Tue Apr 09 12:38:23 2019 +0200
+++ b/client/src/components/importconfiguration/ImportDetails.vue	Tue Apr 09 13:42:44 2019 +0200
@@ -1,7 +1,7 @@
 <template>
-  <div class="mt-3 mb-3 mr-3 ml-3">
+  <div class="mt-3 mb-3 mr-3 ml-3 text-left">
     <small class="text-muted">
-      <translate>Please choose an import type</translate>
+      <translate>Import type</translate>
     </small>
     <select v-model="Import" class="custom-select" id="importtype">
       <optgroup :label="regularLabel">
@@ -90,9 +90,9 @@
 export default {
   components: {
     ApprovedGaugeMeasurement: () =>
-      import("./ImportApprovedGaugeMeasurement.vue"),
-    WaterwayProfiles: () => import("./ImportWaterwayProfiles"),
-    SoundingResults: () => import("./ImportSoundingresults.vue")
+      import("./types/ApprovedGaugeMeasurement.vue"),
+    WaterwayProfiles: () => import("./types/WaterwayProfiles"),
+    SoundingResults: () => import("./types/Soundingresults.vue")
   },
   data() {
     return {};
--- a/client/src/components/importconfiguration/ImportSoundingresults.vue	Tue Apr 09 12:38:23 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-<template>
-  <div>
-    <div v-if="editState" class="mb-3">
-      <div
-        v-for="(message, index) in messages"
-        :key="index"
-        class="alert alert-warning small rounded-0"
-      >
-        {{ message }}
-      </div>
-      <div class="d-flex flex-row w-100">
-        <div class="w-50 mr-2 text-left">
-          <small class="text-muted">
-            <translate>Bottleneck</translate>
-          </small>
-          <select v-model="bottleneck" class="custom-select">
-            <option
-              v-for="bottleneck in availableBottlenecks"
-              :value="bottleneck"
-              :key="bottleneck.properties.objnam"
-            >
-              {{ bottleneck.properties.objnam }}
-            </option>
-          </select>
-          <span class="text-danger">
-            <small v-if="!bottleneck">
-              <translate>Please select a bottleneck</translate>
-            </small>
-          </span>
-        </div>
-        <div class="w-50 ml-3 text-left">
-          <small class="text-muted">
-            <translate>Projection</translate>&nbsp;(EPSG)
-          </small>
-          <input
-            class="form-control"
-            v-model="projection"
-            value="4326"
-            placeholder="e.g. 4326"
-            type="number"
-          />
-          <span class="text-left text-danger">
-            <small v-if="!projection">
-              <translate>Please enter a projection</translate>
-            </small>
-          </span>
-        </div>
-      </div>
-      <div class="d-flex flex-row w-100 mt-3">
-        <div class="w-50 mr-2 text-left">
-          <small class="text-muted">
-            <translate>Depthreference</translate>
-          </small>
-          <select
-            v-model="depthReference"
-            class="custom-select"
-            id="depthreference"
-          >
-            <option
-              v-for="option in this.depthReferenceOptions"
-              :key="option"
-              >{{ option }}</option
-            >
-          </select>
-          <span class="text-left text-danger">
-            <small v-if="!depthReference">
-              <translate>Please enter a reference</translate>
-            </small>
-          </span>
-        </div>
-        <div class="w-50 ml-3 text-left">
-          <small class="text-muted"> <translate>Date</translate> </small>
-          <input
-            id="importdate"
-            type="date"
-            class="form-control"
-            placeholder="Date of import"
-            aria-label="bottleneck"
-            aria-describedby="bottlenecklabel"
-            v-model="importDate"
-          />
-          <span class="text-left text-danger">
-            <small v-if="!importDate">
-              <translate>Please enter a date</translate>
-            </small>
-          </span>
-        </div>
-      </div>
-    </div>
-    <div class="mt-3">
-      <div v-if="uploadState" class="input-group">
-        <div class="custom-file">
-          <input
-            accept=".zip"
-            type="file"
-            @change="fileSelected"
-            class="custom-file-input"
-            id="uploadFile"
-          />
-          <label class="pointer custom-file-label" for="uploadFile">
-            {{ uploadLabel }}
-          </label>
-        </div>
-      </div>
-      <div class="d-flex justify-content-between mt-3" v-if="editState">
-        <a
-          download="meta.json"
-          :href="dataLink"
-          :class="[
-            'btn btn-outline-info',
-            { disabled: !bottleneck || !importDate || !depthReference }
-          ]"
-        >
-          <translate>Download Meta.json</translate>
-        </a>
-        <span>
-          <button
-            :disabled="disableUploadButton"
-            @click="confirm"
-            class="btn btn-info mr-2"
-            type="button"
-          >
-            <translate>Confirm</translate>
-          </button>
-          <button :key="1" @click="deleteTempData()" class="btn btn-warning">
-            Back
-          </button>
-        </span>
-      </div>
-      <div v-if="uploadState" class="d-flex flex-row-100 mt-3">
-        <button :key="2" @click="back()" class="ml-auto btn btn-warning">
-          Back
-        </button>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-/* This is Free Software under GNU Affero General Public License v >= 3.0
- * without warranty, see README.md and license for details.
- *
- * SPDX-License-Identifier: AGPL-3.0-or-later
- * License-Filename: LICENSES/AGPL-3.0.txt
- *
- * Copyright (C) 2018 by via donau
- *   – Österreichische Wasserstraßen-Gesellschaft mbH
- * Software engineering by Intevation GmbH
- *
- * Author(s):
- * Thomas Junk <thomas.junk@intevation.de>
- * Markus Kottländer <markus.kottlaender@intevation.de>
- */
-import { HTTP } from "@/lib/http";
-import { displayError, displayInfo } from "@/lib/errors.js";
-import { mapState } from "vuex";
-
-const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
-
-export default {
-  data() {
-    return {
-      importState: IMPORTSTATE.UPLOAD,
-      depthReference: "",
-      bottleneck: "",
-      projection: "",
-      importDate: "",
-      uploadLabel: this.$gettext("choose .zip- file"),
-      uploadFile: null,
-      disableUpload: false,
-      token: null,
-      messages: []
-    };
-  },
-  methods: {
-    back() {
-      this.$store.commit("importschedule/setListMode");
-    },
-    initialState() {
-      this.importState = IMPORTSTATE.UPLOAD;
-      this.depthReference = "";
-      this.bottleneck = null;
-      this.projection = "";
-      this.importDate = "";
-      this.uploadLabel = this.$gettext("choose .zip- file");
-      this.uploadFile = null;
-      this.disableUpload = false;
-      this.token = null;
-      this.messages = [];
-    },
-    fileSelected(e) {
-      const files = e.target.files || e.dataTransfer.files;
-      if (!files) return;
-      this.uploadLabel = files[0].name;
-      this.uploadFile = files[0];
-      this.upload();
-    },
-    deleteTempData() {
-      HTTP.delete("/imports/sr-upload/" + this.token, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token")
-        }
-      })
-        .then(() => {
-          this.initialState();
-        })
-        .catch(error => {
-          const { status, data } = error.response;
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: `${status}: ${data.message || data}`
-          });
-        });
-    },
-    upload() {
-      let formData = new FormData();
-      formData.append("soundingresult", this.uploadFile);
-      HTTP.post("/imports/sr-upload", formData, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token"),
-          "Content-Type": "multipart/form-data"
-        }
-      })
-        .then(response => {
-          if (response.data.meta) {
-            const { bottleneck, date, epsg } = response.data.meta;
-            const depthReference = response.data.meta["depth-reference"];
-            this.bottleneck = this.bottlenecks.find(
-              bn => bn.properties.objnam === bottleneck
-            );
-            this.depthReference = depthReference;
-            this.importDate = new Date(date).toISOString().split("T")[0];
-            this.projection = epsg;
-          }
-          this.importState = IMPORTSTATE.EDIT;
-          this.token = response.data.token;
-          this.messages = response.data.messages;
-        })
-        .catch(error => {
-          const { status, data } = error.response;
-          const messages = data.messages ? data.messages.join(", ") : "";
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: `${status}: ${messages}`
-          });
-        });
-    },
-    confirm() {
-      let formData = new FormData();
-      formData.append("token", this.token);
-      if (this.bottleneck)
-        formData.append("bottleneck", this.bottleneck.properties.objnam);
-      if (this.importDate)
-        formData.append("date", this.importDate.split("T")[0]);
-      if (this.depthReference)
-        formData.append("depth-reference", this.depthReference);
-      if (this.projection) formData.append("", this.projection);
-
-      HTTP.post("/imports/sr", formData, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token"),
-          "Content-Type": "multipart/form-data"
-        }
-      })
-        .then(() => {
-          displayInfo({
-            title: this.$gettext("Import"),
-            message:
-              this.$gettext("Starting import for ") +
-              this.bottleneck.properties.objnam
-          });
-          this.initialState();
-        })
-        .catch(error => {
-          const { status, data } = error.response;
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: `${status}: ${data.message || data}`
-          });
-        });
-    }
-  },
-  mounted() {
-    this.$store.dispatch("bottlenecks/loadBottlenecks");
-  },
-  watch: {
-    showContextBox() {
-      if (!this.showContextBox && this.token) this.deleteTempData();
-    }
-  },
-  computed: {
-    ...mapState("application", ["showContextBox"]),
-    ...mapState("bottlenecks", ["bottlenecks"]),
-    importSoundingresultsLabel() {
-      return this.$gettext("Import Soundingresults");
-    },
-    disableUploadButton() {
-      if (this.importState === IMPORTSTATE.UPLOAD) return this.disableUpload;
-      if (
-        !this.bottleneck ||
-        !this.importDate ||
-        !this.depthReference ||
-        !this.projection
-      )
-        return true;
-      return this.disableUpload;
-    },
-    availableBottlenecks() {
-      return this.bottlenecks;
-    },
-    editState() {
-      return this.importState === IMPORTSTATE.EDIT;
-    },
-    uploadState() {
-      return this.importState === IMPORTSTATE.UPLOAD;
-    },
-    Upload() {
-      return this.$gettext("Upload");
-    },
-    Confirm() {
-      return this.$gettext("Confirm");
-    },
-    dataLink() {
-      if (this.bottleneck && this.depthReference && this.import) {
-        return (
-          "data:text/json;charset=utf-8," +
-          encodeURIComponent(
-            JSON.stringify({
-              depthReference: this.depthReference,
-              bottleneck: this.bottleneck.properties.objnam,
-              date: this.importDate
-            })
-          )
-        );
-      }
-    },
-    depthReferenceOptions() {
-      if (
-        this.bottleneck &&
-        this.bottleneck.properties.reference_water_levels
-      ) {
-        return Object.keys(
-          JSON.parse(this.bottleneck.properties.reference_water_levels)
-        );
-      }
-      return [];
-    }
-  }
-};
-</script>
--- a/client/src/components/importconfiguration/ImportWaterwayProfiles.vue	Tue Apr 09 12:38:23 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-<template>
-  <div>
-    <div class="mb-4">
-      <div class="d-flex flex-row">
-        <div class="flex-column w-100">
-          <div class="flex-row text-left">
-            <small class="text-muted"> <translate>URL</translate> </small>
-          </div>
-          <div class="w-100">
-            <input class="form-control" type="url" v-model="url" />
-          </div>
-        </div>
-      </div>
-      <div v-if="!url" class="d-flex flex-row">
-        <small
-          ><translate class="text-danger">Please enter a URL</translate></small
-        >
-      </div>
-      <div class="d-flex flex-row">
-        <div class="flex-column mt-3 mr-3 w-50">
-          <div class="flex-row text-left">
-            <small class="text-muted">
-              <translate>Featuretype</translate>
-            </small>
-          </div>
-          <div class="w-100">
-            <input class="form-control" type="text" v-model="featureType" />
-          </div>
-          <div v-if="!featureType" class="d-flex flex-row">
-            <small
-              ><translate class="text-danger"
-                >Please enter a Featuretype</translate
-              ></small
-            >
-          </div>
-        </div>
-        <div class="flex-column mt-3 w-50">
-          <div class="flex-row text-left">
-            <small class="text-muted">
-              <translate>SortBy</translate>
-            </small>
-          </div>
-          <div class="w-100">
-            <input class="form-control" type="text" v-model="sortBy" />
-          </div>
-          <div v-if="!sortBy" class="d-flex flex-row">
-            <small
-              ><translate class="text-danger"
-                >Please enter SortBy</translate
-              ></small
-            >
-          </div>
-        </div>
-      </div>
-    </div>
-    <div class="d-flex flex-row text-left">
-      <div class="mt-3 mb-3 flex-column w-100">
-        <div class="custom-file">
-          <input
-            accept=".csv"
-            type="file"
-            @change="fileSelected"
-            class="custom-file-input"
-            id="uploadFile"
-          />
-          <label class="pointer custom-file-label" for="uploadFile">
-            {{ uploadLabel }}
-          </label>
-        </div>
-      </div>
-    </div>
-    <div class="d-flex flex-row-reverse w-100 mt-3">
-      <button :key="1" @click="back()" class="btn btn-warning">
-        Back
-      </button>
-      <button
-        :key="2"
-        type="submit"
-        @click="submit"
-        class="shadow-sm btn btn-info submit-button  mr-3"
-      >
-        <translate>Submit</translate>
-      </button>
-    </div>
-  </div>
-</template>
-
-<script>
-/* This is Free Software under GNU Affero General Public License v >= 3.0
- * without warranty, see README.md and license for details.
- *
- * SPDX-License-Identifier: AGPL-3.0-or-later
- * License-Filename: LICENSES/AGPL-3.0.txt
- *
- * Copyright (C) 2018 by via donau
- *   – Österreichische Wasserstraßen-Gesellschaft mbH
- * Software engineering by Intevation GmbH
- *
- * Author(s):
- * Thomas Junk <thomas.junk@intevation.de>
- */
-
-import { displayError, displayInfo } from "@/lib/errors.js";
-import { HTTP } from "@/lib/http";
-
-export default {
-  data() {
-    return {
-      url: "https://service.d4d-portal.info/wamos/wfs/",
-      sortBy: "hydro_scamin",
-      featureType: "ws-wamos:ienc_wtwprf",
-      disableUploadButton: false,
-      uploadLabel: this.$gettext("choose file to upload"),
-      uploadFile: null
-    };
-  },
-  computed: {
-    importWaterwayProfilesLabel() {
-      return this.$gettext("Import Waterway Profiles");
-    }
-  },
-  methods: {
-    back() {
-      this.url = "https://service.d4d-portal.info/wamos/wfs/";
-      this.uploadFile = null;
-      this.uploadLabel = this.$gettext("choose file to upload");
-      this.$store.commit("importschedule/setListMode");
-    },
-    fileSelected(e) {
-      const files = e.target.files || e.dataTransfer.files;
-      if (!files) return;
-      this.uploadLabel = files[0].name;
-      this.uploadFile = files[0];
-    },
-    submit() {
-      if (!this.url || !this.featureType || !this.sortBy || !this.uploadFile)
-        return;
-      let formData = new FormData();
-      formData.append("wp", this.uploadFile);
-      formData.append("url", this.url);
-      formData.append("feature-type", this.featureType);
-      formData.append("sort-by", this.sortBy);
-      HTTP.post("/imports/wp", formData, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token"),
-          "Content-Type": "multipart/form-data"
-        }
-      })
-        .then(() => {
-          displayInfo({
-            title: this.$gettext("Import"),
-            message:
-              this.uploadLabel + this.$gettext(" was successfully uploaded.")
-          });
-          this.back();
-        })
-        .catch(error => {
-          const { status, data } = error.response;
-          const messages = data.messages ? data.messages.join(", ") : "";
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: `${status}: ${messages}`
-          });
-        });
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped></style>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/components/importconfiguration/types/ApprovedGaugeMeasurement.vue	Tue Apr 09 13:42:44 2019 +0200
@@ -0,0 +1,132 @@
+<template>
+  <div>
+    <div class="d-flex flex-column text-left w-25">
+      <label class="text-nowrap" for="originator">
+        <small class="text-muted"
+          >{{ $options.ORIGINATOR }} / {{ $options.FROM }}</small
+        >
+      </label>
+      <input
+        type="text"
+        v-model="originator"
+        class="form-control"
+        id="originator"
+      />
+      <span class="text-left text-danger">
+        <small v-if="!originator">
+          <translate>Please enter an originator</translate>
+        </small>
+      </span>
+    </div>
+    <div class="mt-4 flex-column w-100">
+      <div class="custom-file">
+        <input
+          accept=".csv"
+          type="file"
+          @change="fileSelected"
+          class="custom-file-input"
+          id="uploadFile"
+        />
+        <label class="pointer custom-file-label" for="uploadFile">
+          {{ uploadLabel }}
+        </label>
+      </div>
+    </div>
+    <div class="d-flex flex-row-reverse w-100 mt-3">
+      <button :key="1" @click="back()" class="btn btn-warning">
+        Back
+      </button>
+      <button
+        :key="2"
+        type="submit"
+        @click="submit"
+        class="shadow-sm btn btn-info submit-button  mr-3"
+      >
+        <translate>Submit</translate>
+      </button>
+    </div>
+  </div>
+</template>
+
+<script>
+/* This is Free Software under GNU Affero General Public License v >= 3.0
+ * without warranty, see README.md and license for details.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * License-Filename: LICENSES/AGPL-3.0.txt
+ *
+ * Copyright (C) 2018 by via donau
+ *   – Österreichische Wasserstraßen-Gesellschaft mbH
+ * Software engineering by Intevation GmbH
+ *
+ * Author(s):
+ * Thomas Junk <thomas.junk@intevation.de>
+ */
+
+import { HTTP } from "@/lib/http";
+import { displayError, displayInfo } from "@/lib/errors.js";
+import app from "@/main";
+
+export default {
+  name: "importapprovedgaugemeasurements",
+  data() {
+    return {
+      disableUploadButton: false,
+      uploadLabel: this.$gettext("choose file to upload"),
+      uploadFile: null,
+      originator: "viadonau"
+    };
+  },
+  computed: {
+    importGaugmeasurmentLabel() {
+      return this.$gettext("Import approved gaugemeasurements");
+    }
+  },
+  methods: {
+    back() {
+      this.uploadLabel = this.$gettext("choose file to upload");
+      this.uploadFile = null;
+      this.originator = "viadonau";
+      this.$store.commit("importschedule/setListMode");
+    },
+    fileSelected(e) {
+      const files = e.target.files || e.dataTransfer.files;
+      if (!files) return;
+      this.uploadLabel = files[0].name;
+      this.uploadFile = files[0];
+    },
+    submit() {
+      if (!this.originator || !this.uploadFile) return;
+      let formData = new FormData();
+      formData.append("agm", this.uploadFile);
+      formData.append("originator", this.originator);
+      HTTP.post("/imports/agm", formData, {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token"),
+          "Content-Type": "multipart/form-data"
+        }
+      })
+        .then(() => {
+          displayInfo({
+            title: this.$gettext("Import"),
+            message: this.$gettext(
+              "Starting import of Approved Gauge Measurements"
+            )
+          });
+          this.back();
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${data.message || data}`
+          });
+        });
+    }
+  },
+  ORIGINATOR: app.$gettext("originator"),
+  FROM: app.$gettext("from")
+};
+</script>
+
+<style lang="scss" scoped></style>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/components/importconfiguration/types/Soundingresults.vue	Tue Apr 09 13:42:44 2019 +0200
@@ -0,0 +1,350 @@
+<template>
+  <div>
+    <div v-if="editState" class="mb-3">
+      <div
+        v-for="(message, index) in messages"
+        :key="index"
+        class="alert alert-warning small rounded-0"
+      >
+        {{ message }}
+      </div>
+      <div class="d-flex flex-row w-100">
+        <div class="w-50 mr-2 text-left">
+          <small class="text-muted">
+            <translate>Bottleneck</translate>
+          </small>
+          <select v-model="bottleneck" class="custom-select">
+            <option
+              v-for="bottleneck in availableBottlenecks"
+              :value="bottleneck"
+              :key="bottleneck.properties.objnam"
+            >
+              {{ bottleneck.properties.objnam }}
+            </option>
+          </select>
+          <span class="text-danger">
+            <small v-if="!bottleneck">
+              <translate>Please select a bottleneck</translate>
+            </small>
+          </span>
+        </div>
+        <div class="w-50 ml-3 text-left">
+          <small class="text-muted">
+            <translate>Projection</translate>&nbsp;(EPSG)
+          </small>
+          <input
+            class="form-control"
+            v-model="projection"
+            value="4326"
+            placeholder="e.g. 4326"
+            type="number"
+          />
+          <span class="text-left text-danger">
+            <small v-if="!projection">
+              <translate>Please enter a projection</translate>
+            </small>
+          </span>
+        </div>
+      </div>
+      <div class="d-flex flex-row w-100 mt-3">
+        <div class="w-50 mr-2 text-left">
+          <small class="text-muted">
+            <translate>Depthreference</translate>
+          </small>
+          <select
+            v-model="depthReference"
+            class="custom-select"
+            id="depthreference"
+          >
+            <option
+              v-for="option in this.depthReferenceOptions"
+              :key="option"
+              >{{ option }}</option
+            >
+          </select>
+          <span class="text-left text-danger">
+            <small v-if="!depthReference">
+              <translate>Please enter a reference</translate>
+            </small>
+          </span>
+        </div>
+        <div class="w-50 ml-3 text-left">
+          <small class="text-muted"> <translate>Date</translate> </small>
+          <input
+            id="importdate"
+            type="date"
+            class="form-control"
+            placeholder="Date of import"
+            aria-label="bottleneck"
+            aria-describedby="bottlenecklabel"
+            v-model="importDate"
+          />
+          <span class="text-left text-danger">
+            <small v-if="!importDate">
+              <translate>Please enter a date</translate>
+            </small>
+          </span>
+        </div>
+      </div>
+    </div>
+    <div class="mt-3">
+      <div v-if="uploadState" class="input-group">
+        <div class="custom-file">
+          <input
+            accept=".zip"
+            type="file"
+            @change="fileSelected"
+            class="custom-file-input"
+            id="uploadFile"
+          />
+          <label class="pointer custom-file-label" for="uploadFile">
+            {{ uploadLabel }}
+          </label>
+        </div>
+      </div>
+      <div class="d-flex justify-content-between mt-3" v-if="editState">
+        <a
+          download="meta.json"
+          :href="dataLink"
+          :class="[
+            'btn btn-outline-info',
+            { disabled: !bottleneck || !importDate || !depthReference }
+          ]"
+        >
+          <translate>Download Meta.json</translate>
+        </a>
+        <span>
+          <button
+            :disabled="disableUploadButton"
+            @click="confirm"
+            class="btn btn-info mr-2"
+            type="button"
+          >
+            <translate>Confirm</translate>
+          </button>
+          <button :key="1" @click="deleteTempData()" class="btn btn-warning">
+            Back
+          </button>
+        </span>
+      </div>
+      <div v-if="uploadState" class="d-flex flex-row-100 mt-3">
+        <button :key="2" @click="back()" class="ml-auto btn btn-warning">
+          Back
+        </button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+/* This is Free Software under GNU Affero General Public License v >= 3.0
+ * without warranty, see README.md and license for details.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * License-Filename: LICENSES/AGPL-3.0.txt
+ *
+ * Copyright (C) 2018 by via donau
+ *   – Österreichische Wasserstraßen-Gesellschaft mbH
+ * Software engineering by Intevation GmbH
+ *
+ * Author(s):
+ * Thomas Junk <thomas.junk@intevation.de>
+ * Markus Kottländer <markus.kottlaender@intevation.de>
+ */
+import { HTTP } from "@/lib/http";
+import { displayError, displayInfo } from "@/lib/errors.js";
+import { mapState } from "vuex";
+
+const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
+
+export default {
+  data() {
+    return {
+      importState: IMPORTSTATE.UPLOAD,
+      depthReference: "",
+      bottleneck: "",
+      projection: "",
+      importDate: "",
+      uploadLabel: this.$gettext("choose .zip- file"),
+      uploadFile: null,
+      disableUpload: false,
+      token: null,
+      messages: []
+    };
+  },
+  methods: {
+    back() {
+      this.$store.commit("importschedule/setListMode");
+    },
+    initialState() {
+      this.importState = IMPORTSTATE.UPLOAD;
+      this.depthReference = "";
+      this.bottleneck = null;
+      this.projection = "";
+      this.importDate = "";
+      this.uploadLabel = this.$gettext("choose .zip- file");
+      this.uploadFile = null;
+      this.disableUpload = false;
+      this.token = null;
+      this.messages = [];
+    },
+    fileSelected(e) {
+      const files = e.target.files || e.dataTransfer.files;
+      if (!files) return;
+      this.uploadLabel = files[0].name;
+      this.uploadFile = files[0];
+      this.upload();
+    },
+    deleteTempData() {
+      HTTP.delete("/imports/sr-upload/" + this.token, {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token")
+        }
+      })
+        .then(() => {
+          this.initialState();
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${data.message || data}`
+          });
+        });
+    },
+    upload() {
+      let formData = new FormData();
+      formData.append("soundingresult", this.uploadFile);
+      HTTP.post("/imports/sr-upload", formData, {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token"),
+          "Content-Type": "multipart/form-data"
+        }
+      })
+        .then(response => {
+          if (response.data.meta) {
+            const { bottleneck, date, epsg } = response.data.meta;
+            const depthReference = response.data.meta["depth-reference"];
+            this.bottleneck = this.bottlenecks.find(
+              bn => bn.properties.objnam === bottleneck
+            );
+            this.depthReference = depthReference;
+            this.importDate = new Date(date).toISOString().split("T")[0];
+            this.projection = epsg;
+          }
+          this.importState = IMPORTSTATE.EDIT;
+          this.token = response.data.token;
+          this.messages = response.data.messages;
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          const messages = data.messages ? data.messages.join(", ") : "";
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${messages}`
+          });
+        });
+    },
+    confirm() {
+      let formData = new FormData();
+      formData.append("token", this.token);
+      if (this.bottleneck)
+        formData.append("bottleneck", this.bottleneck.properties.objnam);
+      if (this.importDate)
+        formData.append("date", this.importDate.split("T")[0]);
+      if (this.depthReference)
+        formData.append("depth-reference", this.depthReference);
+      if (this.projection) formData.append("", this.projection);
+
+      HTTP.post("/imports/sr", formData, {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token"),
+          "Content-Type": "multipart/form-data"
+        }
+      })
+        .then(() => {
+          displayInfo({
+            title: this.$gettext("Import"),
+            message:
+              this.$gettext("Starting import for ") +
+              this.bottleneck.properties.objnam
+          });
+          this.initialState();
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${data.message || data}`
+          });
+        });
+    }
+  },
+  mounted() {
+    this.$store.dispatch("bottlenecks/loadBottlenecks");
+  },
+  watch: {
+    showContextBox() {
+      if (!this.showContextBox && this.token) this.deleteTempData();
+    }
+  },
+  computed: {
+    ...mapState("application", ["showContextBox"]),
+    ...mapState("bottlenecks", ["bottlenecks"]),
+    importSoundingresultsLabel() {
+      return this.$gettext("Import Soundingresults");
+    },
+    disableUploadButton() {
+      if (this.importState === IMPORTSTATE.UPLOAD) return this.disableUpload;
+      if (
+        !this.bottleneck ||
+        !this.importDate ||
+        !this.depthReference ||
+        !this.projection
+      )
+        return true;
+      return this.disableUpload;
+    },
+    availableBottlenecks() {
+      return this.bottlenecks;
+    },
+    editState() {
+      return this.importState === IMPORTSTATE.EDIT;
+    },
+    uploadState() {
+      return this.importState === IMPORTSTATE.UPLOAD;
+    },
+    Upload() {
+      return this.$gettext("Upload");
+    },
+    Confirm() {
+      return this.$gettext("Confirm");
+    },
+    dataLink() {
+      if (this.bottleneck && this.depthReference && this.import) {
+        return (
+          "data:text/json;charset=utf-8," +
+          encodeURIComponent(
+            JSON.stringify({
+              depthReference: this.depthReference,
+              bottleneck: this.bottleneck.properties.objnam,
+              date: this.importDate
+            })
+          )
+        );
+      }
+    },
+    depthReferenceOptions() {
+      if (
+        this.bottleneck &&
+        this.bottleneck.properties.reference_water_levels
+      ) {
+        return Object.keys(
+          JSON.parse(this.bottleneck.properties.reference_water_levels)
+        );
+      }
+      return [];
+    }
+  }
+};
+</script>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/components/importconfiguration/types/WaterwayProfiles.vue	Tue Apr 09 13:42:44 2019 +0200
@@ -0,0 +1,170 @@
+<template>
+  <div>
+    <div class="mb-4">
+      <div class="d-flex flex-row">
+        <div class="flex-column w-100">
+          <div class="flex-row text-left">
+            <small class="text-muted"> <translate>URL</translate> </small>
+          </div>
+          <div class="w-100">
+            <input class="form-control" type="url" v-model="url" />
+          </div>
+        </div>
+      </div>
+      <div v-if="!url" class="d-flex flex-row">
+        <small
+          ><translate class="text-danger">Please enter a URL</translate></small
+        >
+      </div>
+      <div class="d-flex flex-row">
+        <div class="flex-column mt-3 mr-3 w-50">
+          <div class="flex-row text-left">
+            <small class="text-muted">
+              <translate>Featuretype</translate>
+            </small>
+          </div>
+          <div class="w-100">
+            <input class="form-control" type="text" v-model="featureType" />
+          </div>
+          <div v-if="!featureType" class="d-flex flex-row">
+            <small
+              ><translate class="text-danger"
+                >Please enter a Featuretype</translate
+              ></small
+            >
+          </div>
+        </div>
+        <div class="flex-column mt-3 w-50">
+          <div class="flex-row text-left">
+            <small class="text-muted">
+              <translate>SortBy</translate>
+            </small>
+          </div>
+          <div class="w-100">
+            <input class="form-control" type="text" v-model="sortBy" />
+          </div>
+          <div v-if="!sortBy" class="d-flex flex-row">
+            <small
+              ><translate class="text-danger"
+                >Please enter SortBy</translate
+              ></small
+            >
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="d-flex flex-row text-left">
+      <div class="mt-3 mb-3 flex-column w-100">
+        <div class="custom-file">
+          <input
+            accept=".csv"
+            type="file"
+            @change="fileSelected"
+            class="custom-file-input"
+            id="uploadFile"
+          />
+          <label class="pointer custom-file-label" for="uploadFile">
+            {{ uploadLabel }}
+          </label>
+        </div>
+      </div>
+    </div>
+    <div class="d-flex flex-row-reverse w-100 mt-3">
+      <button :key="1" @click="back()" class="btn btn-warning">
+        Back
+      </button>
+      <button
+        :key="2"
+        type="submit"
+        @click="submit"
+        class="shadow-sm btn btn-info submit-button  mr-3"
+      >
+        <translate>Submit</translate>
+      </button>
+    </div>
+  </div>
+</template>
+
+<script>
+/* This is Free Software under GNU Affero General Public License v >= 3.0
+ * without warranty, see README.md and license for details.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * License-Filename: LICENSES/AGPL-3.0.txt
+ *
+ * Copyright (C) 2018 by via donau
+ *   – Österreichische Wasserstraßen-Gesellschaft mbH
+ * Software engineering by Intevation GmbH
+ *
+ * Author(s):
+ * Thomas Junk <thomas.junk@intevation.de>
+ */
+
+import { displayError, displayInfo } from "@/lib/errors.js";
+import { HTTP } from "@/lib/http";
+
+export default {
+  data() {
+    return {
+      url: "https://service.d4d-portal.info/wamos/wfs/",
+      sortBy: "hydro_scamin",
+      featureType: "ws-wamos:ienc_wtwprf",
+      disableUploadButton: false,
+      uploadLabel: this.$gettext("choose file to upload"),
+      uploadFile: null
+    };
+  },
+  computed: {
+    importWaterwayProfilesLabel() {
+      return this.$gettext("Import Waterway Profiles");
+    }
+  },
+  methods: {
+    back() {
+      this.url = "https://service.d4d-portal.info/wamos/wfs/";
+      this.uploadFile = null;
+      this.uploadLabel = this.$gettext("choose file to upload");
+      this.$store.commit("importschedule/setListMode");
+    },
+    fileSelected(e) {
+      const files = e.target.files || e.dataTransfer.files;
+      if (!files) return;
+      this.uploadLabel = files[0].name;
+      this.uploadFile = files[0];
+    },
+    submit() {
+      if (!this.url || !this.featureType || !this.sortBy || !this.uploadFile)
+        return;
+      let formData = new FormData();
+      formData.append("wp", this.uploadFile);
+      formData.append("url", this.url);
+      formData.append("feature-type", this.featureType);
+      formData.append("sort-by", this.sortBy);
+      HTTP.post("/imports/wp", formData, {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token"),
+          "Content-Type": "multipart/form-data"
+        }
+      })
+        .then(() => {
+          displayInfo({
+            title: this.$gettext("Import"),
+            message:
+              this.uploadLabel + this.$gettext(" was successfully uploaded.")
+          });
+          this.back();
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          const messages = data.messages ? data.messages.join(", ") : "";
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${messages}`
+          });
+        });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>