comparison client/src/components/importoverview/AGMLogItem.vue @ 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 84d01a536bec
comparison
equal deleted inserted replaced
4064:3eaa3ee4630f 4065:6ebe42af392d
38 > 38 >
39 <div :class="isNew(line) ? 'col-6' : 'col-4'"> 39 <div :class="isNew(line) ? 'col-6' : 'col-4'">
40 {{ entry }} 40 {{ entry }}
41 </div> 41 </div>
42 <div :class="isNew(line) ? 'col-6' : 'col-4'"> 42 <div :class="isNew(line) ? 'col-6' : 'col-4'">
43 {{ line.versions[0][entry] }} 43 <span :class="line.versions[1] ? '' : 'text-danger'">{{
44 line.versions[0][entry]
45 }}</span>
44 </div> 46 </div>
45 <div 47 <div
46 v-if="isOld(line) && isDifferent(line, entry)" 48 v-if="isOld(line) && isDifferent(line, entry)"
47 :class="isNew(line) ? 'col-6' : 'col-4'" 49 :class="isNew(line) ? 'col-6' : 'col-4'"
48 > 50 >
49 {{ line.versions[1][entry] }} 51 {{ line.versions[1] ? line.versions[1][entry] : $options.DELETED }}
50 </div> 52 </div>
51 </div> 53 </div>
52 </div> 54 </div>
53 </div> 55 </div>
54 </template> 56 </template>
55 57
56 <script> 58 <script>
59 /* This is Free Software under GNU Affero General Public License v >= 3.0
60 * without warranty, see README.md and license for details.
61 *
62 * SPDX-License-Identifier: AGPL-3.0-or-later
63 * License-Filename: LICENSES/AGPL-3.0.txt
64 *
65 * Copyright (C) 2018, 2019 by via donau
66 * – Österreichische Wasserstraßen-Gesellschaft mbH
67 * Software engineering by Intevation GmbH
68 *
69 * Author(s):
70 * * Thomas Junk <thomas.junk@intevation.de>
71 * * Markus Kottländer <markus.kottlaender@intevation.de>
72 * * Fadi Abbud <fadi.abbud@intevation.de>
73 */
74 import app from "@/main";
57 export default { 75 export default {
58 props: ["line", "index", "showDiff"], 76 props: ["line", "index", "showDiff"],
59 computed: { 77 computed: {
60 show() { 78 show() {
61 return this.index === this.showDiff; 79 return this.index === this.showDiff;
70 }, 88 },
71 isOld(result) { 89 isOld(result) {
72 return !this.isNew(result); 90 return !this.isNew(result);
73 }, 91 },
74 isDifferent(result, entry) { 92 isDifferent(result, entry) {
93 if (!result.versions[1]) return true;
75 return ( 94 return (
76 this.isOld(result) && 95 this.isOld(result) &&
77 result.versions[0][entry] != result.versions[1][entry] 96 result.versions[0][entry] != result.versions[1][entry]
78 ); 97 );
79 } 98 }
80 } 99 },
100 DELETED: app.$gettext("deleted")
81 }; 101 };
82 </script> 102 </script>
83 103
84 <style lang="sass" scoped> 104 <style lang="sass" scoped>
85 .diffs 105 .diffs