# HG changeset patch # User Thomas Junk # Date 1550739504 -3600 # Node ID ff1e4f1b54c6353289bcbca664e34194d0ed3f9a # Parent 242c170e00cee53158474bd84dc5326d8eeafe4d agm_import: originator field added diff -r 242c170e00ce -r ff1e4f1b54c6 client/src/components/ImportApprovedGaugeMeasurement.vue --- a/client/src/components/ImportApprovedGaugeMeasurement.vue Thu Feb 21 09:31:02 2019 +0100 +++ b/client/src/components/ImportApprovedGaugeMeasurement.vue Thu Feb 21 09:58:24 2019 +0100 @@ -12,37 +12,53 @@
-
-
-
- - -
+
+ + + + + Please enter an originator + + +
+
+
+ +
-
- -
+
+
+
@@ -66,6 +82,7 @@ import { HTTP } from "@/lib/http"; import { displayError, displayInfo } from "@/lib/errors.js"; +import app from "@/main"; export default { name: "importapprovedgaugemeasurements", @@ -73,10 +90,16 @@ return { disableUploadButton: false, uploadLabel: this.$gettext("choose file to upload"), - uploadFile: null + uploadFile: null, + originator: "viadonau" }; }, methods: { + initialState() { + this.uploadLabel = this.$gettext("choose file to upload"); + this.uploadFile = null; + this.originator = "viadonau"; + }, fileSelected(e) { const files = e.target.files || e.dataTransfer.files; if (!files) return; @@ -84,9 +107,10 @@ this.uploadFile = files[0]; }, submit() { - if (!this.uploadFile) return; + 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"), @@ -113,7 +137,9 @@ }, components: { Spacer: () => import("./Spacer") - } + }, + ORIGINATOR: app.$gettext("originator"), + FROM: app.$gettext("from") };