changeset 3510:4d7b481e1d39 v3-uat2

import_configuration_overview: user country column
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 28 May 2019 17:12:02 +0200
parents 0e91d40af23e
children c64c47ff2ab1 6cdfc05fd6b0
files client/src/components/importconfiguration/Import.vue
diffstat 1 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/Import.vue	Tue May 28 16:03:07 2019 +0200
+++ b/client/src/components/importconfiguration/Import.vue	Tue May 28 17:12:02 2019 +0200
@@ -6,8 +6,9 @@
       <UITableHeader
         :columns="[
           { id: 'id', title: `${idLabel}`, class: 'col-1' },
-          { id: 'kind', title: `${typeLabel}`, class: 'col-2' },
+          { id: 'kind', title: `${typeLabel}`, class: 'col-1' },
           { id: 'user', title: `${authorLabel}`, class: 'col-2' },
+          { id: 'country', title: `${countryLabel}`, class: 'col-1' },
           { id: 'config.cron', title: `${scheduleLabel}`, class: 'col-2' },
           { id: 'config.send-email', title: `${emailLabel}`, class: 'col-2' }
         ]"
@@ -18,10 +19,15 @@
       >
         <template v-slot:row="{ item: schedule }">
           <div class="table-cell py-1 col-1">{{ schedule.id }}</div>
-          <div class="table-cell py-1 col-2">
+          <div class="table-cell py-1 col-1">
             {{ schedule.kind.toUpperCase() }}
           </div>
-          <div class="table-cell py-1 col-2">{{ schedule.user }}</div>
+          <div style="width:115px;" class="table-cell py-1">
+            {{ schedule.user }}
+          </div>
+          <div style="width:55px;" class="table-cell py-1">
+            {{ userCountries[schedule.user] }}
+          </div>
           <div class="table-cell py-1 col-2">{{ schedule.config.cron }}</div>
           <div class="table-cell py-1 col-2">
             <font-awesome-icon
@@ -84,7 +90,7 @@
  * Thomas Junk <thomas.junk@intevation.de>
  * Markus Kottländer <markus.kottlaender@intevation.de>
  */
-import { mapState } from "vuex";
+import { mapState, mapGetters } from "vuex";
 import { displayInfo, displayError } from "@/lib/errors";
 import { HTTP } from "@/lib/http";
 import {
@@ -207,6 +213,10 @@
       "currentSchedule",
       "importScheduleDetailVisible"
     ]),
+    ...mapGetters("usermanagement", ["userCountries"]),
+    countryLabel() {
+      return this.$gettext("Country");
+    },
     isOnetime() {
       for (let kind of [
         this.$options.IMPORTTYPES.SOUNDINGRESULTS,
@@ -247,9 +257,20 @@
     }
   },
   mounted() {
-    this.$store.commit("importschedule/setListMode");
-    this.$store.commit("importschedule/clearCurrentSchedule");
-    this.getSchedules();
+    this.$store
+      .dispatch("usermanagement/loadUsers")
+      .then(() => {
+        this.$store.commit("importschedule/setListMode");
+        this.$store.commit("importschedule/clearCurrentSchedule");
+        this.getSchedules();
+      })
+      .catch(error => {
+        const { status, data } = error.response;
+        displayError({
+          title: this.$gettext("Backend Error"),
+          message: `${status}: ${data.message || data}`
+        });
+      });
   },
   IMPORTTYPES: IMPORTTYPES,
   MODES: MODES