@commercetools-frontend/experimental-components 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +1061 -344
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +1061 -344
- package/dist/commercetools-frontend-experimental-components.esm.js +1056 -343
- package/dist/styles.css +47 -47
- package/package.json +47 -45
|
@@ -76,7 +76,6 @@ var _reverseInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
76
76
|
var sdk = require('@commercetools-frontend/sdk');
|
|
77
77
|
var client = require('@apollo/client');
|
|
78
78
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
79
|
-
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
80
79
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
81
80
|
var omit = require('lodash/omit');
|
|
82
81
|
var isEmpty$3 = require('lodash/isEmpty');
|
|
@@ -84,6 +83,7 @@ var _Object$freeze = require('@babel/runtime-corejs3/core-js-stable/object/freez
|
|
|
84
83
|
var originalOmitDeep = require('omit-deep');
|
|
85
84
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
86
85
|
var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
|
|
86
|
+
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
87
87
|
var hoistNonReactStatics = require('hoist-non-react-statics');
|
|
88
88
|
var omitBy = require('lodash/omitBy');
|
|
89
89
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
@@ -102,6 +102,8 @@ var _ = require('@commercetools-frontend/ui-kit/');
|
|
|
102
102
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
103
103
|
var memoize = require('memoize-one');
|
|
104
104
|
var utils = require('@commercetools-uikit/utils');
|
|
105
|
+
var differenceBy = require('lodash/differenceBy');
|
|
106
|
+
var intersectionBy = require('lodash/intersectionBy');
|
|
105
107
|
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
106
108
|
var flatMap = require('lodash/flatMap');
|
|
107
109
|
var reactRedux = require('react-redux');
|
|
@@ -166,7 +168,6 @@ var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
|
166
168
|
var Textarea__default = /*#__PURE__*/_interopDefault(Textarea);
|
|
167
169
|
var has__default = /*#__PURE__*/_interopDefault(has);
|
|
168
170
|
var _reverseInstanceProperty__default = /*#__PURE__*/_interopDefault(_reverseInstanceProperty);
|
|
169
|
-
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
170
171
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
171
172
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
172
173
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty$3);
|
|
@@ -174,6 +175,7 @@ var _Object$freeze__default = /*#__PURE__*/_interopDefault(_Object$freeze);
|
|
|
174
175
|
var originalOmitDeep__default = /*#__PURE__*/_interopDefault(originalOmitDeep);
|
|
175
176
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
176
177
|
var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
|
|
178
|
+
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
177
179
|
var hoistNonReactStatics__default = /*#__PURE__*/_interopDefault(hoistNonReactStatics);
|
|
178
180
|
var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
179
181
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
@@ -186,6 +188,8 @@ var times__default = /*#__PURE__*/_interopDefault(times);
|
|
|
186
188
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
187
189
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
188
190
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
191
|
+
var differenceBy__default = /*#__PURE__*/_interopDefault(differenceBy);
|
|
192
|
+
var intersectionBy__default = /*#__PURE__*/_interopDefault(intersectionBy);
|
|
189
193
|
var _parseFloat__default = /*#__PURE__*/_interopDefault(_parseFloat);
|
|
190
194
|
var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
|
|
191
195
|
var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
@@ -300,7 +304,7 @@ function filterDataAttributes(obj) {
|
|
|
300
304
|
}, {});
|
|
301
305
|
}
|
|
302
306
|
|
|
303
|
-
const messages$
|
|
307
|
+
const messages$O = reactIntl.defineMessages({
|
|
304
308
|
unique: {
|
|
305
309
|
id: 'Validation.unique',
|
|
306
310
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1697,8 +1701,8 @@ const getData = (code, field) => {
|
|
|
1697
1701
|
};
|
|
1698
1702
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1699
1703
|
|
|
1700
|
-
function ownKeys$
|
|
1701
|
-
function _objectSpread$
|
|
1704
|
+
function ownKeys$1q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1705
|
+
function _objectSpread$1q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1q(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1702
1706
|
function formatMoneyRangeValue(value, intl) {
|
|
1703
1707
|
var _context;
|
|
1704
1708
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1708,7 +1712,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1708
1712
|
return '';
|
|
1709
1713
|
}
|
|
1710
1714
|
function formatMoneyValue(amount, currency, intl) {
|
|
1711
|
-
return formatMoney$1(_objectSpread$
|
|
1715
|
+
return formatMoney$1(_objectSpread$1q({
|
|
1712
1716
|
centAmount: amount,
|
|
1713
1717
|
fractionDigits: getFractionDigit(currency)
|
|
1714
1718
|
}, currency ? {
|
|
@@ -1725,14 +1729,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1725
1729
|
}
|
|
1726
1730
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1727
1731
|
var _moneyValue$fractione;
|
|
1728
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1732
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1q({
|
|
1729
1733
|
style: 'currency',
|
|
1730
1734
|
currency: moneyValue.currencyCode,
|
|
1731
1735
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1732
1736
|
}, options));
|
|
1733
1737
|
}
|
|
1734
1738
|
|
|
1735
|
-
var messages$
|
|
1739
|
+
var messages$N = reactIntl.defineMessages({
|
|
1736
1740
|
booleanYes: {
|
|
1737
1741
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1738
1742
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1815,7 +1819,7 @@ const formatDateTime = _ref7 => {
|
|
|
1815
1819
|
const formatBoolean = _ref8 => {
|
|
1816
1820
|
let value = _ref8.value,
|
|
1817
1821
|
intl = _ref8.intl;
|
|
1818
|
-
return value ? intl.formatMessage(messages$
|
|
1822
|
+
return value ? intl.formatMessage(messages$N.booleanYes) : intl.formatMessage(messages$N.booleanNo);
|
|
1819
1823
|
};
|
|
1820
1824
|
const formatNilType = _ref9 => {
|
|
1821
1825
|
let value = _ref9.value,
|
|
@@ -1977,8 +1981,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1977
1981
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1978
1982
|
};
|
|
1979
1983
|
|
|
1980
|
-
function ownKeys$
|
|
1981
|
-
function _objectSpread$
|
|
1984
|
+
function ownKeys$1p(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1985
|
+
function _objectSpread$1p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1p(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1982
1986
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1983
1987
|
const WithDataTablePaginationState = props => {
|
|
1984
1988
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1992,7 +1996,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1992
1996
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1993
1997
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1994
1998
|
});
|
|
1995
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1999
|
+
return jsxRuntime.jsx(Component, _objectSpread$1p(_objectSpread$1p({}, props), {}, {
|
|
1996
2000
|
dataTablePaginationState: {
|
|
1997
2001
|
page,
|
|
1998
2002
|
perPage,
|
|
@@ -2004,8 +2008,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
2004
2008
|
return WithDataTablePaginationState;
|
|
2005
2009
|
};
|
|
2006
2010
|
|
|
2007
|
-
function ownKeys$
|
|
2008
|
-
function _objectSpread$
|
|
2011
|
+
function ownKeys$1o(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2012
|
+
function _objectSpread$1o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2009
2013
|
const injectNotifications = function () {
|
|
2010
2014
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
2011
2015
|
return Component => {
|
|
@@ -2020,7 +2024,7 @@ const injectNotifications = function () {
|
|
|
2020
2024
|
onActionError,
|
|
2021
2025
|
hideAllPageNotifications
|
|
2022
2026
|
};
|
|
2023
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2027
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
2024
2028
|
[propName]: notifications
|
|
2025
2029
|
}));
|
|
2026
2030
|
};
|
|
@@ -2029,22 +2033,22 @@ const injectNotifications = function () {
|
|
|
2029
2033
|
};
|
|
2030
2034
|
};
|
|
2031
2035
|
|
|
2032
|
-
function ownKeys$
|
|
2033
|
-
function _objectSpread$
|
|
2036
|
+
function ownKeys$1n(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2037
|
+
function _objectSpread$1n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2034
2038
|
function isPropsMapper(mapProps) {
|
|
2035
2039
|
return typeof mapProps === 'function';
|
|
2036
2040
|
}
|
|
2037
2041
|
const withProps = mapProps => Component => {
|
|
2038
2042
|
const EnhancedWithProps = ownProps => {
|
|
2039
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2040
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2043
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps(ownProps)) : _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps);
|
|
2044
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n({}, enhancedProps));
|
|
2041
2045
|
};
|
|
2042
2046
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2043
2047
|
return EnhancedWithProps;
|
|
2044
2048
|
};
|
|
2045
2049
|
|
|
2046
|
-
function ownKeys$
|
|
2047
|
-
function _objectSpread$
|
|
2050
|
+
function ownKeys$1m(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2051
|
+
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2048
2052
|
const useRedirectEffect = _ref => {
|
|
2049
2053
|
let goTo = _ref.goTo;
|
|
2050
2054
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2064,30 +2068,30 @@ const defaultOptions$5 = {
|
|
|
2064
2068
|
skip: () => false
|
|
2065
2069
|
};
|
|
2066
2070
|
const withRedirectTo = options => Component => {
|
|
2067
|
-
const mergedOptions = _objectSpread$
|
|
2071
|
+
const mergedOptions = _objectSpread$1m(_objectSpread$1m({}, defaultOptions$5), options);
|
|
2068
2072
|
const WithRedirectTo = props => {
|
|
2069
2073
|
if (!mergedOptions.skip(props)) {
|
|
2070
2074
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2071
2075
|
goTo: options.selectGoTo(props)
|
|
2072
2076
|
});
|
|
2073
2077
|
}
|
|
2074
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2078
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, props));
|
|
2075
2079
|
};
|
|
2076
2080
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2077
2081
|
return WithRedirectTo;
|
|
2078
2082
|
};
|
|
2079
2083
|
|
|
2080
|
-
function ownKeys$
|
|
2081
|
-
function _objectSpread$
|
|
2084
|
+
function ownKeys$1l(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2085
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2082
2086
|
const defaultOptions$4 = {
|
|
2083
2087
|
propName: 'modalState',
|
|
2084
2088
|
isInitiallyOpen: false
|
|
2085
2089
|
};
|
|
2086
2090
|
const injectModalState$1 = options => Component => {
|
|
2087
|
-
const mergedOptions = _objectSpread$
|
|
2091
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$4), options);
|
|
2088
2092
|
const WithModalState = props => {
|
|
2089
2093
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2090
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2094
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l(_objectSpread$1l({}, props), {}, {
|
|
2091
2095
|
[mergedOptions.propName]: modalState
|
|
2092
2096
|
}));
|
|
2093
2097
|
};
|
|
@@ -2095,17 +2099,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2095
2099
|
return WithModalState;
|
|
2096
2100
|
};
|
|
2097
2101
|
|
|
2098
|
-
function ownKeys$
|
|
2099
|
-
function _objectSpread$
|
|
2102
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2103
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2100
2104
|
const defaultOptions$3 = {
|
|
2101
2105
|
propName: 'toggleState',
|
|
2102
2106
|
isInitiallyOpen: false
|
|
2103
2107
|
};
|
|
2104
2108
|
const injectModalState = options => Component => {
|
|
2105
|
-
const mergedOptions = _objectSpread$
|
|
2109
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$3), options);
|
|
2106
2110
|
const WithToggleState = props => {
|
|
2107
2111
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2108
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2112
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2109
2113
|
[mergedOptions.propName]: toggleState
|
|
2110
2114
|
}));
|
|
2111
2115
|
};
|
|
@@ -2113,8 +2117,8 @@ const injectModalState = options => Component => {
|
|
|
2113
2117
|
return WithToggleState;
|
|
2114
2118
|
};
|
|
2115
2119
|
|
|
2116
|
-
function ownKeys$
|
|
2117
|
-
function _objectSpread$
|
|
2120
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2121
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1j(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2118
2122
|
const defaultOptions$2 = {
|
|
2119
2123
|
storageType: 'local',
|
|
2120
2124
|
segregateByUser: true
|
|
@@ -2132,7 +2136,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2132
2136
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2133
2137
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2134
2138
|
var _context;
|
|
2135
|
-
const mergedOptions = _objectSpread$
|
|
2139
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$2), options);
|
|
2136
2140
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2137
2141
|
var _context$user;
|
|
2138
2142
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2180,8 +2184,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2180
2184
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2181
2185
|
};
|
|
2182
2186
|
|
|
2183
|
-
function ownKeys$
|
|
2184
|
-
function _objectSpread$
|
|
2187
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2188
|
+
function _objectSpread$1i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2185
2189
|
const defaultOptions$1 = {
|
|
2186
2190
|
propName: 'storage',
|
|
2187
2191
|
storageKey: '',
|
|
@@ -2194,7 +2198,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2194
2198
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2195
2199
|
* argument position does not allow passing specification of option(s).
|
|
2196
2200
|
*/
|
|
2197
|
-
const mergedOptions = _objectSpread$
|
|
2201
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$1), options);
|
|
2198
2202
|
const WithStorage = props => {
|
|
2199
2203
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2200
2204
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2208,7 +2212,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2208
2212
|
readFromStorage
|
|
2209
2213
|
}
|
|
2210
2214
|
};
|
|
2211
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2215
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1i(_objectSpread$1i({}, props), storageProp));
|
|
2212
2216
|
};
|
|
2213
2217
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2214
2218
|
return WithStorage;
|
|
@@ -2254,8 +2258,8 @@ const usePrevious = value => {
|
|
|
2254
2258
|
return ref.current;
|
|
2255
2259
|
};
|
|
2256
2260
|
|
|
2257
|
-
function ownKeys$
|
|
2258
|
-
function _objectSpread$
|
|
2261
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2262
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1h(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2259
2263
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1074, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2260
2264
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2261
2265
|
var _storesQueryResult$re;
|
|
@@ -2266,15 +2270,15 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2266
2270
|
offset: storesQueryResult.offset,
|
|
2267
2271
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2268
2272
|
var _store$productSelecti;
|
|
2269
|
-
return _objectSpread$
|
|
2273
|
+
return _objectSpread$1h(_objectSpread$1h({}, store), {}, {
|
|
2270
2274
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2271
2275
|
});
|
|
2272
2276
|
})
|
|
2273
2277
|
};
|
|
2274
2278
|
};
|
|
2275
|
-
const createQueryVariables$
|
|
2279
|
+
const createQueryVariables$9 = ownProps => {
|
|
2276
2280
|
var _context;
|
|
2277
|
-
return _objectSpread$
|
|
2281
|
+
return _objectSpread$1h(_objectSpread$1h({
|
|
2278
2282
|
limit: ownProps.limit,
|
|
2279
2283
|
offset: ownProps.offset,
|
|
2280
2284
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2288,7 +2292,7 @@ const createQueryVariables$8 = ownProps => {
|
|
|
2288
2292
|
const useStoresListFetcher = props => {
|
|
2289
2293
|
const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
|
|
2290
2294
|
const excludeProductSelections = props.excludeProductSelections || false;
|
|
2291
|
-
const queryVariables = createQueryVariables$
|
|
2295
|
+
const queryVariables = createQueryVariables$9({
|
|
2292
2296
|
limit: props.limit,
|
|
2293
2297
|
offset: props.offset,
|
|
2294
2298
|
sort: _sortInstanceProperty__default["default"](props),
|
|
@@ -2429,8 +2433,8 @@ function useDidFormValidationFail() {
|
|
|
2429
2433
|
return Boolean(didFormValidationFail);
|
|
2430
2434
|
}
|
|
2431
2435
|
|
|
2432
|
-
function ownKeys$
|
|
2433
|
-
function _objectSpread$
|
|
2436
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2437
|
+
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2434
2438
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2435
2439
|
const defaultOptions = {
|
|
2436
2440
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2458,7 +2462,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2458
2462
|
};
|
|
2459
2463
|
const usePersistedReminder = function () {
|
|
2460
2464
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2461
|
-
const mergedOptions = _objectSpread$
|
|
2465
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions), options);
|
|
2462
2466
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2463
2467
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2464
2468
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2504,7 +2508,7 @@ const usePersistedReminder = function () {
|
|
|
2504
2508
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2505
2509
|
};
|
|
2506
2510
|
|
|
2507
|
-
var messages$
|
|
2511
|
+
var messages$M = reactIntl.defineMessages({
|
|
2508
2512
|
profileUpdated: {
|
|
2509
2513
|
id: 'NotificationText.profileUpdated',
|
|
2510
2514
|
description: 'Label for the notification header',
|
|
@@ -2522,8 +2526,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2522
2526
|
}
|
|
2523
2527
|
});
|
|
2524
2528
|
|
|
2525
|
-
function ownKeys$
|
|
2526
|
-
function _objectSpread$
|
|
2529
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2530
|
+
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2527
2531
|
const LinkToProfile = props => {
|
|
2528
2532
|
const _useTrackingShared = useTrackingShared(),
|
|
2529
2533
|
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
@@ -2544,9 +2548,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2544
2548
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2545
2549
|
as: "p",
|
|
2546
2550
|
isBold: true,
|
|
2547
|
-
intlMessage: messages$
|
|
2551
|
+
intlMessage: messages$M.profileUpdated
|
|
2548
2552
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2549
|
-
intlMessage: _objectSpread$
|
|
2553
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.addMoreInformation), {}, {
|
|
2550
2554
|
values: {
|
|
2551
2555
|
newline: getNewLine
|
|
2552
2556
|
}
|
|
@@ -2555,7 +2559,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2555
2559
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2556
2560
|
scale: "xs",
|
|
2557
2561
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2558
|
-
intlMessage: _objectSpread$
|
|
2562
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.informationAndProfileLink), {}, {
|
|
2559
2563
|
values: {
|
|
2560
2564
|
newline: getNewLine,
|
|
2561
2565
|
link: getLinkToProfile
|
|
@@ -2717,7 +2721,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2717
2721
|
}, [ref]);
|
|
2718
2722
|
};
|
|
2719
2723
|
|
|
2720
|
-
var messages$
|
|
2724
|
+
var messages$L = reactIntl.defineMessages({
|
|
2721
2725
|
fallbackHint: {
|
|
2722
2726
|
id: 'KeyFallback.fallbackHint',
|
|
2723
2727
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2741,7 +2745,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2741
2745
|
return values => {
|
|
2742
2746
|
if (!values.resource) return null;
|
|
2743
2747
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2744
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2748
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2745
2749
|
key: values.resource.key
|
|
2746
2750
|
});
|
|
2747
2751
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2753,8 +2757,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2753
2757
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2754
2758
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2755
2759
|
|
|
2756
|
-
function ownKeys$
|
|
2757
|
-
function _objectSpread$
|
|
2760
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2761
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1e(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2758
2762
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2759
2763
|
const updatedColumnProps = {};
|
|
2760
2764
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2774,14 +2778,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2774
2778
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2775
2779
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2776
2780
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2777
|
-
return _objectSpread$
|
|
2781
|
+
return _objectSpread$1e(_objectSpread$1e({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2778
2782
|
});
|
|
2779
2783
|
};
|
|
2780
2784
|
const handleCacheUpdate = _ref2 => {
|
|
2781
2785
|
let update = _ref2.update,
|
|
2782
2786
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2783
2787
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2784
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2788
|
+
return updateCachedTableConfiguration(_objectSpread$1e(_objectSpread$1e({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2785
2789
|
};
|
|
2786
2790
|
|
|
2787
2791
|
// Signature:
|
|
@@ -2810,7 +2814,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2810
2814
|
return {
|
|
2811
2815
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2812
2816
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2813
|
-
return _objectSpread$
|
|
2817
|
+
return _objectSpread$1e({
|
|
2814
2818
|
key: visibleColumnKey
|
|
2815
2819
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2816
2820
|
}),
|
|
@@ -2881,22 +2885,22 @@ const handlers$6 = {
|
|
|
2881
2885
|
}
|
|
2882
2886
|
};
|
|
2883
2887
|
|
|
2884
|
-
function ownKeys$
|
|
2885
|
-
function _objectSpread$
|
|
2888
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2889
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2886
2890
|
|
|
2887
2891
|
// eslint-disable-next-line import/prefer-default-export
|
|
2888
2892
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2889
2893
|
var _context;
|
|
2890
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2891
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2894
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1d(_objectSpread$1d({}, productSelections), {}, {
|
|
2895
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1d({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2892
2896
|
from: 'nameAllLocales',
|
|
2893
2897
|
to: 'name'
|
|
2894
2898
|
}])))
|
|
2895
2899
|
});
|
|
2896
2900
|
};
|
|
2897
2901
|
|
|
2898
|
-
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end:
|
|
2899
|
-
const createQueryVariables$
|
|
2902
|
+
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n type\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2903
|
+
const createQueryVariables$8 = ownProps => ({
|
|
2900
2904
|
limit: ownProps.limit,
|
|
2901
2905
|
offset: ownProps.offset,
|
|
2902
2906
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2908,7 +2912,7 @@ const emptyProductSelections = {
|
|
|
2908
2912
|
results: []
|
|
2909
2913
|
};
|
|
2910
2914
|
const useProductSelectionsFetcher = props => {
|
|
2911
|
-
const queryVariables = createQueryVariables$
|
|
2915
|
+
const queryVariables = createQueryVariables$8(props);
|
|
2912
2916
|
const _useQuery = hooks.useQuery(FetchProductSelections, {
|
|
2913
2917
|
context: {
|
|
2914
2918
|
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
@@ -3038,7 +3042,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
3038
3042
|
});
|
|
3039
3043
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
3040
3044
|
|
|
3041
|
-
var messages$
|
|
3045
|
+
var messages$K = reactIntl.defineMessages({
|
|
3042
3046
|
noChannelsFound: {
|
|
3043
3047
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
3044
3048
|
description: 'The message to display when no channels were found',
|
|
@@ -3087,8 +3091,8 @@ const trackingEvents$4 = {
|
|
|
3087
3091
|
}
|
|
3088
3092
|
};
|
|
3089
3093
|
|
|
3090
|
-
function ownKeys$
|
|
3091
|
-
function _objectSpread$
|
|
3094
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3095
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3092
3096
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3093
3097
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3094
3098
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -3116,7 +3120,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3116
3120
|
const _useIntl = reactIntl.useIntl(),
|
|
3117
3121
|
formatMessage = _useIntl.formatMessage;
|
|
3118
3122
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3119
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3123
|
+
const variables = React.useMemo(() => _objectSpread$1c({
|
|
3120
3124
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3121
3125
|
}, role && {
|
|
3122
3126
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3177,7 +3181,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3177
3181
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3178
3182
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3179
3183
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3180
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3184
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$K.noChannelsFound), [loadingError, formatMessage]);
|
|
3181
3185
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3182
3186
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3183
3187
|
max: "scale",
|
|
@@ -3188,7 +3192,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3188
3192
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3189
3193
|
id: name,
|
|
3190
3194
|
name: name,
|
|
3191
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3195
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$K.placeholder),
|
|
3192
3196
|
loadOptions: loadOptionsDebounced,
|
|
3193
3197
|
defaultOptions: true,
|
|
3194
3198
|
showOptionGroupDivider: true,
|
|
@@ -3245,8 +3249,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3245
3249
|
|
|
3246
3250
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3247
3251
|
|
|
3248
|
-
function ownKeys$
|
|
3249
|
-
function _objectSpread$
|
|
3252
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3253
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3250
3254
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3251
3255
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3252
3256
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3278,7 +3282,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3278
3282
|
handleMouseOver: this.handleMouseOver,
|
|
3279
3283
|
handleMouseOut: this.handleMouseOut
|
|
3280
3284
|
};
|
|
3281
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3285
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$1b({}, _objectSpread$1b(_objectSpread$1b({}, this.props), injectedProps)));
|
|
3282
3286
|
}
|
|
3283
3287
|
}]);
|
|
3284
3288
|
return WithMouseOverState;
|
|
@@ -3287,8 +3291,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3287
3291
|
return WithMouseOverState;
|
|
3288
3292
|
};
|
|
3289
3293
|
|
|
3290
|
-
function ownKeys$
|
|
3291
|
-
function _objectSpread$
|
|
3294
|
+
function ownKeys$1a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3295
|
+
function _objectSpread$1a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3292
3296
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3293
3297
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3294
3298
|
var styles$i = {
|
|
@@ -3399,7 +3403,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3399
3403
|
}, {
|
|
3400
3404
|
key: "render",
|
|
3401
3405
|
value: function render() {
|
|
3402
|
-
const commonProps = _objectSpread$
|
|
3406
|
+
const commonProps = _objectSpread$1a(_objectSpread$1a({
|
|
3403
3407
|
value: this.state.draftValue,
|
|
3404
3408
|
autoComplete: this.props.autoComplete,
|
|
3405
3409
|
onChange: this.handleChange,
|
|
@@ -3418,7 +3422,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3418
3422
|
htmlFor: inputId,
|
|
3419
3423
|
children: this.props.label
|
|
3420
3424
|
})
|
|
3421
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3425
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3422
3426
|
id: inputId,
|
|
3423
3427
|
className: classnames__default["default"](styles$i.textarea, styles$i["textarea-".concat(this.props.style)], {
|
|
3424
3428
|
[styles$i.invalid]: !this.props.isValid,
|
|
@@ -3427,7 +3431,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3427
3431
|
rows: 1,
|
|
3428
3432
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3429
3433
|
cacheMeasurements: true
|
|
3430
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3434
|
+
})) : jsxRuntime.jsx("input", _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3431
3435
|
id: inputId,
|
|
3432
3436
|
ref: this.props.inputRef,
|
|
3433
3437
|
type: this.props.as,
|
|
@@ -3454,7 +3458,7 @@ ThrottledField.defaultProps = {
|
|
|
3454
3458
|
label: 'Throttled field'
|
|
3455
3459
|
};
|
|
3456
3460
|
|
|
3457
|
-
var messages$
|
|
3461
|
+
var messages$J = reactIntl.defineMessages({
|
|
3458
3462
|
buttonLabel: {
|
|
3459
3463
|
id: 'SearchInput.buttonLabel',
|
|
3460
3464
|
description: 'Label for "Search" button.',
|
|
@@ -3562,7 +3566,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3562
3566
|
"data-testid": this.props.testId || 'search-input',
|
|
3563
3567
|
value: this.state.text,
|
|
3564
3568
|
label: this.props.label,
|
|
3565
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3569
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$J.placeholder),
|
|
3566
3570
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3567
3571
|
"data-track-component": "Text",
|
|
3568
3572
|
"data-track-event": "change",
|
|
@@ -3781,7 +3785,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3781
3785
|
};
|
|
3782
3786
|
};
|
|
3783
3787
|
|
|
3784
|
-
var messages$
|
|
3788
|
+
var messages$I = reactIntl.defineMessages({
|
|
3785
3789
|
bottomOption: {
|
|
3786
3790
|
id: 'Products.Pickers.bottomOption',
|
|
3787
3791
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3789,11 +3793,11 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3789
3793
|
}
|
|
3790
3794
|
});
|
|
3791
3795
|
|
|
3792
|
-
function ownKeys$
|
|
3793
|
-
function _objectSpread$
|
|
3796
|
+
function ownKeys$19(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3797
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3794
3798
|
const getBottomOption = () => ({
|
|
3795
3799
|
options: [{
|
|
3796
|
-
label: messages$
|
|
3800
|
+
label: messages$I.bottomOption,
|
|
3797
3801
|
isBottomOption: true,
|
|
3798
3802
|
isDisabled: true
|
|
3799
3803
|
}]
|
|
@@ -3801,7 +3805,7 @@ const getBottomOption = () => ({
|
|
|
3801
3805
|
const Option$2 = props => {
|
|
3802
3806
|
const _useIntl = reactIntl.useIntl(),
|
|
3803
3807
|
formatMessage = _useIntl.formatMessage;
|
|
3804
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3808
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$19(_objectSpread$19({}, props), {}, {
|
|
3805
3809
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3806
3810
|
tone: "secondary",
|
|
3807
3811
|
children: formatMessage(props.data.label)
|
|
@@ -3818,8 +3822,8 @@ const Option$2 = props => {
|
|
|
3818
3822
|
};
|
|
3819
3823
|
Option$2.displayName = 'Option';
|
|
3820
3824
|
|
|
3821
|
-
function ownKeys$
|
|
3822
|
-
function _objectSpread$
|
|
3825
|
+
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3826
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3823
3827
|
const useHandlers = (onChange, getTrackingEvent) => {
|
|
3824
3828
|
const _useTracking = useTracking(),
|
|
3825
3829
|
track = _useTracking.track;
|
|
@@ -3844,8 +3848,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3844
3848
|
if (event.target.value) {
|
|
3845
3849
|
doTrack();
|
|
3846
3850
|
}
|
|
3847
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3848
|
-
target: _objectSpread$
|
|
3851
|
+
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3852
|
+
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3849
3853
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3850
3854
|
})
|
|
3851
3855
|
});
|
|
@@ -3854,8 +3858,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3854
3858
|
return [handleInputChange, handleChange];
|
|
3855
3859
|
};
|
|
3856
3860
|
|
|
3857
|
-
function ownKeys$
|
|
3858
|
-
function _objectSpread$
|
|
3861
|
+
function ownKeys$17(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3862
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$17(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$17(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3859
3863
|
const constructPrefixSearchPredicate = function () {
|
|
3860
3864
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3861
3865
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3898,7 +3902,7 @@ const useLoadOptions = _ref => {
|
|
|
3898
3902
|
}();
|
|
3899
3903
|
return client$1.query({
|
|
3900
3904
|
query,
|
|
3901
|
-
variables: _objectSpread$
|
|
3905
|
+
variables: _objectSpread$17({
|
|
3902
3906
|
where
|
|
3903
3907
|
}, variables),
|
|
3904
3908
|
context: {
|
|
@@ -3952,7 +3956,7 @@ function useCurrentOption(_ref) {
|
|
|
3952
3956
|
};
|
|
3953
3957
|
}
|
|
3954
3958
|
|
|
3955
|
-
var messages$
|
|
3959
|
+
var messages$H = reactIntl.defineMessages({
|
|
3956
3960
|
noProductTypesFound: {
|
|
3957
3961
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3958
3962
|
description: 'The message to display when no product types were found',
|
|
@@ -4061,7 +4065,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4061
4065
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
4062
4066
|
id: name,
|
|
4063
4067
|
name: name,
|
|
4064
|
-
placeholder: formatMessage(messages$
|
|
4068
|
+
placeholder: formatMessage(messages$H.placeholder),
|
|
4065
4069
|
loadOptions: loadOptionsDebounced,
|
|
4066
4070
|
defaultOptions: [],
|
|
4067
4071
|
isClearable: isClearable,
|
|
@@ -4074,7 +4078,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4074
4078
|
onInputChange: handleInputChange,
|
|
4075
4079
|
onBlur: onBlur,
|
|
4076
4080
|
value: currentOption.data,
|
|
4077
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
4081
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$H.noProductTypesFound),
|
|
4078
4082
|
hasError: hasError || isLoadingFailed
|
|
4079
4083
|
})
|
|
4080
4084
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -4086,7 +4090,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4086
4090
|
};
|
|
4087
4091
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
4088
4092
|
|
|
4089
|
-
var messages$
|
|
4093
|
+
var messages$G = reactIntl.defineMessages({
|
|
4090
4094
|
noStatesFound: {
|
|
4091
4095
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
4092
4096
|
description: 'The message to display when no states were found',
|
|
@@ -4200,7 +4204,7 @@ const StatePickerInput = _ref => {
|
|
|
4200
4204
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4201
4205
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4202
4206
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4203
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4207
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noStatesFound), [loadingError, formatMessage]);
|
|
4204
4208
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
4205
4209
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4206
4210
|
max: "scale",
|
|
@@ -4212,7 +4216,7 @@ const StatePickerInput = _ref => {
|
|
|
4212
4216
|
id: name,
|
|
4213
4217
|
name: name,
|
|
4214
4218
|
horizontalConstraint: "scale",
|
|
4215
|
-
placeholder: formatMessage(messages$
|
|
4219
|
+
placeholder: formatMessage(messages$G.placeholder),
|
|
4216
4220
|
loadOptions: loadOptionsDebounced,
|
|
4217
4221
|
defaultOptions: true,
|
|
4218
4222
|
showOptionGroupDivider: true,
|
|
@@ -4238,9 +4242,9 @@ const StatePickerInput = _ref => {
|
|
|
4238
4242
|
};
|
|
4239
4243
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4240
4244
|
|
|
4241
|
-
function ownKeys$
|
|
4242
|
-
function _objectSpread$
|
|
4243
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4245
|
+
function ownKeys$16(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4246
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$16(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4247
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$16({
|
|
4244
4248
|
ref: ref,
|
|
4245
4249
|
style: {
|
|
4246
4250
|
display: 'block',
|
|
@@ -4378,8 +4382,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4378
4382
|
};
|
|
4379
4383
|
|
|
4380
4384
|
const _excluded = ["action"];
|
|
4381
|
-
function ownKeys$
|
|
4382
|
-
function _objectSpread$
|
|
4385
|
+
function ownKeys$15(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4386
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$15(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$15(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4383
4387
|
|
|
4384
4388
|
/**
|
|
4385
4389
|
* Checks if a value is a LocalizedString
|
|
@@ -4401,7 +4405,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4401
4405
|
*/
|
|
4402
4406
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4403
4407
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4404
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4408
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$15(_objectSpread$15({}, customFields), {}, {
|
|
4405
4409
|
[customField.name]: customField.value
|
|
4406
4410
|
}), {});
|
|
4407
4411
|
};
|
|
@@ -4425,7 +4429,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4425
4429
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4426
4430
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4427
4431
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4428
|
-
return _objectSpread$
|
|
4432
|
+
return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, transformedData), parent ? {
|
|
4429
4433
|
parent
|
|
4430
4434
|
} : {}), ancestors ? {
|
|
4431
4435
|
ancestors
|
|
@@ -4567,9 +4571,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4567
4571
|
};
|
|
4568
4572
|
case 'setName':
|
|
4569
4573
|
return {
|
|
4570
|
-
[actionName]:
|
|
4571
|
-
name: _Array$isArray__default["default"](actionPayload.name) ? actionPayload.name : l10n.transformLocalizedStringToLocalizedField(actionPayload.name)
|
|
4572
|
-
}
|
|
4574
|
+
[actionName]: getNameFromPayload(actionPayload)
|
|
4573
4575
|
};
|
|
4574
4576
|
case 'setLocalizedName':
|
|
4575
4577
|
return {
|
|
@@ -4641,7 +4643,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4641
4643
|
case 'addAttributeDefinition':
|
|
4642
4644
|
return {
|
|
4643
4645
|
[actionName]: {
|
|
4644
|
-
attributeDefinition: _objectSpread$
|
|
4646
|
+
attributeDefinition: _objectSpread$15(_objectSpread$15({}, actionPayload.attribute), {}, {
|
|
4645
4647
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4646
4648
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4647
4649
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4657,6 +4659,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4657
4659
|
includedInPrice: actionPayload.taxRate.includedInPrice,
|
|
4658
4660
|
amount: actionPayload.taxRate.amount,
|
|
4659
4661
|
state: actionPayload.taxRate.state,
|
|
4662
|
+
key: actionPayload.taxRate.key,
|
|
4660
4663
|
subRates: actionPayload.taxRate.subRates
|
|
4661
4664
|
},
|
|
4662
4665
|
taxRateId: actionPayload.taxRateId
|
|
@@ -4736,7 +4739,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4736
4739
|
return {
|
|
4737
4740
|
[actionName]: {
|
|
4738
4741
|
attributeName: actionPayload.attributeName,
|
|
4739
|
-
value: _objectSpread$
|
|
4742
|
+
value: _objectSpread$15(_objectSpread$15({}, actionPayload.value), {}, {
|
|
4740
4743
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4741
4744
|
})
|
|
4742
4745
|
}
|
|
@@ -4745,7 +4748,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4745
4748
|
return {
|
|
4746
4749
|
[actionName]: {
|
|
4747
4750
|
attributeName: actionPayload.attributeName,
|
|
4748
|
-
newValue: _objectSpread$
|
|
4751
|
+
newValue: _objectSpread$15(_objectSpread$15({}, actionPayload.newValue), {}, {
|
|
4749
4752
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4750
4753
|
})
|
|
4751
4754
|
}
|
|
@@ -4772,7 +4775,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4772
4775
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4773
4776
|
taxCategory: actionPayload.taxCategory,
|
|
4774
4777
|
money: {
|
|
4775
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4778
|
+
[actionPayload.money.type]: _objectSpread$15({
|
|
4776
4779
|
centAmount: actionPayload.money.centAmount,
|
|
4777
4780
|
currencyCode: actionPayload.money.currencyCode
|
|
4778
4781
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4827,8 +4830,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4827
4830
|
fields: customFields
|
|
4828
4831
|
} : null;
|
|
4829
4832
|
return {
|
|
4830
|
-
[actionName]: _objectSpread$
|
|
4831
|
-
address: _objectSpread$
|
|
4833
|
+
[actionName]: _objectSpread$15(_objectSpread$15({}, actionPayload), {}, {
|
|
4834
|
+
address: _objectSpread$15(_objectSpread$15({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4832
4835
|
custom
|
|
4833
4836
|
})
|
|
4834
4837
|
})
|
|
@@ -4904,8 +4907,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4904
4907
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4905
4908
|
}
|
|
4906
4909
|
|
|
4907
|
-
function ownKeys$
|
|
4908
|
-
function _objectSpread$
|
|
4910
|
+
function ownKeys$14(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4911
|
+
function _objectSpread$14(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$14(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4909
4912
|
function getPriceChannelName(price) {
|
|
4910
4913
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4911
4914
|
return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -4919,11 +4922,11 @@ function getDiscountValue(price) {
|
|
|
4919
4922
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 ? void 0 : (_price$discounted$val = _price$discounted.value) === null || _price$discounted$val === void 0 ? void 0 : _price$discounted$val.type) === PRECISION_TYPES.centPrecision) {
|
|
4920
4923
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4921
4924
|
}
|
|
4922
|
-
return price.discounted ? _objectSpread$
|
|
4925
|
+
return price.discounted ? _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4923
4926
|
fractionedAmount,
|
|
4924
4927
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4925
4928
|
preciseAmount
|
|
4926
|
-
}) : _objectSpread$
|
|
4929
|
+
}) : _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4927
4930
|
centAmount: 0
|
|
4928
4931
|
});
|
|
4929
4932
|
}
|
|
@@ -4944,7 +4947,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4944
4947
|
}
|
|
4945
4948
|
let preciseAmount;
|
|
4946
4949
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4947
|
-
return _objectSpread$
|
|
4950
|
+
return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4948
4951
|
centAmount,
|
|
4949
4952
|
preciseAmount
|
|
4950
4953
|
});
|
|
@@ -4956,7 +4959,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4956
4959
|
const currencyCode = price.value.currencyCode;
|
|
4957
4960
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4958
4961
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4959
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4962
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$14(_objectSpread$14({}, minPrices), {}, {
|
|
4960
4963
|
[currencyCode]: price.value
|
|
4961
4964
|
});
|
|
4962
4965
|
}
|
|
@@ -4965,8 +4968,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4965
4968
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4966
4969
|
}
|
|
4967
4970
|
|
|
4968
|
-
function ownKeys$
|
|
4969
|
-
function _objectSpread$
|
|
4971
|
+
function ownKeys$13(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4972
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$13(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$13(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4970
4973
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4971
4974
|
var _context, _context4;
|
|
4972
4975
|
return {
|
|
@@ -4981,14 +4984,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4981
4984
|
return {
|
|
4982
4985
|
name: fieldDefinition.name,
|
|
4983
4986
|
required: fieldDefinition.required,
|
|
4984
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4985
|
-
elementType: _objectSpread$
|
|
4987
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4988
|
+
elementType: _objectSpread$13(_objectSpread$13({}, fieldDefinition.type.elementType), {}, {
|
|
4986
4989
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4987
4990
|
key: value.key,
|
|
4988
4991
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4989
4992
|
}))
|
|
4990
4993
|
})
|
|
4991
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4994
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4992
4995
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4993
4996
|
key: value.key,
|
|
4994
4997
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4999,7 +5002,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4999
5002
|
})
|
|
5000
5003
|
}
|
|
5001
5004
|
},
|
|
5002
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
5005
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$13(_objectSpread$13({}, fields), {}, {
|
|
5003
5006
|
[customField.name]: customField.value
|
|
5004
5007
|
}), {})
|
|
5005
5008
|
};
|
|
@@ -5011,7 +5014,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
5011
5014
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
5012
5015
|
// in either case we return null
|
|
5013
5016
|
if (!productSelection) return null;
|
|
5014
|
-
return _objectSpread$
|
|
5017
|
+
return _objectSpread$13(_objectSpread$13({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
5015
5018
|
from: 'nameAllLocales',
|
|
5016
5019
|
to: 'name'
|
|
5017
5020
|
}])), {}, {
|
|
@@ -5034,8 +5037,8 @@ const transformAllToProperNounCase = text => {
|
|
|
5034
5037
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
5035
5038
|
};
|
|
5036
5039
|
|
|
5037
|
-
function ownKeys$
|
|
5038
|
-
function _objectSpread$
|
|
5040
|
+
function ownKeys$12(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5041
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$12(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$12(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5039
5042
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
5040
5043
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
5041
5044
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -5052,7 +5055,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
5052
5055
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
5053
5056
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
5054
5057
|
const definitionName = definition.type.elementType.name;
|
|
5055
|
-
return _objectSpread$
|
|
5058
|
+
return _objectSpread$12(_objectSpread$12({}, updateAction), {}, {
|
|
5056
5059
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
5057
5060
|
});
|
|
5058
5061
|
}
|
|
@@ -5126,8 +5129,8 @@ function omitSetsOfSets() {
|
|
|
5126
5129
|
|
|
5127
5130
|
var GetProductTypesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductTypesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query GetProductTypesQuery($where: String) {\n productTypes(where: $where) {\n results {\n id\n name\n }\n }\n}\n\nquery GetProductTypeQuery($id: String) {\n productType(id: $id) {\n id\n name\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5128
5131
|
|
|
5129
|
-
function ownKeys
|
|
5130
|
-
function _objectSpread
|
|
5132
|
+
function ownKeys$11(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5133
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$11(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$11(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5131
5134
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5132
5135
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5133
5136
|
var FetchTypeDefinitionsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1172, source: { body: "query FetchTypeDefinitionsQuery($where: String, $limit: Int, $offset: Int) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n fieldDefinitions {\n type {\n name\n ... on SetType {\n elementType {\n name\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n ... on ReferenceType {\n referenceTypeId\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -5187,7 +5190,7 @@ const mapDataToProps = _ref => {
|
|
|
5187
5190
|
return {
|
|
5188
5191
|
fetchTypeDefinitionsQuery: {
|
|
5189
5192
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5190
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread
|
|
5193
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$11({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5191
5194
|
isImmutable: true
|
|
5192
5195
|
}), [{
|
|
5193
5196
|
from: 'labelAllLocales',
|
|
@@ -5215,12 +5218,12 @@ const handlers$4 = {
|
|
|
5215
5218
|
}
|
|
5216
5219
|
};
|
|
5217
5220
|
|
|
5218
|
-
function ownKeys$
|
|
5219
|
-
function _objectSpread$
|
|
5221
|
+
function ownKeys$10(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5222
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$10(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$10(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5220
5223
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5221
5224
|
return {
|
|
5222
5225
|
fields: customFieldsFromRestResponse.fields,
|
|
5223
|
-
type: _objectSpread$
|
|
5226
|
+
type: _objectSpread$10({
|
|
5224
5227
|
id: customFieldsFromRestResponse.type.id
|
|
5225
5228
|
}, customFieldsFromRestResponse.type.obj)
|
|
5226
5229
|
};
|
|
@@ -5239,14 +5242,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5239
5242
|
name: fieldDefinition.name,
|
|
5240
5243
|
required: fieldDefinition.required,
|
|
5241
5244
|
inputHint: fieldDefinition.inputHint,
|
|
5242
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5243
|
-
elementType: _objectSpread$
|
|
5245
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5246
|
+
elementType: _objectSpread$10(_objectSpread$10({}, fieldDefinition.type.elementType), {}, {
|
|
5244
5247
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5245
5248
|
key: value.key,
|
|
5246
5249
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5247
5250
|
}))
|
|
5248
5251
|
})
|
|
5249
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5252
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5250
5253
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5251
5254
|
key: value.key,
|
|
5252
5255
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5262,7 +5265,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5262
5265
|
type: {
|
|
5263
5266
|
id: formCustomFields.type.id,
|
|
5264
5267
|
typeId: 'type',
|
|
5265
|
-
obj: _objectSpread$
|
|
5268
|
+
obj: _objectSpread$10({}, formCustomFields.type)
|
|
5266
5269
|
},
|
|
5267
5270
|
fields: formCustomFields.fields
|
|
5268
5271
|
});
|
|
@@ -5270,7 +5273,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5270
5273
|
type: {
|
|
5271
5274
|
id: formCustomFields.type.id,
|
|
5272
5275
|
typeId: 'type',
|
|
5273
|
-
obj: _objectSpread$
|
|
5276
|
+
obj: _objectSpread$10({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5274
5277
|
},
|
|
5275
5278
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5276
5279
|
});
|
|
@@ -5401,8 +5404,8 @@ const REFERENCED_TYPES = {
|
|
|
5401
5404
|
zone: 'zone'
|
|
5402
5405
|
};
|
|
5403
5406
|
|
|
5404
|
-
function ownKeys
|
|
5405
|
-
function _objectSpread
|
|
5407
|
+
function ownKeys$$(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5408
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$$(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$$(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5406
5409
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5407
5410
|
let validatedValues = [];
|
|
5408
5411
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5469,8 +5472,8 @@ function validations (formValues, language, languages) {
|
|
|
5469
5472
|
var _context2;
|
|
5470
5473
|
// Collect all required and set type fields
|
|
5471
5474
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5472
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread
|
|
5473
|
-
[fieldDefinition.name]: _objectSpread
|
|
5475
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$$(_objectSpread$$({}, acc), {}, {
|
|
5476
|
+
[fieldDefinition.name]: _objectSpread$$(_objectSpread$$({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5474
5477
|
}), {});
|
|
5475
5478
|
return withoutEmptyErrorsByField(errors);
|
|
5476
5479
|
}
|
|
@@ -5497,8 +5500,8 @@ function CustomTextInput(props) {
|
|
|
5497
5500
|
}
|
|
5498
5501
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5499
5502
|
|
|
5500
|
-
function ownKeys$
|
|
5501
|
-
function _objectSpread$
|
|
5503
|
+
function ownKeys$_(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5504
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5502
5505
|
const getSubfieldLanguage = subfieldName => {
|
|
5503
5506
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5504
5507
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5522,7 +5525,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5522
5525
|
// as a whole.
|
|
5523
5526
|
|
|
5524
5527
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5525
|
-
const newValue = _objectSpread$
|
|
5528
|
+
const newValue = _objectSpread$_(_objectSpread$_({}, props.value), {}, {
|
|
5526
5529
|
[fieldLanguage]: rawValue
|
|
5527
5530
|
});
|
|
5528
5531
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5589,21 +5592,21 @@ function CustomNumberInput(props) {
|
|
|
5589
5592
|
}
|
|
5590
5593
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5591
5594
|
|
|
5592
|
-
function ownKeys$
|
|
5593
|
-
function _objectSpread$
|
|
5595
|
+
function ownKeys$Z(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5596
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Z(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Z(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5594
5597
|
var styles$g = {
|
|
5595
5598
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5596
5599
|
};
|
|
5597
5600
|
const fixCurrencyCode = (value, currencies) => {
|
|
5598
5601
|
if (value.currencyCode) return value;
|
|
5599
5602
|
const firstCurrency = currencies[0];
|
|
5600
|
-
return _objectSpread$
|
|
5603
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5601
5604
|
currencyCode: firstCurrency
|
|
5602
5605
|
});
|
|
5603
5606
|
};
|
|
5604
5607
|
const fixAmount = value => {
|
|
5605
5608
|
if (!value.amount) {
|
|
5606
|
-
return _objectSpread$
|
|
5609
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5607
5610
|
amount: '0'
|
|
5608
5611
|
});
|
|
5609
5612
|
}
|
|
@@ -5645,7 +5648,7 @@ function CustomMoneyInput(props) {
|
|
|
5645
5648
|
}
|
|
5646
5649
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5647
5650
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5648
|
-
const newValue = _objectSpread$
|
|
5651
|
+
const newValue = _objectSpread$Z({}, internalValue.current);
|
|
5649
5652
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5650
5653
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5651
5654
|
internalValue.current = fixedValue;
|
|
@@ -5926,7 +5929,7 @@ function ReferenceSearch(props) {
|
|
|
5926
5929
|
});
|
|
5927
5930
|
}
|
|
5928
5931
|
|
|
5929
|
-
const messages$
|
|
5932
|
+
const messages$F = reactIntl.defineMessages({
|
|
5930
5933
|
placeholder: {
|
|
5931
5934
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5932
5935
|
description: 'Placeholder for search for a category',
|
|
@@ -5959,8 +5962,8 @@ const messages$B = reactIntl.defineMessages({
|
|
|
5959
5962
|
}
|
|
5960
5963
|
});
|
|
5961
5964
|
|
|
5962
|
-
function ownKeys$
|
|
5963
|
-
function _objectSpread$
|
|
5965
|
+
function ownKeys$Y(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5966
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$Y(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$Y(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5964
5967
|
function Option$1(props) {
|
|
5965
5968
|
var _context, _context2;
|
|
5966
5969
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5972,7 +5975,7 @@ function Option$1(props) {
|
|
|
5972
5975
|
const _useIntl = reactIntl.useIntl(),
|
|
5973
5976
|
formatMessage = _useIntl.formatMessage;
|
|
5974
5977
|
const category = props.data;
|
|
5975
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5978
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5976
5979
|
children: jsxRuntime.jsxs("div", {
|
|
5977
5980
|
"data-testid": "category-option",
|
|
5978
5981
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5983,7 +5986,7 @@ function Option$1(props) {
|
|
|
5983
5986
|
fallbackOrder: languages
|
|
5984
5987
|
})
|
|
5985
5988
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5986
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5989
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$F.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5987
5990
|
key: 'name',
|
|
5988
5991
|
locale: language,
|
|
5989
5992
|
fallbackOrder: languages
|
|
@@ -5995,14 +5998,14 @@ function Option$1(props) {
|
|
|
5995
5998
|
fallbackOrder: languages
|
|
5996
5999
|
}))
|
|
5997
6000
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5998
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
6001
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$F.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5999
6002
|
})]
|
|
6000
6003
|
})
|
|
6001
6004
|
}));
|
|
6002
6005
|
}
|
|
6003
6006
|
|
|
6004
|
-
function ownKeys$
|
|
6005
|
-
function _objectSpread$
|
|
6007
|
+
function ownKeys$X(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6008
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$X(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$X(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6006
6009
|
const filterOption$1 = () => true;
|
|
6007
6010
|
function CategoryReferenceSearch(props) {
|
|
6008
6011
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -6014,7 +6017,7 @@ function CategoryReferenceSearch(props) {
|
|
|
6014
6017
|
})),
|
|
6015
6018
|
language = _useApplicationContex.language,
|
|
6016
6019
|
languages = _useApplicationContex.languages;
|
|
6017
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
6020
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$X(_objectSpread$X({}, category), {}, {
|
|
6018
6021
|
value: category.id,
|
|
6019
6022
|
label: l10n.formatLocalizedString(category, {
|
|
6020
6023
|
key: 'name',
|
|
@@ -6032,7 +6035,7 @@ function CategoryReferenceSearch(props) {
|
|
|
6032
6035
|
}), [apolloClient]);
|
|
6033
6036
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
6034
6037
|
id: props.id,
|
|
6035
|
-
components: _objectSpread$
|
|
6038
|
+
components: _objectSpread$X({
|
|
6036
6039
|
Option: Option$1
|
|
6037
6040
|
}, props.components),
|
|
6038
6041
|
isClearable: props.isClearable,
|
|
@@ -6043,10 +6046,10 @@ function CategoryReferenceSearch(props) {
|
|
|
6043
6046
|
onBlur: props.onBlur,
|
|
6044
6047
|
onChange: props.onChange,
|
|
6045
6048
|
value: props.value,
|
|
6046
|
-
placeholderLabel: formatMessage(messages$
|
|
6047
|
-
searchPromptLabel: formatMessage(messages$
|
|
6048
|
-
noResultsLabel: formatMessage(messages$
|
|
6049
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6049
|
+
placeholderLabel: formatMessage(messages$F.placeholder),
|
|
6050
|
+
searchPromptLabel: formatMessage(messages$F.searchPrompt),
|
|
6051
|
+
noResultsLabel: formatMessage(messages$F.noResults),
|
|
6052
|
+
referenceIsMissingLabel: formatMessage(messages$F.isMissing),
|
|
6050
6053
|
mapItemToOption: mapItemToOption,
|
|
6051
6054
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6052
6055
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6122,7 +6125,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
6122
6125
|
});
|
|
6123
6126
|
}
|
|
6124
6127
|
|
|
6125
|
-
const messages$
|
|
6128
|
+
const messages$E = reactIntl.defineMessages({
|
|
6126
6129
|
placeholder: {
|
|
6127
6130
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
6128
6131
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6150,8 +6153,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
6150
6153
|
}
|
|
6151
6154
|
});
|
|
6152
6155
|
|
|
6153
|
-
function ownKeys$
|
|
6154
|
-
function _objectSpread$
|
|
6156
|
+
function ownKeys$W(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6157
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$W(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$W(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6155
6158
|
function Option(props) {
|
|
6156
6159
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6157
6160
|
language: applicationContext.dataLocale,
|
|
@@ -6162,7 +6165,7 @@ function Option(props) {
|
|
|
6162
6165
|
const _useIntl = reactIntl.useIntl(),
|
|
6163
6166
|
formatMessage = _useIntl.formatMessage;
|
|
6164
6167
|
const cartDiscount = props.data;
|
|
6165
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6168
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$W(_objectSpread$W({}, props), {}, {
|
|
6166
6169
|
children: jsxRuntime.jsxs("div", {
|
|
6167
6170
|
"data-testid": "cart-discount-option",
|
|
6168
6171
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6173,14 +6176,14 @@ function Option(props) {
|
|
|
6173
6176
|
fallbackOrder: languages
|
|
6174
6177
|
})
|
|
6175
6178
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6176
|
-
children: [formatMessage(messages$
|
|
6179
|
+
children: [formatMessage(messages$E.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6177
6180
|
})]
|
|
6178
6181
|
})
|
|
6179
6182
|
}));
|
|
6180
6183
|
}
|
|
6181
6184
|
|
|
6182
|
-
function ownKeys$
|
|
6183
|
-
function _objectSpread$
|
|
6185
|
+
function ownKeys$V(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6186
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$V(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$V(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6184
6187
|
var CartDiscountsCount$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 425, source: { body: "query SearchCartDiscount($where: String) {\n cartDiscounts(limit: 500, where: $where) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n\nquery FetchCartDiscountById($cartDiscountId: String!) {\n cartDiscount(id: $cartDiscountId) {\n id\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6185
6188
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6186
6189
|
const filterOption = (option, text) => {
|
|
@@ -6206,7 +6209,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6206
6209
|
})),
|
|
6207
6210
|
language = _useApplicationContex.language,
|
|
6208
6211
|
languages = _useApplicationContex.languages;
|
|
6209
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6212
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$V(_objectSpread$V({}, cartDiscount), {}, {
|
|
6210
6213
|
value: cartDiscount.id,
|
|
6211
6214
|
key: cartDiscount.key,
|
|
6212
6215
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6249,10 +6252,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6249
6252
|
onBlur: props.onBlur,
|
|
6250
6253
|
onChange: props.onChange,
|
|
6251
6254
|
value: returnNullIfEmpty(props.value),
|
|
6252
|
-
placeholderLabel: formatMessage(messages$
|
|
6253
|
-
searchPromptLabel: formatMessage(messages$
|
|
6254
|
-
noResultsLabel: formatMessage(messages$
|
|
6255
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6255
|
+
placeholderLabel: formatMessage(messages$E.placeholder),
|
|
6256
|
+
searchPromptLabel: formatMessage(messages$E.searchPrompt),
|
|
6257
|
+
noResultsLabel: formatMessage(messages$E.noResults),
|
|
6258
|
+
referenceIsMissingLabel: formatMessage(messages$E.isMissing),
|
|
6256
6259
|
mapItemToOption: mapItemToOption,
|
|
6257
6260
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6258
6261
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6313,7 +6316,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6313
6316
|
});
|
|
6314
6317
|
}
|
|
6315
6318
|
|
|
6316
|
-
var messages$
|
|
6319
|
+
var messages$D = reactIntl.defineMessages({
|
|
6317
6320
|
noProductsFound: {
|
|
6318
6321
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6319
6322
|
description: 'The message to display when no products were found',
|
|
@@ -6437,7 +6440,7 @@ const ProductPickerInput = _ref => {
|
|
|
6437
6440
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6438
6441
|
id: name,
|
|
6439
6442
|
name: name,
|
|
6440
|
-
placeholder: formatMessage(messages$
|
|
6443
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
6441
6444
|
loadOptions: loadOptionsDebounced,
|
|
6442
6445
|
defaultOptions: [],
|
|
6443
6446
|
isClearable: isClearable,
|
|
@@ -6451,7 +6454,7 @@ const ProductPickerInput = _ref => {
|
|
|
6451
6454
|
onInputChange: handleInputChange,
|
|
6452
6455
|
onBlur: onBlur,
|
|
6453
6456
|
value: currentOption.data,
|
|
6454
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6457
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$D.noProductsFound),
|
|
6455
6458
|
hasError: hasError || isLoadingFailed
|
|
6456
6459
|
})
|
|
6457
6460
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6769,8 +6772,8 @@ const SetButtons = props => {
|
|
|
6769
6772
|
};
|
|
6770
6773
|
SetButtons.displayName = 'SetButtons';
|
|
6771
6774
|
|
|
6772
|
-
function ownKeys$
|
|
6773
|
-
function _objectSpread$
|
|
6775
|
+
function ownKeys$U(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6776
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$U(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$U(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6774
6777
|
const getDuplicateErrors = setValues => {
|
|
6775
6778
|
/* eslint-disable no-plusplus */
|
|
6776
6779
|
const result = [];
|
|
@@ -6827,7 +6830,7 @@ function CustomInputSet(props) {
|
|
|
6827
6830
|
touched = _useFormikContext.touched,
|
|
6828
6831
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
6829
6832
|
dirty = _useFormikContext.dirty;
|
|
6830
|
-
const itemFieldDefintion = _objectSpread$
|
|
6833
|
+
const itemFieldDefintion = _objectSpread$U(_objectSpread$U({}, props.fieldDefinition), {}, {
|
|
6831
6834
|
type: props.fieldDefinition.type.elementType
|
|
6832
6835
|
});
|
|
6833
6836
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -6940,7 +6943,7 @@ function CustomInputSet(props) {
|
|
|
6940
6943
|
}
|
|
6941
6944
|
CustomInputSet.displayName = 'CustomInputSet';
|
|
6942
6945
|
|
|
6943
|
-
var messages$
|
|
6946
|
+
var messages$C = reactIntl.defineMessages({
|
|
6944
6947
|
referencedProductType: {
|
|
6945
6948
|
id: 'NestedAttributes.referencedProductType',
|
|
6946
6949
|
description: 'Product type referenced hint',
|
|
@@ -6948,10 +6951,10 @@ var messages$y = reactIntl.defineMessages({
|
|
|
6948
6951
|
}
|
|
6949
6952
|
});
|
|
6950
6953
|
|
|
6951
|
-
function ownKeys$
|
|
6952
|
-
function _objectSpread$
|
|
6954
|
+
function ownKeys$T(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6955
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$T(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$T(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6953
6956
|
function ProductTypeReference(props) {
|
|
6954
|
-
const productTypeMessage = _objectSpread$
|
|
6957
|
+
const productTypeMessage = _objectSpread$T(_objectSpread$T({}, messages$C.referencedProductType), {}, {
|
|
6955
6958
|
values: {
|
|
6956
6959
|
productTypeName: props.productType.name
|
|
6957
6960
|
}
|
|
@@ -6962,23 +6965,23 @@ function ProductTypeReference(props) {
|
|
|
6962
6965
|
}
|
|
6963
6966
|
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
6964
6967
|
|
|
6965
|
-
function ownKeys$
|
|
6966
|
-
function _objectSpread$
|
|
6968
|
+
function ownKeys$S(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6969
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$S(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$S(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6967
6970
|
var FetchProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductTypeQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productType" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "attributeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "100" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isRequired" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputTipAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1905, source: { body: "query FetchProductTypeQuery($id: String!) {\n productType(id: $id) {\n name\n attributeDefinitions(limit: 100) {\n results {\n name\n isRequired\n inputHint\n inputTipAllLocales {\n value\n locale\n }\n labelAllLocales {\n value\n locale\n }\n type {\n name\n ... on SetAttributeDefinitionType {\n elementType {\n name\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6968
6971
|
const mapAttributeDefinition = definition => {
|
|
6969
6972
|
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6970
|
-
return _objectSpread$
|
|
6973
|
+
return _objectSpread$S(_objectSpread$S({}, definition), {}, {
|
|
6971
6974
|
required: definition.isRequired,
|
|
6972
6975
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6973
6976
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6974
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$
|
|
6975
|
-
elementType: _objectSpread$
|
|
6977
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6978
|
+
elementType: _objectSpread$S(_objectSpread$S({}, definition.type.elementType), {}, {
|
|
6976
6979
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6977
6980
|
key: value.key,
|
|
6978
6981
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6979
6982
|
}))
|
|
6980
6983
|
})
|
|
6981
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6984
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6982
6985
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6983
6986
|
key: value.key,
|
|
6984
6987
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -7054,9 +7057,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7054
7057
|
}
|
|
7055
7058
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7056
7059
|
|
|
7057
|
-
function ownKeys$
|
|
7058
|
-
function _objectSpread$
|
|
7059
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7060
|
+
function ownKeys$R(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7061
|
+
function _objectSpread$R(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7062
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$R(_objectSpread$R({}, result), itemErrors), {});
|
|
7060
7063
|
|
|
7061
7064
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7062
7065
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7067,15 +7070,15 @@ const CustomFieldErrors = props => {
|
|
|
7067
7070
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7068
7071
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7069
7072
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7070
|
-
intlMessage: messages$
|
|
7073
|
+
intlMessage: messages$O.required
|
|
7071
7074
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7072
|
-
intlMessage: messages$
|
|
7075
|
+
intlMessage: messages$O.unique
|
|
7073
7076
|
})]
|
|
7074
7077
|
});
|
|
7075
7078
|
};
|
|
7076
7079
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7077
7080
|
|
|
7078
|
-
var messages$
|
|
7081
|
+
var messages$B = reactIntl.defineMessages({
|
|
7079
7082
|
productReferenceLabel: {
|
|
7080
7083
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7081
7084
|
description: 'Label shown above the product picker input.',
|
|
@@ -7108,8 +7111,8 @@ var messages$x = reactIntl.defineMessages({
|
|
|
7108
7111
|
}
|
|
7109
7112
|
});
|
|
7110
7113
|
|
|
7111
|
-
function ownKeys$
|
|
7112
|
-
function _objectSpread$
|
|
7114
|
+
function ownKeys$Q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7115
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$Q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$Q(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7113
7116
|
var CartDiscountsCount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 61, source: { body: "query CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7114
7117
|
const CustomFieldsLabelHint = _ref => {
|
|
7115
7118
|
var _type$name;
|
|
@@ -7141,14 +7144,14 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7141
7144
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7142
7145
|
size: "medium",
|
|
7143
7146
|
color: "warning"
|
|
7144
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7147
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7145
7148
|
}) : jsxRuntime.jsx(uiKit.Spacings.Inset, {
|
|
7146
7149
|
scale: "xs",
|
|
7147
7150
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7148
7151
|
alignItems: "flex-start",
|
|
7149
7152
|
children: [jsxRuntime.jsx(uiKit.InformationIcon, {
|
|
7150
7153
|
size: "medium"
|
|
7151
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7154
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7152
7155
|
})
|
|
7153
7156
|
});
|
|
7154
7157
|
}
|
|
@@ -7163,8 +7166,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7163
7166
|
formatMessage = _useIntl.formatMessage;
|
|
7164
7167
|
const _usePimStatus = usePimStatus(),
|
|
7165
7168
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7166
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7167
|
-
return formatMessage(messages$
|
|
7169
|
+
if (isProjectIndexed) return formatMessage(messages$B.productTypeReferenceLabelI);
|
|
7170
|
+
return formatMessage(messages$B.productTypeReferenceLabel);
|
|
7168
7171
|
}
|
|
7169
7172
|
|
|
7170
7173
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7180,7 +7183,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7180
7183
|
const referenceTypeId = type.referenceTypeId;
|
|
7181
7184
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7182
7185
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7183
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7186
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$B.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$B.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$B.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7184
7187
|
}
|
|
7185
7188
|
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
7186
7189
|
let name = _ref3.name,
|
|
@@ -7288,8 +7291,8 @@ const ThemedCustomFieldsInternal = props => {
|
|
|
7288
7291
|
};
|
|
7289
7292
|
ThemedCustomFieldsInternal.displayName = 'ThemedCustomFieldsInternal';
|
|
7290
7293
|
|
|
7291
|
-
function ownKeys$
|
|
7292
|
-
function _objectSpread$
|
|
7294
|
+
function ownKeys$P(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7295
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$P(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$P(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7293
7296
|
const getTypeName = type => type.name.toLowerCase();
|
|
7294
7297
|
const findLabel = (enumType, key) => {
|
|
7295
7298
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -7338,7 +7341,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
7338
7341
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
7339
7342
|
let name = _ref2.name,
|
|
7340
7343
|
value = _ref2.value;
|
|
7341
|
-
return _objectSpread$
|
|
7344
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
7342
7345
|
[name]: value
|
|
7343
7346
|
});
|
|
7344
7347
|
}, {});
|
|
@@ -7445,7 +7448,7 @@ const customFieldsMessages = reactIntl.defineMessages({
|
|
|
7445
7448
|
}
|
|
7446
7449
|
});
|
|
7447
7450
|
|
|
7448
|
-
var messages$
|
|
7451
|
+
var messages$A = reactIntl.defineMessages({
|
|
7449
7452
|
updateButton: {
|
|
7450
7453
|
id: 'NestedAttributes.Details.updateButton',
|
|
7451
7454
|
description: 'Update button label',
|
|
@@ -7525,14 +7528,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
7525
7528
|
|
|
7526
7529
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
7527
7530
|
|
|
7528
|
-
function ownKeys$
|
|
7529
|
-
function _objectSpread$
|
|
7531
|
+
function ownKeys$O(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7532
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$O(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$O(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7530
7533
|
const EditButton = props => {
|
|
7531
7534
|
const _useIntl = reactIntl.useIntl(),
|
|
7532
7535
|
formatMessage = _useIntl.formatMessage;
|
|
7533
7536
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7534
7537
|
placement: "top",
|
|
7535
|
-
title: formatMessage(messages$
|
|
7538
|
+
title: formatMessage(messages$A.editTooltip),
|
|
7536
7539
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
7537
7540
|
label: "Edit",
|
|
7538
7541
|
isDisabled: props.isDisabled,
|
|
@@ -7548,12 +7551,12 @@ const DropChangesConfirmation = props => {
|
|
|
7548
7551
|
formatMessage = _useIntl2.formatMessage;
|
|
7549
7552
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
7550
7553
|
isOpen: props.isOpen || false,
|
|
7551
|
-
title: formatMessage(messages$
|
|
7552
|
-
labelPrimary: formatMessage(messages$
|
|
7554
|
+
title: formatMessage(messages$A.confirmationDialogTitle),
|
|
7555
|
+
labelPrimary: formatMessage(messages$A.nestedAttributesConfirmLabel),
|
|
7553
7556
|
onConfirm: props.onConfirm,
|
|
7554
7557
|
onCancel: props.onCancel,
|
|
7555
7558
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7556
|
-
intlMessage: messages$
|
|
7559
|
+
intlMessage: messages$A.confirmationDialogBody
|
|
7557
7560
|
})
|
|
7558
7561
|
});
|
|
7559
7562
|
};
|
|
@@ -7582,11 +7585,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7582
7585
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
7583
7586
|
isDisabled: !formik$1.dirty,
|
|
7584
7587
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
7585
|
-
label: formatMessage(messages$
|
|
7588
|
+
label: formatMessage(messages$A.cancelButton),
|
|
7586
7589
|
onClick: formik$1.resetForm
|
|
7587
7590
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
7588
7591
|
isDisabled: !formik$1.dirty,
|
|
7589
|
-
label: formatMessage(messages$
|
|
7592
|
+
label: formatMessage(messages$A.updateButton),
|
|
7590
7593
|
onClick: formik$1.handleSubmit
|
|
7591
7594
|
})]
|
|
7592
7595
|
}),
|
|
@@ -7627,7 +7630,7 @@ const NestedInputControls = props => {
|
|
|
7627
7630
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
7628
7631
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7629
7632
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7630
|
-
intlMessage: messages$
|
|
7633
|
+
intlMessage: messages$A.emptyProductType,
|
|
7631
7634
|
tone: "secondary"
|
|
7632
7635
|
});
|
|
7633
7636
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -7677,13 +7680,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7677
7680
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7678
7681
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7679
7682
|
const openNestedAttributesForm = () => {
|
|
7680
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7683
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7681
7684
|
hideSaveToolbar: true
|
|
7682
7685
|
}));
|
|
7683
7686
|
attributesForm.openModal();
|
|
7684
7687
|
};
|
|
7685
7688
|
const closeNestedAttributesForm = () => {
|
|
7686
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7689
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7687
7690
|
hideSaveToolbar: false
|
|
7688
7691
|
}));
|
|
7689
7692
|
attributesForm.closeModal();
|
|
@@ -7703,7 +7706,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7703
7706
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7704
7707
|
kind: 'success',
|
|
7705
7708
|
domain: constants.DOMAINS.SIDE,
|
|
7706
|
-
text: formatMessage(messages$
|
|
7709
|
+
text: formatMessage(messages$A.attributeUpdateSucceeded)
|
|
7707
7710
|
});
|
|
7708
7711
|
setSubmitting(false);
|
|
7709
7712
|
},
|
|
@@ -7928,6 +7931,11 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7928
7931
|
id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
|
|
7929
7932
|
description: 'Placeholder of the search select field for product selections',
|
|
7930
7933
|
defaultMessage: 'Search for product selections by entering exact key'
|
|
7934
|
+
},
|
|
7935
|
+
asyncSelectDropdownTypeAheadPrompt: {
|
|
7936
|
+
id: 'ProductSelectionPicker.asyncSelectDropdownTypeAheadPrompt',
|
|
7937
|
+
description: 'Message shown telling the user to start typing to load more product selections',
|
|
7938
|
+
defaultMessage: 'Start typing above to load more'
|
|
7931
7939
|
}
|
|
7932
7940
|
});
|
|
7933
7941
|
|
|
@@ -7960,6 +7968,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7960
7968
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7961
7969
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
7962
7970
|
const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7971
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
7972
|
+
var _context;
|
|
7973
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7974
|
+
});
|
|
7963
7975
|
const onOptionClick = event => {
|
|
7964
7976
|
const productSelectionId = event.target.value;
|
|
7965
7977
|
const currentProductSelection = _findInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
|
|
@@ -7974,12 +7986,18 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7974
7986
|
isRequired: props.isRequired,
|
|
7975
7987
|
description: props.description,
|
|
7976
7988
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
|
|
7977
|
-
options: mapProductSelectionsToOptions$1(
|
|
7989
|
+
options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
|
|
7978
7990
|
components: props.components,
|
|
7979
7991
|
onChange: onOptionClick,
|
|
7992
|
+
onBlur: props.onBlur,
|
|
7980
7993
|
isDisabled: props.isDisabled,
|
|
7981
7994
|
isReadOnly: props.isReadOnly,
|
|
7982
7995
|
hasWarning: props.hasWarning,
|
|
7996
|
+
hasError: props.hasError,
|
|
7997
|
+
isClearable: props.isClearable,
|
|
7998
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7999
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8000
|
+
maxMenuHeight: props.maxMenuHeight,
|
|
7983
8001
|
isSearchable: true
|
|
7984
8002
|
});
|
|
7985
8003
|
}
|
|
@@ -7987,6 +8005,28 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7987
8005
|
const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
|
|
7988
8006
|
const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
|
|
7989
8007
|
|
|
8008
|
+
const getValueFromOptions$3 = _ref => {
|
|
8009
|
+
let currentlySelectedProductSelections = _ref.currentlySelectedProductSelections,
|
|
8010
|
+
allProductSelectionOptions = _ref.allProductSelectionOptions,
|
|
8011
|
+
isMulti = _ref.isMulti;
|
|
8012
|
+
// return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
|
|
8013
|
+
if (!currentlySelectedProductSelections) {
|
|
8014
|
+
return undefined;
|
|
8015
|
+
}
|
|
8016
|
+
|
|
8017
|
+
// handle async-select-field value transformation
|
|
8018
|
+
if (isMulti) {
|
|
8019
|
+
return _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value));
|
|
8020
|
+
}
|
|
8021
|
+
|
|
8022
|
+
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
8023
|
+
return _findInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value);
|
|
8024
|
+
};
|
|
8025
|
+
const emptyStoreOption$1 = intl => [{
|
|
8026
|
+
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
8027
|
+
value: undefined,
|
|
8028
|
+
isDisabled: true
|
|
8029
|
+
}];
|
|
7990
8030
|
function ProductSelectionsAsyncSelectDropdown(props) {
|
|
7991
8031
|
var _productSelectionsFet3;
|
|
7992
8032
|
const intl = reactIntl.useIntl();
|
|
@@ -8004,6 +8044,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8004
8044
|
var _productSelectionsFet, _productSelectionsFet2;
|
|
8005
8045
|
return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
8006
8046
|
}, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
|
|
8047
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
8048
|
+
var _context;
|
|
8049
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
8050
|
+
});
|
|
8007
8051
|
const onOptionClick = event => {
|
|
8008
8052
|
var _event$target$value;
|
|
8009
8053
|
const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
|
|
@@ -8011,7 +8055,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8011
8055
|
props.onChange(currentProductSelection);
|
|
8012
8056
|
};
|
|
8013
8057
|
const allProductSelectionOptions = React.useMemo(() => {
|
|
8014
|
-
return _mapInstanceProperty__default["default"](
|
|
8058
|
+
return _mapInstanceProperty__default["default"](filteredProductSelections).call(filteredProductSelections, productSelection => {
|
|
8015
8059
|
const localizedName = l10n.formatLocalizedString(productSelection, {
|
|
8016
8060
|
key: 'name',
|
|
8017
8061
|
locale: dataLocale,
|
|
@@ -8024,17 +8068,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8024
8068
|
key: productSelection.key
|
|
8025
8069
|
};
|
|
8026
8070
|
});
|
|
8027
|
-
}, [dataLocale, projectLanguages,
|
|
8071
|
+
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
8028
8072
|
const getDefaultOptions = () => {
|
|
8029
|
-
return
|
|
8073
|
+
return [{
|
|
8074
|
+
options: _sliceInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
|
|
8075
|
+
}, {
|
|
8076
|
+
options: emptyStoreOption$1(intl)
|
|
8077
|
+
}];
|
|
8030
8078
|
};
|
|
8031
8079
|
const handleLoadOptions = async searchTerm => {
|
|
8032
8080
|
const productSelectionOptions = allProductSelectionOptions;
|
|
8033
8081
|
const filteredOptions = _filterInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, productSelection => {
|
|
8034
|
-
var
|
|
8035
|
-
return _includesInstanceProperty__default["default"](
|
|
8082
|
+
var _context2, _context3;
|
|
8083
|
+
return _includesInstanceProperty__default["default"](_context2 = productSelection.label.toLowerCase()).call(_context2, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty__default["default"](_context3 = productSelection.key.toLowerCase()).call(_context3, searchTerm.toLowerCase());
|
|
8036
8084
|
});
|
|
8037
|
-
|
|
8085
|
+
const finalOptions = searchTerm ? _sliceInstanceProperty__default["default"](filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
|
|
8086
|
+
return [{
|
|
8087
|
+
options: finalOptions
|
|
8088
|
+
}, {
|
|
8089
|
+
options: emptyStoreOption$1(intl)
|
|
8090
|
+
}];
|
|
8038
8091
|
};
|
|
8039
8092
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8040
8093
|
return jsxRuntime.jsx(uiKit.AsyncSelectField, {
|
|
@@ -8045,22 +8098,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8045
8098
|
isRequired: props.isRequired,
|
|
8046
8099
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
|
|
8047
8100
|
loadOptions: handleLoadOptions,
|
|
8101
|
+
value: getValueFromOptions$3({
|
|
8102
|
+
currentlySelectedProductSelections: props.value,
|
|
8103
|
+
allProductSelectionOptions,
|
|
8104
|
+
isMulti: props.isMulti
|
|
8105
|
+
}),
|
|
8048
8106
|
onChange: onOptionClick,
|
|
8107
|
+
onBlur: props.onBlur,
|
|
8049
8108
|
isDisabled: props.isDisabled,
|
|
8109
|
+
showOptionGroupDivider: true,
|
|
8050
8110
|
isReadOnly: props.isReadOnly,
|
|
8051
8111
|
components: props.components,
|
|
8052
8112
|
defaultOptions: getDefaultOptions(),
|
|
8053
|
-
hasWarning: props.hasWarning
|
|
8113
|
+
hasWarning: props.hasWarning,
|
|
8114
|
+
hasError: props.hasError,
|
|
8115
|
+
isClearable: props.isClearable,
|
|
8116
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
8117
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8118
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8054
8119
|
});
|
|
8055
8120
|
}
|
|
8056
8121
|
|
|
8122
|
+
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8123
|
+
const createQueryVariables$7 = (productSelections, predicateField) => {
|
|
8124
|
+
var _context;
|
|
8125
|
+
return {
|
|
8126
|
+
where: _concatInstanceProperty__default["default"](_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty__default["default"](productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
|
|
8127
|
+
limit: 500
|
|
8128
|
+
};
|
|
8129
|
+
};
|
|
8130
|
+
const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
|
|
8131
|
+
var _productSelectionsQue, _productSelectionsQue2;
|
|
8132
|
+
const productSelectionList = _Array$isArray__default["default"](productSelections) ? productSelections : [productSelections];
|
|
8133
|
+
const productSelectionsQuery = react.useQuery(ProductSelectionsPickerFetcher$1, {
|
|
8134
|
+
context: {
|
|
8135
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
8136
|
+
},
|
|
8137
|
+
variables: createQueryVariables$7(productSelectionList, predicateField),
|
|
8138
|
+
skip: productSelectionList.length === 0
|
|
8139
|
+
});
|
|
8140
|
+
return {
|
|
8141
|
+
productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
|
|
8142
|
+
isLoading: productSelectionsQuery.loading
|
|
8143
|
+
};
|
|
8144
|
+
};
|
|
8145
|
+
|
|
8057
8146
|
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8058
|
-
const mapProductSelectionsToOptions = memoize__default["default"](
|
|
8059
|
-
let
|
|
8060
|
-
|
|
8061
|
-
|
|
8147
|
+
const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
8148
|
+
let _ref$productSelection = _ref.productSelections,
|
|
8149
|
+
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
8150
|
+
dataLocale = _ref.dataLocale,
|
|
8151
|
+
projectLanguages = _ref.projectLanguages,
|
|
8152
|
+
renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField;
|
|
8062
8153
|
return _mapInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => ({
|
|
8063
|
-
value: productSelection.id,
|
|
8154
|
+
value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
|
|
8064
8155
|
label: l10n.formatLocalizedString(productSelection, {
|
|
8065
8156
|
key: 'name',
|
|
8066
8157
|
locale: dataLocale,
|
|
@@ -8069,9 +8160,22 @@ const mapProductSelectionsToOptions = memoize__default["default"](function () {
|
|
|
8069
8160
|
key: productSelection.key
|
|
8070
8161
|
}));
|
|
8071
8162
|
});
|
|
8072
|
-
const
|
|
8163
|
+
const getValueFromOptions$2 = _ref2 => {
|
|
8164
|
+
let isMulti = _ref2.isMulti,
|
|
8165
|
+
currentlySelectedProductSelections = _ref2.currentlySelectedProductSelections,
|
|
8166
|
+
productSelectionFieldOptions = _ref2.productSelectionFieldOptions;
|
|
8167
|
+
if (!currentlySelectedProductSelections) {
|
|
8168
|
+
return undefined;
|
|
8169
|
+
}
|
|
8170
|
+
if (isMulti) {
|
|
8171
|
+
return productSelectionFieldOptions;
|
|
8172
|
+
}
|
|
8173
|
+
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
8174
|
+
return productSelectionFieldOptions[0];
|
|
8175
|
+
};
|
|
8176
|
+
const createQueryVariables$6 = _ref3 => {
|
|
8073
8177
|
var _context;
|
|
8074
|
-
let searchText =
|
|
8178
|
+
let searchText = _ref3.searchText;
|
|
8075
8179
|
const sanitizedSearchText = sanitize(_trimInstanceProperty__default["default"](searchText).call(searchText, searchText));
|
|
8076
8180
|
const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
|
|
8077
8181
|
const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
|
|
@@ -8081,6 +8185,7 @@ const createQueryVariables$6 = _ref => {
|
|
|
8081
8185
|
};
|
|
8082
8186
|
};
|
|
8083
8187
|
function ProductSelectionsSearchSelectDropdown(props) {
|
|
8188
|
+
var _context3;
|
|
8084
8189
|
const intl = reactIntl.useIntl();
|
|
8085
8190
|
const _useState = React.useState([]),
|
|
8086
8191
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -8093,6 +8198,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8093
8198
|
})),
|
|
8094
8199
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8095
8200
|
dataLocale = _useApplicationContex.dataLocale;
|
|
8201
|
+
const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
|
|
8096
8202
|
const handleLoadOptions = async searchText => {
|
|
8097
8203
|
var _data$productSelectio, _data$productSelectio2;
|
|
8098
8204
|
const _await$client$query = await client$1.query({
|
|
@@ -8108,8 +8214,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8108
8214
|
data = _await$client$query.data;
|
|
8109
8215
|
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 ? void 0 : (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
8110
8216
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
8111
|
-
|
|
8112
|
-
|
|
8217
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
8218
|
+
var _context2;
|
|
8219
|
+
return !_includesInstanceProperty__default["default"](_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
|
|
8220
|
+
});
|
|
8221
|
+
setProductSelectionResults(filteredProductSelections);
|
|
8222
|
+
return mapProductSelectionsToOptions({
|
|
8223
|
+
productSelections: filteredProductSelections,
|
|
8224
|
+
dataLocale,
|
|
8225
|
+
projectLanguages,
|
|
8226
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8227
|
+
});
|
|
8113
8228
|
};
|
|
8114
8229
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8115
8230
|
const onOptionClick = event => {
|
|
@@ -8118,37 +8233,60 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8118
8233
|
const currentProductSelection = _findInstanceProperty__default["default"](productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8119
8234
|
props.onChange(currentProductSelection);
|
|
8120
8235
|
};
|
|
8236
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8121
8237
|
return jsxRuntime.jsx(uiKit.SearchSelectField, {
|
|
8122
8238
|
id: props.id,
|
|
8123
8239
|
name: props.name,
|
|
8124
8240
|
title: props.title,
|
|
8241
|
+
value: getValueFromOptions$2({
|
|
8242
|
+
currentlySelectedProductSelections: props.value,
|
|
8243
|
+
productSelectionFieldOptions: mapProductSelectionsToOptions({
|
|
8244
|
+
productSelections: _mapInstanceProperty__default["default"](_context3 = productSelectionsByFieldFetcher.productSelections).call(_context3, convertProductSelectionFromGraphQl),
|
|
8245
|
+
dataLocale,
|
|
8246
|
+
projectLanguages,
|
|
8247
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8248
|
+
}),
|
|
8249
|
+
isMulti: props.isMulti
|
|
8250
|
+
}),
|
|
8125
8251
|
description: props.description,
|
|
8126
8252
|
isRequired: props.isRequired,
|
|
8127
8253
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
|
|
8128
8254
|
loadOptions: loadOptionsDebounced,
|
|
8129
8255
|
onChange: onOptionClick,
|
|
8256
|
+
onBlur: props.onBlur,
|
|
8130
8257
|
components: props.components,
|
|
8131
|
-
isDisabled: props.isDisabled,
|
|
8258
|
+
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8132
8259
|
isReadOnly: props.isReadOnly,
|
|
8133
|
-
hasWarning: props.hasWarning
|
|
8260
|
+
hasWarning: props.hasWarning,
|
|
8261
|
+
isClearable: props.isClearable,
|
|
8262
|
+
hasError: props.hasError,
|
|
8263
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
8264
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8265
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8134
8266
|
});
|
|
8135
8267
|
}
|
|
8136
8268
|
|
|
8137
|
-
function ownKeys$
|
|
8138
|
-
function _objectSpread$
|
|
8139
|
-
const components = {
|
|
8140
|
-
// eslint-disable-next-line react/display-name
|
|
8141
|
-
Option: optionInnerProps => jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8142
|
-
optionType: "double-property",
|
|
8143
|
-
optionInnerProps: optionInnerProps
|
|
8144
|
-
})
|
|
8145
|
-
};
|
|
8269
|
+
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8270
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8146
8271
|
function ProductSelectionsPicker(props) {
|
|
8147
8272
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8273
|
+
const components = React.useMemo(() => {
|
|
8274
|
+
return {
|
|
8275
|
+
Option: optionInnerProps => {
|
|
8276
|
+
if (optionInnerProps.isDisabled) {
|
|
8277
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$N({}, optionInnerProps));
|
|
8278
|
+
}
|
|
8279
|
+
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8280
|
+
optionType: props.optionType,
|
|
8281
|
+
optionInnerProps: optionInnerProps
|
|
8282
|
+
});
|
|
8283
|
+
}
|
|
8284
|
+
};
|
|
8285
|
+
}, [props.optionType]);
|
|
8148
8286
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8149
8287
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8150
8288
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8151
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8289
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$N(_objectSpread$N({}, props), {}, {
|
|
8152
8290
|
components: components
|
|
8153
8291
|
}))
|
|
8154
8292
|
});
|
|
@@ -8160,12 +8298,18 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8160
8298
|
optionType: 'double-property',
|
|
8161
8299
|
isMulti: false,
|
|
8162
8300
|
isRequired: false,
|
|
8163
|
-
hasWarning: false
|
|
8301
|
+
hasWarning: false,
|
|
8302
|
+
hasError: false,
|
|
8303
|
+
isClearable: false,
|
|
8304
|
+
isReadOnly: false,
|
|
8305
|
+
isDisabled: false,
|
|
8306
|
+
excludedProductSelectionIds: [],
|
|
8307
|
+
title: '' // FieldLabel requires title to have some value
|
|
8164
8308
|
};
|
|
8165
8309
|
|
|
8166
8310
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8167
8311
|
|
|
8168
|
-
var messages$
|
|
8312
|
+
var messages$z = reactIntl.defineMessages({
|
|
8169
8313
|
countriesBasicSelectPlaceholder: {
|
|
8170
8314
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8171
8315
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8193,7 +8337,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8193
8337
|
value: props.value,
|
|
8194
8338
|
isRequired: props.isRequired,
|
|
8195
8339
|
description: props.description,
|
|
8196
|
-
placeholder: intl.formatMessage(messages$
|
|
8340
|
+
placeholder: intl.formatMessage(messages$z.countriesBasicSelectPlaceholder),
|
|
8197
8341
|
options: props.options,
|
|
8198
8342
|
onChange: props.onChange,
|
|
8199
8343
|
isDisabled: props.isDisabled,
|
|
@@ -8203,10 +8347,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8203
8347
|
});
|
|
8204
8348
|
}
|
|
8205
8349
|
|
|
8206
|
-
function ownKeys$
|
|
8207
|
-
function _objectSpread$
|
|
8350
|
+
function ownKeys$M(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8351
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$M(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$M(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8208
8352
|
const emptyCountryOption = intl => [{
|
|
8209
|
-
label: intl.formatMessage(messages$
|
|
8353
|
+
label: intl.formatMessage(messages$z.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8210
8354
|
value: undefined,
|
|
8211
8355
|
isDisabled: true
|
|
8212
8356
|
}];
|
|
@@ -8231,7 +8375,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8231
8375
|
const onOptionChange = event => {
|
|
8232
8376
|
const countries = event.target.value;
|
|
8233
8377
|
props.onChange({
|
|
8234
|
-
target: _objectSpread$
|
|
8378
|
+
target: _objectSpread$M(_objectSpread$M({}, event.target), {}, {
|
|
8235
8379
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8236
8380
|
var _country$value;
|
|
8237
8381
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8252,7 +8396,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8252
8396
|
var _context3;
|
|
8253
8397
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8254
8398
|
}),
|
|
8255
|
-
placeholder: intl.formatMessage(messages$
|
|
8399
|
+
placeholder: intl.formatMessage(messages$z.countriesAsyncSelectPlaceholder),
|
|
8256
8400
|
loadOptions: handleLoadOptions,
|
|
8257
8401
|
onChange: onOptionChange,
|
|
8258
8402
|
isDisabled: props.isDisabled,
|
|
@@ -8262,13 +8406,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8262
8406
|
});
|
|
8263
8407
|
}
|
|
8264
8408
|
|
|
8265
|
-
function ownKeys$
|
|
8266
|
-
function _objectSpread$
|
|
8409
|
+
function ownKeys$L(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8410
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$L(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$L(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8267
8411
|
function CountriesPicker(props) {
|
|
8268
8412
|
var _props$options;
|
|
8269
8413
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8270
8414
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8271
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8415
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$L({}, props))
|
|
8272
8416
|
});
|
|
8273
8417
|
}
|
|
8274
8418
|
CountriesPicker.defaultProps = {
|
|
@@ -8278,7 +8422,7 @@ CountriesPicker.defaultProps = {
|
|
|
8278
8422
|
hasWarning: false
|
|
8279
8423
|
};
|
|
8280
8424
|
|
|
8281
|
-
var messages$
|
|
8425
|
+
var messages$y = reactIntl.defineMessages({
|
|
8282
8426
|
noCustomerGroupsFound: {
|
|
8283
8427
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8284
8428
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8403,7 +8547,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8403
8547
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8404
8548
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8405
8549
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8406
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8550
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$y.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8407
8551
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8408
8552
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8409
8553
|
max: "scale",
|
|
@@ -8414,7 +8558,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8414
8558
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8415
8559
|
id: name,
|
|
8416
8560
|
name: name,
|
|
8417
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8561
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$y.placeholder),
|
|
8418
8562
|
loadOptions: loadOptionsDebounced,
|
|
8419
8563
|
defaultOptions: true,
|
|
8420
8564
|
showOptionGroupDivider: true,
|
|
@@ -8484,7 +8628,7 @@ const getFirst60Options$1 = (storesOptions, currentValues) => {
|
|
|
8484
8628
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8485
8629
|
};
|
|
8486
8630
|
|
|
8487
|
-
var messages$
|
|
8631
|
+
var messages$x = reactIntl.defineMessages({
|
|
8488
8632
|
basicSelectInputPlaceholder: {
|
|
8489
8633
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8490
8634
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8517,8 +8661,8 @@ var messages$t = reactIntl.defineMessages({
|
|
|
8517
8661
|
}
|
|
8518
8662
|
});
|
|
8519
8663
|
|
|
8520
|
-
function ownKeys$
|
|
8521
|
-
function _objectSpread$
|
|
8664
|
+
function ownKeys$K(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8665
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$K(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$K(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8522
8666
|
const hasErrors$5 = errors => {
|
|
8523
8667
|
var _context;
|
|
8524
8668
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8543,7 +8687,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8543
8687
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8544
8688
|
};
|
|
8545
8689
|
const emptyStoreOption = intl => [{
|
|
8546
|
-
label: intl.formatMessage(messages$
|
|
8690
|
+
label: intl.formatMessage(messages$x.asyncSelectDropdownTypeAheadPrompt),
|
|
8547
8691
|
value: undefined,
|
|
8548
8692
|
isDisabled: true
|
|
8549
8693
|
}];
|
|
@@ -8590,10 +8734,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8590
8734
|
};
|
|
8591
8735
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8592
8736
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8593
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8737
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$K(_objectSpread$K({
|
|
8594
8738
|
id: props.id,
|
|
8595
8739
|
name: props.name,
|
|
8596
|
-
placeholder: intl.formatMessage(messages$
|
|
8740
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8597
8741
|
horizontalConstraint: props.horizontalConstraint,
|
|
8598
8742
|
loadOptions: handleLoadOptions,
|
|
8599
8743
|
defaultOptions: true,
|
|
@@ -8632,8 +8776,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8632
8776
|
shouldFetchProductSelections: false
|
|
8633
8777
|
};
|
|
8634
8778
|
|
|
8635
|
-
function ownKeys$
|
|
8636
|
-
function _objectSpread$
|
|
8779
|
+
function ownKeys$J(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8780
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$J(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$J(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8637
8781
|
const hasErrors$4 = errors => {
|
|
8638
8782
|
var _context;
|
|
8639
8783
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8681,10 +8825,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8681
8825
|
};
|
|
8682
8826
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8683
8827
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8684
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8828
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$J(_objectSpread$J({
|
|
8685
8829
|
id: props.id,
|
|
8686
8830
|
name: props.name,
|
|
8687
|
-
placeholder: intl.formatMessage(messages$
|
|
8831
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8688
8832
|
horizontalConstraint: props.horizontalConstraint,
|
|
8689
8833
|
options: mappedStoresListOptions,
|
|
8690
8834
|
isMulti: props.isMulti,
|
|
@@ -8776,8 +8920,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8776
8920
|
};
|
|
8777
8921
|
};
|
|
8778
8922
|
|
|
8779
|
-
function ownKeys$
|
|
8780
|
-
function _objectSpread$
|
|
8923
|
+
function ownKeys$I(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8924
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$I(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$I(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8781
8925
|
var FetchStoresByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByWherePredicate" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 525, source: { body: "query FetchStoresByWherePredicate(\n $where: String!\n $skipFetchingStores: Boolean!\n $excludeProductSelections: Boolean!\n) {\n storesByWherePredicate: stores(where: $where) @skip(if: $skipFetchingStores) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8782
8926
|
const hasErrors$3 = errors => {
|
|
8783
8927
|
var _context;
|
|
@@ -8879,10 +9023,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8879
9023
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8880
9024
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8881
9025
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8882
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
9026
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$I(_objectSpread$I({
|
|
8883
9027
|
id: props.id,
|
|
8884
9028
|
name: props.name,
|
|
8885
|
-
placeholder: intl.formatMessage(messages$
|
|
9029
|
+
placeholder: intl.formatMessage(messages$x.searchSelectInputPlaceholder),
|
|
8886
9030
|
horizontalConstraint: props.horizontalConstraint,
|
|
8887
9031
|
loadOptions: loadOptionsDebounced,
|
|
8888
9032
|
defaultOptions: false,
|
|
@@ -8896,8 +9040,8 @@ const StoresSearchSelectInput = props => {
|
|
|
8896
9040
|
}),
|
|
8897
9041
|
onChange: props.onChange,
|
|
8898
9042
|
onBlur: props.onBlur,
|
|
8899
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8900
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
9043
|
+
loadingMessage: intl.formatMessage(messages$x.searchSelectInputLoadingMessage),
|
|
9044
|
+
noOptionsMessage: () => intl.formatMessage(messages$x.searchSelectInputNoOptionsFoundMessage),
|
|
8901
9045
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8902
9046
|
isReadOnly: props.isReadOnly,
|
|
8903
9047
|
isClearable: props.isClearable,
|
|
@@ -8924,8 +9068,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8924
9068
|
shouldFetchProductSelections: false
|
|
8925
9069
|
};
|
|
8926
9070
|
|
|
8927
|
-
function ownKeys$
|
|
8928
|
-
function _objectSpread$
|
|
9071
|
+
function ownKeys$H(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9072
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$H(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$H(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8929
9073
|
const StoreSelectInput = props => {
|
|
8930
9074
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8931
9075
|
const components = React.useMemo(() => {
|
|
@@ -8933,7 +9077,7 @@ const StoreSelectInput = props => {
|
|
|
8933
9077
|
// eslint-disable-next-line react/display-name
|
|
8934
9078
|
Option: optionInnerProps => {
|
|
8935
9079
|
if (optionInnerProps.isDisabled) {
|
|
8936
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
9080
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$H({}, optionInnerProps));
|
|
8937
9081
|
}
|
|
8938
9082
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8939
9083
|
optionType: props.optionType,
|
|
@@ -8944,7 +9088,7 @@ const StoreSelectInput = props => {
|
|
|
8944
9088
|
}, [props.optionType]);
|
|
8945
9089
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8946
9090
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8947
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
9091
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$H(_objectSpread$H({
|
|
8948
9092
|
projectKey: props.projectKey,
|
|
8949
9093
|
id: props.id,
|
|
8950
9094
|
name: props.name,
|
|
@@ -8983,12 +9127,12 @@ StoreSelectInput.defaultProps = {
|
|
|
8983
9127
|
shouldFetchProductSelections: false
|
|
8984
9128
|
};
|
|
8985
9129
|
|
|
8986
|
-
function ownKeys$
|
|
8987
|
-
function _objectSpread$
|
|
9130
|
+
function ownKeys$G(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9131
|
+
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$G(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$G(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8988
9132
|
var FetchBusinessUnitsListQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsListQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnits" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 340, source: { body: "query FetchBusinessUnitsListQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n) {\n businessUnits(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...BusinessUnitBasicInfo\n }\n }\n}\n\nfragment BusinessUnitBasicInfo on BusinessUnit {\n id\n key\n name\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8989
9133
|
const createQueryVariables$3 = ownProps => {
|
|
8990
9134
|
var _context;
|
|
8991
|
-
return _objectSpread$
|
|
9135
|
+
return _objectSpread$G(_objectSpread$G({
|
|
8992
9136
|
limit: ownProps.limit,
|
|
8993
9137
|
offset: ownProps.offset,
|
|
8994
9138
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -9061,7 +9205,7 @@ const getFirst60Options = (businessUnitOptions, currentValues) => {
|
|
|
9061
9205
|
return _sliceInstanceProperty__default["default"](businessUnitOptions).call(businessUnitOptions, 0, LOWER_BUSINESS_UNITS_LIMIT + currentValuesLength);
|
|
9062
9206
|
};
|
|
9063
9207
|
|
|
9064
|
-
var messages$
|
|
9208
|
+
var messages$w = reactIntl.defineMessages({
|
|
9065
9209
|
asyncSelectInputPlaceholder: {
|
|
9066
9210
|
id: 'Shared.BusinessUnitSelectInput.asyncSelectInputPlaceholder',
|
|
9067
9211
|
description: 'The placeholder shown for async select input',
|
|
@@ -9089,8 +9233,8 @@ var messages$s = reactIntl.defineMessages({
|
|
|
9089
9233
|
}
|
|
9090
9234
|
});
|
|
9091
9235
|
|
|
9092
|
-
function ownKeys$
|
|
9093
|
-
function _objectSpread$
|
|
9236
|
+
function ownKeys$F(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9237
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$F(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$F(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9094
9238
|
const hasErrors$2 = errors => {
|
|
9095
9239
|
var _context;
|
|
9096
9240
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -9132,10 +9276,10 @@ const BusinessUnitAsyncSelectInput = props => {
|
|
|
9132
9276
|
};
|
|
9133
9277
|
if (businessUnitsListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9134
9278
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9135
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
9279
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$F(_objectSpread$F({
|
|
9136
9280
|
id: props.id,
|
|
9137
9281
|
name: props.name,
|
|
9138
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9282
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.asyncSelectInputPlaceholder),
|
|
9139
9283
|
horizontalConstraint: props.horizontalConstraint,
|
|
9140
9284
|
loadOptions: handleLoadOptions,
|
|
9141
9285
|
defaultOptions: getDefaultOptions(),
|
|
@@ -9168,8 +9312,8 @@ BusinessUnitAsyncSelectInput.defaultProps = {
|
|
|
9168
9312
|
shouldFetchProductSelections: false
|
|
9169
9313
|
};
|
|
9170
9314
|
|
|
9171
|
-
function ownKeys$
|
|
9172
|
-
function _objectSpread$
|
|
9315
|
+
function ownKeys$E(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9316
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$E(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$E(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9173
9317
|
const hasErrors$1 = errors => {
|
|
9174
9318
|
var _context;
|
|
9175
9319
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -9196,10 +9340,10 @@ const BusinessUnitBasicSelectInput = props => {
|
|
|
9196
9340
|
};
|
|
9197
9341
|
if (businessUnitsListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9198
9342
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9199
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
9343
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$E(_objectSpread$E({
|
|
9200
9344
|
id: props.id,
|
|
9201
9345
|
name: props.name,
|
|
9202
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9346
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.basicSelectInputPlaceholder),
|
|
9203
9347
|
horizontalConstraint: props.horizontalConstraint,
|
|
9204
9348
|
options: mappedBusinessUnitsOptions,
|
|
9205
9349
|
value: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.value,
|
|
@@ -9283,8 +9427,8 @@ const handlers$1 = {
|
|
|
9283
9427
|
}
|
|
9284
9428
|
};
|
|
9285
9429
|
|
|
9286
|
-
function ownKeys$
|
|
9287
|
-
function _objectSpread$
|
|
9430
|
+
function ownKeys$D(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9431
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$D(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$D(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9288
9432
|
var FetchBusinessUnitsByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "businessUnitsByWherePredicate" }, name: { kind: "Name", value: "businessUnits" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 180, source: { body: "query FetchBusinessUnitsByWherePredicate($where: String!) {\n businessUnitsByWherePredicate: businessUnits(where: $where) {\n results {\n id\n key\n name\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9289
9433
|
const hasErrors = errors => {
|
|
9290
9434
|
var _context;
|
|
@@ -9333,18 +9477,18 @@ const BusinessUnitSearchSelectInput = props => {
|
|
|
9333
9477
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
9334
9478
|
if (businessUnitsByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9335
9479
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9336
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
9480
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$D(_objectSpread$D({
|
|
9337
9481
|
id: props.id,
|
|
9338
9482
|
name: props.name,
|
|
9339
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9483
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.searchSelectInputPlaceholder),
|
|
9340
9484
|
horizontalConstraint: props.horizontalConstraint,
|
|
9341
9485
|
loadOptions: loadOptionsDebounced,
|
|
9342
9486
|
defaultOptions: false,
|
|
9343
9487
|
value: props.value,
|
|
9344
9488
|
onChange: handleChange,
|
|
9345
9489
|
onBlur: props.onBlur,
|
|
9346
|
-
loadingMessage: intl.formatMessage(messages$
|
|
9347
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
9490
|
+
loadingMessage: intl.formatMessage(messages$w.searchSelectInputLoadingMessage),
|
|
9491
|
+
noOptionsMessage: () => intl.formatMessage(messages$w.searchSelectInputNoOptionsFoundMessage),
|
|
9348
9492
|
isDisabled: props.isDisabled || businessUnitsByFieldFetcher.isLoading,
|
|
9349
9493
|
isReadOnly: props.isReadOnly,
|
|
9350
9494
|
isClearable: props.isClearable,
|
|
@@ -9371,8 +9515,8 @@ BusinessUnitSearchSelectInput.defaultProps = {
|
|
|
9371
9515
|
shouldFetchProductSelections: false
|
|
9372
9516
|
};
|
|
9373
9517
|
|
|
9374
|
-
function ownKeys$
|
|
9375
|
-
function _objectSpread$
|
|
9518
|
+
function ownKeys$C(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9519
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$C(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$C(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9376
9520
|
const BusinessUnitSelectInput = props => {
|
|
9377
9521
|
const totalNumberOfBusinessUnitsFetcher = useTotalNumberOfBusinessUnitsFetcher();
|
|
9378
9522
|
const components = React.useMemo(() => {
|
|
@@ -9380,7 +9524,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9380
9524
|
// eslint-disable-next-line react/display-name
|
|
9381
9525
|
Option: optionInnerProps => {
|
|
9382
9526
|
if (optionInnerProps.isDisabled) {
|
|
9383
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
9527
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$C({}, optionInnerProps));
|
|
9384
9528
|
}
|
|
9385
9529
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9386
9530
|
optionType: props.optionType,
|
|
@@ -9391,7 +9535,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9391
9535
|
}, [props.optionType]);
|
|
9392
9536
|
if (totalNumberOfBusinessUnitsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9393
9537
|
const CustomSelectInput = totalNumberOfBusinessUnitsFetcher.total <= props.lowerBusinessUnitsLimit ? BusinessUnitBasicSelectInput : totalNumberOfBusinessUnitsFetcher.total <= props.upperBusinessUnitsLimit ? BusinessUnitAsyncSelectInput : BusinessUnitSearchSelectInput;
|
|
9394
|
-
return jsxRuntime.jsx(CustomSelectInput, _objectSpread$
|
|
9538
|
+
return jsxRuntime.jsx(CustomSelectInput, _objectSpread$C(_objectSpread$C({
|
|
9395
9539
|
id: props.id,
|
|
9396
9540
|
name: props.name,
|
|
9397
9541
|
components: components,
|
|
@@ -9432,7 +9576,7 @@ BusinessUnitSelectInput.defaultProps = {
|
|
|
9432
9576
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
9433
9577
|
const businessRoleKeys = ['ExecutiveManagement', 'BusinessIntelligence', 'BuyingPlanningAndInventoryManagement', 'DataQualityAndContentManagement', 'CustomerService', 'FinanceAndAccounting', 'LegalAndPeople', 'LogisticsAndSupplyChain', 'FulfillmentAndOperationsManagement', 'OfflineRetailStore', 'Marketing', 'BusinessDevSalesAndAccountManagement', 'UXUIDesign', 'TechProductManagement', 'TechProjectAndProgramManagement', 'SoftwareDevelopmentAndSolutionsArchitect', 'OperationsITAndSupportEngineering', 'Other'];
|
|
9434
9578
|
|
|
9435
|
-
var messages$
|
|
9579
|
+
var messages$v = reactIntl.defineMessages({
|
|
9436
9580
|
ExecutiveManagement: {
|
|
9437
9581
|
id: 'Shared.businessRoles.executiveManagement',
|
|
9438
9582
|
description: 'The label for one of the selectable business roles',
|
|
@@ -9525,6 +9669,571 @@ var messages$r = reactIntl.defineMessages({
|
|
|
9525
9669
|
}
|
|
9526
9670
|
});
|
|
9527
9671
|
|
|
9672
|
+
const safelyAddFallback = function (string) {
|
|
9673
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.NO_VALUE_FALLBACK;
|
|
9674
|
+
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
9675
|
+
};
|
|
9676
|
+
|
|
9677
|
+
const ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES = 'businessUnitsAssociateRoles';
|
|
9678
|
+
|
|
9679
|
+
const ASSOCIATE_ROLE_SOURCES = {
|
|
9680
|
+
EXPLICIT: 'Explicit',
|
|
9681
|
+
INHERITED: 'Inherited'
|
|
9682
|
+
};
|
|
9683
|
+
const SEARCH_FIELDS = {
|
|
9684
|
+
ALL_FIELDS: 'allFields',
|
|
9685
|
+
NAME: 'name',
|
|
9686
|
+
EMAIL: 'email'
|
|
9687
|
+
};
|
|
9688
|
+
|
|
9689
|
+
var messages$u = reactIntl.defineMessages({
|
|
9690
|
+
allFieldsFilterOption: {
|
|
9691
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.allFields',
|
|
9692
|
+
description: 'Label for the filter option all fields',
|
|
9693
|
+
defaultMessage: 'All fields'
|
|
9694
|
+
},
|
|
9695
|
+
allFieldsFilterPlaceholder: {
|
|
9696
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.allFields',
|
|
9697
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9698
|
+
defaultMessage: 'Search by name or email'
|
|
9699
|
+
},
|
|
9700
|
+
emailFilterOption: {
|
|
9701
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.email',
|
|
9702
|
+
description: 'Label for the filter option email',
|
|
9703
|
+
defaultMessage: 'Email'
|
|
9704
|
+
},
|
|
9705
|
+
emailFilterPlaceholder: {
|
|
9706
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.email',
|
|
9707
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9708
|
+
defaultMessage: 'Search by email'
|
|
9709
|
+
},
|
|
9710
|
+
nameFilterOption: {
|
|
9711
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.name',
|
|
9712
|
+
description: 'Label for the filter option name',
|
|
9713
|
+
defaultMessage: 'Name'
|
|
9714
|
+
},
|
|
9715
|
+
nameFilterPlaceholder: {
|
|
9716
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.name',
|
|
9717
|
+
description: 'Label for the searchbar placeholder for name option',
|
|
9718
|
+
defaultMessage: 'Search by name'
|
|
9719
|
+
}
|
|
9720
|
+
});
|
|
9721
|
+
|
|
9722
|
+
function ownKeys$B(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9723
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$B(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$B(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9724
|
+
const BusinessUnitAssociatesSearchbar = props => {
|
|
9725
|
+
const intl = reactIntl.useIntl();
|
|
9726
|
+
const searchOptions = React.useMemo(() => [{
|
|
9727
|
+
value: SEARCH_FIELDS.ALL_FIELDS,
|
|
9728
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterOption")])
|
|
9729
|
+
}, {
|
|
9730
|
+
value: SEARCH_FIELDS.NAME,
|
|
9731
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterOption")])
|
|
9732
|
+
}, {
|
|
9733
|
+
value: SEARCH_FIELDS.EMAIL,
|
|
9734
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterOption")])
|
|
9735
|
+
}], [intl]);
|
|
9736
|
+
const seachPlaceholderMessages = React.useMemo(() => ({
|
|
9737
|
+
[SEARCH_FIELDS.ALL_FIELDS]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterPlaceholder")]),
|
|
9738
|
+
[SEARCH_FIELDS.EMAIL]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterPlaceholder")]),
|
|
9739
|
+
[SEARCH_FIELDS.NAME]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterPlaceholder")])
|
|
9740
|
+
}), [intl]);
|
|
9741
|
+
const _useState = React.useState({
|
|
9742
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9743
|
+
text: ''
|
|
9744
|
+
}),
|
|
9745
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9746
|
+
searchValue = _useState2[0],
|
|
9747
|
+
setSearchValue = _useState2[1];
|
|
9748
|
+
return jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
9749
|
+
horizontalConstraint: 15,
|
|
9750
|
+
isDisabled: props.isDisabled,
|
|
9751
|
+
onChange: event => {
|
|
9752
|
+
var _context;
|
|
9753
|
+
if (_endsWithInstanceProperty__default["default"](_context = event.target.id).call(_context, 'dropdown')) {
|
|
9754
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9755
|
+
option: event.target.value
|
|
9756
|
+
}));
|
|
9757
|
+
} else {
|
|
9758
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9759
|
+
text: event.target.value
|
|
9760
|
+
}));
|
|
9761
|
+
}
|
|
9762
|
+
},
|
|
9763
|
+
onReset: () => {
|
|
9764
|
+
setSearchValue({
|
|
9765
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9766
|
+
text: ''
|
|
9767
|
+
});
|
|
9768
|
+
props.onSubmit({
|
|
9769
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9770
|
+
text: ''
|
|
9771
|
+
});
|
|
9772
|
+
},
|
|
9773
|
+
onSubmit: props.onSubmit,
|
|
9774
|
+
options: searchOptions,
|
|
9775
|
+
placeholder: seachPlaceholderMessages[searchValue.option],
|
|
9776
|
+
value: searchValue
|
|
9777
|
+
});
|
|
9778
|
+
};
|
|
9779
|
+
BusinessUnitAssociatesSearchbar.displayName = 'BusinessUnitAssociatesSearchbar';
|
|
9780
|
+
|
|
9781
|
+
var messages$t = reactIntl.defineMessages({
|
|
9782
|
+
addAnAssociate: {
|
|
9783
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.addAnAssociate',
|
|
9784
|
+
description: 'The label for add an associate link button',
|
|
9785
|
+
defaultMessage: 'Add an associate'
|
|
9786
|
+
},
|
|
9787
|
+
noAssociates: {
|
|
9788
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.noAssociates',
|
|
9789
|
+
description: 'The message displayed when there are no associates available',
|
|
9790
|
+
defaultMessage: 'There are no associates.'
|
|
9791
|
+
}
|
|
9792
|
+
});
|
|
9793
|
+
|
|
9794
|
+
const EmptyListMessage = props => {
|
|
9795
|
+
const intl = reactIntl.useIntl();
|
|
9796
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Inset, {
|
|
9797
|
+
scale: "xs",
|
|
9798
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
9799
|
+
scale: "l",
|
|
9800
|
+
children: [jsxRuntime.jsx(Divider, {
|
|
9801
|
+
size: "m"
|
|
9802
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9803
|
+
intlMessage: messages$t.noAssociates
|
|
9804
|
+
})]
|
|
9805
|
+
}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
9806
|
+
isDisabled: !props.canManageBusinessUnits,
|
|
9807
|
+
label: intl.formatMessage(messages$t.addAnAssociate),
|
|
9808
|
+
onClick: props.onAddAssociateClick,
|
|
9809
|
+
tone: "primary"
|
|
9810
|
+
})]
|
|
9811
|
+
});
|
|
9812
|
+
};
|
|
9813
|
+
EmptyListMessage.displayName = 'EmptyListMessage';
|
|
9814
|
+
|
|
9815
|
+
var messages$s = reactIntl.defineMessages({
|
|
9816
|
+
noResultsTitle: {
|
|
9817
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsTitle',
|
|
9818
|
+
description: 'Message for no search result for customers.',
|
|
9819
|
+
defaultMessage: 'There are no results that match your search and/or filter combination.'
|
|
9820
|
+
},
|
|
9821
|
+
noResultsSuggestionsTitle: {
|
|
9822
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestionsTitle',
|
|
9823
|
+
description: 'Suggestions title',
|
|
9824
|
+
defaultMessage: 'Suggestions:'
|
|
9825
|
+
},
|
|
9826
|
+
noResultsSuggestion1: {
|
|
9827
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion1',
|
|
9828
|
+
description: 'One of suggestions when no results are found.',
|
|
9829
|
+
defaultMessage: 'Make sure to select the search field in the dropdown next to the search input.'
|
|
9830
|
+
},
|
|
9831
|
+
noResultsSuggestion2: {
|
|
9832
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion2',
|
|
9833
|
+
description: 'One of suggestions when no results are found.',
|
|
9834
|
+
defaultMessage: 'Check the spelling, search by entering the exact value.'
|
|
9835
|
+
},
|
|
9836
|
+
noResultsSuggestion3: {
|
|
9837
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion3',
|
|
9838
|
+
description: 'One of suggestions when no results are found.',
|
|
9839
|
+
defaultMessage: 'Use the filter to search for further values.'
|
|
9840
|
+
}
|
|
9841
|
+
});
|
|
9842
|
+
|
|
9843
|
+
const EmptySearchResultsMessage = () => jsxRuntime.jsx(uiKit.Spacings.Inset, {
|
|
9844
|
+
scale: "xs",
|
|
9845
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
9846
|
+
scale: "s",
|
|
9847
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9848
|
+
tone: "secondary",
|
|
9849
|
+
intlMessage: messages$s.noResultsTitle,
|
|
9850
|
+
isBold: true
|
|
9851
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9852
|
+
tone: "secondary",
|
|
9853
|
+
intlMessage: messages$s.noResultsSuggestionsTitle
|
|
9854
|
+
}), jsxRuntime.jsxs("ul", {
|
|
9855
|
+
children: [jsxRuntime.jsx("li", {
|
|
9856
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9857
|
+
intlMessage: messages$s.noResultsSuggestion1,
|
|
9858
|
+
tone: "secondary"
|
|
9859
|
+
})
|
|
9860
|
+
}), jsxRuntime.jsx("li", {
|
|
9861
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9862
|
+
intlMessage: messages$s.noResultsSuggestion2,
|
|
9863
|
+
tone: "secondary"
|
|
9864
|
+
})
|
|
9865
|
+
}), jsxRuntime.jsx("li", {
|
|
9866
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9867
|
+
intlMessage: messages$s.noResultsSuggestion3,
|
|
9868
|
+
tone: "secondary"
|
|
9869
|
+
})
|
|
9870
|
+
})]
|
|
9871
|
+
})]
|
|
9872
|
+
})
|
|
9873
|
+
});
|
|
9874
|
+
EmptySearchResultsMessage.displayName = 'EmptySearchResultsMessage';
|
|
9875
|
+
|
|
9876
|
+
const filterByAllFields = (associates, searchValue) => {
|
|
9877
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9878
|
+
return _filterInstanceProperty__default["default"](associates).call(associates, associate => {
|
|
9879
|
+
return _someInstanceProperty__default["default"](searchTextTerms).call(searchTextTerms, term => {
|
|
9880
|
+
var _context, _context2, _context3;
|
|
9881
|
+
return _includesInstanceProperty__default["default"](_context = associate.customer.firstName.toLowerCase()).call(_context, term) || _includesInstanceProperty__default["default"](_context2 = associate.customer.lastName.toLowerCase()).call(_context2, term) || _includesInstanceProperty__default["default"](_context3 = associate.customer.email.toLowerCase()).call(_context3, term);
|
|
9882
|
+
});
|
|
9883
|
+
});
|
|
9884
|
+
};
|
|
9885
|
+
const filterByEmail = (associates, searchValue) => {
|
|
9886
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9887
|
+
return _filterInstanceProperty__default["default"](associates).call(associates, associate => _someInstanceProperty__default["default"](searchTextTerms).call(searchTextTerms, term => {
|
|
9888
|
+
var _context4;
|
|
9889
|
+
return _includesInstanceProperty__default["default"](_context4 = associate.customer.email.toLowerCase()).call(_context4, term);
|
|
9890
|
+
}));
|
|
9891
|
+
};
|
|
9892
|
+
const filterByName = (associates, searchValue) => {
|
|
9893
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9894
|
+
return _filterInstanceProperty__default["default"](associates).call(associates, associate => {
|
|
9895
|
+
return _someInstanceProperty__default["default"](searchTextTerms).call(searchTextTerms, term => {
|
|
9896
|
+
var _context5, _context6;
|
|
9897
|
+
return _includesInstanceProperty__default["default"](_context5 = associate.customer.firstName.toLowerCase()).call(_context5, term) || _includesInstanceProperty__default["default"](_context6 = associate.customer.lastName.toLowerCase()).call(_context6, term);
|
|
9898
|
+
});
|
|
9899
|
+
});
|
|
9900
|
+
};
|
|
9901
|
+
const FILTER_FUNCTIONS = {
|
|
9902
|
+
[SEARCH_FIELDS.ALL_FIELDS]: filterByAllFields,
|
|
9903
|
+
[SEARCH_FIELDS.EMAIL]: filterByEmail,
|
|
9904
|
+
[SEARCH_FIELDS.NAME]: filterByName
|
|
9905
|
+
};
|
|
9906
|
+
const filterAssociates = (associates, searchValue) => FILTER_FUNCTIONS[searchValue.option](associates, searchValue);
|
|
9907
|
+
|
|
9908
|
+
const mergeOverwritten = (inherited, explicit) => {
|
|
9909
|
+
var _context;
|
|
9910
|
+
const onlyExplicit = differenceBy__default["default"](explicit.associateRoleAssignments, inherited.associateRoleAssignments, 'associateRole.key') || [];
|
|
9911
|
+
const onlyInherited = differenceBy__default["default"](inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9912
|
+
const overwritten = intersectionBy__default["default"](inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9913
|
+
const allExplicit = _mapInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](onlyExplicit).call(onlyExplicit, overwritten)).call(_context, _ref => {
|
|
9914
|
+
let associateRole = _ref.associateRole;
|
|
9915
|
+
return {
|
|
9916
|
+
name: associateRole.name || associateRole.key,
|
|
9917
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9918
|
+
};
|
|
9919
|
+
});
|
|
9920
|
+
const allInherited = _mapInstanceProperty__default["default"](onlyInherited).call(onlyInherited, _ref2 => {
|
|
9921
|
+
let associateRole = _ref2.associateRole;
|
|
9922
|
+
return {
|
|
9923
|
+
name: associateRole.name || associateRole.key,
|
|
9924
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9925
|
+
};
|
|
9926
|
+
});
|
|
9927
|
+
return {
|
|
9928
|
+
id: inherited.customer.id,
|
|
9929
|
+
customer: inherited.customer,
|
|
9930
|
+
roles: _concatInstanceProperty__default["default"](allExplicit).call(allExplicit, allInherited)
|
|
9931
|
+
};
|
|
9932
|
+
};
|
|
9933
|
+
const mergeAssociates = businessUnit => {
|
|
9934
|
+
var _businessUnit$associa, _businessUnit$inherit, _context2;
|
|
9935
|
+
const associates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$associa = businessUnit.associates) === null || _businessUnit$associa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$associa).call(_businessUnit$associa, associate => associate === null || associate === void 0 ? void 0 : associate.customer);
|
|
9936
|
+
const inheritedAssociates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$inherit = businessUnit.inheritedAssociates) === null || _businessUnit$inherit === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$inherit).call(_businessUnit$inherit, inheritedAssociate => inheritedAssociate === null || inheritedAssociate === void 0 ? void 0 : inheritedAssociate.customer);
|
|
9937
|
+
const overwrittenOnExplicit = intersectionBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
9938
|
+
const overwrittenOnInherited = intersectionBy__default["default"](inheritedAssociates, associates, 'customer.id') || [];
|
|
9939
|
+
const onlyExplicit = differenceBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
9940
|
+
const onlyInherited = differenceBy__default["default"](inheritedAssociates, associates, 'customer.id') || [];
|
|
9941
|
+
const explicit = _mapInstanceProperty__default["default"](onlyExplicit).call(onlyExplicit, associate => {
|
|
9942
|
+
var _associate$associateR;
|
|
9943
|
+
return {
|
|
9944
|
+
id: associate.customer.id,
|
|
9945
|
+
customer: associate.customer,
|
|
9946
|
+
roles: (_associate$associateR = associate.associateRoleAssignments) === null || _associate$associateR === void 0 ? void 0 : _mapInstanceProperty__default["default"](_associate$associateR).call(_associate$associateR, _ref3 => {
|
|
9947
|
+
let associateRole = _ref3.associateRole;
|
|
9948
|
+
return {
|
|
9949
|
+
name: associateRole.name || associateRole.key,
|
|
9950
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9951
|
+
};
|
|
9952
|
+
})
|
|
9953
|
+
};
|
|
9954
|
+
});
|
|
9955
|
+
const inherited = _mapInstanceProperty__default["default"](onlyInherited).call(onlyInherited, associate => {
|
|
9956
|
+
var _associate$associateR2;
|
|
9957
|
+
return {
|
|
9958
|
+
id: associate.customer.id,
|
|
9959
|
+
customer: associate.customer,
|
|
9960
|
+
roles: (_associate$associateR2 = associate.associateRoleAssignments) === null || _associate$associateR2 === void 0 ? void 0 : _mapInstanceProperty__default["default"](_associate$associateR2).call(_associate$associateR2, _ref4 => {
|
|
9961
|
+
let associateRole = _ref4.associateRole;
|
|
9962
|
+
return {
|
|
9963
|
+
name: associateRole.name || associateRole.key,
|
|
9964
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9965
|
+
};
|
|
9966
|
+
})
|
|
9967
|
+
};
|
|
9968
|
+
});
|
|
9969
|
+
const overwritten = _mapInstanceProperty__default["default"](overwrittenOnInherited).call(overwrittenOnInherited, inherited => {
|
|
9970
|
+
const explicit = _findInstanceProperty__default["default"](overwrittenOnExplicit).call(overwrittenOnExplicit, explicitAssociate => explicitAssociate.customer.id === inherited.customer.id);
|
|
9971
|
+
return mergeOverwritten(inherited, explicit);
|
|
9972
|
+
});
|
|
9973
|
+
return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](explicit).call(explicit, inherited)).call(_context2, overwritten);
|
|
9974
|
+
};
|
|
9975
|
+
|
|
9976
|
+
var messages$r = reactIntl.defineMessages({
|
|
9977
|
+
columnFirstName: {
|
|
9978
|
+
id: 'Shared.BusinessUnitAssociates.columnFirstName',
|
|
9979
|
+
description: 'The column label (First name)',
|
|
9980
|
+
defaultMessage: 'First name'
|
|
9981
|
+
},
|
|
9982
|
+
columnLastName: {
|
|
9983
|
+
id: 'Shared.BusinessUnitAssociates.columnLastName',
|
|
9984
|
+
description: 'The column label (Last name)',
|
|
9985
|
+
defaultMessage: 'Last name'
|
|
9986
|
+
},
|
|
9987
|
+
columnRole: {
|
|
9988
|
+
id: 'Shared.BusinessUnitAssociates.columnRole',
|
|
9989
|
+
description: 'The column label (Role)',
|
|
9990
|
+
defaultMessage: 'Role'
|
|
9991
|
+
},
|
|
9992
|
+
columnEmail: {
|
|
9993
|
+
id: 'Shared.BusinessUnitAssociates.columnEmail',
|
|
9994
|
+
description: 'The column label (Email)',
|
|
9995
|
+
defaultMessage: 'Email'
|
|
9996
|
+
},
|
|
9997
|
+
companyUnitType: {
|
|
9998
|
+
id: 'Shared.BusinessUnitAssociates.unitType.company',
|
|
9999
|
+
description: 'Label for the business unit type company',
|
|
10000
|
+
defaultMessage: 'Company'
|
|
10001
|
+
},
|
|
10002
|
+
divisionUnitType: {
|
|
10003
|
+
id: 'Shared.BusinessUnitAssociates.unitType.division',
|
|
10004
|
+
description: 'Label for the business unit type division',
|
|
10005
|
+
defaultMessage: 'Division'
|
|
10006
|
+
},
|
|
10007
|
+
labelExplicit: {
|
|
10008
|
+
id: 'Shared.BusinessUnitAssociates.labelExplicit',
|
|
10009
|
+
description: 'Label for explicit roles',
|
|
10010
|
+
defaultMessage: 'Explicit'
|
|
10011
|
+
},
|
|
10012
|
+
labelInherited: {
|
|
10013
|
+
id: 'Shared.BusinessUnitAssociates.labelInherited',
|
|
10014
|
+
description: 'Label for explicit roles',
|
|
10015
|
+
defaultMessage: 'Inherited'
|
|
10016
|
+
},
|
|
10017
|
+
roleEnumAdmin: {
|
|
10018
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.admin',
|
|
10019
|
+
description: 'Label for the business unit associate rol Admin',
|
|
10020
|
+
defaultMessage: 'Admin'
|
|
10021
|
+
},
|
|
10022
|
+
roleEnumBuyer: {
|
|
10023
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.buyer',
|
|
10024
|
+
description: 'Label for the business unit associate rol Buyer',
|
|
10025
|
+
defaultMessage: 'Buyer'
|
|
10026
|
+
},
|
|
10027
|
+
searchResultsCount: {
|
|
10028
|
+
id: 'Shared.BusinessUnitAssociates.searchResultsCount',
|
|
10029
|
+
description: 'Total results coming from search',
|
|
10030
|
+
defaultMessage: '{totalResults} results'
|
|
10031
|
+
}
|
|
10032
|
+
});
|
|
10033
|
+
|
|
10034
|
+
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10035
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10036
|
+
const BusinessUnitAssociatesListView = props => {
|
|
10037
|
+
var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
|
|
10038
|
+
const intl = reactIntl.useIntl();
|
|
10039
|
+
const businessUnitsAssociateRolesFeatureEnabled = applicationShell.useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
10040
|
+
const totalAssociates = ((_props$values = _valuesInstanceProperty__default["default"](props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length) + (((_props$values2 = _valuesInstanceProperty__default["default"](props)) === null || _props$values2 === void 0 ? void 0 : (_props$values2$inheri = _props$values2.inheritedAssociates) === null || _props$values2$inheri === void 0 ? void 0 : _props$values2$inheri.length) || 0);
|
|
10041
|
+
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
10042
|
+
const _usePaginationState = uiKit.usePaginationState({
|
|
10043
|
+
perPage: 20
|
|
10044
|
+
}),
|
|
10045
|
+
page = _usePaginationState.page,
|
|
10046
|
+
perPage = _usePaginationState.perPage;
|
|
10047
|
+
const _useState = React.useState({
|
|
10048
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
10049
|
+
text: ''
|
|
10050
|
+
}),
|
|
10051
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10052
|
+
searchValue = _useState2[0],
|
|
10053
|
+
setSearchValue = _useState2[1];
|
|
10054
|
+
const associates = React.useMemo(() => {
|
|
10055
|
+
var _props$values3, _context, _context2;
|
|
10056
|
+
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty__default["default"](props)) : (_props$values3 = _valuesInstanceProperty__default["default"](props)) === null || _props$values3 === void 0 ? void 0 : _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _props$values3.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
|
|
10057
|
+
id: associate.customer.id
|
|
10058
|
+
}));
|
|
10059
|
+
}, [_valuesInstanceProperty__default["default"](props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
10060
|
+
const tableColumns = React.useMemo(() => [{
|
|
10061
|
+
key: 'firstName',
|
|
10062
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$A({}, messages$r.columnFirstName)),
|
|
10063
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
10064
|
+
}, {
|
|
10065
|
+
key: 'lastName',
|
|
10066
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$A({}, messages$r.columnLastName)),
|
|
10067
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
10068
|
+
}, {
|
|
10069
|
+
key: 'roles',
|
|
10070
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$A({}, messages$r.columnRole)),
|
|
10071
|
+
shouldIgnoreRowClick: isBusinessUnitCreation,
|
|
10072
|
+
width: 'max-content'
|
|
10073
|
+
}, {
|
|
10074
|
+
key: 'email',
|
|
10075
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$A({}, messages$r.columnEmail)),
|
|
10076
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
10077
|
+
}], [isBusinessUnitCreation]);
|
|
10078
|
+
const filteredAssociates = React.useMemo(() => {
|
|
10079
|
+
return filterAssociates(associates, searchValue);
|
|
10080
|
+
}, [associates, searchValue]);
|
|
10081
|
+
const associatesToShow = React.useMemo(() => {
|
|
10082
|
+
const from = (page.value - 1) * perPage.value;
|
|
10083
|
+
const to = from + perPage.value;
|
|
10084
|
+
return _sliceInstanceProperty__default["default"](filteredAssociates).call(filteredAssociates, from, to);
|
|
10085
|
+
}, [filteredAssociates, perPage.value, page.value]);
|
|
10086
|
+
const renderAssociate = (associate, _ref) => {
|
|
10087
|
+
let columnKey = _ref.key;
|
|
10088
|
+
let formattedValue;
|
|
10089
|
+
if (!(associate !== null && associate !== void 0 && associate.customer)) return null;
|
|
10090
|
+
switch (columnKey) {
|
|
10091
|
+
case 'roles':
|
|
10092
|
+
const roles = associate[columnKey];
|
|
10093
|
+
formattedValue = jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
10094
|
+
children: (roles === null || roles === void 0 ? void 0 : roles.length) > 0 ? businessUnitsAssociateRolesFeatureEnabled ? jsxRuntime.jsx(uiKit.Grid, {
|
|
10095
|
+
gridGap: uiKit.customProperties.spacingM,
|
|
10096
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
10097
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty__default["default"](roles).call(roles, (associateRole, index) => {
|
|
10098
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10099
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
10100
|
+
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10101
|
+
children: associateRole.name
|
|
10102
|
+
}, associateRole.name)
|
|
10103
|
+
}, "role-grid-item-".concat(index)), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
10104
|
+
children: jsxRuntime.jsx(uiKit.Stamp, {
|
|
10105
|
+
isCondensed: true,
|
|
10106
|
+
label: intl.formatMessage(messages$r["label".concat(associateRole.source)]),
|
|
10107
|
+
tone: associateRole.source === ASSOCIATE_ROLE_SOURCES.EXPLICIT ? 'information' : 'secondary'
|
|
10108
|
+
})
|
|
10109
|
+
}, "".concat(associateRole.name, "-source"))]
|
|
10110
|
+
});
|
|
10111
|
+
})
|
|
10112
|
+
}) : jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
10113
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty__default["default"](roles).call(roles, role => jsxRuntime.jsx(uiKit.Stamp, {
|
|
10114
|
+
isCondensed: true,
|
|
10115
|
+
label: intl.formatMessage(messages$r["roleEnum".concat(role)]),
|
|
10116
|
+
tone: "primary"
|
|
10117
|
+
}, role))
|
|
10118
|
+
}) : constants.NO_VALUE_FALLBACK
|
|
10119
|
+
});
|
|
10120
|
+
break;
|
|
10121
|
+
default:
|
|
10122
|
+
formattedValue = associate.customer[columnKey] || constants.NO_VALUE_FALLBACK;
|
|
10123
|
+
}
|
|
10124
|
+
return safelyAddFallback(formattedValue);
|
|
10125
|
+
};
|
|
10126
|
+
return jsxRuntime.jsx(applicationComponents.PageContentFull, {
|
|
10127
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
10128
|
+
scale: "m",
|
|
10129
|
+
children: totalAssociates ? jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10130
|
+
scale: "s",
|
|
10131
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
10132
|
+
alignItems: "center",
|
|
10133
|
+
scale: "l",
|
|
10134
|
+
children: [jsxRuntime.jsx(BusinessUnitAssociatesSearchbar, {
|
|
10135
|
+
onSubmit: setSearchValue
|
|
10136
|
+
}), searchValue.text.length > 0 && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
10137
|
+
intlMessage: _objectSpread$A(_objectSpread$A({}, messages$r.searchResultsCount), {}, {
|
|
10138
|
+
values: {
|
|
10139
|
+
totalResults: filteredAssociates.length
|
|
10140
|
+
}
|
|
10141
|
+
})
|
|
10142
|
+
})]
|
|
10143
|
+
}), filteredAssociates.length ? jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10144
|
+
scale: "xxxl",
|
|
10145
|
+
children: [jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
10146
|
+
max: "scale",
|
|
10147
|
+
children: jsxRuntime.jsx(uiKit.DataTable, {
|
|
10148
|
+
columns: tableColumns,
|
|
10149
|
+
itemRenderer: renderAssociate,
|
|
10150
|
+
maxHeight: "calc(100vh - (".concat(uiKit.customProperties.constraint7, " + 240px))"),
|
|
10151
|
+
onRowClick: (_, rowIndex) => {
|
|
10152
|
+
var _associate$customer;
|
|
10153
|
+
const associate = associates[rowIndex];
|
|
10154
|
+
if (isBusinessUnitCreation || !(associate !== null && associate !== void 0 && associate.id) || !(associate !== null && associate !== void 0 && (_associate$customer = associate.customer) !== null && _associate$customer !== void 0 && _associate$customer.id)) return;
|
|
10155
|
+
props.onAssociateRowClick({
|
|
10156
|
+
customerId: associate.customer.id
|
|
10157
|
+
});
|
|
10158
|
+
},
|
|
10159
|
+
rows: associatesToShow,
|
|
10160
|
+
wrapHeaderLabels: false
|
|
10161
|
+
})
|
|
10162
|
+
}), jsxRuntime.jsx(uiKit.Pagination, {
|
|
10163
|
+
onPageChange: page.onChange,
|
|
10164
|
+
onPerPageChange: perPage.onChange,
|
|
10165
|
+
page: page.value,
|
|
10166
|
+
perPage: perPage.value,
|
|
10167
|
+
perPageRange: "m",
|
|
10168
|
+
totalItems: filteredAssociates.length
|
|
10169
|
+
})]
|
|
10170
|
+
}) : jsxRuntime.jsx(EmptySearchResultsMessage, {})]
|
|
10171
|
+
}) : jsxRuntime.jsx(EmptyListMessage, {
|
|
10172
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
10173
|
+
onAddAssociateClick: props.onAddAssociateClick
|
|
10174
|
+
})
|
|
10175
|
+
})
|
|
10176
|
+
});
|
|
10177
|
+
};
|
|
10178
|
+
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
10179
|
+
|
|
10180
|
+
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "inheritedAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 831, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n inheritedAssociates {\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10181
|
+
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
10182
|
+
let id = _ref.id,
|
|
10183
|
+
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
10184
|
+
shouldExcludeAssociateRoleAssignmentsRoles = _ref.shouldExcludeAssociateRoleAssignmentsRoles;
|
|
10185
|
+
const _useQuery = hooks.useQuery(BusinessUnitAssociatesQuery, {
|
|
10186
|
+
context: {
|
|
10187
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
10188
|
+
},
|
|
10189
|
+
variables: {
|
|
10190
|
+
id,
|
|
10191
|
+
shouldExcludeRoles,
|
|
10192
|
+
shouldExcludeAssociateRoleAssignmentsRoles
|
|
10193
|
+
}
|
|
10194
|
+
}),
|
|
10195
|
+
loading = _useQuery.loading,
|
|
10196
|
+
data = _useQuery.data;
|
|
10197
|
+
return {
|
|
10198
|
+
isLoading: loading,
|
|
10199
|
+
businessUnit: data === null || data === void 0 ? void 0 : data.businessUnit
|
|
10200
|
+
};
|
|
10201
|
+
};
|
|
10202
|
+
|
|
10203
|
+
const useBusinessUnitAssociates = _ref => {
|
|
10204
|
+
let businessUnitId = _ref.businessUnitId,
|
|
10205
|
+
businessUnitsAssociateRolesFeatureEnabled = _ref.businessUnitsAssociateRolesFeatureEnabled;
|
|
10206
|
+
const businessUnitAssociatesFetcher = useBusinessUnitAssociatesFetcher({
|
|
10207
|
+
id: businessUnitId,
|
|
10208
|
+
shouldExcludeRoles: businessUnitsAssociateRolesFeatureEnabled,
|
|
10209
|
+
shouldExcludeAssociateRoleAssignmentsRoles: !businessUnitsAssociateRolesFeatureEnabled
|
|
10210
|
+
});
|
|
10211
|
+
return {
|
|
10212
|
+
businessUnitAssociatesFetcher: {
|
|
10213
|
+
isLoading: businessUnitAssociatesFetcher.isLoading,
|
|
10214
|
+
businessUnit: businessUnitAssociatesFetcher.businessUnit
|
|
10215
|
+
}
|
|
10216
|
+
};
|
|
10217
|
+
};
|
|
10218
|
+
|
|
10219
|
+
const BusinessUnitAssociatesList = props => {
|
|
10220
|
+
const businessUnitsAssociateRolesFeatureEnabled = applicationShell.useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
10221
|
+
const _useBusinessUnitAssoc = useBusinessUnitAssociates({
|
|
10222
|
+
businessUnitId: props.businessUnitId,
|
|
10223
|
+
businessUnitsAssociateRolesFeatureEnabled
|
|
10224
|
+
}),
|
|
10225
|
+
businessUnitAssociatesFetcher = _useBusinessUnitAssoc.businessUnitAssociatesFetcher;
|
|
10226
|
+
if (businessUnitAssociatesFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
10227
|
+
return jsxRuntime.jsx(BusinessUnitAssociatesListView, {
|
|
10228
|
+
businessUnitId: props.businessUnitId,
|
|
10229
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
10230
|
+
onAddAssociateClick: props.onAddAssociateClick,
|
|
10231
|
+
onAssociateRowClick: props.onAssociateRowClick,
|
|
10232
|
+
values: businessUnitAssociatesFetcher === null || businessUnitAssociatesFetcher === void 0 ? void 0 : businessUnitAssociatesFetcher.businessUnit
|
|
10233
|
+
});
|
|
10234
|
+
};
|
|
10235
|
+
BusinessUnitAssociatesList.displayName = 'BusinessUnitAssociatesList';
|
|
10236
|
+
|
|
9528
10237
|
function formatDiscount(discount, currencyCode, intl) {
|
|
9529
10238
|
var _context;
|
|
9530
10239
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
@@ -9662,17 +10371,17 @@ function validateFilter(_ref, intl) {
|
|
|
9662
10371
|
_ref$allowFloat = _ref.allowFloat,
|
|
9663
10372
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9664
10373
|
if (type !== 'range') {
|
|
9665
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
10374
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$O.integer);
|
|
9666
10375
|
return null;
|
|
9667
10376
|
}
|
|
9668
10377
|
|
|
9669
10378
|
// only range types from here
|
|
9670
10379
|
|
|
9671
10380
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9672
|
-
from: intl.formatMessage(messages$
|
|
10381
|
+
from: intl.formatMessage(messages$O.integer)
|
|
9673
10382
|
};
|
|
9674
10383
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9675
|
-
to: intl.formatMessage(messages$
|
|
10384
|
+
to: intl.formatMessage(messages$O.integer)
|
|
9676
10385
|
};
|
|
9677
10386
|
if (validateSingleFilter({
|
|
9678
10387
|
value: value.from
|
|
@@ -10160,9 +10869,16 @@ function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
10160
10869
|
const PlatformLimitsStatusText = _ref => {
|
|
10161
10870
|
let intlMessage = _ref.intlMessage,
|
|
10162
10871
|
children = _ref.children;
|
|
10163
|
-
return jsxRuntime.
|
|
10164
|
-
as: "
|
|
10165
|
-
children:
|
|
10872
|
+
return jsxRuntime.jsx(uiKit.Text.Headline, {
|
|
10873
|
+
as: "h2",
|
|
10874
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
10875
|
+
size: "xs",
|
|
10876
|
+
children: [jsxRuntime.jsx("span", {
|
|
10877
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
10878
|
+
}), jsxRuntime.jsx("span", {
|
|
10879
|
+
children: children
|
|
10880
|
+
})]
|
|
10881
|
+
})
|
|
10166
10882
|
});
|
|
10167
10883
|
};
|
|
10168
10884
|
PlatformLimitsStatusText.displayName = 'PlatformLimitsStatusText';
|
|
@@ -10286,7 +11002,7 @@ var messages$k = reactIntl.defineMessages({
|
|
|
10286
11002
|
});
|
|
10287
11003
|
|
|
10288
11004
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
10289
|
-
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4
|
|
11005
|
+
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4;
|
|
10290
11006
|
let total = _ref.total;
|
|
10291
11007
|
const intl = reactIntl.useIntl();
|
|
10292
11008
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
@@ -10294,12 +11010,13 @@ const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
|
10294
11010
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 ? void 0 : (_platformLimits$shipp2 = _platformLimits$shipp.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.current;
|
|
10295
11011
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp3 = platformLimits.shippingMethods) === null || _platformLimits$shipp3 === void 0 ? void 0 : (_platformLimits$shipp4 = _platformLimits$shipp3.total) === null || _platformLimits$shipp4 === void 0 ? void 0 : _platformLimits$shipp4.limit;
|
|
10296
11012
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
10297
|
-
|
|
11013
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
11014
|
+
children: getPlatformLimitsStatus({
|
|
10298
11015
|
limit,
|
|
10299
11016
|
current,
|
|
10300
11017
|
total,
|
|
10301
11018
|
intl
|
|
10302
|
-
})
|
|
11019
|
+
})
|
|
10303
11020
|
});
|
|
10304
11021
|
};
|
|
10305
11022
|
PlatformLimitsShippingMethodsStatus.displayName = 'PlatformLimitsShippingMethodsStatus';
|
|
@@ -10432,7 +11149,7 @@ var messages$i = reactIntl.defineMessages({
|
|
|
10432
11149
|
});
|
|
10433
11150
|
|
|
10434
11151
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
10435
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4
|
|
11152
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4;
|
|
10436
11153
|
let total = _ref.total;
|
|
10437
11154
|
const intl = reactIntl.useIntl();
|
|
10438
11155
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
@@ -10440,12 +11157,13 @@ const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
|
10440
11157
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 ? void 0 : (_platformLimits$taxCa2 = _platformLimits$taxCa.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.current;
|
|
10441
11158
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa3 = platformLimits.taxCategories) === null || _platformLimits$taxCa3 === void 0 ? void 0 : (_platformLimits$taxCa4 = _platformLimits$taxCa3.total) === null || _platformLimits$taxCa4 === void 0 ? void 0 : _platformLimits$taxCa4.limit;
|
|
10442
11159
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
10443
|
-
|
|
11160
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
11161
|
+
children: getPlatformLimitsStatus({
|
|
10444
11162
|
limit,
|
|
10445
11163
|
current,
|
|
10446
11164
|
total,
|
|
10447
11165
|
intl
|
|
10448
|
-
})
|
|
11166
|
+
})
|
|
10449
11167
|
});
|
|
10450
11168
|
};
|
|
10451
11169
|
PlatformLimitsTaxCategoriesStatus.displayName = 'PlatformLimitsTaxCategoriesStatus';
|
|
@@ -10573,12 +11291,12 @@ var messages$g = reactIntl.defineMessages({
|
|
|
10573
11291
|
zonesStatus: {
|
|
10574
11292
|
id: 'PlatformLimits.Status.zones',
|
|
10575
11293
|
description: 'The message for zones platform limit values',
|
|
10576
|
-
defaultMessage: 'Zones
|
|
11294
|
+
defaultMessage: 'Zones'
|
|
10577
11295
|
}
|
|
10578
11296
|
});
|
|
10579
11297
|
|
|
10580
11298
|
const PlatformLimitsZonesStatus = _ref => {
|
|
10581
|
-
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4
|
|
11299
|
+
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4;
|
|
10582
11300
|
let total = _ref.total;
|
|
10583
11301
|
const intl = reactIntl.useIntl();
|
|
10584
11302
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
@@ -10586,12 +11304,13 @@ const PlatformLimitsZonesStatus = _ref => {
|
|
|
10586
11304
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 ? void 0 : (_platformLimits$zones2 = _platformLimits$zones.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.current;
|
|
10587
11305
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones3 = platformLimits.zones) === null || _platformLimits$zones3 === void 0 ? void 0 : (_platformLimits$zones4 = _platformLimits$zones3.total) === null || _platformLimits$zones4 === void 0 ? void 0 : _platformLimits$zones4.limit;
|
|
10588
11306
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
10589
|
-
|
|
11307
|
+
intlMessage: messages$g.zonesStatus,
|
|
11308
|
+
children: getPlatformLimitsStatus({
|
|
10590
11309
|
limit,
|
|
10591
11310
|
current,
|
|
10592
11311
|
total,
|
|
10593
11312
|
intl
|
|
10594
|
-
})
|
|
11313
|
+
})
|
|
10595
11314
|
});
|
|
10596
11315
|
};
|
|
10597
11316
|
PlatformLimitsZonesStatus.displayName = 'PlatformLimitsZonesStatus';
|
|
@@ -12034,6 +12753,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
12034
12753
|
return jsxRuntime.jsx("div", {
|
|
12035
12754
|
className: styles$4.container,
|
|
12036
12755
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
12756
|
+
menuHorizontalConstraint: 5,
|
|
12037
12757
|
options: props.options,
|
|
12038
12758
|
value: {
|
|
12039
12759
|
text: searchText,
|
|
@@ -12194,7 +12914,7 @@ const validateRequired = value => {
|
|
|
12194
12914
|
};
|
|
12195
12915
|
const VALIDATOR_REQUIRED = {
|
|
12196
12916
|
name: 'required',
|
|
12197
|
-
message: messages$
|
|
12917
|
+
message: messages$O.required,
|
|
12198
12918
|
permanent: true,
|
|
12199
12919
|
validators: {
|
|
12200
12920
|
change(value) {
|
|
@@ -12208,7 +12928,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
12208
12928
|
};
|
|
12209
12929
|
const VALIDATOR_NUMERIC = {
|
|
12210
12930
|
name: 'numeric',
|
|
12211
|
-
message: messages$
|
|
12931
|
+
message: messages$O.numeric,
|
|
12212
12932
|
permanent: false,
|
|
12213
12933
|
validators: {
|
|
12214
12934
|
change: v => {
|
|
@@ -12223,7 +12943,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
12223
12943
|
};
|
|
12224
12944
|
const VALIDATOR_INTEGER = {
|
|
12225
12945
|
name: 'integer',
|
|
12226
|
-
message: messages$
|
|
12946
|
+
message: messages$O.integer,
|
|
12227
12947
|
permanent: false,
|
|
12228
12948
|
validators: {
|
|
12229
12949
|
change: v => {
|
|
@@ -12238,7 +12958,7 @@ const VALIDATOR_INTEGER = {
|
|
|
12238
12958
|
};
|
|
12239
12959
|
({
|
|
12240
12960
|
name: 'email',
|
|
12241
|
-
message: messages$
|
|
12961
|
+
message: messages$O.email,
|
|
12242
12962
|
permanent: false,
|
|
12243
12963
|
validators: {
|
|
12244
12964
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -13166,17 +13886,17 @@ function isValidISODateTime(_ref3) {
|
|
|
13166
13886
|
}
|
|
13167
13887
|
|
|
13168
13888
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
13169
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
13889
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$O.required);
|
|
13170
13890
|
return null;
|
|
13171
13891
|
};
|
|
13172
13892
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
13173
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
13893
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$O.required);
|
|
13174
13894
|
return null;
|
|
13175
13895
|
};
|
|
13176
13896
|
|
|
13177
13897
|
// eslint-disable-next-line import/prefer-default-export
|
|
13178
13898
|
const validateText = (text, intl) => {
|
|
13179
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
13899
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$O.required);
|
|
13180
13900
|
return null;
|
|
13181
13901
|
};
|
|
13182
13902
|
|
|
@@ -13258,11 +13978,6 @@ const not = function () {
|
|
|
13258
13978
|
};
|
|
13259
13979
|
};
|
|
13260
13980
|
|
|
13261
|
-
const safelyAddFallback = function (string) {
|
|
13262
|
-
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.NO_VALUE_FALLBACK;
|
|
13263
|
-
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
13264
|
-
};
|
|
13265
|
-
|
|
13266
13981
|
var messages = reactIntl.defineMessages({
|
|
13267
13982
|
booleanAttributeTrue: {
|
|
13268
13983
|
id: 'Products.ProductList.column.booleanTrue',
|
|
@@ -13653,6 +14368,8 @@ function withPendingRequests() {
|
|
|
13653
14368
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "slugAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
13654
14369
|
|
|
13655
14370
|
exports.BooleanField = booleanField;
|
|
14371
|
+
exports.BusinessUnitAssociatesList = BusinessUnitAssociatesList;
|
|
14372
|
+
exports.BusinessUnitAssociatesListView = BusinessUnitAssociatesListView;
|
|
13656
14373
|
exports.BusinessUnitSelectField = BusinessUnitSelectField;
|
|
13657
14374
|
exports.BusinessUnitSelectInput = BusinessUnitSelectInput;
|
|
13658
14375
|
exports.Button = Button;
|
|
@@ -13703,7 +14420,7 @@ exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
|
13703
14420
|
exports.base64ToString = base64ToString;
|
|
13704
14421
|
exports.booleanMessages = messages$8;
|
|
13705
14422
|
exports.buildSearchQuery = buildSearchQuery;
|
|
13706
|
-
exports.businessRoleMessages = messages$
|
|
14423
|
+
exports.businessRoleMessages = messages$v;
|
|
13707
14424
|
exports.businessRoles = businessRoleKeys;
|
|
13708
14425
|
exports.capitalizeFirst = capitalizeFirst;
|
|
13709
14426
|
exports.clone = clone;
|
|
@@ -13804,7 +14521,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
13804
14521
|
exports.safelyAddFallback = safelyAddFallback;
|
|
13805
14522
|
exports.sanitize = sanitize;
|
|
13806
14523
|
exports.searchCategories = searchCategories;
|
|
13807
|
-
exports.searchInputMessages = messages$
|
|
14524
|
+
exports.searchInputMessages = messages$J;
|
|
13808
14525
|
exports.setDisplayName = setDisplayName;
|
|
13809
14526
|
exports.setToArray = setToArray;
|
|
13810
14527
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13856,7 +14573,7 @@ exports.validateNumber = validateFilter;
|
|
|
13856
14573
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13857
14574
|
exports.validateText = validateText;
|
|
13858
14575
|
exports.validatedInput = validatedInput;
|
|
13859
|
-
exports.validationMessages = messages$
|
|
14576
|
+
exports.validationMessages = messages$O;
|
|
13860
14577
|
exports.withPendingRequests = withPendingRequests;
|
|
13861
14578
|
exports.withProps = withProps;
|
|
13862
14579
|
exports.withRedirectTo = withRedirectTo;
|