annotate client/src/components/importconfiguration/types/DQLReport.vue @ 5402:f5063fa7f666 marking-single-beam

Add schema change for marking vessel single beam scans.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 06 Jul 2021 00:30:39 +0200
parents bda102c56cfc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5397
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 <div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 <div class="d-flex px-2">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 <div class="flex-column w-100">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 <div class="flex-row text-left">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 <small class="text-muted">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 <translate>DQL Report</translate>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 </small>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 <div class="w-50">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 <select
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 v-model="selectedReport"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 class="ml-1 mr-1 form-control form-control-sm"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 >
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 <option value="" v-if="this.availableReports.length === 0"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 ><translate>No data selectable</translate></option
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 >
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 <option
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 v-for="(option, index) in this.availableReports"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 :key="index"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 :value="option"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 >{{ option }}</option
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 >
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 </select>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 <div v-if="!selectedReport" class="d-flex px-2">
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 <small
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 ><translate class="text-danger"
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 >Please select a report to update</translate
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 ></small
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 >
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 </div>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 </template>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
37
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
38 <script>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
39 /* This is Free Software under GNU Affero General Public License v >= 3.0
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
40 * without warranty, see README.md and license for details.
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
41 *
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42 * SPDX-License-Identifier: AGPL-3.0-or-later
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43 * License-Filename: LICENSES/AGPL-3.0.txt
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
44 *
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
45 * Copyright (C) 2018 by via donau
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
46 * – Österreichische Wasserstraßen-Gesellschaft mbH
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
47 * Software engineering by Intevation GmbH
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
48 *
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
49 * Author(s):
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
50 * Thomas Junk <thomas.junk@intevation.de>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
51 */
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
52 import { displayError } from "@/lib/errors";
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
53
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
54 export default {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
55 name: "reports",
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56 props: ["reportName", "availableReports"],
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 mounted() {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 this.$store.dispatch("importschedule/loadAvailableReports").catch(error => {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59 let message = "Backend not reachable";
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60 if (error.response) {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
61 const { status, data } = error.response;
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
62 message = `${status}: ${data.message || data}`;
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
63 }
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 displayError({
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 title: this.$gettext("Backend Error"),
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66 message: message
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
67 });
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
68 });
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 },
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
70 computed: {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
71 selectedReport: {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
72 get() {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 return this.reportName;
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 },
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75 set(value) {
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 this.selected = value;
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 this.$emit("reportNameChanged", value);
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78 }
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 }
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 }
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81 };
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
82 </script>
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
83
bda102c56cfc add missing component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
84 <style></style>