@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 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(arr, i) {
19016
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
19017
- if (null != _i) {
19018
- var _s,
19019
- _e,
19020
- _x,
19021
- _r,
19022
- _arr = [],
19023
- _n = !0,
19024
- _d = !1;
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 (_x = (_i = _i.call(arr)).next, 0 === i) {
19027
- if (Object(_i) !== _i) return;
19028
- _n = !1;
19029
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
19030
- } catch (err) {
19031
- _d = !0, _e = err;
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 (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
19034
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
19035
19035
  } finally {
19036
- if (_d) throw _e;
19036
+ if (o) throw n;
19037
19037
  }
19038
19038
  }
19039
- return _arr;
19039
+ return a;
19040
19040
  }
19041
19041
  }
19042
19042
  function _regeneratorRuntime() {
19043
19043
  _regeneratorRuntime = function () {
19044
- return exports;
19044
+ return e;
19045
19045
  };
19046
- var exports = {},
19047
- Op = Object.prototype,
19048
- hasOwn = Op.hasOwnProperty,
19049
- defineProperty = Object.defineProperty || function (obj, key, desc) {
19050
- obj[key] = desc.value;
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
- $Symbol = "function" == typeof Symbol ? Symbol : {},
19053
- iteratorSymbol = $Symbol.iterator || "@@iterator",
19054
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
19055
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
19056
- function define(obj, key, value) {
19057
- return Object.defineProperty(obj, key, {
19058
- value: 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
- }), obj[key];
19063
+ }), t[e];
19063
19064
  }
19064
19065
  try {
19065
19066
  define({}, "");
19066
- } catch (err) {
19067
- define = function (obj, key, value) {
19068
- return obj[key] = value;
19067
+ } catch (t) {
19068
+ define = function (t, e, r) {
19069
+ return t[e] = r;
19069
19070
  };
19070
19071
  }
19071
- function wrap(innerFn, outerFn, self, tryLocsList) {
19072
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
19073
- generator = Object.create(protoGenerator.prototype),
19074
- context = new Context(tryLocsList || []);
19075
- return defineProperty(generator, "_invoke", {
19076
- value: makeInvokeMethod(innerFn, self, context)
19077
- }), generator;
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(fn, obj, arg) {
19080
+ function tryCatch(t, e, r) {
19080
19081
  try {
19081
19082
  return {
19082
19083
  type: "normal",
19083
- arg: fn.call(obj, arg)
19084
+ arg: t.call(e, r)
19084
19085
  };
19085
- } catch (err) {
19086
+ } catch (t) {
19086
19087
  return {
19087
19088
  type: "throw",
19088
- arg: err
19089
+ arg: t
19089
19090
  };
19090
19091
  }
19091
19092
  }
19092
- exports.wrap = wrap;
19093
- var ContinueSentinel = {};
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 IteratorPrototype = {};
19098
- define(IteratorPrototype, iteratorSymbol, function () {
19102
+ var p = {};
19103
+ define(p, a, function () {
19099
19104
  return this;
19100
19105
  });
19101
- var getProto = Object.getPrototypeOf,
19102
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
19103
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
19104
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
19105
- function defineIteratorMethods(prototype) {
19106
- ["next", "throw", "return"].forEach(function (method) {
19107
- define(prototype, method, function (arg) {
19108
- return this._invoke(method, arg);
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(generator, PromiseImpl) {
19113
- function invoke(method, arg, resolve, reject) {
19114
- var record = tryCatch(generator[method], generator, arg);
19115
- if ("throw" !== record.type) {
19116
- var result = record.arg,
19117
- value = result.value;
19118
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
19119
- invoke("next", value, resolve, reject);
19120
- }, function (err) {
19121
- invoke("throw", err, resolve, reject);
19122
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
19123
- result.value = unwrapped, resolve(result);
19124
- }, function (error) {
19125
- return invoke("throw", error, resolve, reject);
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
- reject(record.arg);
19133
+ a(c.arg);
19129
19134
  }
19130
- var previousPromise;
19131
- defineProperty(this, "_invoke", {
19132
- value: function (method, arg) {
19135
+ var r;
19136
+ o(this, "_invoke", {
19137
+ value: function (t, n) {
19133
19138
  function callInvokeWithMethodAndArg() {
19134
- return new PromiseImpl(function (resolve, reject) {
19135
- invoke(method, arg, resolve, reject);
19139
+ return new e(function (e, r) {
19140
+ invoke(t, n, e, r);
19136
19141
  });
19137
19142
  }
19138
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
19143
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
19139
19144
  }
19140
19145
  });
19141
19146
  }
19142
- function makeInvokeMethod(innerFn, self, context) {
19143
- var state = "suspendedStart";
19144
- return function (method, arg) {
19145
- if ("executing" === state) throw new Error("Generator is already running");
19146
- if ("completed" === state) {
19147
- if ("throw" === method) throw arg;
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: void 0,
19154
+ value: t,
19150
19155
  done: !0
19151
19156
  };
19152
19157
  }
19153
- for (context.method = method, context.arg = arg;;) {
19154
- var delegate = context.delegate;
19155
- if (delegate) {
19156
- var delegateResult = maybeInvokeDelegate(delegate, context);
19157
- if (delegateResult) {
19158
- if (delegateResult === ContinueSentinel) continue;
19159
- return delegateResult;
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" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
19163
- if ("suspendedStart" === state) throw state = "completed", context.arg;
19164
- context.dispatchException(context.arg);
19165
- } else "return" === context.method && context.abrupt("return", context.arg);
19166
- state = "executing";
19167
- var record = tryCatch(innerFn, self, context);
19168
- if ("normal" === record.type) {
19169
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
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: record.arg,
19172
- done: context.done
19176
+ value: p.arg,
19177
+ done: n.done
19173
19178
  };
19174
19179
  }
19175
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
19180
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
19176
19181
  }
19177
19182
  };
19178
19183
  }
19179
- function maybeInvokeDelegate(delegate, context) {
19180
- var methodName = context.method,
19181
- method = delegate.iterator[methodName];
19182
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
19183
- var record = tryCatch(method, delegate.iterator, context.arg);
19184
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
19185
- var info = record.arg;
19186
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
19187
- }
19188
- function pushTryEntry(locs) {
19189
- var entry = {
19190
- tryLoc: locs[0]
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 locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
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(entry) {
19195
- var record = entry.completion || {};
19196
- record.type = "normal", delete record.arg, entry.completion = record;
19199
+ function resetTryEntry(t) {
19200
+ var e = t.completion || {};
19201
+ e.type = "normal", delete e.arg, t.completion = e;
19197
19202
  }
19198
- function Context(tryLocsList) {
19203
+ function Context(t) {
19199
19204
  this.tryEntries = [{
19200
19205
  tryLoc: "root"
19201
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
19202
- }
19203
- function values(iterable) {
19204
- if (iterable || "" === iterable) {
19205
- var iteratorMethod = iterable[iteratorSymbol];
19206
- if (iteratorMethod) return iteratorMethod.call(iterable);
19207
- if ("function" == typeof iterable.next) return iterable;
19208
- if (!isNaN(iterable.length)) {
19209
- var i = -1,
19210
- next = function next() {
19211
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
19212
- return next.value = undefined, next.done = !0, next;
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 next.next = next;
19219
+ return i.next = i;
19215
19220
  }
19216
19221
  }
19217
- throw new TypeError(typeof iterable + " is not iterable");
19222
+ throw new TypeError(typeof e + " is not iterable");
19218
19223
  }
19219
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
19224
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
19220
19225
  value: GeneratorFunctionPrototype,
19221
19226
  configurable: !0
19222
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
19227
+ }), o(GeneratorFunctionPrototype, "constructor", {
19223
19228
  value: GeneratorFunction,
19224
19229
  configurable: !0
19225
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
19226
- var ctor = "function" == typeof genFun && genFun.constructor;
19227
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
19228
- }, exports.mark = function (genFun) {
19229
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
19230
- }, exports.awrap = function (arg) {
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: arg
19237
+ __await: t
19233
19238
  };
19234
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
19239
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
19235
19240
  return this;
19236
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
19237
- void 0 === PromiseImpl && (PromiseImpl = Promise);
19238
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
19239
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
19240
- return result.done ? result.value : iter.next();
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(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
19247
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
19243
19248
  return this;
19244
- }), define(Gp, "toString", function () {
19249
+ }), define(g, "toString", function () {
19245
19250
  return "[object Generator]";
19246
- }), exports.keys = function (val) {
19247
- var object = Object(val),
19248
- keys = [];
19249
- for (var key in object) keys.push(key);
19250
- return keys.reverse(), function next() {
19251
- for (; keys.length;) {
19252
- var key = keys.pop();
19253
- if (key in object) return next.value = key, next.done = !1, next;
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
- }, exports.values = values, Context.prototype = {
19262
+ }, e.values = values, Context.prototype = {
19258
19263
  constructor: Context,
19259
- reset: function (skipTempReset) {
19260
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
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 rootRecord = this.tryEntries[0].completion;
19265
- if ("throw" === rootRecord.type) throw rootRecord.arg;
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 (exception) {
19269
- if (this.done) throw exception;
19270
- var context = this;
19271
- function handle(loc, caught) {
19272
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
19273
- }
19274
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
19275
- var entry = this.tryEntries[i],
19276
- record = entry.completion;
19277
- if ("root" === entry.tryLoc) return handle("end");
19278
- if (entry.tryLoc <= this.prev) {
19279
- var hasCatch = hasOwn.call(entry, "catchLoc"),
19280
- hasFinally = hasOwn.call(entry, "finallyLoc");
19281
- if (hasCatch && hasFinally) {
19282
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
19283
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
19284
- } else if (hasCatch) {
19285
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
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 (!hasFinally) throw new Error("try statement without catch or finally");
19288
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
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 (type, arg) {
19294
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
19295
- var entry = this.tryEntries[i];
19296
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
19297
- var finallyEntry = entry;
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
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
19302
- var record = finallyEntry ? finallyEntry.completion : {};
19303
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
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 (record, afterLoc) {
19306
- if ("throw" === record.type) throw record.arg;
19307
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
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 (finallyLoc) {
19310
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
19311
- var entry = this.tryEntries[i];
19312
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
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 (tryLoc) {
19316
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
19317
- var entry = this.tryEntries[i];
19318
- if (entry.tryLoc === tryLoc) {
19319
- var record = entry.completion;
19320
- if ("throw" === record.type) {
19321
- var thrown = record.arg;
19322
- resetTryEntry(entry);
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 thrown;
19329
+ return o;
19325
19330
  }
19326
19331
  }
19327
19332
  throw new Error("illegal catch attempt");
19328
19333
  },
19329
- delegateYield: function (iterable, resultName, nextLoc) {
19334
+ delegateYield: function (e, r, n) {
19330
19335
  return this.delegate = {
19331
- iterator: values(iterable),
19332
- resultName: resultName,
19333
- nextLoc: nextLoc
19334
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
19336
+ iterator: values(e),
19337
+ resultName: r,
19338
+ nextLoc: n
19339
+ }, "next" === this.method && (this.arg = t), y;
19335
19340
  }
19336
- }, exports;
19341
+ }, e;
19337
19342
  }
19338
- function _typeof$2(obj) {
19343
+ function _typeof$2(o) {
19339
19344
  "@babel/helpers - typeof";
19340
19345
 
19341
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
19342
- return typeof obj;
19343
- } : function (obj) {
19344
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
19345
- }, _typeof$2(obj);
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["RENAME"] = "Rename";
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, selectedWorkspace, workspaceFilters, searchQuery;
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
- _context2.next = 5;
23917
- return select(getWorkspaceState);
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 = 9;
23947
+ _context2.next = 6;
23925
23948
  return put(routerActions.navigateToUrl({
23926
23949
  url: getWorkspaceRouteUrl()
23927
23950
  }));
23928
- case 9:
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 = 14;
23953
+ _context2.next = 9;
23936
23954
  break;
23937
23955
  }
23938
- _context2.next = 14;
23956
+ _context2.next = 9;
23939
23957
  return put(routerActions.navigateToUrl({
23940
23958
  url: getWorkspaceRouteUrl(workspaceId)
23941
23959
  }));
23942
- case 14:
23943
- _context2.next = 16;
23960
+ case 9:
23961
+ _context2.next = 11;
23944
23962
  return select(getWorkspaceListFilters);
23945
- case 16:
23963
+ case 11:
23946
23964
  workspaceFilters = _context2.sent;
23947
- _context2.next = 19;
23965
+ _context2.next = 14;
23948
23966
  return select(getWorkspaceListSearchQuery);
23949
- case 19:
23967
+ case 14:
23950
23968
  searchQuery = _context2.sent;
23951
- _context2.next = 22;
23969
+ _context2.next = 17;
23952
23970
  return call(fetchWorkspaceListSaga, workspaceListActions.fetchWorkspaceList(constructFilterParams(workspaceFilters, searchQuery)));
23953
- case 22:
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 = 33;
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 33:
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 = 66;
24164
+ _context4.next = 79;
24118
24165
  break;
24119
24166
  }
24120
- _context4.next = 36;
24167
+ _context4.next = 49;
24121
24168
  return select(getWorkspaceState);
24122
- case 36:
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 = 44;
24174
+ _context4.next = 57;
24128
24175
  break;
24129
24176
  }
24130
- _context4.next = 41;
24177
+ _context4.next = 54;
24131
24178
  return call(workspaceApi.saveWorkspacePresetAs, data);
24132
- case 41:
24179
+ case 54:
24133
24180
  _context4.t1 = _context4.sent;
24134
- _context4.next = 45;
24181
+ _context4.next = 58;
24135
24182
  break;
24136
- case 44:
24183
+ case 57:
24137
24184
  _context4.t1 = data.id;
24138
- case 45:
24185
+ case 58:
24139
24186
  workspaceId = _context4.t1;
24140
- _context4.next = 48;
24187
+ _context4.next = 61;
24141
24188
  return select(getViewPresets);
24142
- case 48:
24189
+ case 61:
24143
24190
  views = _context4.sent;
24144
- _context4.next = 51;
24191
+ _context4.next = 64;
24145
24192
  return all(views.map(function (view) {
24146
24193
  return call(saveAllViewPresetSaga, view, data.title);
24147
24194
  }));
24148
- case 51:
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 = 55;
24201
+ _context4.next = 68;
24155
24202
  break;
24156
24203
  }
24157
24204
  throw new Error(errorMessage);
24158
- case 55:
24159
- _context4.next = 57;
24205
+ case 68:
24206
+ _context4.next = 70;
24160
24207
  return select(getWorkspaceData);
24161
- case 57:
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 = 61;
24216
+ _context4.next = 74;
24170
24217
  return call(workspaceApi.saveWorkspacePreset, workspaceId, newWorkspace);
24171
- case 61:
24172
- _context4.next = 63;
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 63:
24226
+ case 76:
24180
24227
  if (!isNew) {
24181
- _context4.next = 66;
24228
+ _context4.next = 79;
24182
24229
  break;
24183
24230
  }
24184
- _context4.next = 66;
24231
+ _context4.next = 79;
24185
24232
  return put(routerActions.navigateToUrl({
24186
24233
  url: getWorkspaceRouteUrl(workspaceId)
24187
24234
  }));
24188
- case 66:
24189
- _context4.next = 73;
24235
+ case 79:
24236
+ _context4.next = 86;
24190
24237
  break;
24191
- case 68:
24192
- _context4.prev = 68;
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 = 73;
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 73:
24249
+ case 86:
24203
24250
  case "end":
24204
24251
  return _context4.stop();
24205
24252
  }
24206
- }, _callee3, null, [[3, 68]]);
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
- _context5.next = 20;
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 20:
24519
+ case 21:
24469
24520
  if (!(action === PresetAction.SAVE_AS && viewPresetId)) {
24470
- _context5.next = 23;
24521
+ _context5.next = 24;
24471
24522
  break;
24472
24523
  }
24473
- _context5.next = 23;
24524
+ _context5.next = 24;
24474
24525
  return put(viewPresetActions.setActiveViewPresetId({
24475
24526
  panelId: panelId,
24476
24527
  viewPresetId: viewPresetId
24477
24528
  }));
24478
- case 23:
24479
- _context5.next = 27;
24529
+ case 24:
24530
+ _context5.next = 28;
24480
24531
  break;
24481
- case 25:
24482
- _context5.prev = 25;
24532
+ case 26:
24533
+ _context5.prev = 26;
24483
24534
  _context5.t0 = _context5["catch"](1);
24484
- case 27:
24535
+ case 28:
24485
24536
  case "end":
24486
24537
  return _context5.stop();
24487
24538
  }
24488
- }, _callee4, null, [[1, 25]]);
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
- // const onEdit = (): void => {
32503
- // onClickWorkspacePresetOption(
32504
- // workspacePreset.id,
32505
- // WorkspacePresetAction.EDIT,
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, panelId);
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
- // case WorkspacePresetAction.EDIT: {
33032
- // break;
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: 'Edit',
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.13.2
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 || sizingTransform(propValue)
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
- // case WorkspacePresetAction.EDIT: {
37454
- // break;
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", 20);
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", 20);
38368
+ return _context.abrupt("break", 31);
38272
38369
  case 19:
38273
- return _context.abrupt("break", 20);
38274
- case 20:
38275
- _context.next = 27;
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 22:
38278
- _context.prev = 22;
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 27:
38396
+ case 38:
38284
38397
  case "end":
38285
38398
  return _context.stop();
38286
38399
  }
38287
- }, _callee, null, [[0, 22]]);
38400
+ }, _callee, null, [[0, 33]]);
38288
38401
  }));
38289
38402
  };
38290
38403
  var onSubmit = function onSubmit() {