diff client/src/components/importconfiguration/types/Soundingresults.vue @ 3013:30222bcbfec9

import_configuration: add email option to onetime imports
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 11 Apr 2019 14:37:13 +0200
parents 1b8bb4f89227
children cb3b31566e48
line wrap: on
line diff
--- a/client/src/components/importconfiguration/types/Soundingresults.vue	Thu Apr 11 14:11:29 2019 +0200
+++ b/client/src/components/importconfiguration/types/Soundingresults.vue	Thu Apr 11 14:37:13 2019 +0200
@@ -89,7 +89,27 @@
     </div>
     <div class="mt-3">
       <div v-if="uploadState" class="input-group">
-        <div class="custom-file">
+        <div :key="1" class="flex-column mr-4">
+          <div class="flex-row text-left">
+            <small class="text-muted">
+              <translate>Email Notification</translate>
+            </small>
+          </div>
+          <div class="flex-flex-row text-left">
+            <toggle-button
+              v-model="eMailNotification"
+              class="mt-2"
+              :speed="100"
+              :labels="{
+                checked: this.$options.on,
+                unchecked: this.$options.off
+              }"
+              :width="60"
+              :height="30"
+            />
+          </div>
+        </div>
+        <div class="custom-file mt-4">
           <input
             accept=".zip"
             type="file"
@@ -169,7 +189,8 @@
       uploadFile: null,
       disableUpload: false,
       token: null,
-      messages: []
+      messages: [],
+      eMailNotification: false
     };
   },
   methods: {
@@ -186,6 +207,7 @@
       this.uploadFile = null;
       this.disableUpload = false;
       this.token = null;
+      this.eMailNotification = false;
       this.messages = [];
     },
     fileSelected(e) {
@@ -215,6 +237,9 @@
     upload() {
       let formData = new FormData();
       formData.append("soundingresult", this.uploadFile);
+      if (this.eMailNotification) {
+        formData.append("send-email", this.eMailNotification);
+      }
       HTTP.post("/imports/sr-upload", formData, {
         headers: {
           "X-Gemma-Auth": localStorage.getItem("token"),