Mercurial > gemma
annotate client/src/components/importoverview/ImportOverviewAlt.vue @ 2618:655c1db641b7
client: importoverview2: improved commit button state/style
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 13 Mar 2019 14:52:25 +0100 |
parents | 359f5f0037f5 |
children | eb1ec926ff97 |
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 /> |
2618
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
8 <div class="p-2 d-flex flex-row flex-fill justify-content-between"> |
2578 | 9 <Filters></Filters> |
10 <div> | |
2618
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
11 <button class="btn btn-sm btn-info" :disabled="!reviewed.length"> |
2615
7025d082c115
client: importoverview2: fixed counter in commit button
Markus Kottlaender <markus@intevation.de>
parents:
2593
diff
changeset
|
12 <translate>Commit</translate> {{ reviewed.length }} |
2578 | 13 </button> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 </div> |
2618
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
16 <LogEntry |
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
17 class="border-top d-flex-flex-column w-100" |
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
18 :entry="entry" |
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
19 v-for="entry in imports" |
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
20 :key="entry.id" |
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
21 ></LogEntry> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
23 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
25 <script> |
2578 | 26 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
27 * without warranty, see README.md and license for details. | |
28 * | |
29 * SPDX-License-Identifier: AGPL-3.0-or-later | |
30 * License-Filename: LICENSES/AGPL-3.0.txt | |
31 * | |
32 * Copyright (C) 2018 by via donau | |
33 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
34 * Software engineering by Intevation GmbH | |
35 * | |
36 * Author(s): | |
37 * Thomas Junk <thomas.junk@intevation.de> | |
38 */ | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 |
2578 | 40 import { displayError } from "@/lib/errors.js"; |
2615
7025d082c115
client: importoverview2: fixed counter in commit button
Markus Kottlaender <markus@intevation.de>
parents:
2593
diff
changeset
|
41 import { mapState } from "vuex"; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 export default { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 name: "importoverviewalt", |
2578 | 45 components: { |
46 Filters: () => import("./Filters.vue"), | |
47 LogEntry: () => import("./LogEntry.vue") | |
48 }, | |
49 computed: { | |
2618
655c1db641b7
client: importoverview2: improved commit button state/style
Markus Kottlaender <markus@intevation.de>
parents:
2617
diff
changeset
|
50 ...mapState("imports", ["imports", "filters", "reviewed"]) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
51 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
52 methods: { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
53 loadLogs() { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
54 this.$store |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
55 .dispatch("imports/getImports") |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
56 .then(() => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
57 this.reload = false; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
58 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
59 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
60 const { status, data } = error.response; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
61 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
62 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
63 message: `${status}: ${data.message || data}` |
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 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 }, |
2593 | 68 watch: { |
69 filters() { | |
70 this.$store.dispatch("imports/getImports", this.filters); | |
71 } | |
72 }, | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 mounted() { |
2578 | 74 this.loadLogs(); |
75 } | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 </script> |