@crystaldesign/diva-backoffice 26.14.0-beta.27 → 26.14.0-beta.28
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/build/esm/index.js +471 -203
- package/build/types/backoffice/src/tests/unit/ui/Form/inheritance.test.d.ts +2 -0
- package/build/types/backoffice/src/tests/unit/ui/Form/inheritance.test.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/Form/InheritedValue.d.ts +16 -0
- package/build/types/backoffice/src/ui/Form/InheritedValue.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/Form/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/inheritance.d.ts +35 -0
- package/build/types/backoffice/src/ui/Form/inheritance.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/Form/types.d.ts +8 -0
- package/build/types/backoffice/src/ui/Form/types.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/useInheritance.d.ts +11 -0
- package/build/types/backoffice/src/ui/Form/useInheritance.d.ts.map +1 -0
- package/package.json +12 -12
package/build/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import React, { createElement, createContext, useState, useEffect, useRef, useMemo, forwardRef, useImperativeHandle, useCallback, createRef, useReducer, useContext, memo, useDeferredValue, useSyncExternalStore, Suspense, lazy } from 'react';
|
|
4
4
|
import 'antd/dist/reset.css';
|
|
5
|
-
import { Divider, Form as Form$2, Button, Input as Input$1, Popover, Typography, Progress, Select, Avatar, Spin, Radio, Space, Dropdown, InputNumber, ColorPicker, Tooltip as Tooltip$1, Slider, DatePicker, Checkbox as Checkbox$1, Modal as Modal$2, Tabs, Cascader, Descriptions, Row, Col, Collapse, List as List$1, Skeleton, Alert, Card, Upload as Upload$2, Table as Table$1, message, Switch, Popconfirm, Image as Image$1, Breadcrumb, Result as Result$1, Badge, Tag,
|
|
5
|
+
import { Divider, Form as Form$2, Button, Input as Input$1, Popover, Typography, Progress, Select, Avatar, Spin, Radio, Space, Dropdown, InputNumber, ColorPicker, Tooltip as Tooltip$1, Slider, DatePicker, Checkbox as Checkbox$1, Modal as Modal$2, theme, Tabs, Cascader, Descriptions, Row, Col, Collapse, List as List$1, Skeleton, Alert, Card, Upload as Upload$2, Table as Table$1, message, Switch, Popconfirm, Image as Image$1, Breadcrumb, Result as Result$1, Badge, Tag, Empty, Splitter, notification, ConfigProvider, Layout, Drawer, Segmented } from 'antd';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import { observer } from 'mobx-react-lite';
|
|
8
8
|
import { getLogger, DivaError, useTranslation, useDivaCore, DivaUtils, i18n } from '@crystaldesign/diva-core';
|
|
@@ -95,12 +95,12 @@ import Button$1 from 'antd/es/button';
|
|
|
95
95
|
import Upload$1 from 'antd/es/upload';
|
|
96
96
|
import DownOutlined from '@ant-design/icons/lib/icons/DownOutlined';
|
|
97
97
|
import Space$1 from 'antd/es/space';
|
|
98
|
+
import get from 'lodash/get';
|
|
98
99
|
import { stringify } from 'csv';
|
|
99
100
|
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
100
101
|
import SearchOutlined from '@ant-design/icons/SearchOutlined';
|
|
101
102
|
import PlusOutlined$1 from '@ant-design/icons/PlusOutlined';
|
|
102
103
|
import set from 'lodash/set';
|
|
103
|
-
import get from 'lodash/get';
|
|
104
104
|
import has from 'lodash/has';
|
|
105
105
|
import isEqual from 'lodash/isEqual';
|
|
106
106
|
import mapValues from 'lodash/mapValues';
|
|
@@ -248,9 +248,9 @@ function plannerBasesEditedAt(path, plannerTools) {
|
|
|
248
248
|
return _toConsumableArray(new Set([packageId].concat(_toConsumableArray(keyedBy))));
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
function _createForOfIteratorHelper$
|
|
252
|
-
function _unsupportedIterableToArray$
|
|
253
|
-
function _arrayLikeToArray$
|
|
251
|
+
function _createForOfIteratorHelper$1d(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1d(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
252
|
+
function _unsupportedIterableToArray$1d(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1d(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1d(r, a) : void 0; } }
|
|
253
|
+
function _arrayLikeToArray$1d(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
254
254
|
var MAX_HEADLESS_INSTANCES = 3;
|
|
255
255
|
/** How long the mounted view gets to rebuild its planner before a consumer builds its own. */
|
|
256
256
|
var VIEW_REBUILD_WAIT_MS = 30000;
|
|
@@ -414,7 +414,7 @@ var WebplannerInstanceStore = /*#__PURE__*/function () {
|
|
|
414
414
|
value: function flagStale(baseIds) {
|
|
415
415
|
var bases = new Set(baseIds);
|
|
416
416
|
// A creation in flight is a use in progress — it discards its result and builds again on the new data.
|
|
417
|
-
var _iterator = _createForOfIteratorHelper$
|
|
417
|
+
var _iterator = _createForOfIteratorHelper$1d(bases),
|
|
418
418
|
_step;
|
|
419
419
|
try {
|
|
420
420
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -428,7 +428,7 @@ var WebplannerInstanceStore = /*#__PURE__*/function () {
|
|
|
428
428
|
_iterator.f();
|
|
429
429
|
}
|
|
430
430
|
if (this._activeKey && this._activeInstance && bases.has(baseOf(this._activeKey))) this._staleInstances.add(this._activeInstance);
|
|
431
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
431
|
+
var _iterator2 = _createForOfIteratorHelper$1d(this._headless),
|
|
432
432
|
_step2;
|
|
433
433
|
try {
|
|
434
434
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -935,12 +935,12 @@ function staleBasesOf(message) {
|
|
|
935
935
|
return bases.length ? bases : undefined;
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
-
function _createForOfIteratorHelper$
|
|
939
|
-
function _unsupportedIterableToArray$
|
|
940
|
-
function _arrayLikeToArray$
|
|
941
|
-
function ownKeys$
|
|
942
|
-
function _objectSpread$
|
|
943
|
-
var LOG$
|
|
938
|
+
function _createForOfIteratorHelper$1c(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1c(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
939
|
+
function _unsupportedIterableToArray$1c(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1c(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1c(r, a) : void 0; } }
|
|
940
|
+
function _arrayLikeToArray$1c(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
941
|
+
function ownKeys$2P(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
942
|
+
function _objectSpread$2P(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2P(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2P(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
943
|
+
var LOG$x = getLogger('Backoffice', 'ApplyMapping');
|
|
944
944
|
function applyMapping (_ref) {
|
|
945
945
|
var mappable = _ref.mappable,
|
|
946
946
|
mappingData = _ref.mappingData,
|
|
@@ -960,10 +960,10 @@ function applyMapping (_ref) {
|
|
|
960
960
|
var newValue = {};
|
|
961
961
|
newValue[newKey] = valueToAdd;
|
|
962
962
|
if ((startValue === null || startValue === void 0 ? void 0 : startValue[newKey]) != undefined) {
|
|
963
|
-
if (_typeof(startValue[newKey]) == 'object') startValue[newKey] = _objectSpread$
|
|
963
|
+
if (_typeof(startValue[newKey]) == 'object') startValue[newKey] = _objectSpread$2P(_objectSpread$2P({}, startValue[newKey]), valueToAdd);else startValue[newKey] = type == 'addToSourceValue' ? startValue[newKey] + valueToAdd : valueToAdd;
|
|
964
964
|
return startValue;
|
|
965
965
|
}
|
|
966
|
-
if (newIdx == 1) return _objectSpread$
|
|
966
|
+
if (newIdx == 1) return _objectSpread$2P(_objectSpread$2P({}, startValue), newValue);
|
|
967
967
|
return _getTarget(idx + 1, keys, startValue, newValue);
|
|
968
968
|
};
|
|
969
969
|
returnValue = _getTarget(0, key.split('.'), returnValue, value);
|
|
@@ -972,7 +972,7 @@ function applyMapping (_ref) {
|
|
|
972
972
|
function meetsCondition(map) {
|
|
973
973
|
if (!map.condition) return true;
|
|
974
974
|
var value = mappingData[map.condition.field];
|
|
975
|
-
var _iterator = _createForOfIteratorHelper$
|
|
975
|
+
var _iterator = _createForOfIteratorHelper$1c(map.condition.values),
|
|
976
976
|
_step;
|
|
977
977
|
try {
|
|
978
978
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -1051,7 +1051,7 @@ function applyMapping (_ref) {
|
|
|
1051
1051
|
_url.href = _url.href.replace('&' + m.targetField + '=${' + m.targetField + '}', '');
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
1054
|
+
var _iterator2 = _createForOfIteratorHelper$1c(_url.searchParams.entries()),
|
|
1055
1055
|
_step2;
|
|
1056
1056
|
try {
|
|
1057
1057
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -1086,13 +1086,13 @@ function applyMapping (_ref) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
return returnValue;
|
|
1088
1088
|
} catch (e) {
|
|
1089
|
-
LOG$
|
|
1089
|
+
LOG$x.debug('Mapabledata', mappable);
|
|
1090
1090
|
throw e;
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
1093
|
|
|
1094
|
-
function ownKeys$
|
|
1095
|
-
function _objectSpread$
|
|
1094
|
+
function ownKeys$2O(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1095
|
+
function _objectSpread$2O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2O(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1096
1096
|
function parseServersideFilters (_ref) {
|
|
1097
1097
|
var baseUrl = _ref.baseUrl,
|
|
1098
1098
|
columns = _ref.columns,
|
|
@@ -1248,7 +1248,7 @@ var ALL_FIELDS_OPERATORS = ['ne', 'doesnotcontain', 'isnull'];
|
|
|
1248
1248
|
* has to check both fields. Expands such column filters (keyed by `column.field`) into one entry per field.
|
|
1249
1249
|
*/
|
|
1250
1250
|
function expandFallbackFieldFilters(filters, columns) {
|
|
1251
|
-
var expanded = _objectSpread$
|
|
1251
|
+
var expanded = _objectSpread$2O({}, filters);
|
|
1252
1252
|
// parseFilter treats group index 0 as "no OR group", so numbering starts at 1.
|
|
1253
1253
|
var orGroup = 1;
|
|
1254
1254
|
for (var _i = 0, _getLeafColumns = getLeafColumns(columns); _i < _getLeafColumns.length; _i++) {
|
|
@@ -1298,9 +1298,9 @@ function getLeafColumns(columns) {
|
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
-
function ownKeys$
|
|
1302
|
-
function _objectSpread$
|
|
1303
|
-
var LOG$
|
|
1301
|
+
function ownKeys$2N(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1302
|
+
function _objectSpread$2N(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2N(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2N(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1303
|
+
var LOG$w = getLogger('Backoffice', 'ApiHandler');
|
|
1304
1304
|
var jp = require('jsonpath');
|
|
1305
1305
|
var _default$c = /*#__PURE__*/function () {
|
|
1306
1306
|
function _default(configuration, _rootStore) {
|
|
@@ -1480,7 +1480,7 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1480
1480
|
_context2.next = 21;
|
|
1481
1481
|
return fetch(finalUrl, {
|
|
1482
1482
|
method: this._updateMethod,
|
|
1483
|
-
headers: _objectSpread$
|
|
1483
|
+
headers: _objectSpread$2N(_objectSpread$2N({}, jwt ? {
|
|
1484
1484
|
Authorization: 'Bearer ' + jwt
|
|
1485
1485
|
} : {}), {}, {
|
|
1486
1486
|
'Content-Type': 'application/json'
|
|
@@ -1575,7 +1575,7 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1575
1575
|
rootStore: this._rootStore,
|
|
1576
1576
|
fallBackToParams: true
|
|
1577
1577
|
});
|
|
1578
|
-
if (data) createData = _objectSpread$
|
|
1578
|
+
if (data) createData = _objectSpread$2N({}, data);
|
|
1579
1579
|
} else if (data !== undefined) {
|
|
1580
1580
|
createData = applyMapping({
|
|
1581
1581
|
mappable: data,
|
|
@@ -1840,7 +1840,7 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1840
1840
|
throw new Error('Read List endpoint is missing in configuration.');
|
|
1841
1841
|
case 2:
|
|
1842
1842
|
jwt = (_this$_rootStore5 = this._rootStore) === null || _this$_rootStore5 === void 0 ? void 0 : _this$_rootStore5.dataStore.jwt;
|
|
1843
|
-
url = filterServerSide ? parseServersideFilters(_objectSpread$
|
|
1843
|
+
url = filterServerSide ? parseServersideFilters(_objectSpread$2N(_objectSpread$2N({}, filterServerSide), {}, {
|
|
1844
1844
|
columns: this._filterFields ? filterServerSide.columns : undefined,
|
|
1845
1845
|
baseUrl: this._readListUrl,
|
|
1846
1846
|
prefilter: prefilter
|
|
@@ -1860,7 +1860,7 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1860
1860
|
});
|
|
1861
1861
|
case 6:
|
|
1862
1862
|
response = _context8.sent;
|
|
1863
|
-
return _context8.abrupt("return", _objectSpread$
|
|
1863
|
+
return _context8.abrupt("return", _objectSpread$2N(_objectSpread$2N({}, response), {}, {
|
|
1864
1864
|
data: response.data.map(function (d) {
|
|
1865
1865
|
return _this2.aplyJsonPath(d, _this2._readJsonPath);
|
|
1866
1866
|
})
|
|
@@ -1884,7 +1884,7 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1884
1884
|
throw new Error('Read List endpoint is missing in configuration.');
|
|
1885
1885
|
}
|
|
1886
1886
|
(_this$_rootStore6 = this._rootStore) === null || _this$_rootStore6 === void 0 ? void 0 : _this$_rootStore6.dataStore.jwt;
|
|
1887
|
-
var url = filterServerSide ? parseServersideFilters(_objectSpread$
|
|
1887
|
+
var url = filterServerSide ? parseServersideFilters(_objectSpread$2N(_objectSpread$2N({}, filterServerSide), {}, {
|
|
1888
1888
|
columns: this._filterFields ? filterServerSide.columns : undefined,
|
|
1889
1889
|
baseUrl: this._readListUrl,
|
|
1890
1890
|
prefilter: prefilter
|
|
@@ -1985,16 +1985,16 @@ var _default$c = /*#__PURE__*/function () {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
});
|
|
1987
1987
|
this._socket.on('error', function (error) {
|
|
1988
|
-
LOG$
|
|
1988
|
+
LOG$w.error(new DivaError('Error on connection', error));
|
|
1989
1989
|
});
|
|
1990
1990
|
this._socket.on('connect_error', function (error) {
|
|
1991
|
-
LOG$
|
|
1991
|
+
LOG$w.log("connect_error due to ".concat(error.message));
|
|
1992
1992
|
});
|
|
1993
1993
|
this._socket.on('connect', function () {
|
|
1994
|
-
LOG$
|
|
1994
|
+
LOG$w.debug('Successfully connected to socket');
|
|
1995
1995
|
});
|
|
1996
1996
|
this._socket.on('disconnect', function () {
|
|
1997
|
-
LOG$
|
|
1997
|
+
LOG$w.debug('Disconnect from socket');
|
|
1998
1998
|
});
|
|
1999
1999
|
return this._socket;
|
|
2000
2000
|
}
|
|
@@ -2710,8 +2710,8 @@ var ASPECT_RATIOS_FULL = ['1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16
|
|
|
2710
2710
|
/** All four image sizes — only `gemini-3.1-flash-image-preview` supports `512`. */
|
|
2711
2711
|
var IMAGE_SIZES_FULL = ['512', '1K', '2K', '4K'];
|
|
2712
2712
|
|
|
2713
|
-
function ownKeys$
|
|
2714
|
-
function _objectSpread$
|
|
2713
|
+
function ownKeys$2M(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2714
|
+
function _objectSpread$2M(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2M(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2M(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2715
2715
|
|
|
2716
2716
|
/** The types of an AI service prompt: TEXT is a text template for /v2/text, every other type an image template. */
|
|
2717
2717
|
var PROMPT_TYPES = ['ROOM_RENDERING', 'SOCIAL_ADD', 'PRODUCT', 'HERO_IMAGE', 'UPSCALE', 'TEXT'];
|
|
@@ -2777,7 +2777,7 @@ var _default$7 = /*#__PURE__*/function () {
|
|
|
2777
2777
|
var _i$permission;
|
|
2778
2778
|
return !i.permission || _this.root.actions.userHasPermission((_i$permission = i.permission) === null || _i$permission === void 0 ? void 0 : _i$permission.toLocaleLowerCase());
|
|
2779
2779
|
});
|
|
2780
|
-
config = _objectSpread$
|
|
2780
|
+
config = _objectSpread$2M(_objectSpread$2M({}, config), {}, {
|
|
2781
2781
|
items: filteredItems
|
|
2782
2782
|
});
|
|
2783
2783
|
}
|
|
@@ -9442,9 +9442,21 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
9442
9442
|
},
|
|
9443
9443
|
create: '${authService}/v2/organizations/${parentId}'
|
|
9444
9444
|
},
|
|
9445
|
+
inheritance: {
|
|
9446
|
+
apiInterface: {
|
|
9447
|
+
read: '${authService}/v2/organizations/${organizationId}/inheritance'
|
|
9448
|
+
},
|
|
9449
|
+
mapping: {
|
|
9450
|
+
type: 'query',
|
|
9451
|
+
map: [{
|
|
9452
|
+
sourceField: '_id',
|
|
9453
|
+
targetField: 'organizationId'
|
|
9454
|
+
}]
|
|
9455
|
+
}
|
|
9456
|
+
},
|
|
9445
9457
|
triggerRerender: true,
|
|
9446
9458
|
enableSearch: true,
|
|
9447
|
-
items: [{
|
|
9459
|
+
items: hideForCampaigns(t, [{
|
|
9448
9460
|
name: 'type',
|
|
9449
9461
|
label: t('backoffice.form.organizationdetails.items.type'),
|
|
9450
9462
|
type: 'radio',
|
|
@@ -9772,6 +9784,7 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
9772
9784
|
label: t('backoffice.form.organizationdetails.items.iwofurn'),
|
|
9773
9785
|
tabgroup: t('backoffice.subtitle.generally'),
|
|
9774
9786
|
type: 'checkbox',
|
|
9787
|
+
inheritancePath: 'iwoFurnOptions',
|
|
9775
9788
|
hidden: function hidden(data) {
|
|
9776
9789
|
return (data === null || data === void 0 ? void 0 : data.type) !== 'RETAILER' && (data === null || data === void 0 ? void 0 : data.parentType) !== 'RETAILER';
|
|
9777
9790
|
},
|
|
@@ -11223,7 +11236,7 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
11223
11236
|
name: ''
|
|
11224
11237
|
}],
|
|
11225
11238
|
initialValue: []
|
|
11226
|
-
}]
|
|
11239
|
+
}])
|
|
11227
11240
|
},
|
|
11228
11241
|
FromAffilateOrganizationDetails: {
|
|
11229
11242
|
type: 'Form',
|
|
@@ -15725,6 +15738,30 @@ var showCampaignFields = function showCampaignFields(data) {
|
|
|
15725
15738
|
return (data === null || data === void 0 ? void 0 : data.type) !== 'SUPPLIER' && !((data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined);
|
|
15726
15739
|
};
|
|
15727
15740
|
|
|
15741
|
+
/**
|
|
15742
|
+
* A campaign organization shows only what its landing page, widgets and tracking read; everything else is the same for every
|
|
15743
|
+
* campaign and comes from the retailer, so it is hidden there. Only hidden: stored values stay.
|
|
15744
|
+
*/
|
|
15745
|
+
function hideForCampaigns(t, items) {
|
|
15746
|
+
var campaignTabs = [t('backoffice.form.organizationdetails.campaignLandingPage'), t('backoffice.form.organizationdetails.additionalContactData')];
|
|
15747
|
+
var campaignFields = ['type', t('backoffice.subtitle.generally'), '_id', 'displayName', 'description', 'email', 'phone', 'homepage', t('backoffice.subtitle.configurator'), 'privacyPolicyUrl', 'termsAndConditionsUrl', 'impressumUrl'];
|
|
15748
|
+
return items.map(function (item) {
|
|
15749
|
+
var _item$tabgroup;
|
|
15750
|
+
if (campaignTabs.includes((_item$tabgroup = item.tabgroup) !== null && _item$tabgroup !== void 0 ? _item$tabgroup : '') || campaignFields.includes(item.name.toString())) return item;
|
|
15751
|
+
var _hidden = item.hidden,
|
|
15752
|
+
_required = item.required;
|
|
15753
|
+
return _objectSpread$2M(_objectSpread$2M({}, item), {}, {
|
|
15754
|
+
hidden: function hidden(data) {
|
|
15755
|
+
return (data === null || data === void 0 ? void 0 : data.type) === 'CAMPAIGN' || (typeof _hidden === 'function' ? _hidden(data) : !!_hidden);
|
|
15756
|
+
}
|
|
15757
|
+
}, _required !== undefined && {
|
|
15758
|
+
required: function required(data) {
|
|
15759
|
+
return (data === null || data === void 0 ? void 0 : data.type) !== 'CAMPAIGN' && (typeof _required === 'function' ? _required(data) : _required);
|
|
15760
|
+
}
|
|
15761
|
+
});
|
|
15762
|
+
});
|
|
15763
|
+
}
|
|
15764
|
+
|
|
15728
15765
|
function styleInject(css, ref) {
|
|
15729
15766
|
if ( ref === void 0 ) ref = {};
|
|
15730
15767
|
var insertAt = ref.insertAt;
|
|
@@ -15779,9 +15816,9 @@ function MenuLabel (_ref) {
|
|
|
15779
15816
|
});
|
|
15780
15817
|
}
|
|
15781
15818
|
|
|
15782
|
-
function _createForOfIteratorHelper$
|
|
15783
|
-
function _unsupportedIterableToArray$
|
|
15784
|
-
function _arrayLikeToArray$
|
|
15819
|
+
function _createForOfIteratorHelper$1b(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1b(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
15820
|
+
function _unsupportedIterableToArray$1b(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1b(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1b(r, a) : void 0; } }
|
|
15821
|
+
function _arrayLikeToArray$1b(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15785
15822
|
function applyRule(_ref) {
|
|
15786
15823
|
var rules = _ref.rules,
|
|
15787
15824
|
data = _ref.data,
|
|
@@ -15790,7 +15827,7 @@ function applyRule(_ref) {
|
|
|
15790
15827
|
//if or we start with false until the first time some result is true
|
|
15791
15828
|
//if and we start with true until the frist time some result is false
|
|
15792
15829
|
var result = !or;
|
|
15793
|
-
var _iterator = _createForOfIteratorHelper$
|
|
15830
|
+
var _iterator = _createForOfIteratorHelper$1b(rules),
|
|
15794
15831
|
_step;
|
|
15795
15832
|
try {
|
|
15796
15833
|
var _loop = function _loop() {
|
|
@@ -15862,7 +15899,7 @@ function aplyRules(_ref2) {
|
|
|
15862
15899
|
if (!data || data.length == 0) return {
|
|
15863
15900
|
applied: false
|
|
15864
15901
|
};
|
|
15865
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
15902
|
+
var _iterator2 = _createForOfIteratorHelper$1b(data),
|
|
15866
15903
|
_step2;
|
|
15867
15904
|
try {
|
|
15868
15905
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -15885,19 +15922,19 @@ function aplyRules(_ref2) {
|
|
|
15885
15922
|
};
|
|
15886
15923
|
}
|
|
15887
15924
|
|
|
15888
|
-
function ownKeys$
|
|
15889
|
-
function _objectSpread$
|
|
15925
|
+
function ownKeys$2L(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15926
|
+
function _objectSpread$2L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2L(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15890
15927
|
/**
|
|
15891
15928
|
* Wraps 16x16 path data from Bootstrap Icons (MIT) in the antd `Icon`, so it sizes like the antd icons and takes the
|
|
15892
15929
|
* surrounding text color (`currentColor`) in the light and the dark theme.
|
|
15893
15930
|
*/
|
|
15894
15931
|
function svgIcon(paths) {
|
|
15895
15932
|
var Svg = function Svg(props) {
|
|
15896
|
-
return /*#__PURE__*/jsx("svg", _objectSpread$
|
|
15933
|
+
return /*#__PURE__*/jsx("svg", _objectSpread$2L(_objectSpread$2L({
|
|
15897
15934
|
viewBox: "0 0 16 16"
|
|
15898
15935
|
}, props), {}, {
|
|
15899
15936
|
children: paths.map(function (path) {
|
|
15900
|
-
return /*#__PURE__*/jsx("path", _objectSpread$
|
|
15937
|
+
return /*#__PURE__*/jsx("path", _objectSpread$2L({}, path), path.d);
|
|
15901
15938
|
})
|
|
15902
15939
|
}));
|
|
15903
15940
|
};
|
|
@@ -16138,8 +16175,8 @@ function getIcon(icon) {
|
|
|
16138
16175
|
return undefined;
|
|
16139
16176
|
}
|
|
16140
16177
|
|
|
16141
|
-
function ownKeys$
|
|
16142
|
-
function _objectSpread$
|
|
16178
|
+
function ownKeys$2K(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16179
|
+
function _objectSpread$2K(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2K(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2K(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16143
16180
|
/**
|
|
16144
16181
|
* Browser-persisted per-tool user preferences (docked width/pin/open + popout geometry).
|
|
16145
16182
|
* Keyed by the owning toolbar's preference key: the tool id, or one shared slot key for
|
|
@@ -16185,14 +16222,14 @@ function readToolPreferences(toolId) {
|
|
|
16185
16222
|
/** Merges the given fields into the tool's stored preferences. Best-effort — preferences are non-essential. */
|
|
16186
16223
|
function updateToolPreferences(toolId, patch) {
|
|
16187
16224
|
try {
|
|
16188
|
-
localStorage.setItem(STORAGE_PREFIX$1 + toolId, JSON.stringify(_objectSpread$
|
|
16225
|
+
localStorage.setItem(STORAGE_PREFIX$1 + toolId, JSON.stringify(_objectSpread$2K(_objectSpread$2K({}, readToolPreferences(toolId)), patch)));
|
|
16189
16226
|
} catch (_unused2) {
|
|
16190
16227
|
// storage unavailable / quota exceeded
|
|
16191
16228
|
}
|
|
16192
16229
|
}
|
|
16193
16230
|
|
|
16194
|
-
function ownKeys$
|
|
16195
|
-
function _objectSpread$
|
|
16231
|
+
function ownKeys$2J(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16232
|
+
function _objectSpread$2J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16196
16233
|
var DEFAULT_WIDTH = 500;
|
|
16197
16234
|
|
|
16198
16235
|
/** The toolbar lent to a temporary owner, see ToolBarStore.borrowTools. */
|
|
@@ -16319,7 +16356,7 @@ var ToolBarStore = /*#__PURE__*/function () {
|
|
|
16319
16356
|
// The page updates a tool it has lent out: this version comes back at the end of the loan, until then the
|
|
16320
16357
|
// tool keeps showing the borrower's data
|
|
16321
16358
|
loan.own = tool;
|
|
16322
|
-
return _objectSpread$
|
|
16359
|
+
return _objectSpread$2J(_objectSpread$2J({}, tool), {}, {
|
|
16323
16360
|
parameters: loan.parameters
|
|
16324
16361
|
});
|
|
16325
16362
|
}));
|
|
@@ -16387,7 +16424,7 @@ var ToolBarStore = /*#__PURE__*/function () {
|
|
|
16387
16424
|
var loan = _this4._loans.get(tool.id);
|
|
16388
16425
|
if (!loan) return tool;
|
|
16389
16426
|
loan.parameters = tool.parameters;
|
|
16390
|
-
return _objectSpread$
|
|
16427
|
+
return _objectSpread$2J(_objectSpread$2J({}, loan.own), {}, {
|
|
16391
16428
|
parameters: tool.parameters
|
|
16392
16429
|
});
|
|
16393
16430
|
}));
|
|
@@ -16925,11 +16962,11 @@ var ToolBarStore = /*#__PURE__*/function () {
|
|
|
16925
16962
|
}]);
|
|
16926
16963
|
}();
|
|
16927
16964
|
|
|
16928
|
-
function ownKeys$
|
|
16929
|
-
function _objectSpread$
|
|
16930
|
-
function _createForOfIteratorHelper$
|
|
16931
|
-
function _unsupportedIterableToArray$
|
|
16932
|
-
function _arrayLikeToArray$
|
|
16965
|
+
function ownKeys$2I(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16966
|
+
function _objectSpread$2I(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2I(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2I(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16967
|
+
function _createForOfIteratorHelper$1a(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1a(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
16968
|
+
function _unsupportedIterableToArray$1a(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1a(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1a(r, a) : void 0; } }
|
|
16969
|
+
function _arrayLikeToArray$1a(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16933
16970
|
var _default$6 = /*#__PURE__*/function () {
|
|
16934
16971
|
function _default(root) {
|
|
16935
16972
|
_classCallCheck(this, _default);
|
|
@@ -16971,7 +17008,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
16971
17008
|
var initKeys = this.root.navigationState.path == '' ? [] : this.keysFormPath(this._menu, this.root.navigationState.path);
|
|
16972
17009
|
var checkedKeys = [];
|
|
16973
17010
|
var currentMenu = this._menu;
|
|
16974
|
-
var _iterator = _createForOfIteratorHelper$
|
|
17011
|
+
var _iterator = _createForOfIteratorHelper$1a(initKeys),
|
|
16975
17012
|
_step;
|
|
16976
17013
|
try {
|
|
16977
17014
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -16980,7 +17017,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
16980
17017
|
var level = currentMenu;
|
|
16981
17018
|
var lastResolved = void 0;
|
|
16982
17019
|
var chainOk = true;
|
|
16983
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
17020
|
+
var _iterator2 = _createForOfIteratorHelper$1a(key),
|
|
16984
17021
|
_step2;
|
|
16985
17022
|
try {
|
|
16986
17023
|
var _loop = function _loop() {
|
|
@@ -17075,7 +17112,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
17075
17112
|
if (index >= 0) {
|
|
17076
17113
|
this._additionalMenuElements[index] = {
|
|
17077
17114
|
key: key,
|
|
17078
|
-
element: _objectSpread$
|
|
17115
|
+
element: _objectSpread$2I(_objectSpread$2I({}, this._additionalMenuElements[index].element), {}, {
|
|
17079
17116
|
items: items,
|
|
17080
17117
|
selected: selected
|
|
17081
17118
|
})
|
|
@@ -17164,7 +17201,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
17164
17201
|
// A host with its own navigation has no menu columns to keep in sync (see `RootStore.menu`).
|
|
17165
17202
|
if (this._menuElement1) {
|
|
17166
17203
|
var _this$_menu$find;
|
|
17167
|
-
this._menuElement1 = _objectSpread$
|
|
17204
|
+
this._menuElement1 = _objectSpread$2I(_objectSpread$2I({}, this._menuElement1), {}, {
|
|
17168
17205
|
selected: this._selectedMenuKeys[0]
|
|
17169
17206
|
});
|
|
17170
17207
|
var menu2 = (_this$_menu$find = this._menu.find(function (element) {
|
|
@@ -17454,7 +17491,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
17454
17491
|
}
|
|
17455
17492
|
return !item.permission || hasPermission(item.permission.toLocaleLowerCase());
|
|
17456
17493
|
}).map(function (item) {
|
|
17457
|
-
return _objectSpread$
|
|
17494
|
+
return _objectSpread$2I(_objectSpread$2I({}, item), {}, {
|
|
17458
17495
|
items: item.items ? _this5.filterMenuByPermission(hasPermission, item.items) : undefined,
|
|
17459
17496
|
subMenu: item.subMenu ? _this5.filterMenuByPermission(hasPermission, item.subMenu) : undefined
|
|
17460
17497
|
});
|
|
@@ -18265,10 +18302,10 @@ var _default$3 = /*#__PURE__*/function () {
|
|
|
18265
18302
|
}]);
|
|
18266
18303
|
}();
|
|
18267
18304
|
|
|
18268
|
-
function _createForOfIteratorHelper$
|
|
18269
|
-
function _unsupportedIterableToArray$
|
|
18270
|
-
function _arrayLikeToArray$
|
|
18271
|
-
var LOG$
|
|
18305
|
+
function _createForOfIteratorHelper$19(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$19(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
18306
|
+
function _unsupportedIterableToArray$19(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$19(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$19(r, a) : void 0; } }
|
|
18307
|
+
function _arrayLikeToArray$19(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18308
|
+
var LOG$v = getLogger('Backoffice', 'DownloadStore');
|
|
18272
18309
|
var DownloadStore = /*#__PURE__*/function () {
|
|
18273
18310
|
function DownloadStore(_rootStore) {
|
|
18274
18311
|
var _this = this;
|
|
@@ -18295,7 +18332,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18295
18332
|
_context2.next = 23;
|
|
18296
18333
|
break;
|
|
18297
18334
|
}
|
|
18298
|
-
_iterator = _createForOfIteratorHelper$
|
|
18335
|
+
_iterator = _createForOfIteratorHelper$19(action.download);
|
|
18299
18336
|
_context2.prev = 8;
|
|
18300
18337
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
18301
18338
|
var _download$params, _data$fileFormat, _data$fileUrl;
|
|
@@ -18324,7 +18361,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18324
18361
|
_context.next = 11;
|
|
18325
18362
|
break;
|
|
18326
18363
|
}
|
|
18327
|
-
LOG$
|
|
18364
|
+
LOG$v.error(new DivaError("Failed to download file: ".concat(download.fileName, ". Status: ").concat(file.status, " ").concat(file.statusText)));
|
|
18328
18365
|
// Optionally, notify the user here
|
|
18329
18366
|
return _context.abrupt("break", 41);
|
|
18330
18367
|
case 11:
|
|
@@ -18338,7 +18375,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18338
18375
|
case 17:
|
|
18339
18376
|
_context.prev = 17;
|
|
18340
18377
|
_context.t1 = _context["catch"](4);
|
|
18341
|
-
LOG$
|
|
18378
|
+
LOG$v.error(new DivaError("Error during file download (".concat(download.fileName, "):") + _context.t1));
|
|
18342
18379
|
// Optionally, notify the user here
|
|
18343
18380
|
case 20:
|
|
18344
18381
|
return _context.abrupt("break", 41);
|
|
@@ -18519,7 +18556,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18519
18556
|
_context5.next = 4;
|
|
18520
18557
|
break;
|
|
18521
18558
|
}
|
|
18522
|
-
LOG$
|
|
18559
|
+
LOG$v.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
|
|
18523
18560
|
throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer, retailer channel or association' : 'supplier or dealer'));
|
|
18524
18561
|
case 4:
|
|
18525
18562
|
orgData = data;
|
|
@@ -18538,7 +18575,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18538
18575
|
_context5.next = 14;
|
|
18539
18576
|
break;
|
|
18540
18577
|
}
|
|
18541
|
-
LOG$
|
|
18578
|
+
LOG$v.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
|
|
18542
18579
|
throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer channel or association' : 'supplier or dealer'));
|
|
18543
18580
|
case 14:
|
|
18544
18581
|
_context5.prev = 14;
|
|
@@ -18600,7 +18637,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18600
18637
|
_context6.next = 7;
|
|
18601
18638
|
break;
|
|
18602
18639
|
}
|
|
18603
|
-
LOG$
|
|
18640
|
+
LOG$v.error(new DivaError("Download request failed: ".concat(result.status, " ").concat(result.statusText)));
|
|
18604
18641
|
throw new Error("Download failed: ".concat(result.status, " ").concat(result.statusText));
|
|
18605
18642
|
case 7:
|
|
18606
18643
|
contentDisposition = result.headers.get('Content-Disposition');
|
|
@@ -18691,7 +18728,7 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
18691
18728
|
successCount = 0;
|
|
18692
18729
|
failedCount = 0;
|
|
18693
18730
|
promises = [];
|
|
18694
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
18731
|
+
_iterator2 = _createForOfIteratorHelper$19(props.data);
|
|
18695
18732
|
_context7.prev = 5;
|
|
18696
18733
|
_iterator2.s();
|
|
18697
18734
|
case 7:
|
|
@@ -18834,9 +18871,9 @@ var _default$2 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
18834
18871
|
return _createClass(_default);
|
|
18835
18872
|
}(_default$c);
|
|
18836
18873
|
|
|
18837
|
-
function ownKeys$
|
|
18838
|
-
function _objectSpread$
|
|
18839
|
-
var LOG$
|
|
18874
|
+
function ownKeys$2H(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18875
|
+
function _objectSpread$2H(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2H(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2H(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18876
|
+
var LOG$u = getLogger('Backoffice', 'ContextStore');
|
|
18840
18877
|
|
|
18841
18878
|
/**
|
|
18842
18879
|
* ContextStore is a store that manages the contexts of the application.
|
|
@@ -18877,9 +18914,9 @@ var ContextStore = /*#__PURE__*/function () {
|
|
|
18877
18914
|
key: "updateContext",
|
|
18878
18915
|
value: function updateContext(contextId, updates) {
|
|
18879
18916
|
var currentState = this.contexts.get(contextId) || {};
|
|
18880
|
-
var updatedState = _objectSpread$
|
|
18917
|
+
var updatedState = _objectSpread$2H(_objectSpread$2H({}, currentState), updates);
|
|
18881
18918
|
this.contexts.set(contextId, updatedState);
|
|
18882
|
-
LOG$
|
|
18919
|
+
LOG$u.debug("Updated context ".concat(contextId), {
|
|
18883
18920
|
updatedState: updatedState
|
|
18884
18921
|
});
|
|
18885
18922
|
}
|
|
@@ -18893,8 +18930,8 @@ var ContextStore = /*#__PURE__*/function () {
|
|
|
18893
18930
|
}]);
|
|
18894
18931
|
}();
|
|
18895
18932
|
|
|
18896
|
-
function ownKeys$
|
|
18897
|
-
function _objectSpread$
|
|
18933
|
+
function ownKeys$2G(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18934
|
+
function _objectSpread$2G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2G(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18898
18935
|
|
|
18899
18936
|
/**
|
|
18900
18937
|
* An operation a table offers beyond cell edits - adding a matrix column, a server-side bulk removal. The VIEW
|
|
@@ -18984,7 +19021,7 @@ var GridRegistry = /*#__PURE__*/function () {
|
|
|
18984
19021
|
key: "register",
|
|
18985
19022
|
value: function register(entry) {
|
|
18986
19023
|
var id = ++this._seq;
|
|
18987
|
-
this._entries = [].concat(_toConsumableArray(this._entries), [_objectSpread$
|
|
19024
|
+
this._entries = [].concat(_toConsumableArray(this._entries), [_objectSpread$2G({
|
|
18988
19025
|
id: id
|
|
18989
19026
|
}, entry)]);
|
|
18990
19027
|
return id;
|
|
@@ -19283,8 +19320,8 @@ function useBorrowedTools(tools) {
|
|
|
19283
19320
|
}, []);
|
|
19284
19321
|
}
|
|
19285
19322
|
|
|
19286
|
-
function ownKeys$
|
|
19287
|
-
function _objectSpread$
|
|
19323
|
+
function ownKeys$2F(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19324
|
+
function _objectSpread$2F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2F(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19288
19325
|
function fetchFileData(_x) {
|
|
19289
19326
|
return _fetchFileData.apply(this, arguments);
|
|
19290
19327
|
}
|
|
@@ -19444,7 +19481,7 @@ function _uploadMediaItem() {
|
|
|
19444
19481
|
_context4.next = 4;
|
|
19445
19482
|
return fetch("".concat(root, "/v1/assets/uploads"), {
|
|
19446
19483
|
method: 'POST',
|
|
19447
|
-
headers: _objectSpread$
|
|
19484
|
+
headers: _objectSpread$2F({
|
|
19448
19485
|
'Content-Type': 'application/json'
|
|
19449
19486
|
}, auth),
|
|
19450
19487
|
body: JSON.stringify({
|
|
@@ -19510,7 +19547,7 @@ function _uploadMediaItem() {
|
|
|
19510
19547
|
_context4.next = 31;
|
|
19511
19548
|
return fetch("".concat(root, "/v1/assets/uploads/complete"), {
|
|
19512
19549
|
method: 'POST',
|
|
19513
|
-
headers: _objectSpread$
|
|
19550
|
+
headers: _objectSpread$2F({
|
|
19514
19551
|
'Content-Type': 'application/json'
|
|
19515
19552
|
}, auth),
|
|
19516
19553
|
body: JSON.stringify({
|
|
@@ -19555,7 +19592,7 @@ function _uploadMediaItem() {
|
|
|
19555
19592
|
refUrl = (_ref$url = ref.url) !== null && _ref$url !== void 0 ? _ref$url : ref.cdnUrl;
|
|
19556
19593
|
return _context4.abrupt("return", {
|
|
19557
19594
|
_id: mediaItem._id,
|
|
19558
|
-
ref: _objectSpread$
|
|
19595
|
+
ref: _objectSpread$2F(_objectSpread$2F({}, ref), {}, {
|
|
19559
19596
|
_id: ref._id,
|
|
19560
19597
|
url: refUrl
|
|
19561
19598
|
})
|
|
@@ -19606,7 +19643,7 @@ function isExternalVid(file) {
|
|
|
19606
19643
|
}
|
|
19607
19644
|
|
|
19608
19645
|
var VIDEO_THUMB_PLACEHOLDER = 'data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjgwMHB4IiB3aWR0aD0iODAwcHgiIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgCgkgdmlld0JveD0iMCAwIDQ5IDQ5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNMzkuMjU2LDYuNUg5Ljc0NEM0LjM3MSw2LjUsMCwxMC44ODUsMCwxNi4yNzR2MTYuNDUxYzAsNS4zOSw0LjM3MSw5Ljc3NCw5Ljc0NCw5Ljc3NGgyOS41MTIKCQkJYzUuMzczLDAsOS43NDQtNC4zODUsOS43NDQtOS43NzRWMTYuMjc0QzQ5LDEwLjg4NSw0NC42MjksNi41LDM5LjI1Niw2LjV6IE00NywzMi43MjZjMCw0LjI4Ny0zLjQ3NCw3Ljc3NC03Ljc0NCw3Ljc3NEg5Ljc0NAoJCQlDNS40NzQsNDAuNSwyLDM3LjAxMiwyLDMyLjcyNlYxNi4yNzRDMiwxMS45ODgsNS40NzQsOC41LDkuNzQ0LDguNWgyOS41MTJjNC4yNywwLDcuNzQ0LDMuNDg4LDcuNzQ0LDcuNzc0VjMyLjcyNnoiLz4KCQk8cGF0aCBkPSJNMzMuMzYsMjQuMTM4bC0xMy44NTUtOC4xMTVjLTAuMzA4LTAuMTgtMC42OTEtMC4xODMtMS4wMDItMC4wMDVTMTgsMTYuNTI3LDE4LDE2Ljg4NnYxNi4yMjkKCQkJYzAsMC4zNTgsMC4xOTIsMC42OSwwLjUwMiwwLjg2OGMwLjE1NCwwLjA4OCwwLjMyNiwwLjEzMiwwLjQ5OCwwLjEzMmMwLjE3NSwwLDAuMzQ5LTAuMDQ2LDAuNTA1LTAuMTM3bDEzLjg1NS04LjExMwoJCQljMC4zMDYtMC4xNzksMC40OTUtMC41MDgsMC40OTUtMC44NjNTMzMuNjY3LDI0LjMxNywzMy4zNiwyNC4xMzh6IE0yMCwzMS4zN1YxOC42M2wxMC44NzYsNi4zNzFMMjAsMzEuMzd6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+';
|
|
19609
|
-
var LOG$
|
|
19646
|
+
var LOG$t = getLogger('Backoffice', 'MediaItem');
|
|
19610
19647
|
var MediaItem = /*#__PURE__*/function () {
|
|
19611
19648
|
function MediaItem(_ref) {
|
|
19612
19649
|
var media = _ref.media,
|
|
@@ -19719,7 +19756,7 @@ var MediaItem = /*#__PURE__*/function () {
|
|
|
19719
19756
|
_context2.prev = 8;
|
|
19720
19757
|
_context2.t0 = _context2["catch"](1);
|
|
19721
19758
|
this._mediaItemRefId = undefined;
|
|
19722
|
-
LOG$
|
|
19759
|
+
LOG$t.error(new DivaError$1('Failed to get media item ref, on next upload a new ref will be created', {
|
|
19723
19760
|
cause: _context2.t0
|
|
19724
19761
|
}));
|
|
19725
19762
|
case 12:
|
|
@@ -19816,9 +19853,9 @@ var MediaItem = /*#__PURE__*/function () {
|
|
|
19816
19853
|
}]);
|
|
19817
19854
|
}();
|
|
19818
19855
|
|
|
19819
|
-
function _createForOfIteratorHelper$
|
|
19820
|
-
function _unsupportedIterableToArray$
|
|
19821
|
-
function _arrayLikeToArray$
|
|
19856
|
+
function _createForOfIteratorHelper$18(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$18(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
19857
|
+
function _unsupportedIterableToArray$18(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$18(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$18(r, a) : void 0; } }
|
|
19858
|
+
function _arrayLikeToArray$18(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19822
19859
|
function processFormMediaBeforeSave(_x, _x2, _x3) {
|
|
19823
19860
|
return _processFormMediaBeforeSave.apply(this, arguments);
|
|
19824
19861
|
}
|
|
@@ -19836,7 +19873,7 @@ function _processFormMediaBeforeSave() {
|
|
|
19836
19873
|
_context.next = 3;
|
|
19837
19874
|
return processItems(data, items, root);
|
|
19838
19875
|
case 3:
|
|
19839
|
-
_iterator = _createForOfIteratorHelper$
|
|
19876
|
+
_iterator = _createForOfIteratorHelper$18(removedMedias);
|
|
19840
19877
|
_context.prev = 4;
|
|
19841
19878
|
_iterator.s();
|
|
19842
19879
|
case 6:
|
|
@@ -19878,7 +19915,7 @@ function _processItems() {
|
|
|
19878
19915
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
19879
19916
|
while (1) switch (_context2.prev = _context2.next) {
|
|
19880
19917
|
case 0:
|
|
19881
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
19918
|
+
_iterator2 = _createForOfIteratorHelper$18(items);
|
|
19882
19919
|
_context2.prev = 1;
|
|
19883
19920
|
_iterator2.s();
|
|
19884
19921
|
case 3:
|
|
@@ -20000,11 +20037,11 @@ function getData$1(id, data) {
|
|
|
20000
20037
|
}
|
|
20001
20038
|
}
|
|
20002
20039
|
|
|
20003
|
-
function _createForOfIteratorHelper$
|
|
20004
|
-
function _unsupportedIterableToArray$
|
|
20005
|
-
function _arrayLikeToArray$
|
|
20006
|
-
function ownKeys$
|
|
20007
|
-
function _objectSpread$
|
|
20040
|
+
function _createForOfIteratorHelper$17(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$17(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
20041
|
+
function _unsupportedIterableToArray$17(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$17(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$17(r, a) : void 0; } }
|
|
20042
|
+
function _arrayLikeToArray$17(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20043
|
+
function ownKeys$2E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20044
|
+
function _objectSpread$2E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20008
20045
|
function toNamePath$2(name) {
|
|
20009
20046
|
if (name === undefined || name === '') return [];
|
|
20010
20047
|
return Array.isArray(name) ? name : [name];
|
|
@@ -20075,7 +20112,7 @@ function useFormData (_ref) {
|
|
|
20075
20112
|
var _useMemo = useMemo(function () {
|
|
20076
20113
|
setCanSave === null || setCanSave === void 0 || setCanSave(true);
|
|
20077
20114
|
var baseConfiguration = configurationOverride !== null && configurationOverride !== void 0 ? configurationOverride : root.configurationStore.getConfiguration(id, 'Form');
|
|
20078
|
-
var configuration = _objectSpread$
|
|
20115
|
+
var configuration = _objectSpread$2E(_objectSpread$2E({}, baseConfiguration), {}, {
|
|
20079
20116
|
apiInterface: apiInterface !== null && apiInterface !== void 0 ? apiInterface : baseConfiguration.apiInterface
|
|
20080
20117
|
});
|
|
20081
20118
|
var c = {
|
|
@@ -20134,7 +20171,7 @@ function useFormData (_ref) {
|
|
|
20134
20171
|
setSelectedItems = _useState14[1];
|
|
20135
20172
|
var _onLoadFields = function onLoadFields(data) {
|
|
20136
20173
|
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : selectedItems;
|
|
20137
|
-
var _iterator = _createForOfIteratorHelper$
|
|
20174
|
+
var _iterator = _createForOfIteratorHelper$17(items),
|
|
20138
20175
|
_step;
|
|
20139
20176
|
try {
|
|
20140
20177
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -20175,7 +20212,7 @@ function useFormData (_ref) {
|
|
|
20175
20212
|
multipleEditingData = inboundData;
|
|
20176
20213
|
}
|
|
20177
20214
|
return {
|
|
20178
|
-
loadedData: _onLoadFields(_objectSpread$
|
|
20215
|
+
loadedData: _onLoadFields(_objectSpread$2E({}, dt)),
|
|
20179
20216
|
multipleEditingData: multipleEditingData
|
|
20180
20217
|
};
|
|
20181
20218
|
}, [inboundData]),
|
|
@@ -20202,7 +20239,7 @@ function useFormData (_ref) {
|
|
|
20202
20239
|
setFieldErrors = _useState20[1];
|
|
20203
20240
|
useEffect(function () {
|
|
20204
20241
|
var _ref3, _loadedData$_id2;
|
|
20205
|
-
setState(_objectSpread$
|
|
20242
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20206
20243
|
data: loadedData,
|
|
20207
20244
|
origData: JSON.parse(JSON.stringify((_ref3 = storedData !== null && storedData !== void 0 ? storedData : inboundData) !== null && _ref3 !== void 0 ? _ref3 : {})),
|
|
20208
20245
|
update: !!((_loadedData$_id2 = loadedData === null || loadedData === void 0 ? void 0 : loadedData._id) !== null && _loadedData$_id2 !== void 0 ? _loadedData$_id2 : loadedData === null || loadedData === void 0 ? void 0 : loadedData.ID),
|
|
@@ -20315,7 +20352,7 @@ function useFormData (_ref) {
|
|
|
20315
20352
|
root.actions.toggleLoading('saving_form');
|
|
20316
20353
|
_context2.prev = 4;
|
|
20317
20354
|
_context2.next = 7;
|
|
20318
|
-
return setDynamicFields(_objectSpread$
|
|
20355
|
+
return setDynamicFields(_objectSpread$2E({}, state.data), newData);
|
|
20319
20356
|
case 7:
|
|
20320
20357
|
newData = _context2.sent;
|
|
20321
20358
|
_context2.next = 10;
|
|
@@ -20330,7 +20367,7 @@ function useFormData (_ref) {
|
|
|
20330
20367
|
root.actions.toggleLoading('saving_form');
|
|
20331
20368
|
throw _context2.t0;
|
|
20332
20369
|
case 17:
|
|
20333
|
-
setState(_objectSpread$
|
|
20370
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20334
20371
|
loading: true
|
|
20335
20372
|
}));
|
|
20336
20373
|
finalData = state.data;
|
|
@@ -20383,14 +20420,14 @@ function useFormData (_ref) {
|
|
|
20383
20420
|
_context2.next = 47;
|
|
20384
20421
|
break;
|
|
20385
20422
|
}
|
|
20386
|
-
setFieldErrors(_objectSpread$
|
|
20423
|
+
setFieldErrors(_objectSpread$2E(_objectSpread$2E({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
|
|
20387
20424
|
return _context2.abrupt("return", undefined);
|
|
20388
20425
|
case 47:
|
|
20389
20426
|
throw _context2.t1;
|
|
20390
20427
|
case 48:
|
|
20391
20428
|
_context2.prev = 48;
|
|
20392
20429
|
root.actions.toggleLoading('saving_form');
|
|
20393
|
-
setState(_objectSpread$
|
|
20430
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20394
20431
|
data: finalData,
|
|
20395
20432
|
loading: false
|
|
20396
20433
|
}));
|
|
@@ -20446,18 +20483,18 @@ function useFormData (_ref) {
|
|
|
20446
20483
|
var data = d !== null && d !== void 0 ? d : mergeWith(cloneDeep(state.data), formValues, mergeFormWithCustomizer);
|
|
20447
20484
|
if (id) {
|
|
20448
20485
|
setFieldInObject(id, data, value);
|
|
20449
|
-
var newFieldErrors = _objectSpread$
|
|
20486
|
+
var newFieldErrors = _objectSpread$2E({}, fieldErrors);
|
|
20450
20487
|
delete newFieldErrors[id.toString()];
|
|
20451
20488
|
setFieldErrors(newFieldErrors);
|
|
20452
20489
|
}
|
|
20453
|
-
setState(_objectSpread$
|
|
20490
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20454
20491
|
data: data
|
|
20455
20492
|
}));
|
|
20456
20493
|
return data;
|
|
20457
20494
|
};
|
|
20458
20495
|
var getItem = function getItem(id) {
|
|
20459
20496
|
var items = selectedItems;
|
|
20460
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
20497
|
+
var _iterator2 = _createForOfIteratorHelper$17(items),
|
|
20461
20498
|
_step2;
|
|
20462
20499
|
try {
|
|
20463
20500
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -20506,10 +20543,10 @@ function useFormData (_ref) {
|
|
|
20506
20543
|
} else {
|
|
20507
20544
|
data[name] = val;
|
|
20508
20545
|
}
|
|
20509
|
-
if (configuration.itemSelectorReset) setState(_objectSpread$
|
|
20546
|
+
if (configuration.itemSelectorReset) setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20510
20547
|
data: data
|
|
20511
|
-
}));else setState(_objectSpread$
|
|
20512
|
-
data: _objectSpread$
|
|
20548
|
+
}));else setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20549
|
+
data: _objectSpread$2E(_objectSpread$2E({}, state.data), data)
|
|
20513
20550
|
}));
|
|
20514
20551
|
if (Array.isArray(configuration.items[selectorIdx[0]]) && Array.isArray(configuration.items[selectorIdx[0]][selectorIdx[1]])) {
|
|
20515
20552
|
setSelectedItemsIndex([selectorIdx[0], selectorIdx[1]]);
|
|
@@ -20542,12 +20579,12 @@ function useFormData (_ref) {
|
|
|
20542
20579
|
var val = _ref8.value;
|
|
20543
20580
|
if (value === val) {
|
|
20544
20581
|
if (configuration.itemSelectorReset) {
|
|
20545
|
-
setState(_objectSpread$
|
|
20582
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20546
20583
|
data: _defineProperty({}, name, val)
|
|
20547
20584
|
}));
|
|
20548
20585
|
} else {
|
|
20549
|
-
setState(_objectSpread$
|
|
20550
|
-
data: _objectSpread$
|
|
20586
|
+
setState(_objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20587
|
+
data: _objectSpread$2E(_objectSpread$2E({}, state.data), {}, _defineProperty({}, name, val))
|
|
20551
20588
|
}));
|
|
20552
20589
|
}
|
|
20553
20590
|
setSelectedItemsIndex([selectedItemsIndex[0], idx]);
|
|
@@ -20633,7 +20670,7 @@ function useFormData (_ref) {
|
|
|
20633
20670
|
return _getDynamicValue.apply(this, arguments);
|
|
20634
20671
|
};
|
|
20635
20672
|
items = selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.items;
|
|
20636
|
-
_iterator4 = _createForOfIteratorHelper$
|
|
20673
|
+
_iterator4 = _createForOfIteratorHelper$17(items);
|
|
20637
20674
|
_context6.prev = 4;
|
|
20638
20675
|
_iterator4.s();
|
|
20639
20676
|
case 6:
|
|
@@ -20719,7 +20756,7 @@ function useFormData (_ref) {
|
|
|
20719
20756
|
var _configuration$tools;
|
|
20720
20757
|
return (_configuration$tools = configuration.tools) === null || _configuration$tools === void 0 ? void 0 : _configuration$tools.map(function (tool) {
|
|
20721
20758
|
var _tool$defaultOpen;
|
|
20722
|
-
return _objectSpread$
|
|
20759
|
+
return _objectSpread$2E(_objectSpread$2E({}, tool), {}, {
|
|
20723
20760
|
parameters: {
|
|
20724
20761
|
data: state.data,
|
|
20725
20762
|
formInstance: form,
|
|
@@ -20741,7 +20778,7 @@ function useFormData (_ref) {
|
|
|
20741
20778
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
20742
20779
|
while (1) switch (_context3.prev = _context3.next) {
|
|
20743
20780
|
case 0:
|
|
20744
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
20781
|
+
_iterator3 = _createForOfIteratorHelper$17(items);
|
|
20745
20782
|
_context3.prev = 1;
|
|
20746
20783
|
_iterator3.s();
|
|
20747
20784
|
case 3:
|
|
@@ -20867,7 +20904,7 @@ function useFormData (_ref) {
|
|
|
20867
20904
|
}
|
|
20868
20905
|
});
|
|
20869
20906
|
}
|
|
20870
|
-
return _objectSpread$
|
|
20907
|
+
return _objectSpread$2E(_objectSpread$2E({}, state), {}, {
|
|
20871
20908
|
getIsHidden: getIsHidden,
|
|
20872
20909
|
setUsedPreset: setUsedPreset,
|
|
20873
20910
|
configuration: configuration,
|
|
@@ -20985,8 +21022,8 @@ var JsonEditor$2 = function JsonEditor(_ref) {
|
|
|
20985
21022
|
};
|
|
20986
21023
|
|
|
20987
21024
|
var _excluded$h = ["key", "name"];
|
|
20988
|
-
function ownKeys$
|
|
20989
|
-
function _objectSpread$
|
|
21025
|
+
function ownKeys$2D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21026
|
+
function _objectSpread$2D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20990
21027
|
var FormList$2 = function FormList(_ref) {
|
|
20991
21028
|
var value = _ref.value,
|
|
20992
21029
|
item = _ref.item,
|
|
@@ -21051,7 +21088,7 @@ var FormList$2 = function FormList(_ref) {
|
|
|
21051
21088
|
var n = [name].concat(_toConsumableArray(Array.isArray(i.name) ? i.name : [i.name]), _toConsumableArray(i.doTranslate && postFixName ? Array.isArray(postFixName) ? postFixName : [postFixName] : []));
|
|
21052
21089
|
var aName = [].concat(_toConsumableArray(Array.isArray(absoluteName) ? absoluteName : [absoluteName]), _toConsumableArray(n));
|
|
21053
21090
|
var hidden = state.getIsHidden(i, state.data, [].concat(_toConsumableArray(Array.isArray(absoluteName) ? absoluteName : [absoluteName]), [name]));
|
|
21054
|
-
return /*#__PURE__*/createElement(Form$2.Item, _objectSpread$
|
|
21091
|
+
return /*#__PURE__*/createElement(Form$2.Item, _objectSpread$2D(_objectSpread$2D({}, restField), {}, {
|
|
21055
21092
|
id: n.join(),
|
|
21056
21093
|
key: n.join(),
|
|
21057
21094
|
name: n,
|
|
@@ -21063,7 +21100,7 @@ var FormList$2 = function FormList(_ref) {
|
|
|
21063
21100
|
validateStatus: !!state.fieldErrors[n.toString()] ? 'error' : undefined,
|
|
21064
21101
|
help: (_state$fieldErrors$n$ = state.fieldErrors[n.toString()]) !== null && _state$fieldErrors$n$ !== void 0 ? _state$fieldErrors$n$ : i.helpText,
|
|
21065
21102
|
hidden: hidden
|
|
21066
|
-
}), getElement(_objectSpread$
|
|
21103
|
+
}), getElement(_objectSpread$2D(_objectSpread$2D({}, i), {}, {
|
|
21067
21104
|
name: n
|
|
21068
21105
|
}), setCanSave, state, aName, state.onInputChanged, onError, root, form, hidden));
|
|
21069
21106
|
})
|
|
@@ -21297,8 +21334,8 @@ var buttonGroup = "button-group-GYt-T";
|
|
|
21297
21334
|
var css_248z$1n = ".wrapper-GVe2h {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n\n.button-group-GYt-T {\n display: flex;\n flex-direction: row;\n gap: 12px;\n margin: 0 12px;\n}\n";
|
|
21298
21335
|
styleInject(css_248z$1n);
|
|
21299
21336
|
|
|
21300
|
-
function ownKeys$
|
|
21301
|
-
function _objectSpread$
|
|
21337
|
+
function ownKeys$2C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21338
|
+
function _objectSpread$2C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21302
21339
|
var SubTitle = function SubTitle(_ref) {
|
|
21303
21340
|
var _item$label, _item$orientation, _item$buttonIds;
|
|
21304
21341
|
var item = _ref.item,
|
|
@@ -21308,7 +21345,7 @@ var SubTitle = function SubTitle(_ref) {
|
|
|
21308
21345
|
var title = (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : Array.isArray(item.name) ? item.name[0].toString() : item.name;
|
|
21309
21346
|
return /*#__PURE__*/jsx(Divider, {
|
|
21310
21347
|
orientation: (_item$orientation = item.orientation) !== null && _item$orientation !== void 0 ? _item$orientation : 'horizontal',
|
|
21311
|
-
style: _objectSpread$
|
|
21348
|
+
style: _objectSpread$2C({}, item.style),
|
|
21312
21349
|
children: /*#__PURE__*/jsxs("div", {
|
|
21313
21350
|
className: wrapper$a,
|
|
21314
21351
|
children: [t(title, title), ((_item$buttonIds = item.buttonIds) === null || _item$buttonIds === void 0 ? void 0 : _item$buttonIds.length) && item.buttonIds.map(function (b) {
|
|
@@ -21399,15 +21436,15 @@ var InputComponent = function InputComponent(_ref, ref) {
|
|
|
21399
21436
|
};
|
|
21400
21437
|
var InputComponent$1 = observer(/*#__PURE__*/React.forwardRef(InputComponent));
|
|
21401
21438
|
|
|
21402
|
-
function _createForOfIteratorHelper$
|
|
21403
|
-
function _unsupportedIterableToArray$
|
|
21404
|
-
function _arrayLikeToArray$
|
|
21439
|
+
function _createForOfIteratorHelper$16(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$16(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
21440
|
+
function _unsupportedIterableToArray$16(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$16(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$16(r, a) : void 0; } }
|
|
21441
|
+
function _arrayLikeToArray$16(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21405
21442
|
function getCombinedValues(data, pattern) {
|
|
21406
21443
|
if (!pattern || !data) {
|
|
21407
21444
|
return data;
|
|
21408
21445
|
}
|
|
21409
21446
|
var value = pattern;
|
|
21410
|
-
var _iterator = _createForOfIteratorHelper$
|
|
21447
|
+
var _iterator = _createForOfIteratorHelper$16(pattern.matchAll(/\$\{(.*?)\}/g)),
|
|
21411
21448
|
_step;
|
|
21412
21449
|
try {
|
|
21413
21450
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -21423,7 +21460,7 @@ function getCombinedValues(data, pattern) {
|
|
|
21423
21460
|
return value;
|
|
21424
21461
|
}
|
|
21425
21462
|
|
|
21426
|
-
var LOG$
|
|
21463
|
+
var LOG$s = getLogger('Backoffice', 'SelectSimple');
|
|
21427
21464
|
function useSelectSimpleData (_ref) {
|
|
21428
21465
|
var apiInterface = _ref.apiInterface,
|
|
21429
21466
|
selectMapping = _ref.selectMapping,
|
|
@@ -21498,7 +21535,7 @@ function useSelectSimpleData (_ref) {
|
|
|
21498
21535
|
var _options$;
|
|
21499
21536
|
setOptions(options);
|
|
21500
21537
|
if (value && options) {
|
|
21501
|
-
LOG$
|
|
21538
|
+
LOG$s.debug('value changed', toJS(value), toJS(options));
|
|
21502
21539
|
var _selected = findByValue(value, options, selectMapping);
|
|
21503
21540
|
var selectedValues = Array.isArray(_selected) ? _selected.map(function (item) {
|
|
21504
21541
|
return item.value;
|
|
@@ -21510,7 +21547,7 @@ function useSelectSimpleData (_ref) {
|
|
|
21510
21547
|
};
|
|
21511
21548
|
useEffect(function () {
|
|
21512
21549
|
if (configuredOptions) {
|
|
21513
|
-
if (apiHandler.canReadList) LOG$
|
|
21550
|
+
if (apiHandler.canReadList) LOG$s.warn('If options are provided, apiInterface will not be used');
|
|
21514
21551
|
setLoadedOptions(configuredOptions);
|
|
21515
21552
|
setLoading(false);
|
|
21516
21553
|
return;
|
|
@@ -21563,7 +21600,7 @@ function findByValue(value, options, selectMapping) {
|
|
|
21563
21600
|
return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? option.value == value : getCombinedValues(option.data, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value) == getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value);
|
|
21564
21601
|
});
|
|
21565
21602
|
if (!option) {
|
|
21566
|
-
LOG$
|
|
21603
|
+
LOG$s.debug('findByValue: option not found, add dummy option for current value', value, options);
|
|
21567
21604
|
//TODO: if we and server side filtering, the dummy option must be handled differently
|
|
21568
21605
|
option = {
|
|
21569
21606
|
label: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : typeof (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) === 'function' ? selectMapping.label(value) : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label),
|
|
@@ -21602,8 +21639,8 @@ var css_248z$1m = ".wrapper-4xyke {\n display: flex;\n flex-direction: column;
|
|
|
21602
21639
|
styleInject(css_248z$1m);
|
|
21603
21640
|
|
|
21604
21641
|
var _excluded$g = ["apiInterface", "selectMapping", "apiMapping", "onChange", "value", "search", "options", "autoSelectFirst", "title", "sharedState"];
|
|
21605
|
-
function ownKeys$
|
|
21606
|
-
function _objectSpread$
|
|
21642
|
+
function ownKeys$2B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21643
|
+
function _objectSpread$2B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21607
21644
|
var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
|
|
21608
21645
|
var apiInterface = _ref.apiInterface,
|
|
21609
21646
|
selectMapping = _ref.selectMapping,
|
|
@@ -21630,7 +21667,7 @@ var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
|
|
|
21630
21667
|
return /*#__PURE__*/jsxs("div", {
|
|
21631
21668
|
ref: ref,
|
|
21632
21669
|
className: classNames(title ? wrapper$9 : undefined),
|
|
21633
|
-
children: [title, /*#__PURE__*/jsx(Select, _objectSpread$
|
|
21670
|
+
children: [title, /*#__PURE__*/jsx(Select, _objectSpread$2B(_objectSpread$2B({}, selectProps), {}, {
|
|
21634
21671
|
showSearch: search,
|
|
21635
21672
|
loading: state.loading,
|
|
21636
21673
|
options: state.options,
|
|
@@ -22247,8 +22284,8 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
|
|
|
22247
22284
|
}]);
|
|
22248
22285
|
}(_default$c);
|
|
22249
22286
|
|
|
22250
|
-
function ownKeys$
|
|
22251
|
-
function _objectSpread$
|
|
22287
|
+
function ownKeys$2A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22288
|
+
function _objectSpread$2A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2A(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22252
22289
|
getLogger('Backoffice', 'SelectClientRelationCatalog');
|
|
22253
22290
|
function useSelectClientRelationCatalog (_ref) {
|
|
22254
22291
|
var onSelectedCatalog = _ref.onSelectedCatalog,
|
|
@@ -22417,7 +22454,7 @@ function useSelectClientRelationCatalog (_ref) {
|
|
|
22417
22454
|
case 22:
|
|
22418
22455
|
supplierData = _context2.sent;
|
|
22419
22456
|
case 23:
|
|
22420
|
-
onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$
|
|
22457
|
+
onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$2A(_objectSpread$2A({}, _selectedSupplier), {}, {
|
|
22421
22458
|
supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
|
|
22422
22459
|
}), supplierData);
|
|
22423
22460
|
if (catalogId && catalogList.find(function (c) {
|
|
@@ -22647,11 +22684,11 @@ function SelectClientRelationCatalog (_ref) {
|
|
|
22647
22684
|
});
|
|
22648
22685
|
}
|
|
22649
22686
|
|
|
22650
|
-
function _createForOfIteratorHelper$
|
|
22651
|
-
function _unsupportedIterableToArray$
|
|
22652
|
-
function _arrayLikeToArray$
|
|
22653
|
-
function ownKeys$
|
|
22654
|
-
function _objectSpread$
|
|
22687
|
+
function _createForOfIteratorHelper$15(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$15(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
22688
|
+
function _unsupportedIterableToArray$15(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$15(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$15(r, a) : void 0; } }
|
|
22689
|
+
function _arrayLikeToArray$15(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22690
|
+
function ownKeys$2z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22691
|
+
function _objectSpread$2z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22655
22692
|
function useSelectData (_ref) {
|
|
22656
22693
|
var data = _ref.data,
|
|
22657
22694
|
onChange = _ref.onChange,
|
|
@@ -22905,7 +22942,7 @@ function useSelectData (_ref) {
|
|
|
22905
22942
|
}
|
|
22906
22943
|
emails = initData;
|
|
22907
22944
|
optionByValue = new Map();
|
|
22908
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
22945
|
+
_iterator2 = _createForOfIteratorHelper$15(emails);
|
|
22909
22946
|
_context4.prev = 12;
|
|
22910
22947
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
22911
22948
|
var email, list, opt;
|
|
@@ -22972,7 +23009,7 @@ function useSelectData (_ref) {
|
|
|
22972
23009
|
}
|
|
22973
23010
|
keys = initData;
|
|
22974
23011
|
_optionByValue = new Map();
|
|
22975
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
23012
|
+
_iterator3 = _createForOfIteratorHelper$15(keys);
|
|
22976
23013
|
_context4.prev = 35;
|
|
22977
23014
|
_loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
|
|
22978
23015
|
var key, list, opt;
|
|
@@ -23123,7 +23160,7 @@ function useSelectData (_ref) {
|
|
|
23123
23160
|
setFetching(true);
|
|
23124
23161
|
serverSideParams = {
|
|
23125
23162
|
filters: selectMapping !== null && selectMapping !== void 0 && selectMapping.searchField ? (_selectMapping$search = selectMapping.searchField) === null || _selectMapping$search === void 0 ? void 0 : _selectMapping$search.reduce(function (filter, field) {
|
|
23126
|
-
return _objectSpread$
|
|
23163
|
+
return _objectSpread$2z(_objectSpread$2z({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
|
|
23127
23164
|
}, {}) : {
|
|
23128
23165
|
_id: [value, 'contains']
|
|
23129
23166
|
},
|
|
@@ -23200,7 +23237,7 @@ function useSelectData (_ref) {
|
|
|
23200
23237
|
var verifySelection = function verifySelection(opt) {
|
|
23201
23238
|
if (disabledConfig == undefined) return [];
|
|
23202
23239
|
var _missingFields = [];
|
|
23203
|
-
var _iterator = _createForOfIteratorHelper$
|
|
23240
|
+
var _iterator = _createForOfIteratorHelper$15(disabledConfig),
|
|
23204
23241
|
_step;
|
|
23205
23242
|
try {
|
|
23206
23243
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -23600,9 +23637,9 @@ var buttonsWrapper$1 = "buttons-wrapper-7ebR9";
|
|
|
23600
23637
|
var css_248z$1j = ".wrapper-WStAk {\n display: flex;\n flex-direction: column;\n}\n.header-wrapper-gWQuH {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-left: 64px;\n}\n\n.buttons-wrapper-7ebR9 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-grow: 1;\n}\n";
|
|
23601
23638
|
styleInject(css_248z$1j);
|
|
23602
23639
|
|
|
23603
|
-
function ownKeys$
|
|
23604
|
-
function _objectSpread$
|
|
23605
|
-
var LOG$
|
|
23640
|
+
function ownKeys$2y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23641
|
+
function _objectSpread$2y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23642
|
+
var LOG$r = getLogger('Backoffice', 'Translation Form');
|
|
23606
23643
|
|
|
23607
23644
|
/** The languages a translation field edits - also the ones the content item preview offers. */
|
|
23608
23645
|
var TRANSLATION_LANGUAGES = ['de', 'it', 'fr', 'en'];
|
|
@@ -23689,7 +23726,7 @@ function useTranslationHook (item, state) {
|
|
|
23689
23726
|
case 23:
|
|
23690
23727
|
_context.prev = 23;
|
|
23691
23728
|
_context.t2 = _context["catch"](9);
|
|
23692
|
-
LOG$
|
|
23729
|
+
LOG$r.error({
|
|
23693
23730
|
message: 'Error on translating ' + value,
|
|
23694
23731
|
name: ''
|
|
23695
23732
|
});
|
|
@@ -23743,7 +23780,7 @@ function useTranslationHook (item, state) {
|
|
|
23743
23780
|
case 0:
|
|
23744
23781
|
_context2.next = 2;
|
|
23745
23782
|
return apiHandler.create({
|
|
23746
|
-
locales: _objectSpread$
|
|
23783
|
+
locales: _objectSpread$2y({
|
|
23747
23784
|
de: {},
|
|
23748
23785
|
it: {},
|
|
23749
23786
|
fr: {},
|
|
@@ -23792,8 +23829,8 @@ function useTranslationHook (item, state) {
|
|
|
23792
23829
|
};
|
|
23793
23830
|
}
|
|
23794
23831
|
|
|
23795
|
-
function ownKeys$
|
|
23796
|
-
function _objectSpread$
|
|
23832
|
+
function ownKeys$2x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23833
|
+
function _objectSpread$2x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2x(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23797
23834
|
var HiddenFormField = function HiddenFormField() {
|
|
23798
23835
|
return null;
|
|
23799
23836
|
};
|
|
@@ -23859,7 +23896,7 @@ var Translation = function Translation(_ref) {
|
|
|
23859
23896
|
}, key);
|
|
23860
23897
|
}
|
|
23861
23898
|
return /*#__PURE__*/jsx(React.Fragment, {
|
|
23862
|
-
children: ['subTitle', 'array'].includes(i.type) ? getElement(_objectSpread$
|
|
23899
|
+
children: ['subTitle', 'array'].includes(i.type) ? getElement(_objectSpread$2x(_objectSpread$2x({}, i), {}, {
|
|
23863
23900
|
name: n
|
|
23864
23901
|
}), setCanSave, state, newAbsoluteName, state.onInputChanged, onError, root, form, hidden, currentLang, newFormName) : /*#__PURE__*/jsx(Form$2.Item, {
|
|
23865
23902
|
id: idx.toString(),
|
|
@@ -23872,7 +23909,7 @@ var Translation = function Translation(_ref) {
|
|
|
23872
23909
|
validateStatus: !!state.fieldErrors[n.toString()] ? 'error' : undefined,
|
|
23873
23910
|
help: (_state$fieldErrors$n$ = state.fieldErrors[n.toString()]) !== null && _state$fieldErrors$n$ !== void 0 ? _state$fieldErrors$n$ : i.helpText,
|
|
23874
23911
|
hidden: hidden,
|
|
23875
|
-
children: getElement(_objectSpread$
|
|
23912
|
+
children: getElement(_objectSpread$2x(_objectSpread$2x({}, i), {}, {
|
|
23876
23913
|
name: n
|
|
23877
23914
|
}), setCanSave, state, newAbsoluteName, state.onInputChanged, onError, root, form, hidden)
|
|
23878
23915
|
})
|
|
@@ -23968,7 +24005,7 @@ function FileInput(_ref3) {
|
|
|
23968
24005
|
});
|
|
23969
24006
|
}
|
|
23970
24007
|
|
|
23971
|
-
var LOG$
|
|
24008
|
+
var LOG$q = getLogger('Backoffice', 'AssetManager');
|
|
23972
24009
|
function Upload (_ref) {
|
|
23973
24010
|
var allowedTypes = _ref.allowedTypes,
|
|
23974
24011
|
media = _ref.media,
|
|
@@ -24000,10 +24037,10 @@ function Upload (_ref) {
|
|
|
24000
24037
|
if (!e) {
|
|
24001
24038
|
setError === null || setError === void 0 || setError(undefined);
|
|
24002
24039
|
} else if (e instanceof DivaError) {
|
|
24003
|
-
LOG$
|
|
24040
|
+
LOG$q.error(e);
|
|
24004
24041
|
setError(t('backoffice.mediaupload.error.' + e.name));
|
|
24005
24042
|
} else {
|
|
24006
|
-
LOG$
|
|
24043
|
+
LOG$q.error(new DivaError('An unexpected error occurred', {
|
|
24007
24044
|
cause: e
|
|
24008
24045
|
}));
|
|
24009
24046
|
setError(t('backoffice.mediaupload.error.unknown'));
|
|
@@ -24359,8 +24396,8 @@ function deltaFromColors(mainHex, valueHex) {
|
|
|
24359
24396
|
return avg;
|
|
24360
24397
|
}
|
|
24361
24398
|
|
|
24362
|
-
function ownKeys$
|
|
24363
|
-
function _objectSpread$
|
|
24399
|
+
function ownKeys$2w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24400
|
+
function _objectSpread$2w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2w(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24364
24401
|
function FormSlider(_ref) {
|
|
24365
24402
|
var item = _ref.item,
|
|
24366
24403
|
disabled = _ref.disabled,
|
|
@@ -24394,7 +24431,7 @@ function FormSlider(_ref) {
|
|
|
24394
24431
|
children: t('backoffice.form.slider.apiDefaultHint', {
|
|
24395
24432
|
defaultValue: 'Not set (Gemini API default, typically 1). Move the slider to set.'
|
|
24396
24433
|
})
|
|
24397
|
-
}) : null, /*#__PURE__*/jsx(Slider, _objectSpread$
|
|
24434
|
+
}) : null, /*#__PURE__*/jsx(Slider, _objectSpread$2w(_objectSpread$2w({
|
|
24398
24435
|
min: item.min,
|
|
24399
24436
|
max: item.max,
|
|
24400
24437
|
step: item.step
|
|
@@ -24422,11 +24459,11 @@ function FormSlider(_ref) {
|
|
|
24422
24459
|
});
|
|
24423
24460
|
}
|
|
24424
24461
|
|
|
24425
|
-
function _createForOfIteratorHelper$
|
|
24426
|
-
function _unsupportedIterableToArray$
|
|
24427
|
-
function _arrayLikeToArray$
|
|
24428
|
-
function ownKeys$
|
|
24429
|
-
function _objectSpread$
|
|
24462
|
+
function _createForOfIteratorHelper$14(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$14(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
24463
|
+
function _unsupportedIterableToArray$14(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$14(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$14(r, a) : void 0; } }
|
|
24464
|
+
function _arrayLikeToArray$14(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24465
|
+
function ownKeys$2v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24466
|
+
function _objectSpread$2v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2v(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24430
24467
|
function getElement(item, setCanSave, state, absoluteName, _onChange, _onError, root, form, hidden, postFixName, formName) {
|
|
24431
24468
|
var _isReadonly, _state$hiddenRequired, _state$data$_id, _state$data;
|
|
24432
24469
|
if (hidden) return /*#__PURE__*/jsx(Fragment, {});
|
|
@@ -24463,7 +24500,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
24463
24500
|
}
|
|
24464
24501
|
});
|
|
24465
24502
|
case 'selectSimple':
|
|
24466
|
-
return /*#__PURE__*/jsx(SimpleSelect, _objectSpread$
|
|
24503
|
+
return /*#__PURE__*/jsx(SimpleSelect, _objectSpread$2v(_objectSpread$2v({}, item), {}, {
|
|
24467
24504
|
disabled: disabled,
|
|
24468
24505
|
onChange: function onChange(value) {
|
|
24469
24506
|
_onChange(absoluteName, value);
|
|
@@ -24539,7 +24576,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
24539
24576
|
mappingData: state.data,
|
|
24540
24577
|
callback: function callback(data) {
|
|
24541
24578
|
if (!item.callbackMapping) return;
|
|
24542
|
-
var _iterator = _createForOfIteratorHelper$
|
|
24579
|
+
var _iterator = _createForOfIteratorHelper$14(item.callbackMapping),
|
|
24543
24580
|
_step;
|
|
24544
24581
|
try {
|
|
24545
24582
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -24738,7 +24775,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
24738
24775
|
},
|
|
24739
24776
|
icon: item.icon,
|
|
24740
24777
|
callback: function callback(data) {
|
|
24741
|
-
return form === null || form === void 0 ? void 0 : form.setFieldsValue(_objectSpread$
|
|
24778
|
+
return form === null || form === void 0 ? void 0 : form.setFieldsValue(_objectSpread$2v(_objectSpread$2v({}, state.data), data));
|
|
24742
24779
|
}
|
|
24743
24780
|
});
|
|
24744
24781
|
case 'media':
|
|
@@ -24776,7 +24813,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
24776
24813
|
var DisplayInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24777
24814
|
var _useTranslation = useTranslation(),
|
|
24778
24815
|
t = _useTranslation.t;
|
|
24779
|
-
return /*#__PURE__*/jsx(Input$1, _objectSpread$
|
|
24816
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$2v(_objectSpread$2v({}, props), {}, {
|
|
24780
24817
|
ref: ref,
|
|
24781
24818
|
disabled: true,
|
|
24782
24819
|
value: t(props.translationPrefix + '.' + props.value)
|
|
@@ -24795,11 +24832,11 @@ function isReadonly(item, data) {
|
|
|
24795
24832
|
return false;
|
|
24796
24833
|
}
|
|
24797
24834
|
|
|
24798
|
-
function ownKeys$
|
|
24799
|
-
function _objectSpread$
|
|
24800
|
-
function _createForOfIteratorHelper$
|
|
24801
|
-
function _unsupportedIterableToArray$
|
|
24802
|
-
function _arrayLikeToArray$
|
|
24835
|
+
function ownKeys$2u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24836
|
+
function _objectSpread$2u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2u(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24837
|
+
function _createForOfIteratorHelper$13(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$13(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
24838
|
+
function _unsupportedIterableToArray$13(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$13(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$13(r, a) : void 0; } }
|
|
24839
|
+
function _arrayLikeToArray$13(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24803
24840
|
var Presets = function Presets(_ref) {
|
|
24804
24841
|
var state = _ref.state,
|
|
24805
24842
|
apiHandler = _ref.apiHandler,
|
|
@@ -24834,7 +24871,7 @@ var Presets = function Presets(_ref) {
|
|
|
24834
24871
|
if (state.selectedItems == undefined) return;
|
|
24835
24872
|
setIsModalVisible(false);
|
|
24836
24873
|
var names = [];
|
|
24837
|
-
var _iterator = _createForOfIteratorHelper$
|
|
24874
|
+
var _iterator = _createForOfIteratorHelper$13(state.selectedItems),
|
|
24838
24875
|
_step;
|
|
24839
24876
|
try {
|
|
24840
24877
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -24846,13 +24883,13 @@ var Presets = function Presets(_ref) {
|
|
|
24846
24883
|
} finally {
|
|
24847
24884
|
_iterator.f();
|
|
24848
24885
|
}
|
|
24849
|
-
var data = _objectSpread$
|
|
24886
|
+
var data = _objectSpread$2u(_objectSpread$2u({}, form.getFieldsValue(names)), {}, {
|
|
24850
24887
|
newPresetName: newPresetName
|
|
24851
24888
|
});
|
|
24852
24889
|
data.dpi = parseInt(data.dpi);
|
|
24853
24890
|
data.organization = root.getGlobalValue('organizationId');
|
|
24854
24891
|
apiHandler.create({}, state.configuration.createPresetMapping, data);
|
|
24855
|
-
var dt = _objectSpread$
|
|
24892
|
+
var dt = _objectSpread$2u(_objectSpread$2u({}, form.getFieldsValue(names)), {}, {
|
|
24856
24893
|
name: newPresetName
|
|
24857
24894
|
});
|
|
24858
24895
|
setPresets({
|
|
@@ -24986,8 +25023,8 @@ function ModalProgressBar(_ref) {
|
|
|
24986
25023
|
});
|
|
24987
25024
|
}
|
|
24988
25025
|
|
|
24989
|
-
function ownKeys$
|
|
24990
|
-
function _objectSpread$
|
|
25026
|
+
function ownKeys$2t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25027
|
+
function _objectSpread$2t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24991
25028
|
function ItemSelector(_ref) {
|
|
24992
25029
|
var state = _ref.state,
|
|
24993
25030
|
setCanSave = _ref.setCanSave,
|
|
@@ -25004,7 +25041,7 @@ function ItemSelector(_ref) {
|
|
|
25004
25041
|
rules: state.getRules(itemSelector, state.data),
|
|
25005
25042
|
label: itemSelector.label ? t(itemSelector.label, itemSelector.label) : itemSelector.name,
|
|
25006
25043
|
valuePropName: itemSelector.type == 'checkbox' ? 'checked' : 'value',
|
|
25007
|
-
children: getElement(_objectSpread$
|
|
25044
|
+
children: getElement(_objectSpread$2t(_objectSpread$2t({}, itemSelector), {}, {
|
|
25008
25045
|
value: itemSelector.type == 'select' ? itemSelector.values[state.selectedItemsIndex[idx]] : undefined
|
|
25009
25046
|
}), setCanSave, state, itemSelector.name, state.onItemSelectorChanged, onErrorInternal)
|
|
25010
25047
|
}, itemSelector.name.toString());
|
|
@@ -25024,6 +25061,193 @@ function formErrorText(error, onError) {
|
|
|
25024
25061
|
return error instanceof DivaError ? onError === null || onError === void 0 ? void 0 : onError[error.name] : undefined;
|
|
25025
25062
|
}
|
|
25026
25063
|
|
|
25064
|
+
var LOG$p = getLogger('Backoffice', 'Form');
|
|
25065
|
+
|
|
25066
|
+
/**
|
|
25067
|
+
* Reads which values of the opened record are inherited from a parent and which override a parent's value, keyed by path.
|
|
25068
|
+
* Kept apart from the form data, so saving never patches it. Empty without `inheritance` configured, while creating, or while loading.
|
|
25069
|
+
*
|
|
25070
|
+
* @param inheritance the form's inheritance configuration
|
|
25071
|
+
* @param id the `_id` of the opened record
|
|
25072
|
+
*/
|
|
25073
|
+
function useInheritance(inheritance, id) {
|
|
25074
|
+
var root = useStore();
|
|
25075
|
+
var _useState = useState(new Map()),
|
|
25076
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25077
|
+
entries = _useState2[0],
|
|
25078
|
+
setEntries = _useState2[1];
|
|
25079
|
+
useEffect(function () {
|
|
25080
|
+
setEntries(new Map());
|
|
25081
|
+
if (!inheritance || !id) return;
|
|
25082
|
+
var active = true;
|
|
25083
|
+
new _default$c({
|
|
25084
|
+
type: 'Form',
|
|
25085
|
+
apiInterface: inheritance.apiInterface
|
|
25086
|
+
}, root).read(inheritance.mapping, {
|
|
25087
|
+
_id: id
|
|
25088
|
+
}).then(function (response) {
|
|
25089
|
+
var loaded = response === null || response === void 0 ? void 0 : response.entries;
|
|
25090
|
+
// the read resolves with the error body on a failed request
|
|
25091
|
+
if (!Array.isArray(loaded)) {
|
|
25092
|
+
LOG$p.warn('Loading the inherited values failed — the form shows no inheritance', response);
|
|
25093
|
+
return;
|
|
25094
|
+
}
|
|
25095
|
+
if (active) setEntries(new Map(loaded.map(function (entry) {
|
|
25096
|
+
return [entry.path, entry];
|
|
25097
|
+
})));
|
|
25098
|
+
})["catch"](function (error) {
|
|
25099
|
+
return LOG$p.warn('Loading the inherited values failed — the form shows no inheritance', error);
|
|
25100
|
+
});
|
|
25101
|
+
return function () {
|
|
25102
|
+
active = false;
|
|
25103
|
+
};
|
|
25104
|
+
}, [inheritance, id]);
|
|
25105
|
+
return entries;
|
|
25106
|
+
}
|
|
25107
|
+
|
|
25108
|
+
function ownKeys$2s(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25109
|
+
function _objectSpread$2s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2s(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25110
|
+
function _createForOfIteratorHelper$12(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$12(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
25111
|
+
function _unsupportedIterableToArray$12(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$12(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$12(r, a) : void 0; } }
|
|
25112
|
+
function _arrayLikeToArray$12(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
25113
|
+
|
|
25114
|
+
/** A value of the form data that is inherited from a parent organization, or a local value that overrides a parent's value. */
|
|
25115
|
+
|
|
25116
|
+
/**
|
|
25117
|
+
* Finds the inheritance entry of a form field: the entry of its exact path, else the first entry below it, since an object value
|
|
25118
|
+
* (e.g. a populated reference) is reported per leaf. Below the field only a `name` leaf stands for the field's value.
|
|
25119
|
+
*/
|
|
25120
|
+
function findInheritanceEntry(entries, name) {
|
|
25121
|
+
var path = Array.isArray(name) ? name.join('.') : name;
|
|
25122
|
+
var exact = entries.get(path);
|
|
25123
|
+
if (exact) return exact;
|
|
25124
|
+
var _iterator = _createForOfIteratorHelper$12(entries),
|
|
25125
|
+
_step;
|
|
25126
|
+
try {
|
|
25127
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
25128
|
+
var _entries$get;
|
|
25129
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
25130
|
+
entryPath = _step$value[0],
|
|
25131
|
+
entry = _step$value[1];
|
|
25132
|
+
if (entryPath.startsWith("".concat(path, "."))) return _objectSpread$2s(_objectSpread$2s({}, entry), {}, {
|
|
25133
|
+
value: (_entries$get = entries.get("".concat(path, ".name"))) === null || _entries$get === void 0 ? void 0 : _entries$get.value
|
|
25134
|
+
});
|
|
25135
|
+
}
|
|
25136
|
+
} catch (err) {
|
|
25137
|
+
_iterator.e(err);
|
|
25138
|
+
} finally {
|
|
25139
|
+
_iterator.f();
|
|
25140
|
+
}
|
|
25141
|
+
return undefined;
|
|
25142
|
+
}
|
|
25143
|
+
|
|
25144
|
+
/**
|
|
25145
|
+
* Formats an inherited value for display: the label of the matching radio option, list items comma separated,
|
|
25146
|
+
* the entries of a list field one per line, or the plain value.
|
|
25147
|
+
*/
|
|
25148
|
+
function formatInheritedValue(value, item) {
|
|
25149
|
+
// a radio's "inherited" option has the value undefined, so a missing value must not match it
|
|
25150
|
+
if (value === undefined) return undefined;
|
|
25151
|
+
if (storesId(item)) return undefined;
|
|
25152
|
+
if (item.type === 'radio') {
|
|
25153
|
+
var option = item.options.find(function (o) {
|
|
25154
|
+
return o.value === value;
|
|
25155
|
+
});
|
|
25156
|
+
if (option) return option.label;
|
|
25157
|
+
}
|
|
25158
|
+
if (Array.isArray(value)) {
|
|
25159
|
+
if (value.every(isPrimitive)) return value.join(', ');
|
|
25160
|
+
if (item.type !== 'array') return undefined;
|
|
25161
|
+
// an entry shows the texts and numbers of its fields, in the order of the form
|
|
25162
|
+
var lines = value.map(function (entry) {
|
|
25163
|
+
return item.items.filter(function (field) {
|
|
25164
|
+
return !storesId(field);
|
|
25165
|
+
}).map(function (field) {
|
|
25166
|
+
return get(entry, field.name);
|
|
25167
|
+
}).filter(function (v) {
|
|
25168
|
+
return typeof v === 'string' && v !== '' || typeof v === 'number';
|
|
25169
|
+
}).join(' · ');
|
|
25170
|
+
}).filter(Boolean);
|
|
25171
|
+
return lines.length ? lines.join('\n') : undefined;
|
|
25172
|
+
}
|
|
25173
|
+
return isPrimitive(value) ? String(value) : undefined;
|
|
25174
|
+
}
|
|
25175
|
+
|
|
25176
|
+
/** Whether a field currently holds no own value (an unchecked checkbox counts as empty). */
|
|
25177
|
+
function isEmptyFieldValue(value, item) {
|
|
25178
|
+
if (value === undefined || value === null || value === '') return true;
|
|
25179
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
25180
|
+
return item.type === 'checkbox' && value === false;
|
|
25181
|
+
}
|
|
25182
|
+
|
|
25183
|
+
/**
|
|
25184
|
+
* Whether the current value of a field overrides the parent's value. As loaded, the stored state tells, since only the backend knows the
|
|
25185
|
+
* field's inheritance rule: a rule may inherit into an unset value only, so a stored '' or false overrides, or take a whole block from the
|
|
25186
|
+
* parent, so an own value is ignored. An edited field is judged by its value: an own value overrides, an emptied field inherits.
|
|
25187
|
+
*
|
|
25188
|
+
* @param value the current value of the field
|
|
25189
|
+
* @param item the form field
|
|
25190
|
+
* @param entry the field's inheritance entry, as stored
|
|
25191
|
+
* @param edited whether the field was edited since the form was loaded
|
|
25192
|
+
*/
|
|
25193
|
+
function overridesParent(value, item, entry, edited) {
|
|
25194
|
+
if (!edited) return entry.state === 'overridden';
|
|
25195
|
+
return !isEmptyFieldValue(value, item);
|
|
25196
|
+
}
|
|
25197
|
+
|
|
25198
|
+
/** Whether the field stores an id, which means nothing to the reader. */
|
|
25199
|
+
function storesId(item) {
|
|
25200
|
+
return item.type === 'media' || item.type === 'selectClientRelationCatalog';
|
|
25201
|
+
}
|
|
25202
|
+
function isPrimitive(value) {
|
|
25203
|
+
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
25204
|
+
}
|
|
25205
|
+
|
|
25206
|
+
/**
|
|
25207
|
+
* Shows the value of a parent organization below a form field — the value the field inherits, or the one its own value overrides —
|
|
25208
|
+
* followed by the organization and whether it is inherited or overridden; a value without a display text shows that text only.
|
|
25209
|
+
*/
|
|
25210
|
+
var InheritedValue = function InheritedValue(_ref) {
|
|
25211
|
+
var entry = _ref.entry,
|
|
25212
|
+
item = _ref.item,
|
|
25213
|
+
overridden = _ref.overridden;
|
|
25214
|
+
var _useTranslation = useTranslation(),
|
|
25215
|
+
t = _useTranslation.t;
|
|
25216
|
+
var _theme$useToken = theme.useToken(),
|
|
25217
|
+
token = _theme$useToken.token;
|
|
25218
|
+
var value = formatInheritedValue(entry.value, item);
|
|
25219
|
+
var origin = overridden ? t('backoffice.form.inheritance.overrides', {
|
|
25220
|
+
organization: entry.displayName,
|
|
25221
|
+
defaultValue: 'Überschreibt den Wert von {{organization}}'
|
|
25222
|
+
}) : t('backoffice.form.inheritance.inheritedFrom', {
|
|
25223
|
+
organization: entry.displayName,
|
|
25224
|
+
defaultValue: 'Geerbt von {{organization}}'
|
|
25225
|
+
});
|
|
25226
|
+
return /*#__PURE__*/jsxs(Typography.Text, {
|
|
25227
|
+
type: "secondary",
|
|
25228
|
+
style: {
|
|
25229
|
+
whiteSpace: 'pre-wrap'
|
|
25230
|
+
},
|
|
25231
|
+
children: [item.type === 'colorPicker' && value !== undefined &&
|
|
25232
|
+
/*#__PURE__*/
|
|
25233
|
+
// the outline keeps white and very light colors visible
|
|
25234
|
+
jsx("span", {
|
|
25235
|
+
style: {
|
|
25236
|
+
display: 'inline-block',
|
|
25237
|
+
width: 10,
|
|
25238
|
+
height: 10,
|
|
25239
|
+
borderRadius: '50%',
|
|
25240
|
+
background: value,
|
|
25241
|
+
boxShadow: "0 0 0 1px ".concat(token.colorBorder),
|
|
25242
|
+
marginInlineEnd: 6,
|
|
25243
|
+
verticalAlign: 'middle'
|
|
25244
|
+
}
|
|
25245
|
+
}), value !== undefined && /*#__PURE__*/jsxs(Fragment, {
|
|
25246
|
+
children: [value, " \xB7 "]
|
|
25247
|
+
}), origin]
|
|
25248
|
+
});
|
|
25249
|
+
};
|
|
25250
|
+
|
|
25027
25251
|
var LOG$o = getLogger('Backoffice', 'Form');
|
|
25028
25252
|
function toNamePath$1(name) {
|
|
25029
25253
|
if (name === undefined || name === '') return [];
|
|
@@ -25035,6 +25259,7 @@ function isFormItemHidden(item, hiddenRequiredDisabled) {
|
|
|
25035
25259
|
return ((_hiddenRequiredDisabl = hiddenRequiredDisabled[key]) === null || _hiddenRequiredDisabl === void 0 ? void 0 : _hiddenRequiredDisabl.hidden) === true;
|
|
25036
25260
|
}
|
|
25037
25261
|
var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
25262
|
+
var _state$data;
|
|
25038
25263
|
var id = _ref.id,
|
|
25039
25264
|
data = _ref.data,
|
|
25040
25265
|
origData = _ref.origData,
|
|
@@ -25080,6 +25305,30 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25080
25305
|
configuration: configuration,
|
|
25081
25306
|
namePrefix: namePrefix
|
|
25082
25307
|
});
|
|
25308
|
+
var inheritance = useInheritance(state.configuration.inheritance, (_state$data = state.data) === null || _state$data === void 0 ? void 0 : _state$data._id);
|
|
25309
|
+
// names below a prefix are relative to it, the inheritance paths are absolute
|
|
25310
|
+
var inheritedItems = useMemo(function () {
|
|
25311
|
+
var _state$selectedItems;
|
|
25312
|
+
return namePrefixPath.length || !inheritance.size ? [] : ((_state$selectedItems = state.selectedItems) !== null && _state$selectedItems !== void 0 ? _state$selectedItems : []).flatMap(function (item) {
|
|
25313
|
+
var _item$inheritancePath;
|
|
25314
|
+
var entry = findInheritanceEntry(inheritance, (_item$inheritancePath = item.inheritancePath) !== null && _item$inheritancePath !== void 0 ? _item$inheritancePath : item.name);
|
|
25315
|
+
return entry ? [{
|
|
25316
|
+
item: item,
|
|
25317
|
+
entry: entry
|
|
25318
|
+
}] : [];
|
|
25319
|
+
});
|
|
25320
|
+
}, [inheritance, state.selectedItems, namePrefixPath]);
|
|
25321
|
+
// of those, the fields whose current value overrides the parent's value; re-renders only when this list changes
|
|
25322
|
+
var overridingFields = Form$2.useWatch(function (values) {
|
|
25323
|
+
return inheritedItems.filter(function (_ref2) {
|
|
25324
|
+
var item = _ref2.item,
|
|
25325
|
+
entry = _ref2.entry;
|
|
25326
|
+
return overridesParent(get(values, item.name), item, entry, form.isFieldTouched(item.name));
|
|
25327
|
+
}).map(function (_ref3) {
|
|
25328
|
+
var item = _ref3.item;
|
|
25329
|
+
return item.name.toString();
|
|
25330
|
+
});
|
|
25331
|
+
}, form);
|
|
25083
25332
|
useImperativeHandle(ref, function () {
|
|
25084
25333
|
return {
|
|
25085
25334
|
submit: function submit() {
|
|
@@ -25101,7 +25350,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25101
25350
|
}
|
|
25102
25351
|
}, [form, namePrefixPath, state.data]);
|
|
25103
25352
|
var onFinish = /*#__PURE__*/function () {
|
|
25104
|
-
var
|
|
25353
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values) {
|
|
25105
25354
|
var newData;
|
|
25106
25355
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
25107
25356
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -25111,10 +25360,10 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25111
25360
|
if (_typeof(values) == 'object' && values !== null) {
|
|
25112
25361
|
state.trimStringsOfObject(values, state.data);
|
|
25113
25362
|
}
|
|
25114
|
-
Object.entries(values).forEach(function (
|
|
25115
|
-
var
|
|
25116
|
-
key =
|
|
25117
|
-
value =
|
|
25363
|
+
Object.entries(values).forEach(function (_ref5, idx) {
|
|
25364
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
25365
|
+
key = _ref6[0],
|
|
25366
|
+
value = _ref6[1];
|
|
25118
25367
|
if (typeof (value === null || value === void 0 ? void 0 : value.unix) !== 'undefined') {
|
|
25119
25368
|
values[key] = value === null || value === void 0 ? void 0 : value.unix();
|
|
25120
25369
|
}
|
|
@@ -25145,7 +25394,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25145
25394
|
}, _callee, null, [[0, 12]]);
|
|
25146
25395
|
}));
|
|
25147
25396
|
return function onFinish(_x) {
|
|
25148
|
-
return
|
|
25397
|
+
return _ref4.apply(this, arguments);
|
|
25149
25398
|
};
|
|
25150
25399
|
}();
|
|
25151
25400
|
var onErrorInternal = function onErrorInternal(err, errorText) {
|
|
@@ -25166,8 +25415,8 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25166
25415
|
var onFinishFailed = function onFinishFailed(data) {
|
|
25167
25416
|
if (data.errorFields.length) {
|
|
25168
25417
|
onError === null || onError === void 0 || onError("Folgende Felder wurden nicht korrekt bef\xFCllt: ".concat(data.errorFields.map(function (f) {
|
|
25169
|
-
var _state$
|
|
25170
|
-
var item = (_state$
|
|
25418
|
+
var _state$selectedItems2;
|
|
25419
|
+
var item = (_state$selectedItems2 = state.selectedItems) === null || _state$selectedItems2 === void 0 ? void 0 : _state$selectedItems2.find(function (item) {
|
|
25171
25420
|
return (typeof item.name == 'string' ? item.name : item.name.join('.')) == (typeof f.name == 'string' ? f.name : f.name.join('.'));
|
|
25172
25421
|
});
|
|
25173
25422
|
if (!item) return f.name;
|
|
@@ -25190,10 +25439,10 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25190
25439
|
}
|
|
25191
25440
|
groups[tabGroup].push(item);
|
|
25192
25441
|
});
|
|
25193
|
-
return Object.entries(groups).map(function (
|
|
25194
|
-
var
|
|
25195
|
-
tabGroup =
|
|
25196
|
-
items =
|
|
25442
|
+
return Object.entries(groups).map(function (_ref7) {
|
|
25443
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
25444
|
+
tabGroup = _ref8[0],
|
|
25445
|
+
items = _ref8[1];
|
|
25197
25446
|
return {
|
|
25198
25447
|
tabGroup: tabGroup,
|
|
25199
25448
|
items: items
|
|
@@ -25201,19 +25450,28 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25201
25450
|
});
|
|
25202
25451
|
};
|
|
25203
25452
|
var getGeneralItems = function getGeneralItems() {
|
|
25204
|
-
var _state$
|
|
25205
|
-
return (_state$
|
|
25453
|
+
var _state$selectedItems3;
|
|
25454
|
+
return (_state$selectedItems3 = state.selectedItems) === null || _state$selectedItems3 === void 0 ? void 0 : _state$selectedItems3.filter(function (item) {
|
|
25206
25455
|
return item.showInAllTabs;
|
|
25207
25456
|
});
|
|
25208
25457
|
};
|
|
25209
25458
|
var renderFormItems = function renderFormItems(items) {
|
|
25210
25459
|
return /*#__PURE__*/jsx(Fragment, {
|
|
25211
25460
|
children: items.map(function (item) {
|
|
25212
|
-
var _state$hiddenRequired, _state$fieldErrors$it;
|
|
25461
|
+
var _state$hiddenRequired, _inheritedItems$find, _state$fieldErrors$it;
|
|
25213
25462
|
var hidden = (_state$hiddenRequired = state.hiddenRequiredDisabled[typeof item.name == 'string' ? item.name : item.name.join('.')]) === null || _state$hiddenRequired === void 0 ? void 0 : _state$hiddenRequired.hidden;
|
|
25214
25463
|
var fieldName = getFieldName(item.name);
|
|
25464
|
+
var inheritanceEntry = (_inheritedItems$find = inheritedItems.find(function (inherited) {
|
|
25465
|
+
return inherited.item.name.toString() === item.name.toString();
|
|
25466
|
+
})) === null || _inheritedItems$find === void 0 ? void 0 : _inheritedItems$find.entry;
|
|
25467
|
+
var inheritedValue = inheritanceEntry && /*#__PURE__*/jsx(InheritedValue, {
|
|
25468
|
+
entry: inheritanceEntry,
|
|
25469
|
+
item: item,
|
|
25470
|
+
overridden: !!(overridingFields !== null && overridingFields !== void 0 && overridingFields.includes(item.name.toString()))
|
|
25471
|
+
});
|
|
25472
|
+
var withoutFormItem = ['subTitle', 'array', 'text', 'translation'].includes(item.type);
|
|
25215
25473
|
return /*#__PURE__*/jsxs("div", {
|
|
25216
|
-
children: [item.marker && /*#__PURE__*/jsx(InfoCircleOutlined, {}),
|
|
25474
|
+
children: [item.marker && /*#__PURE__*/jsx(InfoCircleOutlined, {}), withoutFormItem && !hidden && inheritedValue, withoutFormItem ? getElement(item, setCanSave, state, item.name, state.onInputChanged, onErrorInternal, root, form, hidden, undefined, namePrefixPath.length ? fieldName : undefined) : /*#__PURE__*/jsx(Form$2.Item, {
|
|
25217
25475
|
name: fieldName,
|
|
25218
25476
|
rules: state.getRules(item, state.data),
|
|
25219
25477
|
label: getLabel(item, t),
|
|
@@ -25221,7 +25479,10 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25221
25479
|
initialValue: item === null || item === void 0 ? void 0 : item.defaultValue,
|
|
25222
25480
|
hasFeedback: !!state.fieldErrors[item.name.toString()],
|
|
25223
25481
|
validateStatus: !!state.fieldErrors[item.name.toString()] ? 'error' : undefined,
|
|
25224
|
-
help: (_state$fieldErrors$it = state.fieldErrors[item.name.toString()]) !== null && _state$fieldErrors$it !== void 0 ? _state$fieldErrors$it : item.helpText
|
|
25482
|
+
help: (_state$fieldErrors$it = state.fieldErrors[item.name.toString()]) !== null && _state$fieldErrors$it !== void 0 ? _state$fieldErrors$it : item.helpText
|
|
25483
|
+
// below the field: horizontal labels do not wrap and would cut the value off
|
|
25484
|
+
,
|
|
25485
|
+
extra: inheritedValue,
|
|
25225
25486
|
hidden: hidden,
|
|
25226
25487
|
children: getElement(item, setCanSave, state, item.name, state.onInputChanged, onErrorInternal, root, form, hidden)
|
|
25227
25488
|
}, Array.isArray(fieldName) ? fieldName.join('.') : fieldName)]
|
|
@@ -25242,6 +25503,13 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
25242
25503
|
var generalItems = useMemo(function () {
|
|
25243
25504
|
return getGeneralItems();
|
|
25244
25505
|
}, [state.selectedItems]);
|
|
25506
|
+
// the tab keys are positions, so another set of tabs (e.g. after choosing another organization type) starts on the first tab
|
|
25507
|
+
var visibleTabNames = visibleTabGroups.map(function (group) {
|
|
25508
|
+
return group.tabGroup;
|
|
25509
|
+
}).join();
|
|
25510
|
+
useEffect(function () {
|
|
25511
|
+
return setActiveTabKey('0');
|
|
25512
|
+
}, [visibleTabNames]);
|
|
25245
25513
|
var handleSearchChange = function handleSearchChange(e) {
|
|
25246
25514
|
var searchValue = e.target.value.toLowerCase();
|
|
25247
25515
|
if (searchValue.length <= 2) {
|