changeset 2349:2e57fd9b4f3a

client: imports: removed upload button from soundingresults import and trigger upload automatically Before, you needed to click Upload after selecting a file. This extra click is not necessary any more, reducing confusion and making the UI more intuitive. Maybe this can be done in other places too.
author Markus Kottlaender <markus@intevation.de>
date Wed, 20 Feb 2019 10:58:00 +0100
parents 7cdc211b90cd
children ed6b0a43d42f
files client/src/components/ImportSoundingresults.vue
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/ImportSoundingresults.vue	Wed Feb 20 10:49:41 2019 +0100
+++ b/client/src/components/ImportSoundingresults.vue	Wed Feb 20 10:58:00 2019 +0100
@@ -109,9 +109,8 @@
               </label>
             </div>
           </div>
-          <div class="buttons text-right">
+          <div class="buttons text-right" v-if="editState">
             <a
-              v-if="editState"
               download="meta.json"
               :href="dataLink"
               class="btn btn-outline-info pull-left mt-4"
@@ -119,7 +118,6 @@
               <translate>Download Meta.json</translate>
             </a>
             <button
-              v-if="editState"
               @click="deleteTempData"
               class="btn btn-danger mt-4"
               type="button"
@@ -128,11 +126,11 @@
             </button>
             <button
               :disabled="disableUploadButton"
-              @click="submit"
+              @click="confirm"
               class="btn btn-info mt-4"
               type="button"
             >
-              {{ uploadState ? Upload : Confirm }}
+              <translate>Confirm</translate>
             </button>
           </div>
         </div>
@@ -200,6 +198,7 @@
       if (!files) return;
       this.uploadLabel = files[0].name;
       this.uploadFile = files[0];
+      this.upload();
     },
     deleteTempData() {
       HTTP.delete("/imports/sr-upload/" + this.token, {
@@ -218,14 +217,6 @@
           });
         });
     },
-    submit() {
-      if (!this.uploadFile || this.disableUpload) return;
-      if (this.importState === IMPORTSTATE.UPLOAD) {
-        this.upload();
-      } else {
-        this.confirm();
-      }
-    },
     upload() {
       let formData = new FormData();
       formData.append("soundingresult", this.uploadFile);