Mercurial > gemma
annotate client/src/components/importoverview/ImportOverviewAlt.vue @ 2593:956b230c6062
overview2 WIP
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 12 Mar 2019 10:42:27 +0100 |
parents | 5472a5be09c2 |
children | 7025d082c115 |
rev | line source |
---|---|
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="overview"> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 <UIBoxHeader |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 icon="clipboard-check" |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
5 title="Staging Area" |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 :closeCallback="$parent.close" |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 /> |
2578 | 8 <div |
9 class="ml-2 mt-2 d-flex flex-row flex-fill justify-content-between mr-2" | |
10 > | |
11 <Filters></Filters> | |
12 <div> | |
13 <button :class="commitStyle"> | |
14 <translate>Commit</translate> {{ toCommit.length }} | |
15 </button> | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 </div> |
2579 | 18 <div class="ml-3 mr-2 mt-2 w-95 "> |
19 <LogEntry | |
2592 | 20 class="logentry border-bottom d-flex-flex-column w-100" |
2579 | 21 :entry="entry" |
22 v-for="entry in imports" | |
23 :key="entry.id" | |
24 ></LogEntry> | |
25 </div> | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 <script> |
2578 | 30 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
31 * without warranty, see README.md and license for details. | |
32 * | |
33 * SPDX-License-Identifier: AGPL-3.0-or-later | |
34 * License-Filename: LICENSES/AGPL-3.0.txt | |
35 * | |
36 * Copyright (C) 2018 by via donau | |
37 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
38 * Software engineering by Intevation GmbH | |
39 * | |
40 * Author(s): | |
41 * Thomas Junk <thomas.junk@intevation.de> | |
42 */ | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 |
2578 | 44 import { displayError } from "@/lib/errors.js"; |
45 import { mapState, mapGetters } from "vuex"; | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
46 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
47 export default { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
48 name: "importoverviewalt", |
2578 | 49 components: { |
50 Filters: () => import("./Filters.vue"), | |
51 LogEntry: () => import("./LogEntry.vue") | |
52 }, | |
53 computed: { | |
2593 | 54 ...mapState("imports", ["imports", "filters"]), |
2578 | 55 ...mapGetters("imports", ["toCommit"]), |
56 commitStyle() { | |
57 return { | |
58 btn: true, | |
59 "btn-sm": true, | |
60 "btn-light": this.toCommit.length == 0, | |
61 "btn-info": this.toCommit.length > 0 | |
62 }; | |
63 } | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
64 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 methods: { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 loadLogs() { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 this.$store |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 .dispatch("imports/getImports") |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
69 .then(() => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
70 this.reload = false; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
71 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
72 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 const { status, data } = error.response; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
75 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 message: `${status}: ${data.message || data}` |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
79 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 }, |
2593 | 81 watch: { |
82 filters() { | |
83 this.$store.dispatch("imports/getImports", this.filters); | |
84 } | |
85 }, | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 mounted() { |
2578 | 87 this.loadLogs(); |
88 } | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
89 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 </script> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
91 |
2592 | 92 <style lang="scss" scoped> |
2593 | 93 .logentry { |
94 font-size: 90%; | |
95 } | |
2592 | 96 .logentry:hover { |
97 background: #fafafa; | |
98 } | |
99 </style> |