diff client/src/components/importconfiguration/types/ApprovedGaugeMeasurement.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/ApprovedGaugeMeasurement.vue	Thu Apr 11 14:11:29 2019 +0200
+++ b/client/src/components/importconfiguration/types/ApprovedGaugeMeasurement.vue	Thu Apr 11 14:37:13 2019 +0200
@@ -1,22 +1,44 @@
 <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 class="d-flex flex-row">
+      <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="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>
     <div class="mt-4 flex-column w-100">
       <div class="custom-file">
@@ -74,7 +96,8 @@
       disableUploadButton: false,
       uploadLabel: this.$gettext("choose file to upload"),
       uploadFile: null,
-      originator: "viadonau"
+      originator: "viadonau",
+      eMailNotification: false
     };
   },
   computed: {
@@ -100,6 +123,9 @@
       let formData = new FormData();
       formData.append("agm", this.uploadFile);
       formData.append("originator", this.originator);
+      if (this.eMailNotification) {
+        formData.append("send-email", this.eMailNotification);
+      }
       HTTP.post("/imports/agm", formData, {
         headers: {
           "X-Gemma-Auth": localStorage.getItem("token"),