changeset 4065:6ebe42af392d

review of AGM now visually handles deleted entries
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 25 Jul 2019 12:32:10 +0200
parents 3eaa3ee4630f
children 4332b9e26e2f 5867dcf8e93c
files client/src/components/importoverview/AGMLogItem.vue
diffstat 1 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importoverview/AGMLogItem.vue	Thu Jul 25 11:48:57 2019 +0200
+++ b/client/src/components/importoverview/AGMLogItem.vue	Thu Jul 25 12:32:10 2019 +0200
@@ -40,13 +40,15 @@
           {{ entry }}
         </div>
         <div :class="isNew(line) ? 'col-6' : 'col-4'">
-          {{ line.versions[0][entry] }}
+          <span :class="line.versions[1] ? '' : 'text-danger'">{{
+            line.versions[0][entry]
+          }}</span>
         </div>
         <div
           v-if="isOld(line) && isDifferent(line, entry)"
           :class="isNew(line) ? 'col-6' : 'col-4'"
         >
-          {{ line.versions[1][entry] }}
+          {{ line.versions[1] ? line.versions[1][entry] : $options.DELETED }}
         </div>
       </div>
     </div>
@@ -54,6 +56,22 @@
 </template>
 
 <script>
+/* This is Free Software under GNU Affero General Public License v >= 3.0
+ * without warranty, see README.md and license for details.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * License-Filename: LICENSES/AGPL-3.0.txt
+ *
+ * Copyright (C) 2018, 2019 by via donau
+ *   – Österreichische Wasserstraßen-Gesellschaft mbH
+ * Software engineering by Intevation GmbH
+ *
+ * Author(s):
+ * * Thomas Junk <thomas.junk@intevation.de>
+ * * Markus Kottländer <markus.kottlaender@intevation.de>
+ * * Fadi Abbud <fadi.abbud@intevation.de>
+ */
+import app from "@/main";
 export default {
   props: ["line", "index", "showDiff"],
   computed: {
@@ -72,12 +90,14 @@
       return !this.isNew(result);
     },
     isDifferent(result, entry) {
+      if (!result.versions[1]) return true;
       return (
         this.isOld(result) &&
         result.versions[0][entry] != result.versions[1][entry]
       );
     }
-  }
+  },
+  DELETED: app.$gettext("deleted")
 };
 </script>