changeset 4756:415c1993c7fe

Made CSV export of import log more csv like. Removed spurious leading whitespace from columns, changed filename suffix to 'csv'.
author Sascha Wilde <wilde@intevation.de>
date Fri, 18 Oct 2019 18:17:06 +0200
parents dfd990a4ac64
children e73ab14c7d1b
files client/src/components/importoverview/ImportOverview.vue
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importoverview/ImportOverview.vue	Fri Oct 18 17:55:12 2019 +0200
+++ b/client/src/components/importoverview/ImportOverview.vue	Fri Oct 18 18:17:06 2019 +0200
@@ -268,19 +268,17 @@
                 const csvLink =
                   "data:text/csv;charset=utf-8," +
                   encodeURIComponent(
-                    "id, kind, enqueued, user, country, signer, state, changed, warnings\n" +
+                    "id,kind,enqueued,user,country,signer,state,changed,warnings\n" +
                       imports
                         .map(el => {
-                          return ` ${el.id}, ${el.kind}, ${
-                            el.enqueued
-                          }, ${el.user || " "}, ${this.userCountries[el.user] ||
-                            " "}, ${el.signer || " "}, ${el.state ||
-                            " "},${el.changed || " "}, ${el.warnings || " "}`;
+                          return `${el.id},${el.kind},${el.enqueued},\
+${el.user || " "},${this.userCountries[el.user] || " "},${el.signer || " "},\
+${el.state || " "},${el.changed || " "},${el.warnings || " "}`;
                         })
                         .join("\n")
                   );
                 let element = document.createElement("a");
-                element.setAttribute("download", "log.txt");
+                element.setAttribute("download", "log.csv");
                 element.setAttribute("href", csvLink);
                 document.querySelector("body").appendChild(element);
                 element.click();