@opengeoweb/workspace 6.0.4 → 6.1.1
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/index.esm.js +676 -563
- package/package.json +15 -14
- package/src/lib/components/MapPresetsFormDialog/MapPresetsFormDialog.stories.d.ts +8 -0
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsFormDialog.d.ts +1 -0
- package/src/lib/components/WorkspaceTab/WorkspaceTabConnect.integration.spec.d.ts +1 -0
- package/src/lib/store/viewPresets/types.d.ts +1 -1
- package/src/lib/store/viewPresets/utils.d.ts +1 -0
- package/src/lib/store/workspace/selectors.d.ts +3 -15
- package/src/lib/store/workspaceList/types.d.ts +2 -1
package/index.esm.js
CHANGED
|
@@ -19012,337 +19012,342 @@ var slice$4 = createSlice({
|
|
|
19012
19012
|
var reducer$3 = slice$4.reducer;
|
|
19013
19013
|
var workspaceListActions = slice$4.actions;
|
|
19014
19014
|
|
|
19015
|
-
function _iterableToArrayLimit$2(
|
|
19016
|
-
var
|
|
19017
|
-
if (null !=
|
|
19018
|
-
var
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19015
|
+
function _iterableToArrayLimit$2(r, l) {
|
|
19016
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
19017
|
+
if (null != t) {
|
|
19018
|
+
var e,
|
|
19019
|
+
n,
|
|
19020
|
+
i,
|
|
19021
|
+
u,
|
|
19022
|
+
a = [],
|
|
19023
|
+
f = !0,
|
|
19024
|
+
o = !1;
|
|
19025
19025
|
try {
|
|
19026
|
-
if (
|
|
19027
|
-
if (Object(
|
|
19028
|
-
|
|
19029
|
-
} else for (; !(
|
|
19030
|
-
} catch (
|
|
19031
|
-
|
|
19026
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
19027
|
+
if (Object(t) !== t) return;
|
|
19028
|
+
f = !1;
|
|
19029
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
19030
|
+
} catch (r) {
|
|
19031
|
+
o = !0, n = r;
|
|
19032
19032
|
} finally {
|
|
19033
19033
|
try {
|
|
19034
|
-
if (!
|
|
19034
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
19035
19035
|
} finally {
|
|
19036
|
-
if (
|
|
19036
|
+
if (o) throw n;
|
|
19037
19037
|
}
|
|
19038
19038
|
}
|
|
19039
|
-
return
|
|
19039
|
+
return a;
|
|
19040
19040
|
}
|
|
19041
19041
|
}
|
|
19042
19042
|
function _regeneratorRuntime() {
|
|
19043
19043
|
_regeneratorRuntime = function () {
|
|
19044
|
-
return
|
|
19044
|
+
return e;
|
|
19045
19045
|
};
|
|
19046
|
-
var
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19046
|
+
var t,
|
|
19047
|
+
e = {},
|
|
19048
|
+
r = Object.prototype,
|
|
19049
|
+
n = r.hasOwnProperty,
|
|
19050
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
19051
|
+
t[e] = r.value;
|
|
19051
19052
|
},
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
function define(
|
|
19057
|
-
return Object.defineProperty(
|
|
19058
|
-
value:
|
|
19053
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
19054
|
+
a = i.iterator || "@@iterator",
|
|
19055
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
19056
|
+
u = i.toStringTag || "@@toStringTag";
|
|
19057
|
+
function define(t, e, r) {
|
|
19058
|
+
return Object.defineProperty(t, e, {
|
|
19059
|
+
value: r,
|
|
19059
19060
|
enumerable: !0,
|
|
19060
19061
|
configurable: !0,
|
|
19061
19062
|
writable: !0
|
|
19062
|
-
}),
|
|
19063
|
+
}), t[e];
|
|
19063
19064
|
}
|
|
19064
19065
|
try {
|
|
19065
19066
|
define({}, "");
|
|
19066
|
-
} catch (
|
|
19067
|
-
define = function (
|
|
19068
|
-
return
|
|
19067
|
+
} catch (t) {
|
|
19068
|
+
define = function (t, e, r) {
|
|
19069
|
+
return t[e] = r;
|
|
19069
19070
|
};
|
|
19070
19071
|
}
|
|
19071
|
-
function wrap(
|
|
19072
|
-
var
|
|
19073
|
-
|
|
19074
|
-
|
|
19075
|
-
return
|
|
19076
|
-
value: makeInvokeMethod(
|
|
19077
|
-
}),
|
|
19072
|
+
function wrap(t, e, r, n) {
|
|
19073
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
19074
|
+
a = Object.create(i.prototype),
|
|
19075
|
+
c = new Context(n || []);
|
|
19076
|
+
return o(a, "_invoke", {
|
|
19077
|
+
value: makeInvokeMethod(t, r, c)
|
|
19078
|
+
}), a;
|
|
19078
19079
|
}
|
|
19079
|
-
function tryCatch(
|
|
19080
|
+
function tryCatch(t, e, r) {
|
|
19080
19081
|
try {
|
|
19081
19082
|
return {
|
|
19082
19083
|
type: "normal",
|
|
19083
|
-
arg:
|
|
19084
|
+
arg: t.call(e, r)
|
|
19084
19085
|
};
|
|
19085
|
-
} catch (
|
|
19086
|
+
} catch (t) {
|
|
19086
19087
|
return {
|
|
19087
19088
|
type: "throw",
|
|
19088
|
-
arg:
|
|
19089
|
+
arg: t
|
|
19089
19090
|
};
|
|
19090
19091
|
}
|
|
19091
19092
|
}
|
|
19092
|
-
|
|
19093
|
-
var
|
|
19093
|
+
e.wrap = wrap;
|
|
19094
|
+
var h = "suspendedStart",
|
|
19095
|
+
l = "suspendedYield",
|
|
19096
|
+
f = "executing",
|
|
19097
|
+
s = "completed",
|
|
19098
|
+
y = {};
|
|
19094
19099
|
function Generator() {}
|
|
19095
19100
|
function GeneratorFunction() {}
|
|
19096
19101
|
function GeneratorFunctionPrototype() {}
|
|
19097
|
-
var
|
|
19098
|
-
define(
|
|
19102
|
+
var p = {};
|
|
19103
|
+
define(p, a, function () {
|
|
19099
19104
|
return this;
|
|
19100
19105
|
});
|
|
19101
|
-
var
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
var
|
|
19105
|
-
function defineIteratorMethods(
|
|
19106
|
-
["next", "throw", "return"].forEach(function (
|
|
19107
|
-
define(
|
|
19108
|
-
return this._invoke(
|
|
19106
|
+
var d = Object.getPrototypeOf,
|
|
19107
|
+
v = d && d(d(values([])));
|
|
19108
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
19109
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
19110
|
+
function defineIteratorMethods(t) {
|
|
19111
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
19112
|
+
define(t, e, function (t) {
|
|
19113
|
+
return this._invoke(e, t);
|
|
19109
19114
|
});
|
|
19110
19115
|
});
|
|
19111
19116
|
}
|
|
19112
|
-
function AsyncIterator(
|
|
19113
|
-
function invoke(
|
|
19114
|
-
var
|
|
19115
|
-
if ("throw" !==
|
|
19116
|
-
var
|
|
19117
|
-
|
|
19118
|
-
return
|
|
19119
|
-
invoke("next",
|
|
19120
|
-
}, function (
|
|
19121
|
-
invoke("throw",
|
|
19122
|
-
}) :
|
|
19123
|
-
|
|
19124
|
-
}, function (
|
|
19125
|
-
return invoke("throw",
|
|
19117
|
+
function AsyncIterator(t, e) {
|
|
19118
|
+
function invoke(r, o, i, a) {
|
|
19119
|
+
var c = tryCatch(t[r], t, o);
|
|
19120
|
+
if ("throw" !== c.type) {
|
|
19121
|
+
var u = c.arg,
|
|
19122
|
+
h = u.value;
|
|
19123
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
19124
|
+
invoke("next", t, i, a);
|
|
19125
|
+
}, function (t) {
|
|
19126
|
+
invoke("throw", t, i, a);
|
|
19127
|
+
}) : e.resolve(h).then(function (t) {
|
|
19128
|
+
u.value = t, i(u);
|
|
19129
|
+
}, function (t) {
|
|
19130
|
+
return invoke("throw", t, i, a);
|
|
19126
19131
|
});
|
|
19127
19132
|
}
|
|
19128
|
-
|
|
19133
|
+
a(c.arg);
|
|
19129
19134
|
}
|
|
19130
|
-
var
|
|
19131
|
-
|
|
19132
|
-
value: function (
|
|
19135
|
+
var r;
|
|
19136
|
+
o(this, "_invoke", {
|
|
19137
|
+
value: function (t, n) {
|
|
19133
19138
|
function callInvokeWithMethodAndArg() {
|
|
19134
|
-
return new
|
|
19135
|
-
invoke(
|
|
19139
|
+
return new e(function (e, r) {
|
|
19140
|
+
invoke(t, n, e, r);
|
|
19136
19141
|
});
|
|
19137
19142
|
}
|
|
19138
|
-
return
|
|
19143
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
19139
19144
|
}
|
|
19140
19145
|
});
|
|
19141
19146
|
}
|
|
19142
|
-
function makeInvokeMethod(
|
|
19143
|
-
var
|
|
19144
|
-
return function (
|
|
19145
|
-
if (
|
|
19146
|
-
if (
|
|
19147
|
-
if ("throw" ===
|
|
19147
|
+
function makeInvokeMethod(e, r, n) {
|
|
19148
|
+
var o = h;
|
|
19149
|
+
return function (i, a) {
|
|
19150
|
+
if (o === f) throw new Error("Generator is already running");
|
|
19151
|
+
if (o === s) {
|
|
19152
|
+
if ("throw" === i) throw a;
|
|
19148
19153
|
return {
|
|
19149
|
-
value:
|
|
19154
|
+
value: t,
|
|
19150
19155
|
done: !0
|
|
19151
19156
|
};
|
|
19152
19157
|
}
|
|
19153
|
-
for (
|
|
19154
|
-
var
|
|
19155
|
-
if (
|
|
19156
|
-
var
|
|
19157
|
-
if (
|
|
19158
|
-
if (
|
|
19159
|
-
return
|
|
19158
|
+
for (n.method = i, n.arg = a;;) {
|
|
19159
|
+
var c = n.delegate;
|
|
19160
|
+
if (c) {
|
|
19161
|
+
var u = maybeInvokeDelegate(c, n);
|
|
19162
|
+
if (u) {
|
|
19163
|
+
if (u === y) continue;
|
|
19164
|
+
return u;
|
|
19160
19165
|
}
|
|
19161
19166
|
}
|
|
19162
|
-
if ("next" ===
|
|
19163
|
-
if (
|
|
19164
|
-
|
|
19165
|
-
} else "return" ===
|
|
19166
|
-
|
|
19167
|
-
var
|
|
19168
|
-
if ("normal" ===
|
|
19169
|
-
if (
|
|
19167
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
19168
|
+
if (o === h) throw o = s, n.arg;
|
|
19169
|
+
n.dispatchException(n.arg);
|
|
19170
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
19171
|
+
o = f;
|
|
19172
|
+
var p = tryCatch(e, r, n);
|
|
19173
|
+
if ("normal" === p.type) {
|
|
19174
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
19170
19175
|
return {
|
|
19171
|
-
value:
|
|
19172
|
-
done:
|
|
19176
|
+
value: p.arg,
|
|
19177
|
+
done: n.done
|
|
19173
19178
|
};
|
|
19174
19179
|
}
|
|
19175
|
-
"throw" ===
|
|
19180
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
19176
19181
|
}
|
|
19177
19182
|
};
|
|
19178
19183
|
}
|
|
19179
|
-
function maybeInvokeDelegate(
|
|
19180
|
-
var
|
|
19181
|
-
|
|
19182
|
-
if (
|
|
19183
|
-
var
|
|
19184
|
-
if ("throw" ===
|
|
19185
|
-
var
|
|
19186
|
-
return
|
|
19187
|
-
}
|
|
19188
|
-
function pushTryEntry(
|
|
19189
|
-
var
|
|
19190
|
-
tryLoc:
|
|
19184
|
+
function maybeInvokeDelegate(e, r) {
|
|
19185
|
+
var n = r.method,
|
|
19186
|
+
o = e.iterator[n];
|
|
19187
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
19188
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
19189
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
19190
|
+
var a = i.arg;
|
|
19191
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
19192
|
+
}
|
|
19193
|
+
function pushTryEntry(t) {
|
|
19194
|
+
var e = {
|
|
19195
|
+
tryLoc: t[0]
|
|
19191
19196
|
};
|
|
19192
|
-
1 in
|
|
19197
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
19193
19198
|
}
|
|
19194
|
-
function resetTryEntry(
|
|
19195
|
-
var
|
|
19196
|
-
|
|
19199
|
+
function resetTryEntry(t) {
|
|
19200
|
+
var e = t.completion || {};
|
|
19201
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
19197
19202
|
}
|
|
19198
|
-
function Context(
|
|
19203
|
+
function Context(t) {
|
|
19199
19204
|
this.tryEntries = [{
|
|
19200
19205
|
tryLoc: "root"
|
|
19201
|
-
}],
|
|
19202
|
-
}
|
|
19203
|
-
function values(
|
|
19204
|
-
if (
|
|
19205
|
-
var
|
|
19206
|
-
if (
|
|
19207
|
-
if ("function" == typeof
|
|
19208
|
-
if (!isNaN(
|
|
19209
|
-
var
|
|
19210
|
-
|
|
19211
|
-
for (; ++
|
|
19212
|
-
return next.value =
|
|
19206
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
19207
|
+
}
|
|
19208
|
+
function values(e) {
|
|
19209
|
+
if (e || "" === e) {
|
|
19210
|
+
var r = e[a];
|
|
19211
|
+
if (r) return r.call(e);
|
|
19212
|
+
if ("function" == typeof e.next) return e;
|
|
19213
|
+
if (!isNaN(e.length)) {
|
|
19214
|
+
var o = -1,
|
|
19215
|
+
i = function next() {
|
|
19216
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
19217
|
+
return next.value = t, next.done = !0, next;
|
|
19213
19218
|
};
|
|
19214
|
-
return
|
|
19219
|
+
return i.next = i;
|
|
19215
19220
|
}
|
|
19216
19221
|
}
|
|
19217
|
-
throw new TypeError(typeof
|
|
19222
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
19218
19223
|
}
|
|
19219
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
19224
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
19220
19225
|
value: GeneratorFunctionPrototype,
|
|
19221
19226
|
configurable: !0
|
|
19222
|
-
}),
|
|
19227
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
19223
19228
|
value: GeneratorFunction,
|
|
19224
19229
|
configurable: !0
|
|
19225
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
19226
|
-
var
|
|
19227
|
-
return !!
|
|
19228
|
-
},
|
|
19229
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
19230
|
-
},
|
|
19230
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
19231
|
+
var e = "function" == typeof t && t.constructor;
|
|
19232
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
19233
|
+
}, e.mark = function (t) {
|
|
19234
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
19235
|
+
}, e.awrap = function (t) {
|
|
19231
19236
|
return {
|
|
19232
|
-
__await:
|
|
19237
|
+
__await: t
|
|
19233
19238
|
};
|
|
19234
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
19239
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
19235
19240
|
return this;
|
|
19236
|
-
}),
|
|
19237
|
-
void 0 ===
|
|
19238
|
-
var
|
|
19239
|
-
return
|
|
19240
|
-
return
|
|
19241
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
19242
|
+
void 0 === i && (i = Promise);
|
|
19243
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
19244
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
19245
|
+
return t.done ? t.value : a.next();
|
|
19241
19246
|
});
|
|
19242
|
-
}, defineIteratorMethods(
|
|
19247
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
19243
19248
|
return this;
|
|
19244
|
-
}), define(
|
|
19249
|
+
}), define(g, "toString", function () {
|
|
19245
19250
|
return "[object Generator]";
|
|
19246
|
-
}),
|
|
19247
|
-
var
|
|
19248
|
-
|
|
19249
|
-
for (var
|
|
19250
|
-
return
|
|
19251
|
-
for (;
|
|
19252
|
-
var
|
|
19253
|
-
if (
|
|
19251
|
+
}), e.keys = function (t) {
|
|
19252
|
+
var e = Object(t),
|
|
19253
|
+
r = [];
|
|
19254
|
+
for (var n in e) r.push(n);
|
|
19255
|
+
return r.reverse(), function next() {
|
|
19256
|
+
for (; r.length;) {
|
|
19257
|
+
var t = r.pop();
|
|
19258
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
19254
19259
|
}
|
|
19255
19260
|
return next.done = !0, next;
|
|
19256
19261
|
};
|
|
19257
|
-
},
|
|
19262
|
+
}, e.values = values, Context.prototype = {
|
|
19258
19263
|
constructor: Context,
|
|
19259
|
-
reset: function (
|
|
19260
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
19264
|
+
reset: function (e) {
|
|
19265
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
19261
19266
|
},
|
|
19262
19267
|
stop: function () {
|
|
19263
19268
|
this.done = !0;
|
|
19264
|
-
var
|
|
19265
|
-
if ("throw" ===
|
|
19269
|
+
var t = this.tryEntries[0].completion;
|
|
19270
|
+
if ("throw" === t.type) throw t.arg;
|
|
19266
19271
|
return this.rval;
|
|
19267
19272
|
},
|
|
19268
|
-
dispatchException: function (
|
|
19269
|
-
if (this.done) throw
|
|
19270
|
-
var
|
|
19271
|
-
function handle(
|
|
19272
|
-
return
|
|
19273
|
-
}
|
|
19274
|
-
for (var
|
|
19275
|
-
var
|
|
19276
|
-
|
|
19277
|
-
if ("root" ===
|
|
19278
|
-
if (
|
|
19279
|
-
var
|
|
19280
|
-
|
|
19281
|
-
if (
|
|
19282
|
-
if (this.prev <
|
|
19283
|
-
if (this.prev <
|
|
19284
|
-
} else if (
|
|
19285
|
-
if (this.prev <
|
|
19273
|
+
dispatchException: function (e) {
|
|
19274
|
+
if (this.done) throw e;
|
|
19275
|
+
var r = this;
|
|
19276
|
+
function handle(n, o) {
|
|
19277
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
19278
|
+
}
|
|
19279
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
19280
|
+
var i = this.tryEntries[o],
|
|
19281
|
+
a = i.completion;
|
|
19282
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
19283
|
+
if (i.tryLoc <= this.prev) {
|
|
19284
|
+
var c = n.call(i, "catchLoc"),
|
|
19285
|
+
u = n.call(i, "finallyLoc");
|
|
19286
|
+
if (c && u) {
|
|
19287
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
19288
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
19289
|
+
} else if (c) {
|
|
19290
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
19286
19291
|
} else {
|
|
19287
|
-
if (!
|
|
19288
|
-
if (this.prev <
|
|
19292
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
19293
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
19289
19294
|
}
|
|
19290
19295
|
}
|
|
19291
19296
|
}
|
|
19292
19297
|
},
|
|
19293
|
-
abrupt: function (
|
|
19294
|
-
for (var
|
|
19295
|
-
var
|
|
19296
|
-
if (
|
|
19297
|
-
var
|
|
19298
|
+
abrupt: function (t, e) {
|
|
19299
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
19300
|
+
var o = this.tryEntries[r];
|
|
19301
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
19302
|
+
var i = o;
|
|
19298
19303
|
break;
|
|
19299
19304
|
}
|
|
19300
19305
|
}
|
|
19301
|
-
|
|
19302
|
-
var
|
|
19303
|
-
return
|
|
19306
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
19307
|
+
var a = i ? i.completion : {};
|
|
19308
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
19304
19309
|
},
|
|
19305
|
-
complete: function (
|
|
19306
|
-
if ("throw" ===
|
|
19307
|
-
return "break" ===
|
|
19310
|
+
complete: function (t, e) {
|
|
19311
|
+
if ("throw" === t.type) throw t.arg;
|
|
19312
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
19308
19313
|
},
|
|
19309
|
-
finish: function (
|
|
19310
|
-
for (var
|
|
19311
|
-
var
|
|
19312
|
-
if (
|
|
19314
|
+
finish: function (t) {
|
|
19315
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
19316
|
+
var r = this.tryEntries[e];
|
|
19317
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
19313
19318
|
}
|
|
19314
19319
|
},
|
|
19315
|
-
catch: function (
|
|
19316
|
-
for (var
|
|
19317
|
-
var
|
|
19318
|
-
if (
|
|
19319
|
-
var
|
|
19320
|
-
if ("throw" ===
|
|
19321
|
-
var
|
|
19322
|
-
resetTryEntry(
|
|
19320
|
+
catch: function (t) {
|
|
19321
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
19322
|
+
var r = this.tryEntries[e];
|
|
19323
|
+
if (r.tryLoc === t) {
|
|
19324
|
+
var n = r.completion;
|
|
19325
|
+
if ("throw" === n.type) {
|
|
19326
|
+
var o = n.arg;
|
|
19327
|
+
resetTryEntry(r);
|
|
19323
19328
|
}
|
|
19324
|
-
return
|
|
19329
|
+
return o;
|
|
19325
19330
|
}
|
|
19326
19331
|
}
|
|
19327
19332
|
throw new Error("illegal catch attempt");
|
|
19328
19333
|
},
|
|
19329
|
-
delegateYield: function (
|
|
19334
|
+
delegateYield: function (e, r, n) {
|
|
19330
19335
|
return this.delegate = {
|
|
19331
|
-
iterator: values(
|
|
19332
|
-
resultName:
|
|
19333
|
-
nextLoc:
|
|
19334
|
-
}, "next" === this.method && (this.arg =
|
|
19336
|
+
iterator: values(e),
|
|
19337
|
+
resultName: r,
|
|
19338
|
+
nextLoc: n
|
|
19339
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
19335
19340
|
}
|
|
19336
|
-
},
|
|
19341
|
+
}, e;
|
|
19337
19342
|
}
|
|
19338
|
-
function _typeof$2(
|
|
19343
|
+
function _typeof$2(o) {
|
|
19339
19344
|
"@babel/helpers - typeof";
|
|
19340
19345
|
|
|
19341
|
-
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
19342
|
-
return typeof
|
|
19343
|
-
} : function (
|
|
19344
|
-
return
|
|
19345
|
-
}, _typeof$2(
|
|
19346
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
19347
|
+
return typeof o;
|
|
19348
|
+
} : function (o) {
|
|
19349
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
19350
|
+
}, _typeof$2(o);
|
|
19346
19351
|
}
|
|
19347
19352
|
function _defineProperty$f(obj, key, value) {
|
|
19348
19353
|
key = _toPropertyKey(key);
|
|
@@ -19945,9 +19950,204 @@ var PresetAction;
|
|
|
19945
19950
|
PresetAction["SAVE"] = "Save";
|
|
19946
19951
|
PresetAction["SAVE_AS"] = "Save as";
|
|
19947
19952
|
PresetAction["SHARE"] = "Share";
|
|
19948
|
-
PresetAction["
|
|
19953
|
+
PresetAction["EDIT"] = "Edit";
|
|
19949
19954
|
})(PresetAction || (PresetAction = {}));
|
|
19950
19955
|
|
|
19956
|
+
/* *
|
|
19957
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19958
|
+
* you may not use this file except in compliance with the License.
|
|
19959
|
+
* You may obtain a copy of the License at
|
|
19960
|
+
*
|
|
19961
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19962
|
+
*
|
|
19963
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19964
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19965
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19966
|
+
* See the License for the specific language governing permissions and
|
|
19967
|
+
* limitations under the License.
|
|
19968
|
+
*
|
|
19969
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19970
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
19971
|
+
* */
|
|
19972
|
+
var getCleanSearchQuery = function getCleanSearchQuery(searchQuery) {
|
|
19973
|
+
return searchQuery.trim().split(/\s+/).join();
|
|
19974
|
+
};
|
|
19975
|
+
|
|
19976
|
+
/* *
|
|
19977
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19978
|
+
* you may not use this file except in compliance with the License.
|
|
19979
|
+
* You may obtain a copy of the License at
|
|
19980
|
+
*
|
|
19981
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19982
|
+
*
|
|
19983
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19984
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19985
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19986
|
+
* See the License for the specific language governing permissions and
|
|
19987
|
+
* limitations under the License.
|
|
19988
|
+
*
|
|
19989
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19990
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
19991
|
+
* */
|
|
19992
|
+
var MAPPRESET_ACTIVE_TITLE = 'New map preset';
|
|
19993
|
+
var MAPPRESET_DIALOG_TITLE_SAVE_AS = 'Save map preset as';
|
|
19994
|
+
var MAPPRESET_DIALOG_TITLE_DELETE = 'Delete map preset';
|
|
19995
|
+
var MAPPRESET_DIALOG_TITLE_EDIT = 'Edit map preset';
|
|
19996
|
+
var getSnackbarMessage$1 = function getSnackbarMessage(action, title) {
|
|
19997
|
+
// Trim and add quotes
|
|
19998
|
+
var trimmedTitle = "\"".concat(title.trim(), "\"");
|
|
19999
|
+
switch (action) {
|
|
20000
|
+
case PresetAction.DELETE:
|
|
20001
|
+
return "Map preset ".concat(trimmedTitle, " successfully deleted");
|
|
20002
|
+
case PresetAction.SAVE_AS:
|
|
20003
|
+
return "New map preset ".concat(trimmedTitle, " successfully saved");
|
|
20004
|
+
case PresetAction.EDIT:
|
|
20005
|
+
return "Map preset ".concat(trimmedTitle, " successfully edited");
|
|
20006
|
+
default:
|
|
20007
|
+
return "Map preset ".concat(trimmedTitle, " successfully saved");
|
|
20008
|
+
}
|
|
20009
|
+
};
|
|
20010
|
+
var getPresetsApi = function getPresetsApi() {
|
|
20011
|
+
return getApi(API_NAME);
|
|
20012
|
+
};
|
|
20013
|
+
var emptyMapViewPreset = {
|
|
20014
|
+
componentType: 'Map',
|
|
20015
|
+
keywords: '',
|
|
20016
|
+
scope: 'user',
|
|
20017
|
+
title: '',
|
|
20018
|
+
initialProps: {
|
|
20019
|
+
mapPreset: {}
|
|
20020
|
+
}
|
|
20021
|
+
};
|
|
20022
|
+
// Returns object of applied user filters such as scope/search etc
|
|
20023
|
+
// If all filter chips are selected, an empty string is returned for that filter which is interpreted in the BE as "return all" _
|
|
20024
|
+
var constructFilterParams$1 = function constructFilterParams(filters, searchQuery) {
|
|
20025
|
+
// get filters
|
|
20026
|
+
var isAllSelectedForFilters = filters.every(function (filter) {
|
|
20027
|
+
return filter.isSelected;
|
|
20028
|
+
});
|
|
20029
|
+
// If all filters are selected, ensure we return nothing for scope
|
|
20030
|
+
var _ref = isAllSelectedForFilters ? {
|
|
20031
|
+
scope: []
|
|
20032
|
+
} : filters.reduce(function (filterList, filter) {
|
|
20033
|
+
if (filter.isSelected && filter.type === 'scope') {
|
|
20034
|
+
return Object.assign(Object.assign({}, filter), {
|
|
20035
|
+
scope: filterList.scope.concat(filter.id)
|
|
20036
|
+
});
|
|
20037
|
+
}
|
|
20038
|
+
return filterList;
|
|
20039
|
+
}, {
|
|
20040
|
+
scope: []
|
|
20041
|
+
}),
|
|
20042
|
+
scope = _ref.scope;
|
|
20043
|
+
// get search
|
|
20044
|
+
var search = getCleanSearchQuery(searchQuery);
|
|
20045
|
+
return Object.assign(Object.assign({}, scope.length && {
|
|
20046
|
+
scope: scope.toString()
|
|
20047
|
+
}), search.length && {
|
|
20048
|
+
search: search
|
|
20049
|
+
});
|
|
20050
|
+
};
|
|
20051
|
+
|
|
20052
|
+
/* *
|
|
20053
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20054
|
+
* you may not use this file except in compliance with the License.
|
|
20055
|
+
* You may obtain a copy of the License at
|
|
20056
|
+
*
|
|
20057
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20058
|
+
*
|
|
20059
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20060
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20061
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20062
|
+
* See the License for the specific language governing permissions and
|
|
20063
|
+
* limitations under the License.
|
|
20064
|
+
*
|
|
20065
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20066
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
20067
|
+
* */
|
|
20068
|
+
var getSnackbarMessage = function getSnackbarMessage(action, title) {
|
|
20069
|
+
// Trim and add quotes
|
|
20070
|
+
var trimmedTitle = "\"".concat(title.trim(), "\"");
|
|
20071
|
+
switch (action) {
|
|
20072
|
+
case WorkspacePresetAction.SAVE_ALL:
|
|
20073
|
+
return "Workspace ".concat(trimmedTitle, " and underlying viewpresets successfully saved");
|
|
20074
|
+
case WorkspacePresetAction.DELETE:
|
|
20075
|
+
return "Workspace ".concat(trimmedTitle, " successfully deleted");
|
|
20076
|
+
case WorkspacePresetAction.DUPLICATE:
|
|
20077
|
+
return "Workspace ".concat(trimmedTitle, " successfully saved");
|
|
20078
|
+
case WorkspacePresetAction.EDIT:
|
|
20079
|
+
return "Workspace ".concat(trimmedTitle, " successfully edited");
|
|
20080
|
+
default:
|
|
20081
|
+
return "Workspace ".concat(trimmedTitle, " successfully saved");
|
|
20082
|
+
}
|
|
20083
|
+
};
|
|
20084
|
+
var emptyMapWorkspace = {
|
|
20085
|
+
title: 'New workspace',
|
|
20086
|
+
scope: 'system',
|
|
20087
|
+
"abstract": '',
|
|
20088
|
+
views: {
|
|
20089
|
+
allIds: ['1_screen'],
|
|
20090
|
+
byId: {
|
|
20091
|
+
'1_screen': {
|
|
20092
|
+
title: MAPPRESET_ACTIVE_TITLE,
|
|
20093
|
+
componentType: 'Map',
|
|
20094
|
+
initialProps: {
|
|
20095
|
+
mapPreset: {
|
|
20096
|
+
layers: [],
|
|
20097
|
+
proj: {
|
|
20098
|
+
bbox: {
|
|
20099
|
+
left: 58703.6377,
|
|
20100
|
+
bottom: 6408480.4514,
|
|
20101
|
+
right: 3967387.5161,
|
|
20102
|
+
top: 11520588.9031
|
|
20103
|
+
},
|
|
20104
|
+
srs: 'EPSG:3857'
|
|
20105
|
+
},
|
|
20106
|
+
shouldShowLayerManager: true,
|
|
20107
|
+
dockedLayerManagerSize: 'sizeSmall'
|
|
20108
|
+
},
|
|
20109
|
+
syncGroupsIds: []
|
|
20110
|
+
}
|
|
20111
|
+
}
|
|
20112
|
+
}
|
|
20113
|
+
},
|
|
20114
|
+
mosaicNode: '1_screen',
|
|
20115
|
+
viewType: 'singleWindow'
|
|
20116
|
+
};
|
|
20117
|
+
var constructFilterParams = function constructFilterParams(filters, searchQuery) {
|
|
20118
|
+
// get filters
|
|
20119
|
+
var _filters$reduce = filters.reduce(function (filterList, filter) {
|
|
20120
|
+
if (filter.isSelected && filter.type === 'scope') {
|
|
20121
|
+
return Object.assign(Object.assign({}, filter), {
|
|
20122
|
+
scope: filterList.scope.concat(filter.id)
|
|
20123
|
+
});
|
|
20124
|
+
}
|
|
20125
|
+
return filterList;
|
|
20126
|
+
}, {
|
|
20127
|
+
scope: []
|
|
20128
|
+
}),
|
|
20129
|
+
scope = _filters$reduce.scope;
|
|
20130
|
+
// get search
|
|
20131
|
+
var search = getCleanSearchQuery(searchQuery);
|
|
20132
|
+
return Object.assign(Object.assign({}, scope.length && {
|
|
20133
|
+
scope: scope.toString()
|
|
20134
|
+
}), search.length && {
|
|
20135
|
+
search: search
|
|
20136
|
+
});
|
|
20137
|
+
};
|
|
20138
|
+
// TODO: better to use a lib for this. Currently this is only used in workspace 'save all', and will probably be replaced by a backend solution
|
|
20139
|
+
// https://stackoverflow.com/questions/6248666/how-to-generate-short-uid-like-ax4j9z-in-js
|
|
20140
|
+
var generateUID = function generateUID() {
|
|
20141
|
+
var firstPart = Math.random() * 46656 || 0;
|
|
20142
|
+
var secondPart = Math.random() * 46656 || 0;
|
|
20143
|
+
var firstPartCombined = "000".concat(firstPart.toString(36)).slice(-3);
|
|
20144
|
+
var secondPartCombined = "000".concat(secondPart.toString(36)).slice(-3);
|
|
20145
|
+
return firstPartCombined + secondPartCombined;
|
|
20146
|
+
};
|
|
20147
|
+
var getGeneratedViewPresetTitle = function getGeneratedViewPresetTitle(workspaceTitle, uid) {
|
|
20148
|
+
return "".concat(workspaceTitle, " - viewpreset ").concat(uid);
|
|
20149
|
+
};
|
|
20150
|
+
|
|
19951
20151
|
/* *
|
|
19952
20152
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19953
20153
|
* you may not use this file except in compliance with the License.
|
|
@@ -20133,6 +20333,19 @@ var slice$2 = createSlice({
|
|
|
20133
20333
|
if (action.payload.action === WorkspacePresetAction.SAVE) {
|
|
20134
20334
|
draft.hasChanges = false;
|
|
20135
20335
|
}
|
|
20336
|
+
if (action.payload.action === WorkspacePresetAction.EDIT) {
|
|
20337
|
+
draft.title = action.payload.title;
|
|
20338
|
+
draft["abstract"] = action.payload["abstract"];
|
|
20339
|
+
}
|
|
20340
|
+
// If current selected workspace is deleted
|
|
20341
|
+
// Remove the id, rename to empty workspace and set it has changes
|
|
20342
|
+
if (action.payload.action === WorkspacePresetAction.DELETE && action.payload.workspaceId === draft.id) {
|
|
20343
|
+
delete draft.id;
|
|
20344
|
+
draft.title = emptyMapWorkspace.title;
|
|
20345
|
+
draft["abstract"] = emptyMapWorkspace["abstract"];
|
|
20346
|
+
draft.scope = emptyMapWorkspace.scope;
|
|
20347
|
+
draft.hasChanges = true;
|
|
20348
|
+
}
|
|
20136
20349
|
}).addCase(viewPresetActions.fetchedViewPreset, function (draft, action) {
|
|
20137
20350
|
var _action$payload3 = action.payload,
|
|
20138
20351
|
panelId = _action$payload3.panelId,
|
|
@@ -20230,126 +20443,33 @@ var getViewPresetActiveId = function getViewPresetActiveId(store, panelId) {
|
|
|
20230
20443
|
};
|
|
20231
20444
|
var getViewPresetPanelId = function getViewPresetPanelId(store, mapId) {
|
|
20232
20445
|
var _a, _b;
|
|
20233
|
-
return (_b = (_a = getViewPresets(store).find(function (preset) {
|
|
20234
|
-
return preset.activeViewPresetId === mapId;
|
|
20235
|
-
})) === null || _a === void 0 ? void 0 : _a.panelId) !== null && _b !== void 0 ? _b : '';
|
|
20236
|
-
};
|
|
20237
|
-
var getDialogOptions = function getDialogOptions(store) {
|
|
20238
|
-
return getViewPresetsStore(store).viewPresetDialog || undefined;
|
|
20239
|
-
};
|
|
20240
|
-
var getIsViewPresetListDialogOpen = function getIsViewPresetListDialogOpen(store, panelId) {
|
|
20241
|
-
var _a;
|
|
20242
|
-
return ((_a = getViewPresetById(store, panelId)) === null || _a === void 0 ? void 0 : _a.isViewPresetListDialogOpen) || false;
|
|
20243
|
-
};
|
|
20244
|
-
var getViewPresetListFiltersForView = createSelector(getViewPresetById, function (viewPresetById) {
|
|
20245
|
-
return (viewPresetById === null || viewPresetById === void 0 ? void 0 : viewPresetById.filters) || [];
|
|
20246
|
-
});
|
|
20247
|
-
var getViewPresetListSearchQueryForView = function getViewPresetListSearchQueryForView(store, panelId) {
|
|
20248
|
-
var _a;
|
|
20249
|
-
return ((_a = getViewPresetById(store, panelId)) === null || _a === void 0 ? void 0 : _a.searchQuery) || '';
|
|
20250
|
-
};
|
|
20251
|
-
// Used to retrieve the filtered view preset list for your view - if no filters/search applied it will be empty
|
|
20252
|
-
// To ensure you retrieve the view preset list specific for your view (incl and excl filters), use getFilteredViewPresetListForView
|
|
20253
|
-
var getViewPresetListFilterResultsForView = createSelector(getViewPresetById, function (viewPresetById) {
|
|
20254
|
-
var filteredResults = (viewPresetById === null || viewPresetById === void 0 ? void 0 : viewPresetById.filterResults) || {
|
|
20255
|
-
entities: {},
|
|
20256
|
-
ids: []
|
|
20257
|
-
};
|
|
20258
|
-
return Object.values(filteredResults.entities);
|
|
20259
|
-
});
|
|
20260
|
-
|
|
20261
|
-
/* *
|
|
20262
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20263
|
-
* you may not use this file except in compliance with the License.
|
|
20264
|
-
* You may obtain a copy of the License at
|
|
20265
|
-
*
|
|
20266
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20267
|
-
*
|
|
20268
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20269
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20270
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20271
|
-
* See the License for the specific language governing permissions and
|
|
20272
|
-
* limitations under the License.
|
|
20273
|
-
*
|
|
20274
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20275
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
20276
|
-
* */
|
|
20277
|
-
var getCleanSearchQuery = function getCleanSearchQuery(searchQuery) {
|
|
20278
|
-
return searchQuery.trim().split(/\s+/).join();
|
|
20279
|
-
};
|
|
20280
|
-
|
|
20281
|
-
/* *
|
|
20282
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20283
|
-
* you may not use this file except in compliance with the License.
|
|
20284
|
-
* You may obtain a copy of the License at
|
|
20285
|
-
*
|
|
20286
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20287
|
-
*
|
|
20288
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20289
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20290
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20291
|
-
* See the License for the specific language governing permissions and
|
|
20292
|
-
* limitations under the License.
|
|
20293
|
-
*
|
|
20294
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20295
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
20296
|
-
* */
|
|
20297
|
-
var MAPPRESET_ACTIVE_TITLE = 'New map preset';
|
|
20298
|
-
var MAPPRESET_DIALOG_TITLE_SAVE_AS = 'Save map preset as';
|
|
20299
|
-
var MAPPRESET_DIALOG_TITLE_DELETE = 'Delete map preset';
|
|
20300
|
-
var getSnackbarMessage$1 = function getSnackbarMessage(action, title) {
|
|
20301
|
-
// Trim and add quotes
|
|
20302
|
-
var trimmedTitle = "\"".concat(title.trim(), "\"");
|
|
20303
|
-
switch (action) {
|
|
20304
|
-
case PresetAction.DELETE:
|
|
20305
|
-
return "Map preset ".concat(trimmedTitle, " successfully deleted");
|
|
20306
|
-
case PresetAction.SAVE_AS:
|
|
20307
|
-
return "New map preset ".concat(trimmedTitle, " successfully saved");
|
|
20308
|
-
default:
|
|
20309
|
-
return "Map preset ".concat(trimmedTitle, " successfully saved");
|
|
20310
|
-
}
|
|
20311
|
-
};
|
|
20312
|
-
var getPresetsApi = function getPresetsApi() {
|
|
20313
|
-
return getApi(API_NAME);
|
|
20314
|
-
};
|
|
20315
|
-
var emptyMapViewPreset = {
|
|
20316
|
-
componentType: 'Map',
|
|
20317
|
-
keywords: '',
|
|
20318
|
-
scope: 'user',
|
|
20319
|
-
title: '',
|
|
20320
|
-
initialProps: {
|
|
20321
|
-
mapPreset: {}
|
|
20322
|
-
}
|
|
20323
|
-
};
|
|
20324
|
-
// Returns object of applied user filters such as scope/search etc
|
|
20325
|
-
// If all filter chips are selected, an empty string is returned for that filter which is interpreted in the BE as "return all" _
|
|
20326
|
-
var constructFilterParams$1 = function constructFilterParams(filters, searchQuery) {
|
|
20327
|
-
// get filters
|
|
20328
|
-
var isAllSelectedForFilters = filters.every(function (filter) {
|
|
20329
|
-
return filter.isSelected;
|
|
20330
|
-
});
|
|
20331
|
-
// If all filters are selected, ensure we return nothing for scope
|
|
20332
|
-
var _ref = isAllSelectedForFilters ? {
|
|
20333
|
-
scope: []
|
|
20334
|
-
} : filters.reduce(function (filterList, filter) {
|
|
20335
|
-
if (filter.isSelected && filter.type === 'scope') {
|
|
20336
|
-
return Object.assign(Object.assign({}, filter), {
|
|
20337
|
-
scope: filterList.scope.concat(filter.id)
|
|
20338
|
-
});
|
|
20339
|
-
}
|
|
20340
|
-
return filterList;
|
|
20341
|
-
}, {
|
|
20342
|
-
scope: []
|
|
20343
|
-
}),
|
|
20344
|
-
scope = _ref.scope;
|
|
20345
|
-
// get search
|
|
20346
|
-
var search = getCleanSearchQuery(searchQuery);
|
|
20347
|
-
return Object.assign(Object.assign({}, scope.length && {
|
|
20348
|
-
scope: scope.toString()
|
|
20349
|
-
}), search.length && {
|
|
20350
|
-
search: search
|
|
20351
|
-
});
|
|
20446
|
+
return (_b = (_a = getViewPresets(store).find(function (preset) {
|
|
20447
|
+
return preset.activeViewPresetId === mapId;
|
|
20448
|
+
})) === null || _a === void 0 ? void 0 : _a.panelId) !== null && _b !== void 0 ? _b : '';
|
|
20449
|
+
};
|
|
20450
|
+
var getDialogOptions = function getDialogOptions(store) {
|
|
20451
|
+
return getViewPresetsStore(store).viewPresetDialog || undefined;
|
|
20452
|
+
};
|
|
20453
|
+
var getIsViewPresetListDialogOpen = function getIsViewPresetListDialogOpen(store, panelId) {
|
|
20454
|
+
var _a;
|
|
20455
|
+
return ((_a = getViewPresetById(store, panelId)) === null || _a === void 0 ? void 0 : _a.isViewPresetListDialogOpen) || false;
|
|
20456
|
+
};
|
|
20457
|
+
var getViewPresetListFiltersForView = createSelector(getViewPresetById, function (viewPresetById) {
|
|
20458
|
+
return (viewPresetById === null || viewPresetById === void 0 ? void 0 : viewPresetById.filters) || [];
|
|
20459
|
+
});
|
|
20460
|
+
var getViewPresetListSearchQueryForView = function getViewPresetListSearchQueryForView(store, panelId) {
|
|
20461
|
+
var _a;
|
|
20462
|
+
return ((_a = getViewPresetById(store, panelId)) === null || _a === void 0 ? void 0 : _a.searchQuery) || '';
|
|
20352
20463
|
};
|
|
20464
|
+
// Used to retrieve the filtered view preset list for your view - if no filters/search applied it will be empty
|
|
20465
|
+
// To ensure you retrieve the view preset list specific for your view (incl and excl filters), use getFilteredViewPresetListForView
|
|
20466
|
+
var getViewPresetListFilterResultsForView = createSelector(getViewPresetById, function (viewPresetById) {
|
|
20467
|
+
var filteredResults = (viewPresetById === null || viewPresetById === void 0 ? void 0 : viewPresetById.filterResults) || {
|
|
20468
|
+
entities: {},
|
|
20469
|
+
ids: []
|
|
20470
|
+
};
|
|
20471
|
+
return Object.values(filteredResults.entities);
|
|
20472
|
+
});
|
|
20353
20473
|
|
|
20354
20474
|
/* *
|
|
20355
20475
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -20486,6 +20606,10 @@ var getWorkspaceData = createSelector(getWorkspaceState, getViewPresetsStore, ge
|
|
|
20486
20606
|
"abstract": store["abstract"],
|
|
20487
20607
|
mosaicNode: store.mosaicNode
|
|
20488
20608
|
};
|
|
20609
|
+
}, {
|
|
20610
|
+
memoizeOptions: {
|
|
20611
|
+
resultEqualityCheck: lodash.exports.isEqual
|
|
20612
|
+
}
|
|
20489
20613
|
});
|
|
20490
20614
|
var getViewPresetToSendToBackend = createSelector(getViewById, mapSelectors.getMapPreset, syncGroupsSelectors.getAllTargetGroupsForSource, function (workspaceView, mapPreset, syncGroupsIds) {
|
|
20491
20615
|
var title = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title) || MAPPRESET_ACTIVE_TITLE;
|
|
@@ -21305,7 +21429,7 @@ var workspacePresetsList = [
|
|
|
21305
21429
|
title: "Radar",
|
|
21306
21430
|
date: "2022-06-01T12:34:27.787184",
|
|
21307
21431
|
scope: "user",
|
|
21308
|
-
abstract: "",
|
|
21432
|
+
abstract: "Some abstract",
|
|
21309
21433
|
viewType: "singleWindow"
|
|
21310
21434
|
},
|
|
21311
21435
|
{
|
|
@@ -23700,103 +23824,6 @@ var WorkspaceListErrorType;
|
|
|
23700
23824
|
WorkspaceListErrorType["GENERIC"] = "GENERIC";
|
|
23701
23825
|
})(WorkspaceListErrorType || (WorkspaceListErrorType = {}));
|
|
23702
23826
|
|
|
23703
|
-
/* *
|
|
23704
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23705
|
-
* you may not use this file except in compliance with the License.
|
|
23706
|
-
* You may obtain a copy of the License at
|
|
23707
|
-
*
|
|
23708
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
23709
|
-
*
|
|
23710
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
23711
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
23712
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23713
|
-
* See the License for the specific language governing permissions and
|
|
23714
|
-
* limitations under the License.
|
|
23715
|
-
*
|
|
23716
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
23717
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
23718
|
-
* */
|
|
23719
|
-
var getSnackbarMessage = function getSnackbarMessage(action, title) {
|
|
23720
|
-
// Trim and add quotes
|
|
23721
|
-
var trimmedTitle = "\"".concat(title.trim(), "\"");
|
|
23722
|
-
switch (action) {
|
|
23723
|
-
case WorkspacePresetAction.SAVE_ALL:
|
|
23724
|
-
return "Workspace ".concat(trimmedTitle, " and underlying viewpresets successfully saved");
|
|
23725
|
-
case WorkspacePresetAction.DELETE:
|
|
23726
|
-
return "Workspace ".concat(trimmedTitle, " successfully deleted");
|
|
23727
|
-
case WorkspacePresetAction.DUPLICATE:
|
|
23728
|
-
return "Workspace ".concat(trimmedTitle, " successfully saved");
|
|
23729
|
-
default:
|
|
23730
|
-
return "Workspace ".concat(trimmedTitle, " successfully saved");
|
|
23731
|
-
}
|
|
23732
|
-
};
|
|
23733
|
-
var emptyMapWorkspace = {
|
|
23734
|
-
title: 'New workspace',
|
|
23735
|
-
scope: 'system',
|
|
23736
|
-
"abstract": '',
|
|
23737
|
-
views: {
|
|
23738
|
-
allIds: ['1_screen'],
|
|
23739
|
-
byId: {
|
|
23740
|
-
'1_screen': {
|
|
23741
|
-
title: MAPPRESET_ACTIVE_TITLE,
|
|
23742
|
-
componentType: 'Map',
|
|
23743
|
-
initialProps: {
|
|
23744
|
-
mapPreset: {
|
|
23745
|
-
layers: [],
|
|
23746
|
-
proj: {
|
|
23747
|
-
bbox: {
|
|
23748
|
-
left: 58703.6377,
|
|
23749
|
-
bottom: 6408480.4514,
|
|
23750
|
-
right: 3967387.5161,
|
|
23751
|
-
top: 11520588.9031
|
|
23752
|
-
},
|
|
23753
|
-
srs: 'EPSG:3857'
|
|
23754
|
-
},
|
|
23755
|
-
shouldShowLayerManager: true,
|
|
23756
|
-
dockedLayerManagerSize: 'sizeSmall'
|
|
23757
|
-
},
|
|
23758
|
-
syncGroupsIds: []
|
|
23759
|
-
}
|
|
23760
|
-
}
|
|
23761
|
-
}
|
|
23762
|
-
},
|
|
23763
|
-
mosaicNode: '1_screen',
|
|
23764
|
-
viewType: 'singleWindow'
|
|
23765
|
-
};
|
|
23766
|
-
var constructFilterParams = function constructFilterParams(filters, searchQuery) {
|
|
23767
|
-
// get filters
|
|
23768
|
-
var _filters$reduce = filters.reduce(function (filterList, filter) {
|
|
23769
|
-
if (filter.isSelected && filter.type === 'scope') {
|
|
23770
|
-
return Object.assign(Object.assign({}, filter), {
|
|
23771
|
-
scope: filterList.scope.concat(filter.id)
|
|
23772
|
-
});
|
|
23773
|
-
}
|
|
23774
|
-
return filterList;
|
|
23775
|
-
}, {
|
|
23776
|
-
scope: []
|
|
23777
|
-
}),
|
|
23778
|
-
scope = _filters$reduce.scope;
|
|
23779
|
-
// get search
|
|
23780
|
-
var search = getCleanSearchQuery(searchQuery);
|
|
23781
|
-
return Object.assign(Object.assign({}, scope.length && {
|
|
23782
|
-
scope: scope.toString()
|
|
23783
|
-
}), search.length && {
|
|
23784
|
-
search: search
|
|
23785
|
-
});
|
|
23786
|
-
};
|
|
23787
|
-
// TODO: better to use a lib for this. Currently this is only used in workspace 'save all', and will probably be replaced by a backend solution
|
|
23788
|
-
// https://stackoverflow.com/questions/6248666/how-to-generate-short-uid-like-ax4j9z-in-js
|
|
23789
|
-
var generateUID = function generateUID() {
|
|
23790
|
-
var firstPart = Math.random() * 46656 || 0;
|
|
23791
|
-
var secondPart = Math.random() * 46656 || 0;
|
|
23792
|
-
var firstPartCombined = "000".concat(firstPart.toString(36)).slice(-3);
|
|
23793
|
-
var secondPartCombined = "000".concat(secondPart.toString(36)).slice(-3);
|
|
23794
|
-
return firstPartCombined + secondPartCombined;
|
|
23795
|
-
};
|
|
23796
|
-
var getGeneratedViewPresetTitle = function getGeneratedViewPresetTitle(workspaceTitle, uid) {
|
|
23797
|
-
return "".concat(workspaceTitle, " - viewpreset ").concat(uid);
|
|
23798
|
-
};
|
|
23799
|
-
|
|
23800
23827
|
/* *
|
|
23801
23828
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23802
23829
|
* you may not use this file except in compliance with the License.
|
|
@@ -23903,7 +23930,7 @@ function fetchWorkspaceListSaga(_ref) {
|
|
|
23903
23930
|
function onSuccessWorkspacePresetsActionSaga(_ref2) {
|
|
23904
23931
|
var payload = _ref2.payload;
|
|
23905
23932
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
23906
|
-
var action, workspaceId, title,
|
|
23933
|
+
var action, workspaceId, title, workspaceFilters, searchQuery;
|
|
23907
23934
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
23908
23935
|
while (1) switch (_context2.prev = _context2.next) {
|
|
23909
23936
|
case 0:
|
|
@@ -23913,44 +23940,35 @@ function onSuccessWorkspacePresetsActionSaga(_ref2) {
|
|
|
23913
23940
|
message: getSnackbarMessage(action, title)
|
|
23914
23941
|
}));
|
|
23915
23942
|
case 3:
|
|
23916
|
-
|
|
23917
|
-
|
|
23918
|
-
case 5:
|
|
23919
|
-
selectedWorkspace = _context2.sent;
|
|
23920
|
-
if (!(action === WorkspacePresetAction.DELETE && workspaceId === (selectedWorkspace === null || selectedWorkspace === void 0 ? void 0 : selectedWorkspace.id))) {
|
|
23921
|
-
_context2.next = 11;
|
|
23943
|
+
if (!(action === WorkspacePresetAction.DELETE && payload.currentActiveWorkspaceId && workspaceId === payload.currentActiveWorkspaceId)) {
|
|
23944
|
+
_context2.next = 6;
|
|
23922
23945
|
break;
|
|
23923
23946
|
}
|
|
23924
|
-
_context2.next =
|
|
23947
|
+
_context2.next = 6;
|
|
23925
23948
|
return put(routerActions.navigateToUrl({
|
|
23926
23949
|
url: getWorkspaceRouteUrl()
|
|
23927
23950
|
}));
|
|
23928
|
-
case
|
|
23929
|
-
_context2.next = 11;
|
|
23930
|
-
return put(workspaceActions.changePreset({
|
|
23931
|
-
workspacePreset: emptyMapWorkspace
|
|
23932
|
-
}));
|
|
23933
|
-
case 11:
|
|
23951
|
+
case 6:
|
|
23934
23952
|
if (!(action === WorkspacePresetAction.SAVE_AS)) {
|
|
23935
|
-
_context2.next =
|
|
23953
|
+
_context2.next = 9;
|
|
23936
23954
|
break;
|
|
23937
23955
|
}
|
|
23938
|
-
_context2.next =
|
|
23956
|
+
_context2.next = 9;
|
|
23939
23957
|
return put(routerActions.navigateToUrl({
|
|
23940
23958
|
url: getWorkspaceRouteUrl(workspaceId)
|
|
23941
23959
|
}));
|
|
23942
|
-
case
|
|
23943
|
-
_context2.next =
|
|
23960
|
+
case 9:
|
|
23961
|
+
_context2.next = 11;
|
|
23944
23962
|
return select(getWorkspaceListFilters);
|
|
23945
|
-
case
|
|
23963
|
+
case 11:
|
|
23946
23964
|
workspaceFilters = _context2.sent;
|
|
23947
|
-
_context2.next =
|
|
23965
|
+
_context2.next = 14;
|
|
23948
23966
|
return select(getWorkspaceListSearchQuery);
|
|
23949
|
-
case
|
|
23967
|
+
case 14:
|
|
23950
23968
|
searchQuery = _context2.sent;
|
|
23951
|
-
_context2.next =
|
|
23969
|
+
_context2.next = 17;
|
|
23952
23970
|
return call(fetchWorkspaceListSaga, workspaceListActions.fetchWorkspaceList(constructFilterParams(workspaceFilters, searchQuery)));
|
|
23953
|
-
case
|
|
23971
|
+
case 17:
|
|
23954
23972
|
case "end":
|
|
23955
23973
|
return _context2.stop();
|
|
23956
23974
|
}
|
|
@@ -24040,7 +24058,7 @@ function saveAllViewPresetSaga(viewPresetEntity, workspaceTitle) {
|
|
|
24040
24058
|
function submitFormWorkspaceDialogSaga(_ref3) {
|
|
24041
24059
|
var payload = _ref3.payload;
|
|
24042
24060
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
24043
|
-
var workspaceApi, presetId, presetAction, data, newId, isNewWorkspace, _ref4, presetToDuplicate, fullPreset, _newId, workspace, isNew, workspaceId, views, savedViewPresetResult, errorMessage, workspaceData, newWorkspace, message;
|
|
24061
|
+
var workspaceApi, presetId, presetAction, data, newId, isNewWorkspace, _ref4, presetToDuplicate, fullPreset, _newId, selectedWorkspace, _yield$call2, originalData, workspaceDataNewTitle, workspace, isNew, workspaceId, views, savedViewPresetResult, errorMessage, workspaceData, newWorkspace, message;
|
|
24044
24062
|
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
|
24045
24063
|
while (1) switch (_context4.prev = _context4.next) {
|
|
24046
24064
|
case 0:
|
|
@@ -24100,65 +24118,94 @@ function submitFormWorkspaceDialogSaga(_ref3) {
|
|
|
24100
24118
|
}));
|
|
24101
24119
|
case 28:
|
|
24102
24120
|
if (!(presetAction === WorkspacePresetAction.DELETE)) {
|
|
24103
|
-
_context4.next =
|
|
24121
|
+
_context4.next = 36;
|
|
24104
24122
|
break;
|
|
24105
24123
|
}
|
|
24106
24124
|
_context4.next = 31;
|
|
24107
24125
|
return call(workspaceApi.deleteWorkspacePreset, presetId);
|
|
24108
24126
|
case 31:
|
|
24109
24127
|
_context4.next = 33;
|
|
24128
|
+
return select(getWorkspaceState);
|
|
24129
|
+
case 33:
|
|
24130
|
+
selectedWorkspace = _context4.sent;
|
|
24131
|
+
_context4.next = 36;
|
|
24110
24132
|
return put(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
24111
24133
|
workspaceId: presetId,
|
|
24112
24134
|
action: presetAction,
|
|
24113
|
-
title: data.title
|
|
24135
|
+
title: data.title,
|
|
24136
|
+
currentActiveWorkspaceId: selectedWorkspace.id
|
|
24114
24137
|
}));
|
|
24115
|
-
case
|
|
24138
|
+
case 36:
|
|
24139
|
+
if (!(presetAction === WorkspacePresetAction.EDIT)) {
|
|
24140
|
+
_context4.next = 46;
|
|
24141
|
+
break;
|
|
24142
|
+
}
|
|
24143
|
+
_context4.next = 39;
|
|
24144
|
+
return call(workspaceApi.getWorkspacePreset, presetId);
|
|
24145
|
+
case 39:
|
|
24146
|
+
_yield$call2 = _context4.sent;
|
|
24147
|
+
originalData = _yield$call2.data;
|
|
24148
|
+
workspaceDataNewTitle = Object.assign(Object.assign({}, originalData), {
|
|
24149
|
+
title: data.title,
|
|
24150
|
+
"abstract": data["abstract"]
|
|
24151
|
+
});
|
|
24152
|
+
_context4.next = 44;
|
|
24153
|
+
return call(workspaceApi.saveWorkspacePreset, presetId, workspaceDataNewTitle);
|
|
24154
|
+
case 44:
|
|
24155
|
+
_context4.next = 46;
|
|
24156
|
+
return put(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
24157
|
+
workspaceId: presetId,
|
|
24158
|
+
action: presetAction,
|
|
24159
|
+
title: data.title,
|
|
24160
|
+
"abstract": data["abstract"]
|
|
24161
|
+
}));
|
|
24162
|
+
case 46:
|
|
24116
24163
|
if (!(presetAction === WorkspacePresetAction.SAVE_ALL)) {
|
|
24117
|
-
_context4.next =
|
|
24164
|
+
_context4.next = 79;
|
|
24118
24165
|
break;
|
|
24119
24166
|
}
|
|
24120
|
-
_context4.next =
|
|
24167
|
+
_context4.next = 49;
|
|
24121
24168
|
return select(getWorkspaceState);
|
|
24122
|
-
case
|
|
24169
|
+
case 49:
|
|
24123
24170
|
workspace = _context4.sent;
|
|
24124
24171
|
// first save a new workspace to make sure we have an unique title
|
|
24125
24172
|
isNew = !workspace.scope || workspace.scope === 'system';
|
|
24126
24173
|
if (!isNew) {
|
|
24127
|
-
_context4.next =
|
|
24174
|
+
_context4.next = 57;
|
|
24128
24175
|
break;
|
|
24129
24176
|
}
|
|
24130
|
-
_context4.next =
|
|
24177
|
+
_context4.next = 54;
|
|
24131
24178
|
return call(workspaceApi.saveWorkspacePresetAs, data);
|
|
24132
|
-
case
|
|
24179
|
+
case 54:
|
|
24133
24180
|
_context4.t1 = _context4.sent;
|
|
24134
|
-
_context4.next =
|
|
24181
|
+
_context4.next = 58;
|
|
24135
24182
|
break;
|
|
24136
|
-
case
|
|
24183
|
+
case 57:
|
|
24137
24184
|
_context4.t1 = data.id;
|
|
24138
|
-
case
|
|
24185
|
+
case 58:
|
|
24139
24186
|
workspaceId = _context4.t1;
|
|
24140
|
-
_context4.next =
|
|
24187
|
+
_context4.next = 61;
|
|
24141
24188
|
return select(getViewPresets);
|
|
24142
|
-
case
|
|
24189
|
+
case 61:
|
|
24143
24190
|
views = _context4.sent;
|
|
24144
|
-
_context4.next =
|
|
24191
|
+
_context4.next = 64;
|
|
24145
24192
|
return all(views.map(function (view) {
|
|
24146
24193
|
return call(saveAllViewPresetSaga, view, data.title);
|
|
24147
24194
|
}));
|
|
24148
|
-
case
|
|
24195
|
+
case 64:
|
|
24149
24196
|
savedViewPresetResult = _context4.sent;
|
|
24150
24197
|
errorMessage = savedViewPresetResult.find(function (viewPresetResult) {
|
|
24151
24198
|
return typeof viewPresetResult === 'string';
|
|
24152
24199
|
});
|
|
24153
24200
|
if (!errorMessage) {
|
|
24154
|
-
_context4.next =
|
|
24201
|
+
_context4.next = 68;
|
|
24155
24202
|
break;
|
|
24156
24203
|
}
|
|
24157
24204
|
throw new Error(errorMessage);
|
|
24158
|
-
case
|
|
24159
|
-
_context4.next =
|
|
24205
|
+
case 68:
|
|
24206
|
+
_context4.next = 70;
|
|
24160
24207
|
return select(getWorkspaceData);
|
|
24161
|
-
case
|
|
24208
|
+
case 70:
|
|
24162
24209
|
workspaceData = _context4.sent;
|
|
24163
24210
|
newWorkspace = Object.assign(Object.assign({}, workspaceData), {
|
|
24164
24211
|
id: workspaceId,
|
|
@@ -24166,44 +24213,44 @@ function submitFormWorkspaceDialogSaga(_ref3) {
|
|
|
24166
24213
|
title: data.title,
|
|
24167
24214
|
"abstract": data["abstract"]
|
|
24168
24215
|
});
|
|
24169
|
-
_context4.next =
|
|
24216
|
+
_context4.next = 74;
|
|
24170
24217
|
return call(workspaceApi.saveWorkspacePreset, workspaceId, newWorkspace);
|
|
24171
|
-
case
|
|
24172
|
-
_context4.next =
|
|
24218
|
+
case 74:
|
|
24219
|
+
_context4.next = 76;
|
|
24173
24220
|
return put(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
24174
24221
|
action: WorkspacePresetAction.SAVE_ALL,
|
|
24175
24222
|
workspaceId: workspaceId,
|
|
24176
24223
|
title: newWorkspace.title,
|
|
24177
24224
|
"abstract": newWorkspace["abstract"]
|
|
24178
24225
|
}));
|
|
24179
|
-
case
|
|
24226
|
+
case 76:
|
|
24180
24227
|
if (!isNew) {
|
|
24181
|
-
_context4.next =
|
|
24228
|
+
_context4.next = 79;
|
|
24182
24229
|
break;
|
|
24183
24230
|
}
|
|
24184
|
-
_context4.next =
|
|
24231
|
+
_context4.next = 79;
|
|
24185
24232
|
return put(routerActions.navigateToUrl({
|
|
24186
24233
|
url: getWorkspaceRouteUrl(workspaceId)
|
|
24187
24234
|
}));
|
|
24188
|
-
case
|
|
24189
|
-
_context4.next =
|
|
24235
|
+
case 79:
|
|
24236
|
+
_context4.next = 86;
|
|
24190
24237
|
break;
|
|
24191
|
-
case
|
|
24192
|
-
_context4.prev =
|
|
24238
|
+
case 81:
|
|
24239
|
+
_context4.prev = 81;
|
|
24193
24240
|
_context4.t2 = _context4["catch"](3);
|
|
24194
24241
|
message = isAxiosError(_context4.t2) ? getAxiosErrorMessage(_context4.t2) : _context4.t2.message;
|
|
24195
|
-
_context4.next =
|
|
24242
|
+
_context4.next = 86;
|
|
24196
24243
|
return put(workspaceListActions.onErrorWorkspacePresetAction({
|
|
24197
24244
|
error: {
|
|
24198
24245
|
type: WorkspaceListErrorType.GENERIC,
|
|
24199
24246
|
message: message
|
|
24200
24247
|
}
|
|
24201
24248
|
}));
|
|
24202
|
-
case
|
|
24249
|
+
case 86:
|
|
24203
24250
|
case "end":
|
|
24204
24251
|
return _context4.stop();
|
|
24205
24252
|
}
|
|
24206
|
-
}, _callee3, null, [[3,
|
|
24253
|
+
}, _callee3, null, [[3, 81]]);
|
|
24207
24254
|
})();
|
|
24208
24255
|
}
|
|
24209
24256
|
function rootSaga$1() {
|
|
@@ -24460,32 +24507,36 @@ function onSuccessViewPresetActionSaga(_ref4) {
|
|
|
24460
24507
|
filterParams: constructFilterParams$1(viewPresetFilters, viewPresetSearchQuery)
|
|
24461
24508
|
}));
|
|
24462
24509
|
case 18:
|
|
24463
|
-
|
|
24510
|
+
if (!(action !== PresetAction.EDIT)) {
|
|
24511
|
+
_context5.next = 21;
|
|
24512
|
+
break;
|
|
24513
|
+
}
|
|
24514
|
+
_context5.next = 21;
|
|
24464
24515
|
return put(viewPresetActions.setViewPresetHasChanges({
|
|
24465
24516
|
panelId: panelId,
|
|
24466
24517
|
hasChanges: false
|
|
24467
24518
|
}));
|
|
24468
|
-
case
|
|
24519
|
+
case 21:
|
|
24469
24520
|
if (!(action === PresetAction.SAVE_AS && viewPresetId)) {
|
|
24470
|
-
_context5.next =
|
|
24521
|
+
_context5.next = 24;
|
|
24471
24522
|
break;
|
|
24472
24523
|
}
|
|
24473
|
-
_context5.next =
|
|
24524
|
+
_context5.next = 24;
|
|
24474
24525
|
return put(viewPresetActions.setActiveViewPresetId({
|
|
24475
24526
|
panelId: panelId,
|
|
24476
24527
|
viewPresetId: viewPresetId
|
|
24477
24528
|
}));
|
|
24478
|
-
case
|
|
24479
|
-
_context5.next =
|
|
24529
|
+
case 24:
|
|
24530
|
+
_context5.next = 28;
|
|
24480
24531
|
break;
|
|
24481
|
-
case
|
|
24482
|
-
_context5.prev =
|
|
24532
|
+
case 26:
|
|
24533
|
+
_context5.prev = 26;
|
|
24483
24534
|
_context5.t0 = _context5["catch"](1);
|
|
24484
|
-
case
|
|
24535
|
+
case 28:
|
|
24485
24536
|
case "end":
|
|
24486
24537
|
return _context5.stop();
|
|
24487
24538
|
}
|
|
24488
|
-
}, _callee4, null, [[1,
|
|
24539
|
+
}, _callee4, null, [[1, 26]]);
|
|
24489
24540
|
})();
|
|
24490
24541
|
}
|
|
24491
24542
|
function rootSaga() {
|
|
@@ -32449,22 +32500,6 @@ var FixedSizeList = /*#__PURE__*/createListComponent({
|
|
|
32449
32500
|
}
|
|
32450
32501
|
});
|
|
32451
32502
|
|
|
32452
|
-
/* *
|
|
32453
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
32454
|
-
* you may not use this file except in compliance with the License.
|
|
32455
|
-
* You may obtain a copy of the License at
|
|
32456
|
-
*
|
|
32457
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
32458
|
-
*
|
|
32459
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
32460
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32461
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
32462
|
-
* See the License for the specific language governing permissions and
|
|
32463
|
-
* limitations under the License.
|
|
32464
|
-
*
|
|
32465
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
32466
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
32467
|
-
* */
|
|
32468
32503
|
var WORKSPACE_SELECT_LIST_ROW_HEIGHT = 46;
|
|
32469
32504
|
var getPresetIcon = function getPresetIcon(preset) {
|
|
32470
32505
|
switch (preset.viewType) {
|
|
@@ -32499,12 +32534,17 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
32499
32534
|
var onDuplicate = function onDuplicate() {
|
|
32500
32535
|
onClickWorkspacePresetOption(workspacePreset.id, WorkspacePresetAction.DUPLICATE, workspacePreset);
|
|
32501
32536
|
};
|
|
32502
|
-
|
|
32503
|
-
|
|
32504
|
-
|
|
32505
|
-
|
|
32506
|
-
|
|
32507
|
-
|
|
32537
|
+
var onEdit = function onEdit() {
|
|
32538
|
+
onClickWorkspacePresetOption(workspacePreset.id, WorkspacePresetAction.EDIT, workspacePreset);
|
|
32539
|
+
};
|
|
32540
|
+
var editTitle = testIdPrefix === 'viewpreset' ? 'Edit (name)' : 'Edit (name and abstract)';
|
|
32541
|
+
var menuItems = [{
|
|
32542
|
+
text: 'Duplicate',
|
|
32543
|
+
action: onDuplicate
|
|
32544
|
+
}].concat(_toConsumableArray$1(workspacePreset.scope === 'user' ? [{
|
|
32545
|
+
text: editTitle,
|
|
32546
|
+
action: onEdit
|
|
32547
|
+
}] : []));
|
|
32508
32548
|
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
32509
32549
|
disablePadding: true,
|
|
32510
32550
|
sx: {
|
|
@@ -32560,15 +32600,7 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
32560
32600
|
}, /*#__PURE__*/React__default.createElement(ToggleMenu, {
|
|
32561
32601
|
buttonTestId: "".concat(testIdPrefix, "-listOptionsButton"),
|
|
32562
32602
|
menuPosition: "right",
|
|
32563
|
-
menuItems:
|
|
32564
|
-
text: 'Duplicate',
|
|
32565
|
-
action: onDuplicate
|
|
32566
|
-
}
|
|
32567
|
-
// {
|
|
32568
|
-
// text: 'Edit (name & meta)',
|
|
32569
|
-
// action: onEdit,
|
|
32570
|
-
// },
|
|
32571
|
-
],
|
|
32603
|
+
menuItems: menuItems,
|
|
32572
32604
|
menuTitle: "Options",
|
|
32573
32605
|
isDefaultOpen: isOptionsMenuOpen
|
|
32574
32606
|
}), workspacePreset.scope === 'user' && /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
@@ -32914,7 +32946,8 @@ var WorkspaceSelectList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
32914
32946
|
}, /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
32915
32947
|
height: listHeight,
|
|
32916
32948
|
itemCount: items.length,
|
|
32917
|
-
itemSize: rowHeight
|
|
32949
|
+
itemSize: rowHeight,
|
|
32950
|
+
width: "100%"
|
|
32918
32951
|
}, function (_ref2) {
|
|
32919
32952
|
var index = _ref2.index,
|
|
32920
32953
|
style = _ref2.style;
|
|
@@ -32973,7 +33006,9 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
32973
33006
|
});
|
|
32974
33007
|
var lastViewPresetListSearchQuery = usePrevious(viewPresetListSearchQuery);
|
|
32975
33008
|
var relatedSyncGroupIds = useSelector(function (store) {
|
|
32976
|
-
return syncGroupsSelectors.getAllTargetGroupsForSource(store,
|
|
33009
|
+
return syncGroupsSelectors.getAllTargetGroupsForSource(store, {
|
|
33010
|
+
sourceId: panelId
|
|
33011
|
+
});
|
|
32977
33012
|
});
|
|
32978
33013
|
var errorViewPresetsList = useSelector(function (store) {
|
|
32979
33014
|
return getViewPresetListError(store, panelId);
|
|
@@ -33028,9 +33063,20 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
33028
33063
|
});
|
|
33029
33064
|
break;
|
|
33030
33065
|
}
|
|
33031
|
-
|
|
33032
|
-
|
|
33033
|
-
|
|
33066
|
+
case WorkspacePresetAction.EDIT:
|
|
33067
|
+
{
|
|
33068
|
+
var presetTitle = (preset === null || preset === void 0 ? void 0 : preset.title) || '';
|
|
33069
|
+
openViewPresetsDialog({
|
|
33070
|
+
title: MAPPRESET_DIALOG_TITLE_EDIT,
|
|
33071
|
+
action: PresetAction.EDIT,
|
|
33072
|
+
panelId: panelId,
|
|
33073
|
+
viewPresetId: presetId,
|
|
33074
|
+
formValues: {
|
|
33075
|
+
title: presetTitle
|
|
33076
|
+
}
|
|
33077
|
+
});
|
|
33078
|
+
break;
|
|
33079
|
+
}
|
|
33034
33080
|
// case WorkspacePresetAction.SAVE: {
|
|
33035
33081
|
// break;
|
|
33036
33082
|
// }
|
|
@@ -33206,6 +33252,7 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
33206
33252
|
setAnchorEl(document.getElementById(id));
|
|
33207
33253
|
}
|
|
33208
33254
|
}, [isDefaultOpen, id]);
|
|
33255
|
+
var editTitle = id === 'viewpreset-options-toolbutton' ? 'Edit (name)' : 'Edit (name and abstract)';
|
|
33209
33256
|
var options = [{
|
|
33210
33257
|
title: 'Save',
|
|
33211
33258
|
callback: handleSave
|
|
@@ -33216,7 +33263,7 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
33216
33263
|
title: 'Save (incl. viewpresets)',
|
|
33217
33264
|
callback: handleSaveAll
|
|
33218
33265
|
}] : []), [{
|
|
33219
|
-
title:
|
|
33266
|
+
title: editTitle,
|
|
33220
33267
|
callback: handleEdit
|
|
33221
33268
|
}, {
|
|
33222
33269
|
title: 'Delete',
|
|
@@ -33404,6 +33451,22 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
33404
33451
|
}
|
|
33405
33452
|
});
|
|
33406
33453
|
};
|
|
33454
|
+
var onEdit = function onEdit() {
|
|
33455
|
+
var formTitle = activeMapPresetId ? title : '';
|
|
33456
|
+
openViewPresetsDialog({
|
|
33457
|
+
title: MAPPRESET_DIALOG_TITLE_EDIT,
|
|
33458
|
+
action: PresetAction.EDIT,
|
|
33459
|
+
panelId: panelId,
|
|
33460
|
+
viewPresetId: activeMapPresetId,
|
|
33461
|
+
formValues: {
|
|
33462
|
+
title: formTitle,
|
|
33463
|
+
initialProps: {
|
|
33464
|
+
mapPreset: currentMapPreset,
|
|
33465
|
+
syncGroupsIds: relatedSyncGroupIds
|
|
33466
|
+
}
|
|
33467
|
+
}
|
|
33468
|
+
});
|
|
33469
|
+
};
|
|
33407
33470
|
var isNewActive = activeMapPresetId === '';
|
|
33408
33471
|
var title = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title) || MAPPRESET_ACTIVE_TITLE;
|
|
33409
33472
|
var viewScope = workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.scope;
|
|
@@ -33415,6 +33478,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
33415
33478
|
handleSave: viewScope === 'user' ? onSave : undefined,
|
|
33416
33479
|
handleDelete: viewScope === 'user' ? onDelete : undefined,
|
|
33417
33480
|
handleSaveAs: onSaveAs,
|
|
33481
|
+
handleEdit: viewScope === 'user' ? onEdit : undefined,
|
|
33418
33482
|
id: "viewpreset-options-toolbutton"
|
|
33419
33483
|
});
|
|
33420
33484
|
};
|
|
@@ -36101,7 +36165,7 @@ tags.forEach(function (tagName) {
|
|
|
36101
36165
|
});
|
|
36102
36166
|
|
|
36103
36167
|
/**
|
|
36104
|
-
* @mui/styled-engine v5.
|
|
36168
|
+
* @mui/styled-engine v5.14.8
|
|
36105
36169
|
*
|
|
36106
36170
|
* @license MIT
|
|
36107
36171
|
* This source code is licensed under the MIT license found in the
|
|
@@ -36743,10 +36807,20 @@ const width = style$1({
|
|
|
36743
36807
|
const maxWidth = props => {
|
|
36744
36808
|
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
36745
36809
|
const styleFromPropValue = propValue => {
|
|
36746
|
-
var _props$theme;
|
|
36810
|
+
var _props$theme, _props$theme2;
|
|
36747
36811
|
const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
|
|
36812
|
+
if (!breakpoint) {
|
|
36813
|
+
return {
|
|
36814
|
+
maxWidth: sizingTransform(propValue)
|
|
36815
|
+
};
|
|
36816
|
+
}
|
|
36817
|
+
if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
|
|
36818
|
+
return {
|
|
36819
|
+
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
36820
|
+
};
|
|
36821
|
+
}
|
|
36748
36822
|
return {
|
|
36749
|
-
maxWidth: breakpoint
|
|
36823
|
+
maxWidth: breakpoint
|
|
36750
36824
|
};
|
|
36751
36825
|
};
|
|
36752
36826
|
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
@@ -37450,9 +37524,19 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
37450
37524
|
});
|
|
37451
37525
|
break;
|
|
37452
37526
|
}
|
|
37453
|
-
|
|
37454
|
-
|
|
37455
|
-
|
|
37527
|
+
case WorkspacePresetAction.EDIT:
|
|
37528
|
+
{
|
|
37529
|
+
setWorkspaceActionDialogOptions({
|
|
37530
|
+
action: workspaceAction,
|
|
37531
|
+
presetId: presetId,
|
|
37532
|
+
formValues: {
|
|
37533
|
+
title: presetTitle,
|
|
37534
|
+
"abstract": affectedPreset["abstract"],
|
|
37535
|
+
scope: 'user'
|
|
37536
|
+
}
|
|
37537
|
+
});
|
|
37538
|
+
break;
|
|
37539
|
+
}
|
|
37456
37540
|
// case WorkspacePresetAction.SAVE: {
|
|
37457
37541
|
// break;
|
|
37458
37542
|
// }
|
|
@@ -37738,6 +37822,13 @@ var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
|
37738
37822
|
workspace: workspaceData
|
|
37739
37823
|
}));
|
|
37740
37824
|
}, [dispatch, workspaceData]);
|
|
37825
|
+
var onEdit = function onEdit() {
|
|
37826
|
+
setWorkspaceActionDialogOptions({
|
|
37827
|
+
action: WorkspacePresetAction.EDIT,
|
|
37828
|
+
presetId: workspaceId,
|
|
37829
|
+
formValues: Object.assign({}, workspaceData)
|
|
37830
|
+
});
|
|
37831
|
+
};
|
|
37741
37832
|
var fullTitle = getTitle(title, hasChanges, workspaceId);
|
|
37742
37833
|
return /*#__PURE__*/React.createElement(WorkspaceOptions, {
|
|
37743
37834
|
hasChanges: hasChanges,
|
|
@@ -37747,6 +37838,7 @@ var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
|
37747
37838
|
handleSaveAs: onSaveAs,
|
|
37748
37839
|
handleSaveAll: onSaveAll,
|
|
37749
37840
|
handleSave: workspaceScope === 'user' ? onSave : undefined,
|
|
37841
|
+
handleEdit: workspaceScope === 'user' ? onEdit : undefined,
|
|
37750
37842
|
isDisabled: !viewIds.length || !isLoggedIn
|
|
37751
37843
|
});
|
|
37752
37844
|
};
|
|
@@ -37873,7 +37965,7 @@ var WorkspacePresetsForm = function WorkspacePresetsForm(_ref) {
|
|
|
37873
37965
|
event.preventDefault();
|
|
37874
37966
|
onSubmit();
|
|
37875
37967
|
};
|
|
37876
|
-
var hasFormInput = action === WorkspacePresetAction.DUPLICATE || action === WorkspacePresetAction.SAVE_AS || action === WorkspacePresetAction.SAVE_ALL;
|
|
37968
|
+
var hasFormInput = action === WorkspacePresetAction.DUPLICATE || action === WorkspacePresetAction.SAVE_AS || action === WorkspacePresetAction.SAVE_ALL || action === WorkspacePresetAction.EDIT;
|
|
37877
37969
|
// disable form inputs for 'Save (incl. viewpresets)' existing workspace preset
|
|
37878
37970
|
var isDisabled = action === WorkspacePresetAction.SAVE_ALL && formValues.id !== undefined && formValues.id !== '' && formValues.scope === 'user';
|
|
37879
37971
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Boolean(error) && /*#__PURE__*/React__default.createElement(Box$2, {
|
|
@@ -37949,6 +38041,7 @@ var DIALOG_TITLE_DELETE = 'Delete workspace';
|
|
|
37949
38041
|
var DIALOG_TITLE_DUPLICATE = 'Duplicate';
|
|
37950
38042
|
var DIALOG_BUTTON_SAVE = 'Save';
|
|
37951
38043
|
var DIALOG_BUTTON_DELETE = 'Delete';
|
|
38044
|
+
var DIALOG_BUTTON_EDIT = 'Edit (name and abstract)';
|
|
37952
38045
|
var getDialogTitle = function getDialogTitle(action) {
|
|
37953
38046
|
switch (action) {
|
|
37954
38047
|
case WorkspacePresetAction.DELETE:
|
|
@@ -37963,6 +38056,10 @@ var getDialogTitle = function getDialogTitle(action) {
|
|
|
37963
38056
|
{
|
|
37964
38057
|
return DIALOG_TITLE_SAVE_ALL;
|
|
37965
38058
|
}
|
|
38059
|
+
case WorkspacePresetAction.EDIT:
|
|
38060
|
+
{
|
|
38061
|
+
return DIALOG_BUTTON_EDIT;
|
|
38062
|
+
}
|
|
37966
38063
|
default:
|
|
37967
38064
|
{
|
|
37968
38065
|
return DIALOG_TITLE_SAVE_AS;
|
|
@@ -38166,7 +38263,7 @@ var MapPresetsForm = function MapPresetsForm(_ref) {
|
|
|
38166
38263
|
}
|
|
38167
38264
|
}, /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
38168
38265
|
title: error
|
|
38169
|
-
})), action === PresetAction.SAVE_AS && /*#__PURE__*/React__default.createElement("form", {
|
|
38266
|
+
})), (action === PresetAction.SAVE_AS || action === PresetAction.EDIT) && /*#__PURE__*/React__default.createElement("form", {
|
|
38170
38267
|
"data-testid": "map-preset-form",
|
|
38171
38268
|
onSubmit: onSubmitForm
|
|
38172
38269
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
|
|
@@ -38242,7 +38339,7 @@ var MapPresetsFormDialog = function MapPresetsFormDialog(_ref) {
|
|
|
38242
38339
|
var confirmLabel = getConfirmLabel(action);
|
|
38243
38340
|
var onFormSubmit = function onFormSubmit(newFormValues) {
|
|
38244
38341
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
38245
|
-
var newId, message;
|
|
38342
|
+
var newId, _yield$api$getViewPre, originalViewPreset, viewPresetEdited, message;
|
|
38246
38343
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38247
38344
|
while (1) switch (_context.prev = _context.next) {
|
|
38248
38345
|
case 0:
|
|
@@ -38250,7 +38347,7 @@ var MapPresetsFormDialog = function MapPresetsFormDialog(_ref) {
|
|
|
38250
38347
|
setError(null);
|
|
38251
38348
|
setIsLoading(true);
|
|
38252
38349
|
_context.t0 = action;
|
|
38253
|
-
_context.next = _context.t0 === PresetAction.SAVE_AS ? 6 : _context.t0 === PresetAction.DELETE ? 13 : 19;
|
|
38350
|
+
_context.next = _context.t0 === PresetAction.SAVE_AS ? 6 : _context.t0 === PresetAction.DELETE ? 13 : _context.t0 === PresetAction.EDIT ? 19 : 30;
|
|
38254
38351
|
break;
|
|
38255
38352
|
case 6:
|
|
38256
38353
|
_context.next = 8;
|
|
@@ -38260,7 +38357,7 @@ var MapPresetsFormDialog = function MapPresetsFormDialog(_ref) {
|
|
|
38260
38357
|
setIsLoading(false);
|
|
38261
38358
|
onClose();
|
|
38262
38359
|
onSuccess(action, newId, newFormValues.title);
|
|
38263
|
-
return _context.abrupt("break",
|
|
38360
|
+
return _context.abrupt("break", 31);
|
|
38264
38361
|
case 13:
|
|
38265
38362
|
_context.next = 15;
|
|
38266
38363
|
return api.deleteViewPreset(viewPresetId);
|
|
@@ -38268,23 +38365,39 @@ var MapPresetsFormDialog = function MapPresetsFormDialog(_ref) {
|
|
|
38268
38365
|
setIsLoading(false);
|
|
38269
38366
|
onClose();
|
|
38270
38367
|
onSuccess(action, viewPresetId, newFormValues.title);
|
|
38271
|
-
return _context.abrupt("break",
|
|
38368
|
+
return _context.abrupt("break", 31);
|
|
38272
38369
|
case 19:
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38370
|
+
_context.next = 21;
|
|
38371
|
+
return api.getViewPreset(viewPresetId);
|
|
38372
|
+
case 21:
|
|
38373
|
+
_yield$api$getViewPre = _context.sent;
|
|
38374
|
+
originalViewPreset = _yield$api$getViewPre.data;
|
|
38375
|
+
viewPresetEdited = Object.assign(Object.assign({}, originalViewPreset), {
|
|
38376
|
+
title: newFormValues.title
|
|
38377
|
+
});
|
|
38378
|
+
_context.next = 26;
|
|
38379
|
+
return api.saveViewPreset(viewPresetId, viewPresetEdited);
|
|
38380
|
+
case 26:
|
|
38381
|
+
setIsLoading(false);
|
|
38382
|
+
onClose();
|
|
38383
|
+
onSuccess(action, viewPresetId, newFormValues.title);
|
|
38384
|
+
return _context.abrupt("break", 31);
|
|
38385
|
+
case 30:
|
|
38386
|
+
return _context.abrupt("break", 31);
|
|
38387
|
+
case 31:
|
|
38388
|
+
_context.next = 38;
|
|
38276
38389
|
break;
|
|
38277
|
-
case
|
|
38278
|
-
_context.prev =
|
|
38390
|
+
case 33:
|
|
38391
|
+
_context.prev = 33;
|
|
38279
38392
|
_context.t1 = _context["catch"](0);
|
|
38280
38393
|
setIsLoading(false);
|
|
38281
38394
|
message = isAxiosError(_context.t1) ? getAxiosErrorMessage(_context.t1) : _context.t1.message;
|
|
38282
38395
|
setError(message);
|
|
38283
|
-
case
|
|
38396
|
+
case 38:
|
|
38284
38397
|
case "end":
|
|
38285
38398
|
return _context.stop();
|
|
38286
38399
|
}
|
|
38287
|
-
}, _callee, null, [[0,
|
|
38400
|
+
}, _callee, null, [[0, 33]]);
|
|
38288
38401
|
}));
|
|
38289
38402
|
};
|
|
38290
38403
|
var onSubmit = function onSubmit() {
|