@opengeoweb/knmi-components 17.0.1 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +25 -12
- package/index.d.ts +0 -1
- package/index.esm.js +0 -855
package/package.json
CHANGED
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/knmi-components",
|
|
3
|
-
"version": "17.0
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"description": "GeoWeb knmi-components library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
|
+
"main": "./dist/index.esm.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"@opengeoweb/source": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"default": "./dist/index.esm.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
10
22
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/form-fields": "
|
|
23
|
+
"@opengeoweb/form-fields": "*",
|
|
12
24
|
"react-hook-form": "^7.61.1",
|
|
13
25
|
"@mui/material": "^7.2.0",
|
|
14
|
-
"@opengeoweb/shared": "
|
|
15
|
-
"@opengeoweb/theme": "
|
|
26
|
+
"@opengeoweb/shared": "*",
|
|
27
|
+
"@opengeoweb/theme": "*",
|
|
16
28
|
"i18next": "^25.3.2",
|
|
17
29
|
"react-i18next": "^15.1.1",
|
|
18
|
-
"@opengeoweb/api": "
|
|
19
|
-
"@opengeoweb/authentication": "
|
|
30
|
+
"@opengeoweb/api": "*",
|
|
31
|
+
"@opengeoweb/authentication": "*",
|
|
20
32
|
"@tanstack/react-query": "^5.85.5",
|
|
21
33
|
"react-redux": "^9.2.0",
|
|
22
|
-
"@opengeoweb/snackbar": "
|
|
34
|
+
"@opengeoweb/snackbar": "*"
|
|
23
35
|
},
|
|
24
36
|
"devDependencies": {
|
|
25
37
|
"eslint-plugin-storybook": "10.3.3"
|
|
26
38
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"README.md",
|
|
42
|
+
"package.json"
|
|
43
|
+
]
|
|
44
|
+
}
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/index";
|
package/index.esm.js
DELETED
|
@@ -1,855 +0,0 @@
|
|
|
1
|
-
import { LinearProgress, Box, Grid, FormControlLabel, Radio, MenuItem, Checkbox, Button } from '@mui/material';
|
|
2
|
-
import { useFormContext } from 'react-hook-form';
|
|
3
|
-
import { FORM_FIELDS_NAMESPACE, ReactHookFormTextField, ReactHookFormNumberField, isLatitude, isLongitude, isValidMin, isValidMax, ReactHookFormDateTime, isXHoursBefore, isXHoursAfter, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormFormControl, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
4
|
-
import { sessionStorageProvider, SHARED_NAMESPACE, usePreventBrowserClose, AlertBanner, dateUtils, ErrorBoundary } from '@opengeoweb/shared';
|
|
5
|
-
import { useMutation } from '@tanstack/react-query';
|
|
6
|
-
import { useDispatch } from 'react-redux';
|
|
7
|
-
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
8
|
-
import { snackbarActions, snackbarTypes } from '@opengeoweb/snackbar';
|
|
9
|
-
import { getHeaders, handleResponse } from '@opengeoweb/api';
|
|
10
|
-
import 'i18next';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
|
-
|
|
14
|
-
var en = {
|
|
15
|
-
"error-auth-login": "This feature is protected by authentication. Please log in to proceed",
|
|
16
|
-
"error-publish": "Something went wrong while publishing. Please try again.",
|
|
17
|
-
"message-publish-success": "Product was published successfully",
|
|
18
|
-
"clear-form": "Clear",
|
|
19
|
-
"publish-form": "Publish",
|
|
20
|
-
"reference-name": "Reference name",
|
|
21
|
-
latitude: "Latitude",
|
|
22
|
-
longitude: "Longitude",
|
|
23
|
-
"release-height": "Release height (m)",
|
|
24
|
-
start: "Start",
|
|
25
|
-
"direction-back": "Backward",
|
|
26
|
-
"direction-for": "Forward",
|
|
27
|
-
"trajectory-duration": "Trajectory duration (hours)",
|
|
28
|
-
"num-vertical-levels": "Number of vertical levels",
|
|
29
|
-
"spatial-uncertainty": "Add spatial uncertainty",
|
|
30
|
-
"start-time-before-error-message": "The start time cannot lie more than {{hours}} hours in the past",
|
|
31
|
-
"start-time-after-error-message": "The start time cannot lie more than {{hours}} hours in the future",
|
|
32
|
-
"trajectory-duration-min-error": "The minimum duration is 1 hour",
|
|
33
|
-
"trajectory-duration-max-error": "The maximum duration is 125 hours",
|
|
34
|
-
"release-height-min-error": "The minimum release height is 0 meters",
|
|
35
|
-
"release-height-max-error": "The maximum release height is 10000 meters"
|
|
36
|
-
};
|
|
37
|
-
var fi = {
|
|
38
|
-
};
|
|
39
|
-
var no = {
|
|
40
|
-
};
|
|
41
|
-
var nl = {
|
|
42
|
-
"error-auth-login": "Deze functie wordt beschermd door authenticatie. Log in om verder te gaan",
|
|
43
|
-
"error-publish": "Er is iets mis gegaan met publiceren. Probeer het opnieuw.",
|
|
44
|
-
"message-publish-success": "Product is succesvol gepubliceerd",
|
|
45
|
-
"clear-form": "Wissen",
|
|
46
|
-
"publish-form": "Publiceren",
|
|
47
|
-
"reference-name": "Referentie naam",
|
|
48
|
-
latitude: "Latitude",
|
|
49
|
-
longitude: "Longitude",
|
|
50
|
-
"release-height": "Vrijgave hoogte (m)",
|
|
51
|
-
start: "Start",
|
|
52
|
-
"direction-back:": "Achteruit",
|
|
53
|
-
"direction-for": "Vooruit",
|
|
54
|
-
"trajectory-duration": "Traject duratie (uren)",
|
|
55
|
-
"num-vertical-levels": "Aantal verticale niveaus",
|
|
56
|
-
"spatial-uncertainty": "Ruimtelijke onzekerheid toevoegen",
|
|
57
|
-
"start-time-before-error-message": "De start tijd mag niet meer dan {{hours}} uur in het verleden liggen",
|
|
58
|
-
"start-time-after-error-message": "De start tijd mag niet meer dan {{hours}} uur in de toekomst liggen",
|
|
59
|
-
"trajectory-duration-min-error": "De minimale duur is 1 uur",
|
|
60
|
-
"trajectory-duration-max-error": "De maximale duur is 125 uur",
|
|
61
|
-
"release-height-min-error": "De minimale vrijgave hoogte is 0 meter",
|
|
62
|
-
"release-height-max-error": "De maximale Vrijgave hoogte is 10000 meter"
|
|
63
|
-
};
|
|
64
|
-
var knmicomponentTranslations = {
|
|
65
|
-
en: en,
|
|
66
|
-
fi: fi,
|
|
67
|
-
no: no,
|
|
68
|
-
nl: nl
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
function _OverloadYield(e, d) {
|
|
72
|
-
this.v = e, this.k = d;
|
|
73
|
-
}
|
|
74
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
75
|
-
try {
|
|
76
|
-
var i = n[a](c),
|
|
77
|
-
u = i.value;
|
|
78
|
-
} catch (n) {
|
|
79
|
-
return void e(n);
|
|
80
|
-
}
|
|
81
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
82
|
-
}
|
|
83
|
-
function _asyncToGenerator(n) {
|
|
84
|
-
return function () {
|
|
85
|
-
var t = this,
|
|
86
|
-
e = arguments;
|
|
87
|
-
return new Promise(function (r, o) {
|
|
88
|
-
var a = n.apply(t, e);
|
|
89
|
-
function _next(n) {
|
|
90
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
91
|
-
}
|
|
92
|
-
function _throw(n) {
|
|
93
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
94
|
-
}
|
|
95
|
-
_next(void 0);
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function _regenerator() {
|
|
100
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
101
|
-
var e,
|
|
102
|
-
t,
|
|
103
|
-
r = "function" == typeof Symbol ? Symbol : {},
|
|
104
|
-
n = r.iterator || "@@iterator",
|
|
105
|
-
o = r.toStringTag || "@@toStringTag";
|
|
106
|
-
function i(r, n, o, i) {
|
|
107
|
-
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
108
|
-
u = Object.create(c.prototype);
|
|
109
|
-
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
110
|
-
var i,
|
|
111
|
-
c,
|
|
112
|
-
u,
|
|
113
|
-
f = 0,
|
|
114
|
-
p = o || [],
|
|
115
|
-
y = false,
|
|
116
|
-
G = {
|
|
117
|
-
p: 0,
|
|
118
|
-
n: 0,
|
|
119
|
-
v: e,
|
|
120
|
-
a: d,
|
|
121
|
-
f: d.bind(e, 4),
|
|
122
|
-
d: function (t, r) {
|
|
123
|
-
return i = t, c = 0, u = e, G.n = r, a;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
function d(r, n) {
|
|
127
|
-
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
128
|
-
var o,
|
|
129
|
-
i = p[t],
|
|
130
|
-
d = G.p,
|
|
131
|
-
l = i[2];
|
|
132
|
-
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
133
|
-
}
|
|
134
|
-
if (o || r > 1) return a;
|
|
135
|
-
throw y = true, n;
|
|
136
|
-
}
|
|
137
|
-
return function (o, p, l) {
|
|
138
|
-
if (f > 1) throw TypeError("Generator is already running");
|
|
139
|
-
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
140
|
-
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
141
|
-
try {
|
|
142
|
-
if (f = 2, i) {
|
|
143
|
-
if (c || (o = "next"), t = i[o]) {
|
|
144
|
-
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
145
|
-
if (!t.done) return t;
|
|
146
|
-
u = t.value, c < 2 && (c = 0);
|
|
147
|
-
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
148
|
-
i = e;
|
|
149
|
-
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
150
|
-
} catch (t) {
|
|
151
|
-
i = e, c = 1, u = t;
|
|
152
|
-
} finally {
|
|
153
|
-
f = 1;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
value: t,
|
|
158
|
-
done: y
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
}(r, o, i), true), u;
|
|
162
|
-
}
|
|
163
|
-
var a = {};
|
|
164
|
-
function Generator() {}
|
|
165
|
-
function GeneratorFunction() {}
|
|
166
|
-
function GeneratorFunctionPrototype() {}
|
|
167
|
-
t = Object.getPrototypeOf;
|
|
168
|
-
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
169
|
-
return this;
|
|
170
|
-
}), t),
|
|
171
|
-
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
172
|
-
function f(e) {
|
|
173
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
174
|
-
}
|
|
175
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
176
|
-
return this;
|
|
177
|
-
}), _regeneratorDefine(u, "toString", function () {
|
|
178
|
-
return "[object Generator]";
|
|
179
|
-
}), (_regenerator = function () {
|
|
180
|
-
return {
|
|
181
|
-
w: i,
|
|
182
|
-
m: f
|
|
183
|
-
};
|
|
184
|
-
})();
|
|
185
|
-
}
|
|
186
|
-
function _regeneratorAsync(n, e, r, t, o) {
|
|
187
|
-
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
188
|
-
return a.next().then(function (n) {
|
|
189
|
-
return n.done ? n.value : a.next();
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
193
|
-
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
194
|
-
}
|
|
195
|
-
function _regeneratorAsyncIterator(t, e) {
|
|
196
|
-
function n(r, o, i, f) {
|
|
197
|
-
try {
|
|
198
|
-
var c = t[r](o),
|
|
199
|
-
u = c.value;
|
|
200
|
-
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
201
|
-
n("next", t, i, f);
|
|
202
|
-
}, function (t) {
|
|
203
|
-
n("throw", t, i, f);
|
|
204
|
-
}) : e.resolve(u).then(function (t) {
|
|
205
|
-
c.value = t, i(c);
|
|
206
|
-
}, function (t) {
|
|
207
|
-
return n("throw", t, i, f);
|
|
208
|
-
});
|
|
209
|
-
} catch (t) {
|
|
210
|
-
f(t);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
var r;
|
|
214
|
-
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
215
|
-
return this;
|
|
216
|
-
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
217
|
-
function f() {
|
|
218
|
-
return new e(function (e, r) {
|
|
219
|
-
n(t, i, e, r);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
return r = r ? r.then(f, f) : f();
|
|
223
|
-
}, true);
|
|
224
|
-
}
|
|
225
|
-
function _regeneratorDefine(e, r, n, t) {
|
|
226
|
-
var i = Object.defineProperty;
|
|
227
|
-
try {
|
|
228
|
-
i({}, "", {});
|
|
229
|
-
} catch (e) {
|
|
230
|
-
i = 0;
|
|
231
|
-
}
|
|
232
|
-
_regeneratorDefine = function (e, r, n, t) {
|
|
233
|
-
if (r) i ? i(e, r, {
|
|
234
|
-
value: n,
|
|
235
|
-
enumerable: !t,
|
|
236
|
-
configurable: !t,
|
|
237
|
-
writable: !t
|
|
238
|
-
}) : e[r] = n;else {
|
|
239
|
-
function o(r, n) {
|
|
240
|
-
_regeneratorDefine(e, r, function (e) {
|
|
241
|
-
return this._invoke(r, n, e);
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
o("next", 0), o("throw", 1), o("return", 2);
|
|
245
|
-
}
|
|
246
|
-
}, _regeneratorDefine(e, r, n, t);
|
|
247
|
-
}
|
|
248
|
-
function _regeneratorKeys(e) {
|
|
249
|
-
var n = Object(e),
|
|
250
|
-
r = [];
|
|
251
|
-
for (var t in n) r.unshift(t);
|
|
252
|
-
return function e() {
|
|
253
|
-
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
254
|
-
return e.done = true, e;
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
function _regeneratorValues(e) {
|
|
258
|
-
if (null != e) {
|
|
259
|
-
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
260
|
-
r = 0;
|
|
261
|
-
if (t) return t.call(e);
|
|
262
|
-
if ("function" == typeof e.next) return e;
|
|
263
|
-
if (!isNaN(e.length)) return {
|
|
264
|
-
next: function () {
|
|
265
|
-
return e && r >= e.length && (e = void 0), {
|
|
266
|
-
value: e && e[r++],
|
|
267
|
-
done: !e
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
273
|
-
}
|
|
274
|
-
function _regeneratorRuntime() {
|
|
275
|
-
|
|
276
|
-
var r = _regenerator(),
|
|
277
|
-
e = r.m(_regeneratorRuntime),
|
|
278
|
-
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
279
|
-
function n(r) {
|
|
280
|
-
var e = "function" == typeof r && r.constructor;
|
|
281
|
-
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
282
|
-
}
|
|
283
|
-
var o = {
|
|
284
|
-
throw: 1,
|
|
285
|
-
return: 2,
|
|
286
|
-
break: 3,
|
|
287
|
-
continue: 3
|
|
288
|
-
};
|
|
289
|
-
function a(r) {
|
|
290
|
-
var e, t;
|
|
291
|
-
return function (n) {
|
|
292
|
-
e || (e = {
|
|
293
|
-
stop: function () {
|
|
294
|
-
return t(n.a, 2);
|
|
295
|
-
},
|
|
296
|
-
catch: function () {
|
|
297
|
-
return n.v;
|
|
298
|
-
},
|
|
299
|
-
abrupt: function (r, e) {
|
|
300
|
-
return t(n.a, o[r], e);
|
|
301
|
-
},
|
|
302
|
-
delegateYield: function (r, o, a) {
|
|
303
|
-
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
304
|
-
},
|
|
305
|
-
finish: function (r) {
|
|
306
|
-
return t(n.f, r);
|
|
307
|
-
}
|
|
308
|
-
}, t = function (r, t, o) {
|
|
309
|
-
n.p = e.prev, n.n = e.next;
|
|
310
|
-
try {
|
|
311
|
-
return r(t, o);
|
|
312
|
-
} finally {
|
|
313
|
-
e.next = n.n;
|
|
314
|
-
}
|
|
315
|
-
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
316
|
-
try {
|
|
317
|
-
return r.call(this, e);
|
|
318
|
-
} finally {
|
|
319
|
-
n.p = e.prev, n.n = e.next;
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
return (_regeneratorRuntime = function () {
|
|
324
|
-
return {
|
|
325
|
-
wrap: function (e, t, n, o) {
|
|
326
|
-
return r.w(a(e), t, n, o && o.reverse());
|
|
327
|
-
},
|
|
328
|
-
isGeneratorFunction: n,
|
|
329
|
-
mark: r.m,
|
|
330
|
-
awrap: function (r, e) {
|
|
331
|
-
return new _OverloadYield(r, e);
|
|
332
|
-
},
|
|
333
|
-
AsyncIterator: _regeneratorAsyncIterator,
|
|
334
|
-
async: function (r, e, t, o, u) {
|
|
335
|
-
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
336
|
-
},
|
|
337
|
-
keys: _regeneratorKeys,
|
|
338
|
-
values: _regeneratorValues
|
|
339
|
-
};
|
|
340
|
-
})();
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
var config = sessionStorageProvider.getConfig();
|
|
344
|
-
var publisherBaseUrl = config.GW_KNMI_PUBLISHER_BASE_URL || '';
|
|
345
|
-
var publishProduct = /*#__PURE__*/function () {
|
|
346
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(auth, data, productType) {
|
|
347
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
348
|
-
while (1) switch (_context.prev = _context.next) {
|
|
349
|
-
case 0:
|
|
350
|
-
if (productType === void 0) {
|
|
351
|
-
productType = 'trajks';
|
|
352
|
-
}
|
|
353
|
-
return _context.abrupt("return", fetch(publisherBaseUrl + "/publish/" + productType, {
|
|
354
|
-
headers: getHeaders(auth),
|
|
355
|
-
method: 'POST',
|
|
356
|
-
body: JSON.stringify(data)
|
|
357
|
-
}).then(handleResponse));
|
|
358
|
-
case 2:
|
|
359
|
-
case "end":
|
|
360
|
-
return _context.stop();
|
|
361
|
-
}
|
|
362
|
-
}, _callee);
|
|
363
|
-
}));
|
|
364
|
-
return function publishProduct(_x, _x2, _x3) {
|
|
365
|
-
return _ref.apply(this, arguments);
|
|
366
|
-
};
|
|
367
|
-
}();
|
|
368
|
-
|
|
369
|
-
/* *
|
|
370
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
371
|
-
* you may not use this file except in compliance with the License.
|
|
372
|
-
* You may obtain a copy of the License at
|
|
373
|
-
*
|
|
374
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
375
|
-
*
|
|
376
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
377
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
378
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
379
|
-
* See the License for the specific language governing permissions and
|
|
380
|
-
* limitations under the License.
|
|
381
|
-
*
|
|
382
|
-
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
383
|
-
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
384
|
-
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
385
|
-
* */
|
|
386
|
-
|
|
387
|
-
var KNMICOMPONENTS_NAMESPACE = 'KNMIComponents';
|
|
388
|
-
var ns = [KNMICOMPONENTS_NAMESPACE, SHARED_NAMESPACE, FORM_FIELDS_NAMESPACE];
|
|
389
|
-
var useKNMIComponentsTranslation = function useKNMIComponentsTranslation() {
|
|
390
|
-
return useTranslation(ns);
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
var usePublishProduct = function usePublishProduct() {
|
|
394
|
-
var _useAuthenticationCon = useAuthenticationContext(),
|
|
395
|
-
auth = _useAuthenticationCon.auth;
|
|
396
|
-
var _useKNMIComponentsTra = useKNMIComponentsTranslation(),
|
|
397
|
-
t = _useKNMIComponentsTra.t;
|
|
398
|
-
var dispatch = useDispatch();
|
|
399
|
-
return useMutation({
|
|
400
|
-
mutationFn: function () {
|
|
401
|
-
var _mutationFn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
402
|
-
var data;
|
|
403
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
404
|
-
while (1) switch (_context.prev = _context.next) {
|
|
405
|
-
case 0:
|
|
406
|
-
data = _ref.data;
|
|
407
|
-
if (auth) {
|
|
408
|
-
_context.next = 3;
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
throw new Error('Authentication context not found');
|
|
412
|
-
case 3:
|
|
413
|
-
return _context.abrupt("return", publishProduct(auth, data));
|
|
414
|
-
case 4:
|
|
415
|
-
case "end":
|
|
416
|
-
return _context.stop();
|
|
417
|
-
}
|
|
418
|
-
}, _callee);
|
|
419
|
-
}));
|
|
420
|
-
function mutationFn(_x) {
|
|
421
|
-
return _mutationFn.apply(this, arguments);
|
|
422
|
-
}
|
|
423
|
-
return mutationFn;
|
|
424
|
-
}(),
|
|
425
|
-
onSuccess: function () {
|
|
426
|
-
var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_data, _ref2) {
|
|
427
|
-
var clearForm;
|
|
428
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
429
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
430
|
-
case 0:
|
|
431
|
-
clearForm = _ref2.clearForm;
|
|
432
|
-
dispatch(snackbarActions.openSnackbar({
|
|
433
|
-
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
434
|
-
key: t('message-publish-success')
|
|
435
|
-
}));
|
|
436
|
-
clearForm();
|
|
437
|
-
case 3:
|
|
438
|
-
case "end":
|
|
439
|
-
return _context2.stop();
|
|
440
|
-
}
|
|
441
|
-
}, _callee2);
|
|
442
|
-
}));
|
|
443
|
-
function onSuccess(_x2, _x3) {
|
|
444
|
-
return _onSuccess.apply(this, arguments);
|
|
445
|
-
}
|
|
446
|
-
return onSuccess;
|
|
447
|
-
}()
|
|
448
|
-
});
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
/* *
|
|
452
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
453
|
-
* you may not use this file except in compliance with the License.
|
|
454
|
-
* You may obtain a copy of the License at
|
|
455
|
-
*
|
|
456
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
457
|
-
*
|
|
458
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
459
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
460
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
461
|
-
* See the License for the specific language governing permissions and
|
|
462
|
-
* limitations under the License.
|
|
463
|
-
*
|
|
464
|
-
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
465
|
-
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
466
|
-
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
467
|
-
* */
|
|
468
|
-
|
|
469
|
-
var formStyles = {
|
|
470
|
-
padding: '32px 16px',
|
|
471
|
-
'.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
|
|
472
|
-
paddingTop: '17px',
|
|
473
|
-
paddingBottom: '0px'
|
|
474
|
-
},
|
|
475
|
-
'.MuiInputBase-input.MuiFilledInput-input': {
|
|
476
|
-
paddingTop: '15px',
|
|
477
|
-
paddingBottom: '2px'
|
|
478
|
-
},
|
|
479
|
-
'.MuiPickersSectionList-root': {
|
|
480
|
-
paddingTop: '17px',
|
|
481
|
-
paddingBottom: '0px'
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
var rowStyles = {
|
|
485
|
-
width: '100%',
|
|
486
|
-
display: 'flex',
|
|
487
|
-
flexWrap: 'wrap',
|
|
488
|
-
gap: '16px',
|
|
489
|
-
marginTop: '-8px'
|
|
490
|
-
};
|
|
491
|
-
var fieldStyles = {
|
|
492
|
-
flexGrow: 1,
|
|
493
|
-
flexBasis: '240px',
|
|
494
|
-
minWidth: '240px'
|
|
495
|
-
};
|
|
496
|
-
var fieldStylesRadio = {
|
|
497
|
-
flexGrow: 1,
|
|
498
|
-
flexBasis: '112px',
|
|
499
|
-
minWidth: '112px'
|
|
500
|
-
};
|
|
501
|
-
var MIN_HEIGHT = 0;
|
|
502
|
-
var MAX_HEIGHT = 10000;
|
|
503
|
-
var MIN_DURATION = 1;
|
|
504
|
-
var MAX_DURATION = 125;
|
|
505
|
-
var MIN_MAX_TIME = 120;
|
|
506
|
-
|
|
507
|
-
// String type for number fields is to allow empty default values
|
|
508
|
-
|
|
509
|
-
var generateDefaultValues = function generateDefaultValues() {
|
|
510
|
-
var _dateUtils$dateToStri;
|
|
511
|
-
return {
|
|
512
|
-
referenceName: '',
|
|
513
|
-
lat: '',
|
|
514
|
-
lon: '',
|
|
515
|
-
releaseHeight: '',
|
|
516
|
-
start: (_dateUtils$dateToStri = dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {}))) != null ? _dateUtils$dateToStri : '',
|
|
517
|
-
direction: 'forward',
|
|
518
|
-
duration: 48,
|
|
519
|
-
numVerticalLevels: 1,
|
|
520
|
-
spatialUncertainty: false
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
|
-
var Form = function Form() {
|
|
524
|
-
var _useKNMIComponentsTra = useKNMIComponentsTranslation(),
|
|
525
|
-
t = _useKNMIComponentsTra.t;
|
|
526
|
-
var _useFormContext = useFormContext(),
|
|
527
|
-
handleSubmit = _useFormContext.handleSubmit,
|
|
528
|
-
formState = _useFormContext.formState,
|
|
529
|
-
reset = _useFormContext.reset,
|
|
530
|
-
watch = _useFormContext.watch,
|
|
531
|
-
setValue = _useFormContext.setValue;
|
|
532
|
-
var dirtyFields = formState.dirtyFields,
|
|
533
|
-
isValid = formState.isValid;
|
|
534
|
-
var isDirty = Object.keys(dirtyFields).length > 0;
|
|
535
|
-
usePreventBrowserClose(isDirty);
|
|
536
|
-
var _usePublishProduct = usePublishProduct(),
|
|
537
|
-
publishProduct = _usePublishProduct.mutate,
|
|
538
|
-
publishError = _usePublishProduct.error,
|
|
539
|
-
isPublishing = _usePublishProduct.isPending;
|
|
540
|
-
var handleSendForm = function handleSendForm() {
|
|
541
|
-
void handleSubmit(function (data) {
|
|
542
|
-
publishProduct({
|
|
543
|
-
data: data,
|
|
544
|
-
clearForm: handleClearForm
|
|
545
|
-
});
|
|
546
|
-
})();
|
|
547
|
-
};
|
|
548
|
-
var handleClearForm = function handleClearForm() {
|
|
549
|
-
reset(generateDefaultValues());
|
|
550
|
-
};
|
|
551
|
-
var spatialUncertainty = watch('spatialUncertainty');
|
|
552
|
-
return /*#__PURE__*/jsxs("form", {
|
|
553
|
-
"data-testid": "trajks-form",
|
|
554
|
-
style: {
|
|
555
|
-
height: '100%',
|
|
556
|
-
overflowY: 'auto'
|
|
557
|
-
},
|
|
558
|
-
children: [isPublishing ? /*#__PURE__*/jsx(LinearProgress, {
|
|
559
|
-
color: "secondary",
|
|
560
|
-
sx: {
|
|
561
|
-
position: 'absolute',
|
|
562
|
-
width: '100%'
|
|
563
|
-
}
|
|
564
|
-
}) : null, publishError ? /*#__PURE__*/jsx(Box, {
|
|
565
|
-
sx: {
|
|
566
|
-
width: '100%'
|
|
567
|
-
},
|
|
568
|
-
children: /*#__PURE__*/jsx(AlertBanner, {
|
|
569
|
-
info: publishError.message,
|
|
570
|
-
shouldClose: true,
|
|
571
|
-
title: t('error-publish')
|
|
572
|
-
})
|
|
573
|
-
}) : null, /*#__PURE__*/jsxs(Grid, {
|
|
574
|
-
container: true,
|
|
575
|
-
spacing: 3,
|
|
576
|
-
sx: formStyles,
|
|
577
|
-
children: [/*#__PURE__*/jsx(ReactHookFormTextField, {
|
|
578
|
-
label: t('reference-name'),
|
|
579
|
-
name: "referenceName",
|
|
580
|
-
rules: {
|
|
581
|
-
required: true
|
|
582
|
-
},
|
|
583
|
-
size: "small"
|
|
584
|
-
}), /*#__PURE__*/jsxs(Box, {
|
|
585
|
-
sx: rowStyles,
|
|
586
|
-
children: [/*#__PURE__*/jsx(Box, {
|
|
587
|
-
sx: fieldStyles,
|
|
588
|
-
children: /*#__PURE__*/jsx(ReactHookFormNumberField, {
|
|
589
|
-
inputMode: "decimal",
|
|
590
|
-
label: t('latitude'),
|
|
591
|
-
name: "lat",
|
|
592
|
-
rules: {
|
|
593
|
-
required: true,
|
|
594
|
-
validate: {
|
|
595
|
-
isLatitude: isLatitude
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
size: "small"
|
|
599
|
-
})
|
|
600
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
601
|
-
sx: fieldStyles,
|
|
602
|
-
children: /*#__PURE__*/jsx(ReactHookFormNumberField, {
|
|
603
|
-
inputMode: "decimal",
|
|
604
|
-
label: t('longitude'),
|
|
605
|
-
name: "lon",
|
|
606
|
-
rules: {
|
|
607
|
-
required: true,
|
|
608
|
-
validate: {
|
|
609
|
-
isLongitude: isLongitude
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
size: "small"
|
|
613
|
-
})
|
|
614
|
-
})]
|
|
615
|
-
}), /*#__PURE__*/jsxs(Box, {
|
|
616
|
-
sx: rowStyles,
|
|
617
|
-
children: [/*#__PURE__*/jsx(Box, {
|
|
618
|
-
sx: fieldStyles,
|
|
619
|
-
children: /*#__PURE__*/jsx(ReactHookFormNumberField, {
|
|
620
|
-
label: t('release-height'),
|
|
621
|
-
name: "releaseHeight",
|
|
622
|
-
rules: {
|
|
623
|
-
required: true,
|
|
624
|
-
validate: {
|
|
625
|
-
maxHeight: function maxHeight(value) {
|
|
626
|
-
return isValidMax(value, MAX_HEIGHT) || t('release-height-max-error', {
|
|
627
|
-
maxValue: MAX_HEIGHT
|
|
628
|
-
});
|
|
629
|
-
},
|
|
630
|
-
minHeight: function minHeight(value) {
|
|
631
|
-
return isValidMin(value, MIN_HEIGHT) || t('release-height-min-error', {
|
|
632
|
-
minHeightValue: MIN_HEIGHT
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
},
|
|
637
|
-
size: "small"
|
|
638
|
-
})
|
|
639
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
640
|
-
sx: fieldStyles,
|
|
641
|
-
children: /*#__PURE__*/jsx(ReactHookFormDateTime, {
|
|
642
|
-
format: "dd/MM/yyyy HH:mm",
|
|
643
|
-
label: t('start'),
|
|
644
|
-
name: "start",
|
|
645
|
-
openTo: "hours",
|
|
646
|
-
rules: {
|
|
647
|
-
required: true,
|
|
648
|
-
validate: {
|
|
649
|
-
isValidDate: dateUtils.isValidIsoDateString,
|
|
650
|
-
isCurrentTimeWithinXHoursValue: function isCurrentTimeWithinXHoursValue(value) {
|
|
651
|
-
var isValidBefore = isXHoursBefore(dateUtils.getCurrentTimeAsString(), value, MIN_MAX_TIME);
|
|
652
|
-
if (!isValidBefore) {
|
|
653
|
-
return t('start-time-after-error-message', {
|
|
654
|
-
hours: MIN_MAX_TIME
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
var isValidAfter = isXHoursAfter(dateUtils.getCurrentTimeAsString(), value, MIN_MAX_TIME);
|
|
658
|
-
return isValidBefore && isValidAfter || t('start-time-before-error-message', {
|
|
659
|
-
hours: MIN_MAX_TIME
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
})
|
|
665
|
-
})]
|
|
666
|
-
}), /*#__PURE__*/jsx(ReactHookFormRadioGroup, {
|
|
667
|
-
name: "direction",
|
|
668
|
-
row: true,
|
|
669
|
-
rules: {
|
|
670
|
-
required: true
|
|
671
|
-
},
|
|
672
|
-
children: /*#__PURE__*/jsxs(Box, {
|
|
673
|
-
sx: rowStyles,
|
|
674
|
-
children: [/*#__PURE__*/jsx(Box, {
|
|
675
|
-
sx: fieldStylesRadio,
|
|
676
|
-
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
677
|
-
control: /*#__PURE__*/jsx(Radio, {}),
|
|
678
|
-
label: t('direction-for'),
|
|
679
|
-
value: "forward"
|
|
680
|
-
}, "forward")
|
|
681
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
682
|
-
sx: fieldStylesRadio,
|
|
683
|
-
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
684
|
-
control: /*#__PURE__*/jsx(Radio, {}),
|
|
685
|
-
label: t('direction-back'),
|
|
686
|
-
value: "backward"
|
|
687
|
-
}, "backward")
|
|
688
|
-
})]
|
|
689
|
-
})
|
|
690
|
-
}), /*#__PURE__*/jsxs(Box, {
|
|
691
|
-
sx: rowStyles,
|
|
692
|
-
children: [/*#__PURE__*/jsx(Box, {
|
|
693
|
-
sx: fieldStyles,
|
|
694
|
-
children: /*#__PURE__*/jsx(ReactHookFormNumberField, {
|
|
695
|
-
label: t('trajectory-duration'),
|
|
696
|
-
name: "duration",
|
|
697
|
-
rules: {
|
|
698
|
-
required: true,
|
|
699
|
-
validate: {
|
|
700
|
-
maxDuration: function maxDuration(value) {
|
|
701
|
-
return isValidMax(value, MAX_DURATION) || t('trajectory-duration-max-error', {
|
|
702
|
-
maxValue: MAX_DURATION
|
|
703
|
-
});
|
|
704
|
-
},
|
|
705
|
-
minDuration: function minDuration(value) {
|
|
706
|
-
return (
|
|
707
|
-
// The min level depends on the unit
|
|
708
|
-
isValidMin(value, MIN_DURATION) || t('trajectory-duration-min-error', {
|
|
709
|
-
minLevelValue: MIN_DURATION
|
|
710
|
-
})
|
|
711
|
-
);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
},
|
|
715
|
-
size: "small"
|
|
716
|
-
})
|
|
717
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
718
|
-
sx: fieldStyles,
|
|
719
|
-
children: /*#__PURE__*/jsx(ReactHookFormSelect, {
|
|
720
|
-
label: t('num-vertical-levels'),
|
|
721
|
-
name: "numVerticalLevels",
|
|
722
|
-
rules: {
|
|
723
|
-
required: true
|
|
724
|
-
},
|
|
725
|
-
size: "small",
|
|
726
|
-
children: Array.from({
|
|
727
|
-
length: 10
|
|
728
|
-
}, function (_, i) {
|
|
729
|
-
return i + 1;
|
|
730
|
-
}).map(function (level) {
|
|
731
|
-
return /*#__PURE__*/jsx(MenuItem, {
|
|
732
|
-
value: level,
|
|
733
|
-
children: level
|
|
734
|
-
}, level);
|
|
735
|
-
})
|
|
736
|
-
})
|
|
737
|
-
})]
|
|
738
|
-
}), /*#__PURE__*/jsx(ReactHookFormFormControl, {
|
|
739
|
-
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
740
|
-
control: /*#__PURE__*/jsx(Checkbox, {
|
|
741
|
-
checked: spatialUncertainty,
|
|
742
|
-
color: "secondary",
|
|
743
|
-
name: "spatialUncertainty",
|
|
744
|
-
onChange: function onChange() {
|
|
745
|
-
setValue('spatialUncertainty', !spatialUncertainty, {
|
|
746
|
-
shouldDirty: true
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
}),
|
|
750
|
-
label: t('spatial-uncertainty')
|
|
751
|
-
})
|
|
752
|
-
}), /*#__PURE__*/jsxs(Grid, {
|
|
753
|
-
alignItems: "center",
|
|
754
|
-
container: true,
|
|
755
|
-
justifyContent: "flex-end",
|
|
756
|
-
size: 12,
|
|
757
|
-
spacing: 2,
|
|
758
|
-
children: [/*#__PURE__*/jsx(Grid, {
|
|
759
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
760
|
-
onClick: handleClearForm,
|
|
761
|
-
size: "small",
|
|
762
|
-
sx: {
|
|
763
|
-
width: '136px',
|
|
764
|
-
height: '32px'
|
|
765
|
-
},
|
|
766
|
-
variant: "tertiary",
|
|
767
|
-
children: t('clear-form')
|
|
768
|
-
})
|
|
769
|
-
}), /*#__PURE__*/jsx(Grid, {
|
|
770
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
771
|
-
disabled: !isValid || isPublishing,
|
|
772
|
-
onClick: handleSendForm,
|
|
773
|
-
size: "small",
|
|
774
|
-
sx: {
|
|
775
|
-
width: '136px',
|
|
776
|
-
height: '32px'
|
|
777
|
-
},
|
|
778
|
-
variant: "primary",
|
|
779
|
-
children: t('publish-form')
|
|
780
|
-
})
|
|
781
|
-
})]
|
|
782
|
-
})]
|
|
783
|
-
})]
|
|
784
|
-
});
|
|
785
|
-
};
|
|
786
|
-
var TrajksForm = function TrajksForm(props) {
|
|
787
|
-
return /*#__PURE__*/jsx(ReactHookFormProvider, {
|
|
788
|
-
options: Object.assign({}, defaultFormOptions, {
|
|
789
|
-
defaultValues: generateDefaultValues()
|
|
790
|
-
}),
|
|
791
|
-
children: /*#__PURE__*/jsx(Form, Object.assign({}, props))
|
|
792
|
-
});
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
/* *
|
|
796
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
797
|
-
* you may not use this file except in compliance with the License.
|
|
798
|
-
* You may obtain a copy of the License at
|
|
799
|
-
*
|
|
800
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
801
|
-
*
|
|
802
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
803
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
804
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
805
|
-
* See the License for the specific language governing permissions and
|
|
806
|
-
* limitations under the License.
|
|
807
|
-
*
|
|
808
|
-
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
809
|
-
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
810
|
-
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
811
|
-
* */
|
|
812
|
-
var TrajksFormWrapper = function TrajksFormWrapper() {
|
|
813
|
-
var _useKNMIComponentsTra = useKNMIComponentsTranslation(),
|
|
814
|
-
t = _useKNMIComponentsTra.t;
|
|
815
|
-
var _useAuthenticationCon = useAuthenticationContext(),
|
|
816
|
-
isLoggedIn = _useAuthenticationCon.isLoggedIn;
|
|
817
|
-
if (!isLoggedIn) {
|
|
818
|
-
return /*#__PURE__*/jsx(AlertBanner, {
|
|
819
|
-
title: t('error-auth-login')
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
return /*#__PURE__*/jsx(ErrorBoundary, {
|
|
823
|
-
children: /*#__PURE__*/jsx(TrajksForm, {})
|
|
824
|
-
});
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
/* *
|
|
828
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
829
|
-
* you may not use this file except in compliance with the License.
|
|
830
|
-
* You may obtain a copy of the License at
|
|
831
|
-
*
|
|
832
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
833
|
-
*
|
|
834
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
835
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
836
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
837
|
-
* See the License for the specific language governing permissions and
|
|
838
|
-
* limitations under the License.
|
|
839
|
-
*
|
|
840
|
-
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
841
|
-
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
842
|
-
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
843
|
-
* */
|
|
844
|
-
var TRAJKS_COMPONENT_TYPE = 'TrajksModule';
|
|
845
|
-
var componentsLookUp = function componentsLookUp(payload) {
|
|
846
|
-
var componentType = payload.componentType;
|
|
847
|
-
switch (componentType) {
|
|
848
|
-
case TRAJKS_COMPONENT_TYPE:
|
|
849
|
-
return /*#__PURE__*/jsx(TrajksFormWrapper, {});
|
|
850
|
-
default:
|
|
851
|
-
return null;
|
|
852
|
-
}
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
export { Form, KNMICOMPONENTS_NAMESPACE, TrajksForm, componentsLookUp, generateDefaultValues, knmicomponentTranslations as knmiComponentTranslations };
|