Mercurial > gemma
annotate client/src/components/importoverview/Filters.vue @ 3678:8f58851927c0
client: make layer factory only return new layer config for individual maps
instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers.
But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory
reuses the same objects it created before, per map.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 17:31:35 +0200 |
parents | 3473f3b72e21 |
children |
rev | line source |
---|---|
2579 | 1 <template> |
2 <div> | |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
3 <button |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
4 @click="setFilter('pending')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
5 :class="'mr-1 btn btn-xs btn-' + (this.pending ? 'secondary' : 'light')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
6 > |
2579 | 7 <translate>pending</translate> |
8 </button> | |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
9 <button |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
10 @click="setFilter('failed')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
11 :class="'mr-1 btn btn-xs btn-' + (this.failed ? 'secondary' : 'light')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
12 > |
2579 | 13 <translate>failed</translate> |
14 </button> | |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
15 <button |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
16 @click="setFilter('accepted')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
17 :class="'mr-1 btn btn-xs btn-' + (this.accepted ? 'secondary' : 'light')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
18 > |
2579 | 19 <translate>accepted</translate> |
20 </button> | |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
21 <button |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
22 @click="setFilter('declined')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
23 :class="'mr-1 btn btn-xs btn-' + (this.declined ? 'secondary' : 'light')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
24 > |
2579 | 25 <translate>declined</translate> |
26 </button> | |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
27 <button |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
28 @click="setFilter('warning')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
29 :class="'btn btn-xs btn-' + (this.warning ? 'secondary' : 'light')" |
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
30 > |
2579 | 31 <translate>warning</translate> |
32 </button> | |
33 </div> | |
34 </template> | |
35 | |
36 <script> | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
37 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
38 * without warranty, see README.md and license for details. |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
39 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
40 * SPDX-License-Identifier: AGPL-3.0-or-later |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
41 * License-Filename: LICENSES/AGPL-3.0.txt |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
42 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
43 * Copyright (C) 2018 by via donau |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
44 * – Österreichische Wasserstraßen-Gesellschaft mbH |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
45 * Software engineering by Intevation GmbH |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
46 * |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
47 * Author(s): |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
48 * Thomas Junk <thomas.junk@intevation.de> |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
49 */ |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
50 import { mapState } from "vuex"; |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
51 |
2579 | 52 export default { |
53 name: "importfilters", | |
54 methods: { | |
55 setFilter(name) { | |
56 if (this.loading) return; | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
57 this.$store.commit("imports/toggleFilter", name); |
2579 | 58 } |
59 }, | |
60 computed: { | |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
61 ...mapState("imports", [ |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
62 "pending", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
63 "failed", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
64 "accepted", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
65 "warning", |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2593
diff
changeset
|
66 "declined" |
2883
3473f3b72e21
client: importsoverview: filters: made code more compact
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
67 ]) |
2579 | 68 } |
69 }; | |
70 </script> |