Mercurial > gemma
annotate client/src/store/imports.js @ 1809:b16a6db0008f
feat: define sections and stretches with targetting option
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 15 Jan 2019 17:02:51 +0100 |
parents | 0f98ef2531a5 |
children | f1ac917ec4a0 |
rev | line source |
---|---|
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1311
diff
changeset
|
1 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 * without warranty, see README.md and license for details. |
1173 | 3 * |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 * SPDX-License-Identifier: AGPL-3.0-or-later |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
5 * License-Filename: LICENSES/AGPL-3.0.txt |
1173 | 6 * |
7 * Copyright (C) 2018 by via donau | |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 * – Österreichische Wasserstraßen-Gesellschaft mbH |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 * Software engineering by Intevation GmbH |
1173 | 10 * |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 * Author(s): |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 * Thomas Junk <thomas.junk@intevation.de> |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 */ |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
15 import { HTTP } from "@/lib/http"; |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
16 import Vue from "vue"; |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
18 /* eslint-disable no-unused-vars */ |
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
19 /* eslint-disable no-unreachable */ |
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
20 const STATES = { |
1468 | 21 NEEDSAPPROVAL: "pending", |
22 APPROVED: "accepted", | |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1470
diff
changeset
|
23 REJECTED: "declined" |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
24 }; |
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
25 |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
26 const IMPORTTYPES = { |
1747
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
27 BOTTLENECK: "bottleneck", |
1749
0a6b2ace7b7e
Gauge measurement, Fairway availability implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
1747
diff
changeset
|
28 WATERWAYAXIS: "waterwayaxis", |
0a6b2ace7b7e
Gauge measurement, Fairway availability implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
1747
diff
changeset
|
29 GAUGEMEASUREMENT: "gaugemeasurement", |
1789
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
30 FAIRWAYAVAILABILITY: "fairwayavailability", |
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
31 WATERWAYAREA: "waterwayarea", |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
32 FAIRWAYDIMENSIONS: "fd", |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
33 WATERWAYGAUGES: "wg" |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
34 }; |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
35 |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
36 const SCHEDULES = { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
37 DAILY: "daily", |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
38 MONTHLY: "monthly" |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
39 }; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
40 |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
41 const IMPORTTYPEKIND = { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
42 bottleneck: "bn", |
1765
f73fc7e5b51a
fix: typo »fairwayawailability« m(
Thomas Junk <thomas.junk@intevation.de>
parents:
1762
diff
changeset
|
43 fairwayavailability: "fa", |
1762
f567ede52fa6
Fixed kind key for gaugemeasurement in client.
Sascha Wilde <wilde@intevation.de>
parents:
1749
diff
changeset
|
44 gaugemeasurement: "gm", |
1789
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
45 waterwayaxis: "wx", |
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
46 waterwayarea: "wa", |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
47 fairwaydimensions: "fd", |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
48 waterwaygauges: "wg" |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
49 }; |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
50 |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
51 const KINDIMPORTTYPE = { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
52 bn: "bottleneck", |
1765
f73fc7e5b51a
fix: typo »fairwayawailability« m(
Thomas Junk <thomas.junk@intevation.de>
parents:
1762
diff
changeset
|
53 fa: "fairwayavailability", |
1770 | 54 gm: "gaugemeasurement", |
1789
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
55 wx: "waterwayaxis", |
4a7aa3f57efe
importschedule: frontend for WW_Area and Fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
1770
diff
changeset
|
56 wa: "waterwayarea", |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
57 fd: "fairwaydimensions", |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
58 wg: "waterwaygauges" |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
59 }; |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
60 |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
61 const initializeCurrentSchedule = () => { |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
62 return { |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
63 id: null, |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
64 importType: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
65 schedule: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
66 import_: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
67 importSource: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
68 eMailNotification: false, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
69 scheduled: false, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
70 easyCron: true, |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
71 cronString: "* * * * ", |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
72 cronMode: "", |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
73 minutes: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
74 month: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
75 hour: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
76 day: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
77 dayOfMonth: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
78 simple: null, |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
79 url: null, |
1747
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
80 insecure: false, |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
81 triggerActive: true, |
1747
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
82 featureType: null, |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
83 sortBy: null, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
84 username: "", |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
85 password: "" |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
86 }; |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
87 }; |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
88 |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
89 // initial state |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
90 const init = () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
91 return { |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
92 imports: [], |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
93 staging: [], |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
94 schedules: [], |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
95 importScheduleDetailVisible: false, |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
96 currentSchedule: initializeCurrentSchedule(), |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
97 importToReview: null |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
98 }; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
99 }; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
100 |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
101 const imports = { |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
102 init, |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 namespaced: true, |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
104 state: init(), |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 mutations: { |
1714
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
106 clearCurrentSchedule: state => { |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
107 state.currentSchedule = initializeCurrentSchedule(); |
1b25e7a3a92e
importschedule: manage initial data from detailsview via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1711
diff
changeset
|
108 }, |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
109 setImportScheduleDetailInvisible: state => { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
110 state.importScheduleDetailVisible = false; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
111 }, |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
112 setImportScheduleDetailVisible: state => { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
113 state.importScheduleDetailVisible = true; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
114 }, |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
115 setSchedules: (state, schedules) => { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
116 state.schedules = schedules; |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
117 }, |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
118 setImports: (state, imports) => { |
1173 | 119 state.imports = imports; |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
120 }, |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
121 setStaging: (state, staging) => { |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
122 const enriched = staging.map(x => { |
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
123 return { ...x, status: STATES.NEEDSAPPROVAL }; |
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
124 }); |
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
125 state.staging = enriched; |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
126 }, |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
127 setImportToReview: (state, id) => { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
128 if (!isNaN(parseFloat(id)) && isFinite(id)) { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
129 state.importToReview = id; |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
130 } |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1593
diff
changeset
|
131 }, |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
132 toggleApproval: (state, change) => { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
133 const { id, newStatus } = change; |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
134 const stagedResult = state.staging.find(e => { |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
135 return e.id === id; |
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
136 }); |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
137 if (stagedResult.status === newStatus) { |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
138 stagedResult.status = STATES.NEEDSAPPROVAL; |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
139 } else { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
140 stagedResult.status = newStatus; |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
141 } |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
142 }, |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
143 unmarshallCurrentSchedule: (state, payload) => { |
1744
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
144 const { kind, id, cron, url, attributes } = payload; |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
145 const eMailNotification = payload["send-email"]; |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
146 Vue.set(state.currentSchedule, "import_", KINDIMPORTTYPE[kind]); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
147 Vue.set(state.currentSchedule, "id", id); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
148 if (cron) { |
1734
549337e6facd
importschedule: POC edit functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
149 Vue.set(state.currentSchedule, "scheduled", true); |
549337e6facd
importschedule: POC edit functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
150 Vue.set(state.currentSchedule, "easyCron", false); |
549337e6facd
importschedule: POC edit functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
151 Vue.set(state.currentSchedule, "cronString", cron); |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
152 } |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
153 if (eMailNotification) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
154 Vue.set(state.currentSchedule, "eMailNotification", eMailNotification); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
155 } |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
156 if (url) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
157 Vue.set(state.currentSchedule, "url", url); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
158 } |
1744
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
159 if (attributes) { |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
160 let { insecure, username, password } = attributes; |
1769
435612f42adb
sort-by problem fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
1765
diff
changeset
|
161 let sortBy = attributes["sort-by"]; |
1747
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
162 const featureType = attributes["feature-type"]; |
1744
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
163 insecure = insecure == "true"; |
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
164 if (insecure) { |
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
165 Vue.set(state.currentSchedule, "insecure", insecure); |
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
166 } |
1747
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
167 if (featureType) { |
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
168 Vue.set(state.currentSchedule, "featureType", featureType); |
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
169 } |
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
170 if (sortBy) { |
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
171 Vue.set(state.currentSchedule, "sortBy", sortBy); |
90178f4ce255
import waterway axis
Thomas Junk <thomas.junk@intevation.de>
parents:
1744
diff
changeset
|
172 } |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
173 if (username) { |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
174 Vue.set(state.currentSchedule, "username", username); |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
175 } |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
176 if (password) { |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
177 Vue.set(state.currentSchedule, "password", password); |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
178 } |
1744
ecd4ceccfd02
importschedule: insecure flag is now unmarshalled
Thomas Junk <thomas.junk@intevation.de>
parents:
1734
diff
changeset
|
179 } |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
180 } |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
181 }, |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
182 actions: { |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
183 loadSchedule({ commit }, id) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
184 return new Promise((resolve, reject) => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
185 HTTP.get("/imports/config/" + id, { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
186 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
187 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
188 .then(response => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
189 commit("unmarshallCurrentSchedule", response.data); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
190 resolve(response); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
191 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
192 .catch(error => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
193 reject(error); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
194 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
195 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
196 }, |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
197 deleteSchedule({ commit }, id) { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
198 return new Promise((resolve, reject) => { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
199 HTTP.delete("imports/config/" + id, { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
200 headers: { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
201 "X-Gemma-Auth": localStorage.getItem("token") |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
202 } |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
203 }) |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
204 .then(response => { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
205 resolve(response); |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
206 }) |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
207 .catch(error => { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
208 reject(error); |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
209 }); |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
210 }); |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
211 }, |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
212 updateCurrentSchedule({ commit }, payload) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
213 const { data, id } = payload; |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
214 return new Promise((resolve, reject) => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
215 HTTP.patch("imports/config/" + id, data, { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
216 headers: { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
217 "X-Gemma-Auth": localStorage.getItem("token") |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
218 } |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
219 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
220 .then(response => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
221 resolve(response); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
222 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
223 .catch(error => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
224 reject(error); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
225 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
226 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
227 }, |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
228 saveCurrentSchedule({ commit }, data) { |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
229 return new Promise((resolve, reject) => { |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
230 HTTP.post("imports/config", data, { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
231 headers: { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
232 "X-Gemma-Auth": localStorage.getItem("token") |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
233 } |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
234 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
235 .then(response => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
236 resolve(response); |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
237 }) |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
238 .catch(error => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
239 reject(error); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
240 }); |
1724
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
241 }); |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
242 }, |
79a18eb1672b
import: POC import saveable
Thomas Junk <thomas.junk@intevation.de>
parents:
1714
diff
changeset
|
243 loadSchedules({ commit }) { |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
244 return new Promise((resolve, reject) => { |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
245 HTTP.get("/imports/config", { |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
246 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
247 }) |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
248 .then(response => { |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
249 commit("setSchedules", response.data); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
250 resolve(response); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
251 }) |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
252 .catch(error => { |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
253 reject(error); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
254 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
255 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1709
diff
changeset
|
256 }, |
1709
8ff8d873ef6b
refac: trigger manual import via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
257 triggerImport({ commit }, { type, data }) { |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
258 return new Promise((resolve, reject) => { |
1709
8ff8d873ef6b
refac: trigger manual import via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
259 HTTP.post("imports/" + type, data, { |
8ff8d873ef6b
refac: trigger manual import via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
260 headers: { |
8ff8d873ef6b
refac: trigger manual import via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
261 "X-Gemma-Auth": localStorage.getItem("token") |
8ff8d873ef6b
refac: trigger manual import via store
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
262 } |
1429
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
263 }) |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
264 .then(response => { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
265 resolve(response); |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
266 }) |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
267 .catch(error => { |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
268 reject(error); |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
269 }); |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
270 }); |
f4b3fb43b311
automatic imports WIP added
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
271 }, |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
272 getImports({ commit }) { |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
273 return new Promise((resolve, reject) => { |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
274 HTTP.get("/imports", { |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
275 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
276 }) |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
277 .then(response => { |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
278 commit("setImports", response.data.imports); |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
279 resolve(response); |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
280 }) |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
281 .catch(error => { |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
282 reject(error); |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
283 }); |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
284 }); |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
285 }, |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
286 getStaging({ commit }) { |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
287 return new Promise((resolve, reject) => { |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
288 HTTP.get("/imports?states=pending", { |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
289 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
290 }) |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
291 .then(response => { |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
292 commit("setStaging", response.data.imports); |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
293 resolve(response); |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
294 }) |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
295 .catch(error => { |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
296 reject(error); |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
297 }); |
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1296
diff
changeset
|
298 }); |
1142
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
299 } |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
300 } |
dc3f0277628a
feat: Importqueue listing (Proof of concept)
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
301 }; |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1311
diff
changeset
|
302 |
1791
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
303 export { |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
304 imports, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
305 STATES, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
306 SCHEDULES, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
307 IMPORTTYPES, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
308 IMPORTTYPEKIND, |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
309 initializeCurrentSchedule |
0f98ef2531a5
importschedule: frontend for waterway gauges etd
Thomas Junk <thomas.junk@intevation.de>
parents:
1789
diff
changeset
|
310 }; |