[Lada-commits] [PATCH] Pipe out more information in import report

Wald Commits scm-commit at wald.intevation.org
Thu Apr 6 10:14:33 CEST 2017


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1491466468 -7200
# Node ID ee21d0e1b9988bfc646a8d81fa05e43274be3f0a
# Parent  dc5851d433e8029846419aecfe06b86608b6c3c7
Pipe out more information in import report.

diff -r dc5851d433e8 -r ee21d0e1b998 app/view/form/Messung.js
--- a/app/view/form/Messung.js	Wed Apr 05 16:04:36 2017 +0200
+++ b/app/view/form/Messung.js	Thu Apr 06 10:14:28 2017 +0200
@@ -316,7 +316,11 @@
         var i18n = Lada.getApplication().bundle;
         if (warnings) {
             for (key in warnings) {
-                element = this.down('component[name=' + key + ']');
+                var tmp = key;
+                if (tmp.indexOf('#') > 0) {
+                    tmp = tmp.split('#')[0];
+                }
+                element = this.down('component[name=' + tmp + ']');
                 if (!element) {
                     continue;
                 }
@@ -330,7 +334,11 @@
         }
         if (errors) {
             for (key in errors) {
-                element = this.down('component[name=' + key + ']');
+                var tmp = key;
+                if (tmp.indexOf('#') > 0) {
+                    tmp = tmp.split('#')[0];
+                }
+                element = this.down('component[name=' + tmp + ']');
                 if (!element) {
                     continue;
                 }
diff -r dc5851d433e8 -r ee21d0e1b998 app/view/form/Probe.js
--- a/app/view/form/Probe.js	Wed Apr 05 16:04:36 2017 +0200
+++ b/app/view/form/Probe.js	Thu Apr 06 10:14:28 2017 +0200
@@ -480,7 +480,11 @@
         var i18n = Lada.getApplication().bundle;
         if (warnings) {
             for (key in warnings) {
-                element = this.down('component[name=' + key + ']');
+                var tmp = key;
+                if (tmp.indexOf('#') > 0) {
+                    tmp = tmp.split('#')[0];
+                }
+                element = this.down('component[name=' + tmp + ']');
                 if (!element) {
                     continue;
                 }
@@ -494,7 +498,11 @@
         }
         if (errors) {
             for (key in errors) {
-                element = this.down('component[name=' + key + ']');
+                var tmp = key;
+                if (tmp.indexOf('#') > 0) {
+                    tmp = tmp.split('#')[0];
+                }
+                element = this.down('component[name=' + tmp + ']');
                 if (!element) {
                     continue;
                 }
diff -r dc5851d433e8 -r ee21d0e1b998 app/view/window/ImportResponse.js
--- a/app/view/window/ImportResponse.js	Wed Apr 05 16:04:36 2017 +0200
+++ b/app/view/window/ImportResponse.js	Thu Apr 06 10:14:28 2017 +0200
@@ -164,7 +164,10 @@
                     for (var i = msgs.length - 1; i >= 0; i--) {
                         if (msgs[i].key === 'validation') {
                             validation.push('<ol>');
-                            validation.push(Lada.getApplication().bundle.getMsg(msgs[i].value) + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')');
+                            var parts = msgs[i].value.split('#');
+                            var str = Lada.getApplication().bundle.getMsg(parts[0]) +
+                                parts[1] === undefined ? '' : parts[1];
+                            validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')');
                             validation.push('</ol>');
                         }
                         else {
@@ -198,7 +201,10 @@
                     for (var i = msgs.length - 1; i >= 0; i--) {
                         if (msgs[i].key === 'validation') {
                             validation.push('<ol>');
-                            validation.push(Lada.getApplication().bundle.getMsg(msgs[i].value) + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')');
+                            var parts = msgs[i].value.split('#');
+                            var str = Lada.getApplication().bundle.getMsg(parts[0]) +
+                                parts[1] === undefined ? '' : parts[1];
+                            validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')');
                             validation.push('</ol>');
                         }
                         else {


More information about the Lada-commits mailing list