@commercetools-frontend/experimental-components 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +692 -489
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +692 -489
- package/dist/commercetools-frontend-experimental-components.esm.js +685 -484
- package/dist/styles.css +251 -251
- package/package.json +18 -18
|
@@ -75,6 +75,7 @@ var sdk = require('@commercetools-frontend/sdk');
|
|
|
75
75
|
var client = require('@apollo/client');
|
|
76
76
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
77
77
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
78
|
+
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
78
79
|
var omit = require('lodash/omit');
|
|
79
80
|
var isEmpty$3 = require('lodash/isEmpty');
|
|
80
81
|
var _Object$freeze = require('@babel/runtime-corejs3/core-js-stable/object/freeze');
|
|
@@ -101,7 +102,6 @@ var _ = require('@commercetools-frontend/ui-kit/');
|
|
|
101
102
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
102
103
|
var memoize = require('memoize-one');
|
|
103
104
|
var utils = require('@commercetools-uikit/utils');
|
|
104
|
-
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
105
105
|
var flatMap = require('lodash/flatMap');
|
|
106
106
|
var reactRedux = require('react-redux');
|
|
107
107
|
var commonTags = require('common-tags');
|
|
@@ -162,6 +162,7 @@ var Textarea__default = /*#__PURE__*/_interopDefault(Textarea);
|
|
|
162
162
|
var has__default = /*#__PURE__*/_interopDefault(has);
|
|
163
163
|
var _reverseInstanceProperty__default = /*#__PURE__*/_interopDefault(_reverseInstanceProperty);
|
|
164
164
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
165
|
+
var _parseFloat__default = /*#__PURE__*/_interopDefault(_parseFloat);
|
|
165
166
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
166
167
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty$3);
|
|
167
168
|
var _Object$freeze__default = /*#__PURE__*/_interopDefault(_Object$freeze);
|
|
@@ -182,7 +183,6 @@ var times__default = /*#__PURE__*/_interopDefault(times);
|
|
|
182
183
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
183
184
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
184
185
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
185
|
-
var _parseFloat__default = /*#__PURE__*/_interopDefault(_parseFloat);
|
|
186
186
|
var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
|
|
187
187
|
var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
188
188
|
var _Number$isNaN__default = /*#__PURE__*/_interopDefault(_Number$isNaN);
|
|
@@ -375,7 +375,7 @@ function uniqueObjects(items) {
|
|
|
375
375
|
|
|
376
376
|
*/
|
|
377
377
|
|
|
378
|
-
const messages$
|
|
378
|
+
const messages$K = reactIntl.defineMessages({
|
|
379
379
|
unique: {
|
|
380
380
|
id: 'Validation.unique',
|
|
381
381
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1670,8 +1670,8 @@ const getData = (code, field) => {
|
|
|
1670
1670
|
};
|
|
1671
1671
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1672
1672
|
|
|
1673
|
-
function ownKeys$
|
|
1674
|
-
function _objectSpread$
|
|
1673
|
+
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; }
|
|
1674
|
+
function _objectSpread$1k(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$1k(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$1k(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1675
1675
|
function formatMoneyRangeValue(value, intl) {
|
|
1676
1676
|
var _context;
|
|
1677
1677
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1681,7 +1681,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1681
1681
|
return '';
|
|
1682
1682
|
}
|
|
1683
1683
|
function formatMoneyValue(amount, currency, intl) {
|
|
1684
|
-
return formatMoney$1(_objectSpread$
|
|
1684
|
+
return formatMoney$1(_objectSpread$1k({
|
|
1685
1685
|
centAmount: amount,
|
|
1686
1686
|
fractionDigits: getFractionDigit(currency)
|
|
1687
1687
|
}, currency ? {
|
|
@@ -1698,14 +1698,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1700
1700
|
var _moneyValue$fractione;
|
|
1701
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1701
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1k({
|
|
1702
1702
|
style: 'currency',
|
|
1703
1703
|
currency: moneyValue.currencyCode,
|
|
1704
1704
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1705
1705
|
}, options));
|
|
1706
1706
|
}
|
|
1707
1707
|
|
|
1708
|
-
var messages$
|
|
1708
|
+
var messages$J = reactIntl.defineMessages({
|
|
1709
1709
|
booleanYes: {
|
|
1710
1710
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1711
1711
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1790,7 +1790,7 @@ const formatDateTime = _ref7 => {
|
|
|
1790
1790
|
const formatBoolean = _ref8 => {
|
|
1791
1791
|
let value = _ref8.value,
|
|
1792
1792
|
intl = _ref8.intl;
|
|
1793
|
-
return value ? intl.formatMessage(messages$
|
|
1793
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1794
1794
|
};
|
|
1795
1795
|
const formatNilType = _ref9 => {
|
|
1796
1796
|
let value = _ref9.value,
|
|
@@ -1952,8 +1952,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1952
1952
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1953
1953
|
};
|
|
1954
1954
|
|
|
1955
|
-
function ownKeys$
|
|
1956
|
-
function _objectSpread$
|
|
1955
|
+
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; }
|
|
1956
|
+
function _objectSpread$1j(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$1j(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$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1957
1957
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1958
1958
|
const WithDataTablePaginationState = props => {
|
|
1959
1959
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1964,10 +1964,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1964
1964
|
page = _usePaginationState.page,
|
|
1965
1965
|
perPage = _usePaginationState.perPage;
|
|
1966
1966
|
const tableSorting = uiKit.useDataTableSortingState({
|
|
1967
|
-
key: initialValues === null || initialValues === void 0
|
|
1968
|
-
order: initialValues === null || initialValues === void 0
|
|
1967
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1968
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1969
1969
|
});
|
|
1970
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1970
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1971
1971
|
dataTablePaginationState: {
|
|
1972
1972
|
page,
|
|
1973
1973
|
perPage,
|
|
@@ -1979,8 +1979,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1979
1979
|
return WithDataTablePaginationState;
|
|
1980
1980
|
};
|
|
1981
1981
|
|
|
1982
|
-
function ownKeys$
|
|
1983
|
-
function _objectSpread$
|
|
1982
|
+
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; }
|
|
1983
|
+
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; }
|
|
1984
1984
|
const injectNotifications = function () {
|
|
1985
1985
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1986
1986
|
return Component => {
|
|
@@ -1995,7 +1995,7 @@ const injectNotifications = function () {
|
|
|
1995
1995
|
onActionError,
|
|
1996
1996
|
hideAllPageNotifications
|
|
1997
1997
|
};
|
|
1998
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1998
|
+
return jsxRuntime.jsx(Component, _objectSpread$1i(_objectSpread$1i({}, props), {}, {
|
|
1999
1999
|
[propName]: notifications
|
|
2000
2000
|
}));
|
|
2001
2001
|
};
|
|
@@ -2004,22 +2004,22 @@ const injectNotifications = function () {
|
|
|
2004
2004
|
};
|
|
2005
2005
|
};
|
|
2006
2006
|
|
|
2007
|
-
function ownKeys$
|
|
2008
|
-
function _objectSpread$
|
|
2007
|
+
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; }
|
|
2008
|
+
function _objectSpread$1h(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$1h(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$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2009
2009
|
function isPropsMapper(mapProps) {
|
|
2010
2010
|
return typeof mapProps === 'function';
|
|
2011
2011
|
}
|
|
2012
2012
|
const withProps = mapProps => Component => {
|
|
2013
2013
|
const EnhancedWithProps = ownProps => {
|
|
2014
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2015
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2014
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps(ownProps)) : _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps);
|
|
2015
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h({}, enhancedProps));
|
|
2016
2016
|
};
|
|
2017
2017
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2018
2018
|
return EnhancedWithProps;
|
|
2019
2019
|
};
|
|
2020
2020
|
|
|
2021
|
-
function ownKeys$
|
|
2022
|
-
function _objectSpread$
|
|
2021
|
+
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; }
|
|
2022
|
+
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; }
|
|
2023
2023
|
const useRedirectEffect = _ref => {
|
|
2024
2024
|
let goTo = _ref.goTo;
|
|
2025
2025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2039,30 +2039,30 @@ const defaultOptions$5 = {
|
|
|
2039
2039
|
skip: () => false
|
|
2040
2040
|
};
|
|
2041
2041
|
const withRedirectTo = options => Component => {
|
|
2042
|
-
const mergedOptions = _objectSpread$
|
|
2042
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$5), options);
|
|
2043
2043
|
const WithRedirectTo = props => {
|
|
2044
2044
|
if (!mergedOptions.skip(props)) {
|
|
2045
2045
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2046
2046
|
goTo: options.selectGoTo(props)
|
|
2047
2047
|
});
|
|
2048
2048
|
}
|
|
2049
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2049
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g({}, props));
|
|
2050
2050
|
};
|
|
2051
2051
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2052
2052
|
return WithRedirectTo;
|
|
2053
2053
|
};
|
|
2054
2054
|
|
|
2055
|
-
function ownKeys$
|
|
2056
|
-
function _objectSpread$
|
|
2055
|
+
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; }
|
|
2056
|
+
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; }
|
|
2057
2057
|
const defaultOptions$4 = {
|
|
2058
2058
|
propName: 'modalState',
|
|
2059
2059
|
isInitiallyOpen: false
|
|
2060
2060
|
};
|
|
2061
2061
|
const injectModalState$1 = options => Component => {
|
|
2062
|
-
const mergedOptions = _objectSpread$
|
|
2062
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$4), options);
|
|
2063
2063
|
const WithModalState = props => {
|
|
2064
2064
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2065
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2065
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2066
2066
|
[mergedOptions.propName]: modalState
|
|
2067
2067
|
}));
|
|
2068
2068
|
};
|
|
@@ -2070,17 +2070,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2070
2070
|
return WithModalState;
|
|
2071
2071
|
};
|
|
2072
2072
|
|
|
2073
|
-
function ownKeys$
|
|
2074
|
-
function _objectSpread$
|
|
2073
|
+
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; }
|
|
2074
|
+
function _objectSpread$1e(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$1e(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$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2075
2075
|
const defaultOptions$3 = {
|
|
2076
2076
|
propName: 'toggleState',
|
|
2077
2077
|
isInitiallyOpen: false
|
|
2078
2078
|
};
|
|
2079
2079
|
const injectModalState = options => Component => {
|
|
2080
|
-
const mergedOptions = _objectSpread$
|
|
2080
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$3), options);
|
|
2081
2081
|
const WithToggleState = props => {
|
|
2082
2082
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2083
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2083
|
+
return jsxRuntime.jsx(Component, _objectSpread$1e(_objectSpread$1e({}, props), {}, {
|
|
2084
2084
|
[mergedOptions.propName]: toggleState
|
|
2085
2085
|
}));
|
|
2086
2086
|
};
|
|
@@ -2088,8 +2088,8 @@ const injectModalState = options => Component => {
|
|
|
2088
2088
|
return WithToggleState;
|
|
2089
2089
|
};
|
|
2090
2090
|
|
|
2091
|
-
function ownKeys$
|
|
2092
|
-
function _objectSpread$
|
|
2091
|
+
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; }
|
|
2092
|
+
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; }
|
|
2093
2093
|
const defaultOptions$2 = {
|
|
2094
2094
|
storageType: 'local',
|
|
2095
2095
|
segregateByUser: true
|
|
@@ -2107,7 +2107,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2107
2107
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2108
2108
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2109
2109
|
var _context;
|
|
2110
|
-
const mergedOptions = _objectSpread$
|
|
2110
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$2), options);
|
|
2111
2111
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2112
2112
|
var _context$user;
|
|
2113
2113
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2155,8 +2155,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2155
2155
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2156
2156
|
};
|
|
2157
2157
|
|
|
2158
|
-
function ownKeys$
|
|
2159
|
-
function _objectSpread$
|
|
2158
|
+
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; }
|
|
2159
|
+
function _objectSpread$1c(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$1c(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$1c(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2160
2160
|
const defaultOptions$1 = {
|
|
2161
2161
|
propName: 'storage',
|
|
2162
2162
|
storageKey: '',
|
|
@@ -2169,7 +2169,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2169
2169
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2170
2170
|
* argument position does not allow passing specification of option(s).
|
|
2171
2171
|
*/
|
|
2172
|
-
const mergedOptions = _objectSpread$
|
|
2172
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$1), options);
|
|
2173
2173
|
const WithStorage = props => {
|
|
2174
2174
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2175
2175
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2183,7 +2183,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2183
2183
|
readFromStorage
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2186
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1c(_objectSpread$1c({}, props), storageProp));
|
|
2187
2187
|
};
|
|
2188
2188
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2189
2189
|
return WithStorage;
|
|
@@ -2227,8 +2227,8 @@ const usePrevious = value => {
|
|
|
2227
2227
|
return ref.current;
|
|
2228
2228
|
};
|
|
2229
2229
|
|
|
2230
|
-
function ownKeys$
|
|
2231
|
-
function _objectSpread$
|
|
2230
|
+
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; }
|
|
2231
|
+
function _objectSpread$1b(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$1b(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$1b(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2232
2232
|
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: "type" }, 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: 1089, 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 type\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2233
2233
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2234
2234
|
var _storesQueryResult$re;
|
|
@@ -2239,7 +2239,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2239
2239
|
offset: storesQueryResult.offset,
|
|
2240
2240
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2241
2241
|
var _store$productSelecti;
|
|
2242
|
-
return _objectSpread$
|
|
2242
|
+
return _objectSpread$1b(_objectSpread$1b({}, store), {}, {
|
|
2243
2243
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2244
2244
|
});
|
|
2245
2245
|
})
|
|
@@ -2247,7 +2247,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2247
2247
|
};
|
|
2248
2248
|
const createQueryVariables$6 = ownProps => {
|
|
2249
2249
|
var _context;
|
|
2250
|
-
return _objectSpread$
|
|
2250
|
+
return _objectSpread$1b(_objectSpread$1b({
|
|
2251
2251
|
limit: ownProps.limit,
|
|
2252
2252
|
offset: ownProps.offset,
|
|
2253
2253
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2402,8 +2402,8 @@ function useDidFormValidationFail() {
|
|
|
2402
2402
|
return Boolean(didFormValidationFail);
|
|
2403
2403
|
}
|
|
2404
2404
|
|
|
2405
|
-
function ownKeys$
|
|
2406
|
-
function _objectSpread$
|
|
2405
|
+
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; }
|
|
2406
|
+
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; }
|
|
2407
2407
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2408
2408
|
const defaultOptions = {
|
|
2409
2409
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2431,7 +2431,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2431
2431
|
};
|
|
2432
2432
|
const usePersistedReminder = function () {
|
|
2433
2433
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2434
|
-
const mergedOptions = _objectSpread$
|
|
2434
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions), options);
|
|
2435
2435
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2436
2436
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2437
2437
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2477,7 +2477,7 @@ const usePersistedReminder = function () {
|
|
|
2477
2477
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2478
2478
|
};
|
|
2479
2479
|
|
|
2480
|
-
var messages$
|
|
2480
|
+
var messages$I = reactIntl.defineMessages({
|
|
2481
2481
|
profileUpdated: {
|
|
2482
2482
|
id: 'NotificationText.profileUpdated',
|
|
2483
2483
|
description: 'Label for the notification header',
|
|
@@ -2495,8 +2495,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2495
2495
|
}
|
|
2496
2496
|
});
|
|
2497
2497
|
|
|
2498
|
-
function ownKeys$
|
|
2499
|
-
function _objectSpread$
|
|
2498
|
+
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; }
|
|
2499
|
+
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; }
|
|
2500
2500
|
const LinkToProfile = props => {
|
|
2501
2501
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2502
2502
|
to: "/account/profile",
|
|
@@ -2514,9 +2514,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2514
2514
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2515
2515
|
as: "p",
|
|
2516
2516
|
isBold: true,
|
|
2517
|
-
intlMessage: messages$
|
|
2517
|
+
intlMessage: messages$I.profileUpdated
|
|
2518
2518
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2519
|
-
intlMessage: _objectSpread$
|
|
2519
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.addMoreInformation), {}, {
|
|
2520
2520
|
values: {
|
|
2521
2521
|
newline: getNewLine
|
|
2522
2522
|
}
|
|
@@ -2525,7 +2525,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2525
2525
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2526
2526
|
scale: "xs",
|
|
2527
2527
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2528
|
-
intlMessage: _objectSpread$
|
|
2528
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.informationAndProfileLink), {}, {
|
|
2529
2529
|
values: {
|
|
2530
2530
|
newline: getNewLine,
|
|
2531
2531
|
link: getLinkToProfile
|
|
@@ -2646,7 +2646,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2646
2646
|
}, [ref]);
|
|
2647
2647
|
};
|
|
2648
2648
|
|
|
2649
|
-
var messages$
|
|
2649
|
+
var messages$H = reactIntl.defineMessages({
|
|
2650
2650
|
fallbackHint: {
|
|
2651
2651
|
id: 'KeyFallback.fallbackHint',
|
|
2652
2652
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2670,7 +2670,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2670
2670
|
return values => {
|
|
2671
2671
|
if (!values.resource) return null;
|
|
2672
2672
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2673
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2673
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2674
2674
|
key: values.resource.key
|
|
2675
2675
|
});
|
|
2676
2676
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2682,8 +2682,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2682
2682
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2683
2683
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2684
2684
|
|
|
2685
|
-
function ownKeys$
|
|
2686
|
-
function _objectSpread$
|
|
2685
|
+
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; }
|
|
2686
|
+
function _objectSpread$18(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$18(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$18(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2687
2687
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2688
2688
|
const updatedColumnProps = {};
|
|
2689
2689
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2703,14 +2703,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2703
2703
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2704
2704
|
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 => {
|
|
2705
2705
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2706
|
-
return _objectSpread$
|
|
2706
|
+
return _objectSpread$18(_objectSpread$18({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2707
2707
|
});
|
|
2708
2708
|
};
|
|
2709
2709
|
const handleCacheUpdate = _ref2 => {
|
|
2710
2710
|
let update = _ref2.update,
|
|
2711
2711
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2712
2712
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2713
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2713
|
+
return updateCachedTableConfiguration(_objectSpread$18(_objectSpread$18({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2714
2714
|
};
|
|
2715
2715
|
|
|
2716
2716
|
// Signature:
|
|
@@ -2739,7 +2739,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2739
2739
|
return {
|
|
2740
2740
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2741
2741
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2742
|
-
return _objectSpread$
|
|
2742
|
+
return _objectSpread$18({
|
|
2743
2743
|
key: visibleColumnKey
|
|
2744
2744
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2745
2745
|
}),
|
|
@@ -2795,7 +2795,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2795
2795
|
data = _useQuery.data;
|
|
2796
2796
|
return {
|
|
2797
2797
|
isLoading: loading,
|
|
2798
|
-
total: data === null || data === void 0
|
|
2798
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2799
2799
|
};
|
|
2800
2800
|
};
|
|
2801
2801
|
|
|
@@ -2810,14 +2810,14 @@ const handlers$4 = {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
};
|
|
2812
2812
|
|
|
2813
|
-
function ownKeys$
|
|
2814
|
-
function _objectSpread$
|
|
2813
|
+
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; }
|
|
2814
|
+
function _objectSpread$17(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$17(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$17(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2815
2815
|
|
|
2816
2816
|
// eslint-disable-next-line import/prefer-default-export
|
|
2817
2817
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2818
2818
|
var _context;
|
|
2819
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2820
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2819
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
|
|
2820
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$17({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2821
2821
|
from: 'nameAllLocales',
|
|
2822
2822
|
to: 'name'
|
|
2823
2823
|
}])))
|
|
@@ -2967,7 +2967,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
2967
2967
|
});
|
|
2968
2968
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2969
2969
|
|
|
2970
|
-
var messages$
|
|
2970
|
+
var messages$G = reactIntl.defineMessages({
|
|
2971
2971
|
noChannelsFound: {
|
|
2972
2972
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2973
2973
|
description: 'The message to display when no channels were found',
|
|
@@ -2993,8 +2993,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2993
2993
|
}
|
|
2994
2994
|
});
|
|
2995
2995
|
|
|
2996
|
-
function ownKeys$
|
|
2997
|
-
function _objectSpread$
|
|
2996
|
+
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; }
|
|
2997
|
+
function _objectSpread$16(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$16(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$16(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2998
2998
|
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 } } } };
|
|
2999
2999
|
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 } } } };
|
|
3000
3000
|
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 } } } };
|
|
@@ -3015,7 +3015,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3015
3015
|
const _useIntl = reactIntl.useIntl(),
|
|
3016
3016
|
formatMessage = _useIntl.formatMessage;
|
|
3017
3017
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3018
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3018
|
+
const variables = React.useMemo(() => _objectSpread$16({
|
|
3019
3019
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3020
3020
|
}, role && {
|
|
3021
3021
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3076,8 +3076,8 @@ const ChannelPickerInput = _ref => {
|
|
|
3076
3076
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3077
3077
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3078
3078
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3079
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3080
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3079
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3080
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
3081
3081
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3082
3082
|
max: "scale",
|
|
3083
3083
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3087,7 +3087,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3087
3087
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3088
3088
|
id: name,
|
|
3089
3089
|
name: name,
|
|
3090
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3090
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3091
3091
|
loadOptions: loadOptionsDebounced,
|
|
3092
3092
|
defaultOptions: true,
|
|
3093
3093
|
showOptionGroupDivider: true,
|
|
@@ -3130,7 +3130,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3130
3130
|
var _this$props;
|
|
3131
3131
|
let user = _ref.user;
|
|
3132
3132
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3133
|
-
timeZone: (this === null || this === void 0
|
|
3133
|
+
timeZone: (this === null || this === void 0 || (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.timeZone) || (user === null || user === void 0 ? void 0 : user.timeZone),
|
|
3134
3134
|
locale: this.props.intl.locale
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
@@ -3144,8 +3144,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3144
3144
|
|
|
3145
3145
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3146
3146
|
|
|
3147
|
-
function ownKeys$
|
|
3148
|
-
function _objectSpread$
|
|
3147
|
+
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; }
|
|
3148
|
+
function _objectSpread$15(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$15(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$15(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3149
3149
|
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); }; }
|
|
3150
3150
|
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; } }
|
|
3151
3151
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3177,7 +3177,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3177
3177
|
handleMouseOver: this.handleMouseOver,
|
|
3178
3178
|
handleMouseOut: this.handleMouseOut
|
|
3179
3179
|
};
|
|
3180
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3180
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$15({}, _objectSpread$15(_objectSpread$15({}, this.props), injectedProps)));
|
|
3181
3181
|
}
|
|
3182
3182
|
}]);
|
|
3183
3183
|
return WithMouseOverState;
|
|
@@ -3186,8 +3186,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3186
3186
|
return WithMouseOverState;
|
|
3187
3187
|
};
|
|
3188
3188
|
|
|
3189
|
-
function ownKeys$
|
|
3190
|
-
function _objectSpread$
|
|
3189
|
+
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; }
|
|
3190
|
+
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; }
|
|
3191
3191
|
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); }; }
|
|
3192
3192
|
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; } }
|
|
3193
3193
|
var styles$h = {
|
|
@@ -3298,7 +3298,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3298
3298
|
}, {
|
|
3299
3299
|
key: "render",
|
|
3300
3300
|
value: function render() {
|
|
3301
|
-
const commonProps = _objectSpread$
|
|
3301
|
+
const commonProps = _objectSpread$14(_objectSpread$14({
|
|
3302
3302
|
value: this.state.draftValue,
|
|
3303
3303
|
autoComplete: this.props.autoComplete,
|
|
3304
3304
|
onChange: this.handleChange,
|
|
@@ -3317,7 +3317,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3317
3317
|
htmlFor: inputId,
|
|
3318
3318
|
children: this.props.label
|
|
3319
3319
|
})
|
|
3320
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3320
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3321
3321
|
id: inputId,
|
|
3322
3322
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3323
3323
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3326,7 +3326,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3326
3326
|
rows: 1,
|
|
3327
3327
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3328
3328
|
cacheMeasurements: true
|
|
3329
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3329
|
+
})) : jsxRuntime.jsx("input", _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3330
3330
|
id: inputId,
|
|
3331
3331
|
ref: this.props.inputRef,
|
|
3332
3332
|
type: this.props.as,
|
|
@@ -3353,7 +3353,7 @@ ThrottledField.defaultProps = {
|
|
|
3353
3353
|
label: 'Throttled field'
|
|
3354
3354
|
};
|
|
3355
3355
|
|
|
3356
|
-
var messages$
|
|
3356
|
+
var messages$F = reactIntl.defineMessages({
|
|
3357
3357
|
buttonLabel: {
|
|
3358
3358
|
id: 'SearchInput.buttonLabel',
|
|
3359
3359
|
description: 'Label for "Search" button.',
|
|
@@ -3460,7 +3460,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3460
3460
|
"data-testid": this.props.testId || 'search-input',
|
|
3461
3461
|
value: this.state.text,
|
|
3462
3462
|
label: this.props.label,
|
|
3463
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3463
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3464
3464
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3465
3465
|
onChange: this.handleInputChange,
|
|
3466
3466
|
onEnter: this.handleEnter,
|
|
@@ -3553,7 +3553,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3553
3553
|
const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
|
|
3554
3554
|
var _result$hits$map, _result$hits;
|
|
3555
3555
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3556
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3556
|
+
const ids = (_result$hits$map = result === null || result === void 0 || (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _mapInstanceProperty__default["default"](_result$hits).call(_result$hits, hit => hit.id)) !== null && _result$hits$map !== void 0 ? _result$hits$map : [];
|
|
3557
3557
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3558
3558
|
if (ids.length === 0) {
|
|
3559
3559
|
return {
|
|
@@ -3636,7 +3636,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3636
3636
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3637
3637
|
};
|
|
3638
3638
|
const usePimStatus = () => {
|
|
3639
|
-
var _data$indicesExist
|
|
3639
|
+
var _data$indicesExist;
|
|
3640
3640
|
const _useQuery = react.useQuery(FetchIndicesExist$1, {
|
|
3641
3641
|
context: {
|
|
3642
3642
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3646,7 +3646,7 @@ const usePimStatus = () => {
|
|
|
3646
3646
|
data = _useQuery.data;
|
|
3647
3647
|
return {
|
|
3648
3648
|
data,
|
|
3649
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3649
|
+
isProjectIndexed: Boolean(data === null || data === void 0 || (_data$indicesExist = data.indicesExist) === null || _data$indicesExist === void 0 || (_data$indicesExist = _data$indicesExist.productTypes) === null || _data$indicesExist === void 0 ? void 0 : _data$indicesExist.searchableIndexExists)
|
|
3650
3650
|
};
|
|
3651
3651
|
};
|
|
3652
3652
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3675,7 +3675,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3675
3675
|
};
|
|
3676
3676
|
};
|
|
3677
3677
|
|
|
3678
|
-
var messages$
|
|
3678
|
+
var messages$E = reactIntl.defineMessages({
|
|
3679
3679
|
bottomOption: {
|
|
3680
3680
|
id: 'Products.Pickers.bottomOption',
|
|
3681
3681
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3683,11 +3683,11 @@ var messages$D = reactIntl.defineMessages({
|
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
3685
|
|
|
3686
|
-
function ownKeys$
|
|
3687
|
-
function _objectSpread$
|
|
3688
|
-
const getBottomOption =
|
|
3686
|
+
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; }
|
|
3687
|
+
function _objectSpread$13(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$13(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$13(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3688
|
+
const getBottomOption = formatMessage => ({
|
|
3689
3689
|
options: [{
|
|
3690
|
-
label: messages$
|
|
3690
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3691
3691
|
isBottomOption: true,
|
|
3692
3692
|
isDisabled: true
|
|
3693
3693
|
}]
|
|
@@ -3695,7 +3695,7 @@ const getBottomOption = () => ({
|
|
|
3695
3695
|
const Option$2 = props => {
|
|
3696
3696
|
const _useIntl = reactIntl.useIntl(),
|
|
3697
3697
|
formatMessage = _useIntl.formatMessage;
|
|
3698
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3698
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$13(_objectSpread$13({}, props), {}, {
|
|
3699
3699
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3700
3700
|
tone: "secondary",
|
|
3701
3701
|
children: formatMessage(props.data.label)
|
|
@@ -3712,8 +3712,8 @@ const Option$2 = props => {
|
|
|
3712
3712
|
};
|
|
3713
3713
|
Option$2.displayName = 'Option';
|
|
3714
3714
|
|
|
3715
|
-
function ownKeys$
|
|
3716
|
-
function _objectSpread$
|
|
3715
|
+
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; }
|
|
3716
|
+
function _objectSpread$12(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$12(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$12(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3717
3717
|
const useHandlers = onChange => {
|
|
3718
3718
|
const _useState = React.useState(),
|
|
3719
3719
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3724,8 +3724,8 @@ const useHandlers = onChange => {
|
|
|
3724
3724
|
}, []);
|
|
3725
3725
|
const handleChange = useEventCallback(event => {
|
|
3726
3726
|
var _event$target$value;
|
|
3727
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3728
|
-
target: _objectSpread$
|
|
3727
|
+
const eventWithExtractedValue = _objectSpread$12(_objectSpread$12({}, event), {}, {
|
|
3728
|
+
target: _objectSpread$12(_objectSpread$12({}, event.target), {}, {
|
|
3729
3729
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3730
3730
|
})
|
|
3731
3731
|
});
|
|
@@ -3734,8 +3734,8 @@ const useHandlers = onChange => {
|
|
|
3734
3734
|
return [handleInputChange, handleChange];
|
|
3735
3735
|
};
|
|
3736
3736
|
|
|
3737
|
-
function ownKeys
|
|
3738
|
-
function _objectSpread
|
|
3737
|
+
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; }
|
|
3738
|
+
function _objectSpread$11(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$11(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$11(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3739
3739
|
const constructPrefixSearchPredicate = function () {
|
|
3740
3740
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3741
3741
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3778,7 +3778,7 @@ const useLoadOptions = _ref => {
|
|
|
3778
3778
|
}();
|
|
3779
3779
|
return client$1.query({
|
|
3780
3780
|
query,
|
|
3781
|
-
variables: _objectSpread
|
|
3781
|
+
variables: _objectSpread$11({
|
|
3782
3782
|
where
|
|
3783
3783
|
}, variables),
|
|
3784
3784
|
context: {
|
|
@@ -3832,7 +3832,7 @@ function useCurrentOption(_ref) {
|
|
|
3832
3832
|
};
|
|
3833
3833
|
}
|
|
3834
3834
|
|
|
3835
|
-
var messages$
|
|
3835
|
+
var messages$D = reactIntl.defineMessages({
|
|
3836
3836
|
noProductTypesFound: {
|
|
3837
3837
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3838
3838
|
description: 'The message to display when no product types were found',
|
|
@@ -3912,7 +3912,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3912
3912
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3913
3913
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3914
3914
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3915
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3915
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
3916
3916
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3917
3917
|
max: "scale",
|
|
3918
3918
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3922,7 +3922,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3922
3922
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3923
3923
|
id: name,
|
|
3924
3924
|
name: name,
|
|
3925
|
-
placeholder: formatMessage(messages$
|
|
3925
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3926
3926
|
loadOptions: loadOptionsDebounced,
|
|
3927
3927
|
defaultOptions: [],
|
|
3928
3928
|
isClearable: isClearable,
|
|
@@ -3935,7 +3935,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3935
3935
|
onInputChange: handleInputChange,
|
|
3936
3936
|
onBlur: onBlur,
|
|
3937
3937
|
value: currentOption.data,
|
|
3938
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3938
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3939
3939
|
hasError: hasError || isLoadingFailed
|
|
3940
3940
|
})
|
|
3941
3941
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3947,7 +3947,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3947
3947
|
};
|
|
3948
3948
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3949
3949
|
|
|
3950
|
-
var messages$
|
|
3950
|
+
var messages$C = reactIntl.defineMessages({
|
|
3951
3951
|
noStatesFound: {
|
|
3952
3952
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3953
3953
|
description: 'The message to display when no states were found',
|
|
@@ -4031,8 +4031,8 @@ const StatePickerInput = _ref => {
|
|
|
4031
4031
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4032
4032
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4033
4033
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4034
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4035
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
4034
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
4035
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
4036
4036
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4037
4037
|
max: "scale",
|
|
4038
4038
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -4043,7 +4043,7 @@ const StatePickerInput = _ref => {
|
|
|
4043
4043
|
id: name,
|
|
4044
4044
|
name: name,
|
|
4045
4045
|
horizontalConstraint: "scale",
|
|
4046
|
-
placeholder: formatMessage(messages$
|
|
4046
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
4047
4047
|
loadOptions: loadOptionsDebounced,
|
|
4048
4048
|
defaultOptions: true,
|
|
4049
4049
|
showOptionGroupDivider: true,
|
|
@@ -4069,9 +4069,9 @@ const StatePickerInput = _ref => {
|
|
|
4069
4069
|
};
|
|
4070
4070
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4071
4071
|
|
|
4072
|
-
function ownKeys$
|
|
4073
|
-
function _objectSpread$
|
|
4074
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4072
|
+
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; }
|
|
4073
|
+
function _objectSpread$10(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$10(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$10(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4074
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$10({
|
|
4075
4075
|
ref: ref,
|
|
4076
4076
|
style: {
|
|
4077
4077
|
display: 'block',
|
|
@@ -4209,8 +4209,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4209
4209
|
};
|
|
4210
4210
|
|
|
4211
4211
|
const _excluded = ["action"];
|
|
4212
|
-
function ownKeys
|
|
4213
|
-
function _objectSpread
|
|
4212
|
+
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; }
|
|
4213
|
+
function _objectSpread$$(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$$(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$$(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4214
4214
|
|
|
4215
4215
|
/**
|
|
4216
4216
|
* Checks if a value is a LocalizedString
|
|
@@ -4232,7 +4232,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4232
4232
|
*/
|
|
4233
4233
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4234
4234
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4235
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4235
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$$(_objectSpread$$({}, customFields), {}, {
|
|
4236
4236
|
[customField.name]: customField.value
|
|
4237
4237
|
}), {});
|
|
4238
4238
|
};
|
|
@@ -4256,7 +4256,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4256
4256
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4257
4257
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4258
4258
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4259
|
-
return _objectSpread
|
|
4259
|
+
return _objectSpread$$(_objectSpread$$(_objectSpread$$({}, transformedData), parent ? {
|
|
4260
4260
|
parent
|
|
4261
4261
|
} : {}), ancestors ? {
|
|
4262
4262
|
ancestors
|
|
@@ -4367,7 +4367,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4367
4367
|
* as its dynamic content can not be typed in SDL for the mutation.
|
|
4368
4368
|
*/
|
|
4369
4369
|
const convertAction = (actionName, actionPayload) => {
|
|
4370
|
-
var _actionPayload$type, _context3, _actionPayload$shippi, _context4, _context5;
|
|
4370
|
+
var _actionPayload$type, _context3, _actionPayload$geoLoc, _actionPayload$geoLoc2, _actionPayload$shippi, _context4, _context5;
|
|
4371
4371
|
const getNameFromPayload = payload => {
|
|
4372
4372
|
// changeName for `Organizations`
|
|
4373
4373
|
if (typeof payload.name === 'string') return payload;
|
|
@@ -4453,6 +4453,17 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4453
4453
|
}
|
|
4454
4454
|
}
|
|
4455
4455
|
};
|
|
4456
|
+
case 'setGeoLocation':
|
|
4457
|
+
return {
|
|
4458
|
+
[actionName]: actionPayload !== null && actionPayload !== void 0 && actionPayload.geoLocation ? {
|
|
4459
|
+
geoLocation: {
|
|
4460
|
+
type: 'Point',
|
|
4461
|
+
coordinates: [_parseFloat__default["default"]((_actionPayload$geoLoc = actionPayload.geoLocation) === null || _actionPayload$geoLoc === void 0 ? void 0 : _actionPayload$geoLoc.longitude), _parseFloat__default["default"]((_actionPayload$geoLoc2 = actionPayload.geoLocation) === null || _actionPayload$geoLoc2 === void 0 ? void 0 : _actionPayload$geoLoc2.latitude)]
|
|
4462
|
+
}
|
|
4463
|
+
} : {
|
|
4464
|
+
undefined
|
|
4465
|
+
}
|
|
4466
|
+
};
|
|
4456
4467
|
case 'changeLabel':
|
|
4457
4468
|
return {
|
|
4458
4469
|
changeLabel: {
|
|
@@ -4470,7 +4481,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4470
4481
|
case 'addAttributeDefinition':
|
|
4471
4482
|
return {
|
|
4472
4483
|
[actionName]: {
|
|
4473
|
-
attributeDefinition: _objectSpread
|
|
4484
|
+
attributeDefinition: _objectSpread$$(_objectSpread$$({}, actionPayload.attribute), {}, {
|
|
4474
4485
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4475
4486
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4476
4487
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4566,7 +4577,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4566
4577
|
return {
|
|
4567
4578
|
[actionName]: {
|
|
4568
4579
|
attributeName: actionPayload.attributeName,
|
|
4569
|
-
value: _objectSpread
|
|
4580
|
+
value: _objectSpread$$(_objectSpread$$({}, actionPayload.value), {}, {
|
|
4570
4581
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4571
4582
|
})
|
|
4572
4583
|
}
|
|
@@ -4575,7 +4586,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4575
4586
|
return {
|
|
4576
4587
|
[actionName]: {
|
|
4577
4588
|
attributeName: actionPayload.attributeName,
|
|
4578
|
-
newValue: _objectSpread
|
|
4589
|
+
newValue: _objectSpread$$(_objectSpread$$({}, actionPayload.newValue), {}, {
|
|
4579
4590
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4580
4591
|
})
|
|
4581
4592
|
}
|
|
@@ -4602,7 +4613,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4602
4613
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4603
4614
|
taxCategory: actionPayload.taxCategory,
|
|
4604
4615
|
money: {
|
|
4605
|
-
[actionPayload.money.type]: _objectSpread
|
|
4616
|
+
[actionPayload.money.type]: _objectSpread$$({
|
|
4606
4617
|
centAmount: actionPayload.money.centAmount,
|
|
4607
4618
|
currencyCode: actionPayload.money.currencyCode
|
|
4608
4619
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4637,7 +4648,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4637
4648
|
case 'addAddress':
|
|
4638
4649
|
case 'changeAddress':
|
|
4639
4650
|
{
|
|
4640
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4651
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4641
4652
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4642
4653
|
_ref3$fields = _ref3.fields,
|
|
4643
4654
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4650,15 +4661,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4650
4661
|
value: _JSON$stringify__default["default"](value)
|
|
4651
4662
|
};
|
|
4652
4663
|
});
|
|
4653
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4664
|
+
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.custom) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.type) !== null && _actionPayload$addres2 !== void 0 && _actionPayload$addres2.id ? {
|
|
4654
4665
|
type: {
|
|
4655
4666
|
id: actionPayload.address.custom.type.id
|
|
4656
4667
|
},
|
|
4657
4668
|
fields: customFields
|
|
4658
4669
|
} : null;
|
|
4659
4670
|
return {
|
|
4660
|
-
[actionName]: _objectSpread
|
|
4661
|
-
address: _objectSpread
|
|
4671
|
+
[actionName]: _objectSpread$$(_objectSpread$$({}, actionPayload), {}, {
|
|
4672
|
+
address: _objectSpread$$(_objectSpread$$({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4662
4673
|
custom
|
|
4663
4674
|
})
|
|
4664
4675
|
})
|
|
@@ -4704,8 +4715,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
|
|
|
4704
4715
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4705
4716
|
}, []);
|
|
4706
4717
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4707
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4708
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4718
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4719
|
+
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.result) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.errors) === null || _graphQlResponse$netw === void 0 ? void 0 : _graphQlResponse$netw.length) > 0) {
|
|
4709
4720
|
return graphQlResponse.networkError.result.errors;
|
|
4710
4721
|
}
|
|
4711
4722
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4734,26 +4745,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4734
4745
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4735
4746
|
}
|
|
4736
4747
|
|
|
4737
|
-
function ownKeys$
|
|
4738
|
-
function _objectSpread$
|
|
4748
|
+
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; }
|
|
4749
|
+
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; }
|
|
4739
4750
|
function getPriceChannelName(price) {
|
|
4740
4751
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4741
4752
|
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;
|
|
4742
4753
|
}
|
|
4743
4754
|
function getDiscountValue(price) {
|
|
4744
|
-
var _price$value, _price$value2, _price$discounted
|
|
4755
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4745
4756
|
let preciseAmount;
|
|
4746
4757
|
let fractionedAmount;
|
|
4747
4758
|
if (((_price$value = price.value) === null || _price$value === void 0 ? void 0 : _price$value.type) === PRECISION_TYPES.highPrecision && price.discounted.value.type === PRECISION_TYPES.highPrecision) {
|
|
4748
4759
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
4749
|
-
} 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
|
|
4760
|
+
} 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 || (_price$discounted = _price$discounted.value) === null || _price$discounted === void 0 ? void 0 : _price$discounted.type) === PRECISION_TYPES.centPrecision) {
|
|
4750
4761
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4751
4762
|
}
|
|
4752
|
-
return price.discounted ? _objectSpread$
|
|
4763
|
+
return price.discounted ? _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4753
4764
|
fractionedAmount,
|
|
4754
4765
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4755
4766
|
preciseAmount
|
|
4756
|
-
}) : _objectSpread$
|
|
4767
|
+
}) : _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4757
4768
|
centAmount: 0
|
|
4758
4769
|
});
|
|
4759
4770
|
}
|
|
@@ -4761,17 +4772,17 @@ function getSelectedPrice(price) {
|
|
|
4761
4772
|
return price.discounted ? price.discounted : price;
|
|
4762
4773
|
}
|
|
4763
4774
|
function getNetUnitPrice(_ref2) {
|
|
4764
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4775
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4765
4776
|
let lineItem = _ref2.lineItem,
|
|
4766
4777
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4767
4778
|
const price = getSelectedPrice(lineItem.price);
|
|
4768
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4769
|
-
var _lineItem$shippingDet
|
|
4770
|
-
return (lineItem === null || lineItem === void 0
|
|
4779
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 || (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4780
|
+
var _lineItem$shippingDet;
|
|
4781
|
+
return (lineItem === null || lineItem === void 0 || (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 || (_lineItem$shippingDet = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet === void 0 ? void 0 : _findIndexInstanceProperty__default["default"](_lineItem$shippingDet).call(_lineItem$shippingDet, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
|
|
4771
4782
|
});
|
|
4772
4783
|
|
|
4773
4784
|
// when shipping mode is multi with the same tax rate
|
|
4774
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4785
|
+
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax !== void 0 && _filteredPerMethodTax.includedInPrice) {
|
|
4775
4786
|
var _price$value3, _price$value4;
|
|
4776
4787
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4777
4788
|
let centAmount;
|
|
@@ -4782,7 +4793,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4782
4793
|
}
|
|
4783
4794
|
let preciseAmount;
|
|
4784
4795
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4785
|
-
return _objectSpread$
|
|
4796
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4786
4797
|
centAmount,
|
|
4787
4798
|
preciseAmount
|
|
4788
4799
|
});
|
|
@@ -4799,7 +4810,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4799
4810
|
}
|
|
4800
4811
|
let preciseAmount;
|
|
4801
4812
|
if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4802
|
-
return _objectSpread$
|
|
4813
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4803
4814
|
centAmount,
|
|
4804
4815
|
preciseAmount
|
|
4805
4816
|
});
|
|
@@ -4811,7 +4822,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4811
4822
|
const currencyCode = price.value.currencyCode;
|
|
4812
4823
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4813
4824
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4814
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4825
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$_(_objectSpread$_({}, minPrices), {}, {
|
|
4815
4826
|
[currencyCode]: price.value
|
|
4816
4827
|
});
|
|
4817
4828
|
}
|
|
@@ -4820,8 +4831,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4820
4831
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4821
4832
|
}
|
|
4822
4833
|
|
|
4823
|
-
function ownKeys$
|
|
4824
|
-
function _objectSpread$
|
|
4834
|
+
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; }
|
|
4835
|
+
function _objectSpread$Z(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$Z(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$Z(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4825
4836
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4826
4837
|
var _context, _context4;
|
|
4827
4838
|
return {
|
|
@@ -4832,18 +4843,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4832
4843
|
key: resource.custom.type.key,
|
|
4833
4844
|
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4834
4845
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4835
|
-
var _fieldDefinition$type,
|
|
4846
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4836
4847
|
return {
|
|
4837
4848
|
name: fieldDefinition.name,
|
|
4838
4849
|
required: fieldDefinition.required,
|
|
4839
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4840
|
-
elementType: _objectSpread$
|
|
4850
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4851
|
+
elementType: _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type.elementType), {}, {
|
|
4841
4852
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4842
4853
|
key: value.key,
|
|
4843
4854
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4844
4855
|
}))
|
|
4845
4856
|
})
|
|
4846
|
-
}) : ((_fieldDefinition$
|
|
4857
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4847
4858
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4848
4859
|
key: value.key,
|
|
4849
4860
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4854,7 +4865,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4854
4865
|
})
|
|
4855
4866
|
}
|
|
4856
4867
|
},
|
|
4857
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4868
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$Z(_objectSpread$Z({}, fields), {}, {
|
|
4858
4869
|
[customField.name]: customField.value
|
|
4859
4870
|
}), {})
|
|
4860
4871
|
};
|
|
@@ -4866,7 +4877,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4866
4877
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4867
4878
|
// in either case we return null
|
|
4868
4879
|
if (!productSelection) return null;
|
|
4869
|
-
return _objectSpread$
|
|
4880
|
+
return _objectSpread$Z(_objectSpread$Z({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4870
4881
|
from: 'nameAllLocales',
|
|
4871
4882
|
to: 'name'
|
|
4872
4883
|
}])), {}, {
|
|
@@ -4889,8 +4900,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4889
4900
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4890
4901
|
};
|
|
4891
4902
|
|
|
4892
|
-
function ownKeys$
|
|
4893
|
-
function _objectSpread$
|
|
4903
|
+
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; }
|
|
4904
|
+
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; }
|
|
4894
4905
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4895
4906
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4896
4907
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4907,7 +4918,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4907
4918
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4908
4919
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4909
4920
|
const definitionName = definition.type.elementType.name;
|
|
4910
|
-
return _objectSpread$
|
|
4921
|
+
return _objectSpread$Y(_objectSpread$Y({}, updateAction), {}, {
|
|
4911
4922
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4912
4923
|
});
|
|
4913
4924
|
}
|
|
@@ -4981,8 +4992,8 @@ function omitSetsOfSets() {
|
|
|
4981
4992
|
|
|
4982
4993
|
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 } } } };
|
|
4983
4994
|
|
|
4984
|
-
function ownKeys$
|
|
4985
|
-
function _objectSpread$
|
|
4995
|
+
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; }
|
|
4996
|
+
function _objectSpread$X(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$X(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$X(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4986
4997
|
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); }; }
|
|
4987
4998
|
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; } }
|
|
4988
4999
|
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 } } } };
|
|
@@ -5042,7 +5053,7 @@ const mapDataToProps = _ref => {
|
|
|
5042
5053
|
return {
|
|
5043
5054
|
fetchTypeDefinitionsQuery: {
|
|
5044
5055
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5045
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5056
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$X({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5046
5057
|
isImmutable: true
|
|
5047
5058
|
}), [{
|
|
5048
5059
|
from: 'labelAllLocales',
|
|
@@ -5070,12 +5081,12 @@ const handlers$2 = {
|
|
|
5070
5081
|
}
|
|
5071
5082
|
};
|
|
5072
5083
|
|
|
5073
|
-
function ownKeys$
|
|
5074
|
-
function _objectSpread$
|
|
5084
|
+
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; }
|
|
5085
|
+
function _objectSpread$W(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$W(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$W(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5075
5086
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5076
5087
|
return {
|
|
5077
5088
|
fields: customFieldsFromRestResponse.fields,
|
|
5078
|
-
type: _objectSpread$
|
|
5089
|
+
type: _objectSpread$W({
|
|
5079
5090
|
id: customFieldsFromRestResponse.type.id
|
|
5080
5091
|
}, customFieldsFromRestResponse.type.obj)
|
|
5081
5092
|
};
|
|
@@ -5089,19 +5100,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5089
5100
|
key: typeDefinition.key,
|
|
5090
5101
|
name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5091
5102
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5092
|
-
var _fieldDefinition$type,
|
|
5103
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5093
5104
|
return {
|
|
5094
5105
|
name: fieldDefinition.name,
|
|
5095
5106
|
required: fieldDefinition.required,
|
|
5096
5107
|
inputHint: fieldDefinition.inputHint,
|
|
5097
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5098
|
-
elementType: _objectSpread$
|
|
5108
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5109
|
+
elementType: _objectSpread$W(_objectSpread$W({}, fieldDefinition.type.elementType), {}, {
|
|
5099
5110
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5100
5111
|
key: value.key,
|
|
5101
5112
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5102
5113
|
}))
|
|
5103
5114
|
})
|
|
5104
|
-
}) : ((_fieldDefinition$
|
|
5115
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5105
5116
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5106
5117
|
key: value.key,
|
|
5107
5118
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5117,7 +5128,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5117
5128
|
type: {
|
|
5118
5129
|
id: formCustomFields.type.id,
|
|
5119
5130
|
typeId: 'type',
|
|
5120
|
-
obj: _objectSpread$
|
|
5131
|
+
obj: _objectSpread$W({}, formCustomFields.type)
|
|
5121
5132
|
},
|
|
5122
5133
|
fields: formCustomFields.fields
|
|
5123
5134
|
});
|
|
@@ -5125,7 +5136,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5125
5136
|
type: {
|
|
5126
5137
|
id: formCustomFields.type.id,
|
|
5127
5138
|
typeId: 'type',
|
|
5128
|
-
obj: _objectSpread$
|
|
5139
|
+
obj: _objectSpread$W({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5129
5140
|
},
|
|
5130
5141
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5131
5142
|
});
|
|
@@ -5141,7 +5152,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5141
5152
|
function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); 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); }; }
|
|
5142
5153
|
function _isNativeReflectConstruct$4() { 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; } }
|
|
5143
5154
|
var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, 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: "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: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, 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: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, 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: "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: "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: "Field", name: { kind: "Name", value: "name" }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, 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: "Field", name: { kind: "Name", value: "name" }, 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: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5144
|
-
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5155
|
+
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5145
5156
|
const emptyTypeDefinitions = {
|
|
5146
5157
|
total: 0,
|
|
5147
5158
|
count: 0,
|
|
@@ -5199,7 +5210,7 @@ const createGraphQlOptions = ownProps => {
|
|
|
5199
5210
|
}
|
|
5200
5211
|
};
|
|
5201
5212
|
};
|
|
5202
|
-
var
|
|
5213
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics__default["default"](hoc.graphql(FetchTypeDefinitionsWithNamesQuery, {
|
|
5203
5214
|
name: 'fetchTypeDefinitionsQuery',
|
|
5204
5215
|
skip: ownProps => ownProps.isDisabled,
|
|
5205
5216
|
options: createGraphQlOptions
|
|
@@ -5256,8 +5267,8 @@ const REFERENCED_TYPES = {
|
|
|
5256
5267
|
zone: 'zone'
|
|
5257
5268
|
};
|
|
5258
5269
|
|
|
5259
|
-
function ownKeys$
|
|
5260
|
-
function _objectSpread$
|
|
5270
|
+
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; }
|
|
5271
|
+
function _objectSpread$V(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$V(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$V(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5261
5272
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5262
5273
|
let validatedValues = [];
|
|
5263
5274
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5324,8 +5335,8 @@ function validations (formValues, language, languages) {
|
|
|
5324
5335
|
var _context2;
|
|
5325
5336
|
// Collect all required and set type fields
|
|
5326
5337
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5327
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5328
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5338
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$V(_objectSpread$V({}, acc), {}, {
|
|
5339
|
+
[fieldDefinition.name]: _objectSpread$V(_objectSpread$V({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5329
5340
|
}), {});
|
|
5330
5341
|
return withoutEmptyErrorsByField(errors);
|
|
5331
5342
|
}
|
|
@@ -5352,8 +5363,8 @@ function CustomTextInput(props) {
|
|
|
5352
5363
|
}
|
|
5353
5364
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5354
5365
|
|
|
5355
|
-
function ownKeys$
|
|
5356
|
-
function _objectSpread$
|
|
5366
|
+
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; }
|
|
5367
|
+
function _objectSpread$U(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$U(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$U(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5357
5368
|
const getSubfieldLanguage = subfieldName => {
|
|
5358
5369
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5359
5370
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5377,7 +5388,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5377
5388
|
// as a whole.
|
|
5378
5389
|
|
|
5379
5390
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5380
|
-
const newValue = _objectSpread$
|
|
5391
|
+
const newValue = _objectSpread$U(_objectSpread$U({}, props.value), {}, {
|
|
5381
5392
|
[fieldLanguage]: rawValue
|
|
5382
5393
|
});
|
|
5383
5394
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5444,21 +5455,21 @@ function CustomNumberInput(props) {
|
|
|
5444
5455
|
}
|
|
5445
5456
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5446
5457
|
|
|
5447
|
-
function ownKeys$
|
|
5448
|
-
function _objectSpread$
|
|
5458
|
+
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; }
|
|
5459
|
+
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; }
|
|
5449
5460
|
var styles$f = {
|
|
5450
5461
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5451
5462
|
};
|
|
5452
5463
|
const fixCurrencyCode = (value, currencies) => {
|
|
5453
5464
|
if (value.currencyCode) return value;
|
|
5454
5465
|
const firstCurrency = currencies[0];
|
|
5455
|
-
return _objectSpread$
|
|
5466
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5456
5467
|
currencyCode: firstCurrency
|
|
5457
5468
|
});
|
|
5458
5469
|
};
|
|
5459
5470
|
const fixAmount = value => {
|
|
5460
5471
|
if (!value.amount) {
|
|
5461
|
-
return _objectSpread$
|
|
5472
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5462
5473
|
amount: '0'
|
|
5463
5474
|
});
|
|
5464
5475
|
}
|
|
@@ -5500,7 +5511,7 @@ function CustomMoneyInput(props) {
|
|
|
5500
5511
|
}
|
|
5501
5512
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5502
5513
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5503
|
-
const newValue = _objectSpread$
|
|
5514
|
+
const newValue = _objectSpread$T({}, internalValue.current);
|
|
5504
5515
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5505
5516
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5506
5517
|
internalValue.current = fixedValue;
|
|
@@ -5781,7 +5792,7 @@ function ReferenceSearch(props) {
|
|
|
5781
5792
|
});
|
|
5782
5793
|
}
|
|
5783
5794
|
|
|
5784
|
-
const messages$
|
|
5795
|
+
const messages$B = reactIntl.defineMessages({
|
|
5785
5796
|
placeholder: {
|
|
5786
5797
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5787
5798
|
description: 'Placeholder for search for a category',
|
|
@@ -5814,8 +5825,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5814
5825
|
}
|
|
5815
5826
|
});
|
|
5816
5827
|
|
|
5817
|
-
function ownKeys$
|
|
5818
|
-
function _objectSpread$
|
|
5828
|
+
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; }
|
|
5829
|
+
function _objectSpread$S(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$S(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$S(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5819
5830
|
function Option$1(props) {
|
|
5820
5831
|
var _context, _context2;
|
|
5821
5832
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5827,7 +5838,7 @@ function Option$1(props) {
|
|
|
5827
5838
|
const _useIntl = reactIntl.useIntl(),
|
|
5828
5839
|
formatMessage = _useIntl.formatMessage;
|
|
5829
5840
|
const category = props.data;
|
|
5830
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5841
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$S(_objectSpread$S({}, props), {}, {
|
|
5831
5842
|
children: jsxRuntime.jsxs("div", {
|
|
5832
5843
|
"data-testid": "category-option",
|
|
5833
5844
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5838,7 +5849,7 @@ function Option$1(props) {
|
|
|
5838
5849
|
fallbackOrder: languages
|
|
5839
5850
|
})
|
|
5840
5851
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5841
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5852
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5842
5853
|
key: 'name',
|
|
5843
5854
|
locale: language,
|
|
5844
5855
|
fallbackOrder: languages
|
|
@@ -5850,14 +5861,14 @@ function Option$1(props) {
|
|
|
5850
5861
|
fallbackOrder: languages
|
|
5851
5862
|
}))
|
|
5852
5863
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5853
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5864
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5854
5865
|
})]
|
|
5855
5866
|
})
|
|
5856
5867
|
}));
|
|
5857
5868
|
}
|
|
5858
5869
|
|
|
5859
|
-
function ownKeys$
|
|
5860
|
-
function _objectSpread$
|
|
5870
|
+
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; }
|
|
5871
|
+
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; }
|
|
5861
5872
|
const filterOption$1 = () => true;
|
|
5862
5873
|
function CategoryReferenceSearch(props) {
|
|
5863
5874
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5869,7 +5880,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5869
5880
|
})),
|
|
5870
5881
|
language = _useApplicationContex.language,
|
|
5871
5882
|
languages = _useApplicationContex.languages;
|
|
5872
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5883
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$R(_objectSpread$R({}, category), {}, {
|
|
5873
5884
|
value: category.id,
|
|
5874
5885
|
label: l10n.formatLocalizedString(category, {
|
|
5875
5886
|
key: 'name',
|
|
@@ -5887,7 +5898,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5887
5898
|
}), [apolloClient]);
|
|
5888
5899
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5889
5900
|
id: props.id,
|
|
5890
|
-
components: _objectSpread$
|
|
5901
|
+
components: _objectSpread$R({
|
|
5891
5902
|
Option: Option$1
|
|
5892
5903
|
}, props.components),
|
|
5893
5904
|
isClearable: props.isClearable,
|
|
@@ -5898,10 +5909,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5898
5909
|
onBlur: props.onBlur,
|
|
5899
5910
|
onChange: props.onChange,
|
|
5900
5911
|
value: props.value,
|
|
5901
|
-
placeholderLabel: formatMessage(messages$
|
|
5902
|
-
searchPromptLabel: formatMessage(messages$
|
|
5903
|
-
noResultsLabel: formatMessage(messages$
|
|
5904
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5912
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5913
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5914
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5915
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5905
5916
|
mapItemToOption: mapItemToOption,
|
|
5906
5917
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5907
5918
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5977,7 +5988,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5977
5988
|
});
|
|
5978
5989
|
}
|
|
5979
5990
|
|
|
5980
|
-
const messages$
|
|
5991
|
+
const messages$A = reactIntl.defineMessages({
|
|
5981
5992
|
placeholder: {
|
|
5982
5993
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5983
5994
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6005,8 +6016,8 @@ const messages$z = reactIntl.defineMessages({
|
|
|
6005
6016
|
}
|
|
6006
6017
|
});
|
|
6007
6018
|
|
|
6008
|
-
function ownKeys$
|
|
6009
|
-
function _objectSpread$
|
|
6019
|
+
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; }
|
|
6020
|
+
function _objectSpread$Q(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$Q(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$Q(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6010
6021
|
function Option(props) {
|
|
6011
6022
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6012
6023
|
language: applicationContext.dataLocale,
|
|
@@ -6017,7 +6028,7 @@ function Option(props) {
|
|
|
6017
6028
|
const _useIntl = reactIntl.useIntl(),
|
|
6018
6029
|
formatMessage = _useIntl.formatMessage;
|
|
6019
6030
|
const cartDiscount = props.data;
|
|
6020
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6031
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
6021
6032
|
children: jsxRuntime.jsxs("div", {
|
|
6022
6033
|
"data-testid": "cart-discount-option",
|
|
6023
6034
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6028,14 +6039,14 @@ function Option(props) {
|
|
|
6028
6039
|
fallbackOrder: languages
|
|
6029
6040
|
})
|
|
6030
6041
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6031
|
-
children: [formatMessage(messages$
|
|
6042
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6032
6043
|
})]
|
|
6033
6044
|
})
|
|
6034
6045
|
}));
|
|
6035
6046
|
}
|
|
6036
6047
|
|
|
6037
|
-
function ownKeys$
|
|
6038
|
-
function _objectSpread$
|
|
6048
|
+
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; }
|
|
6049
|
+
function _objectSpread$P(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$P(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$P(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6039
6050
|
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 } } } };
|
|
6040
6051
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6041
6052
|
const filterOption = (option, text) => {
|
|
@@ -6061,7 +6072,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6061
6072
|
})),
|
|
6062
6073
|
language = _useApplicationContex.language,
|
|
6063
6074
|
languages = _useApplicationContex.languages;
|
|
6064
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6075
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$P(_objectSpread$P({}, cartDiscount), {}, {
|
|
6065
6076
|
value: cartDiscount.id,
|
|
6066
6077
|
key: cartDiscount.key,
|
|
6067
6078
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6104,10 +6115,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6104
6115
|
onBlur: props.onBlur,
|
|
6105
6116
|
onChange: props.onChange,
|
|
6106
6117
|
value: returnNullIfEmpty(props.value),
|
|
6107
|
-
placeholderLabel: formatMessage(messages$
|
|
6108
|
-
searchPromptLabel: formatMessage(messages$
|
|
6109
|
-
noResultsLabel: formatMessage(messages$
|
|
6110
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6118
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6119
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6120
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6121
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6111
6122
|
mapItemToOption: mapItemToOption,
|
|
6112
6123
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6113
6124
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6168,7 +6179,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6168
6179
|
});
|
|
6169
6180
|
}
|
|
6170
6181
|
|
|
6171
|
-
var messages$
|
|
6182
|
+
var messages$z = reactIntl.defineMessages({
|
|
6172
6183
|
noProductsFound: {
|
|
6173
6184
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6174
6185
|
description: 'The message to display when no products were found',
|
|
@@ -6257,7 +6268,7 @@ const ProductPickerInput = _ref => {
|
|
|
6257
6268
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6258
6269
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6259
6270
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6260
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6271
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
6261
6272
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6262
6273
|
max: "scale",
|
|
6263
6274
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -6267,7 +6278,7 @@ const ProductPickerInput = _ref => {
|
|
|
6267
6278
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6268
6279
|
id: name,
|
|
6269
6280
|
name: name,
|
|
6270
|
-
placeholder: formatMessage(messages$
|
|
6281
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6271
6282
|
loadOptions: loadOptionsDebounced,
|
|
6272
6283
|
defaultOptions: [],
|
|
6273
6284
|
isClearable: isClearable,
|
|
@@ -6281,7 +6292,7 @@ const ProductPickerInput = _ref => {
|
|
|
6281
6292
|
onInputChange: handleInputChange,
|
|
6282
6293
|
onBlur: onBlur,
|
|
6283
6294
|
value: currentOption.data,
|
|
6284
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6295
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6285
6296
|
hasError: hasError || isLoadingFailed
|
|
6286
6297
|
})
|
|
6287
6298
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6531,8 +6542,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6531
6542
|
}
|
|
6532
6543
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6533
6544
|
|
|
6534
|
-
function ownKeys$
|
|
6535
|
-
function _objectSpread$
|
|
6545
|
+
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; }
|
|
6546
|
+
function _objectSpread$O(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$O(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$O(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6536
6547
|
const getTypeName = type => type.name.toLowerCase();
|
|
6537
6548
|
const findLabel = (enumType, key) => {
|
|
6538
6549
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6581,7 +6592,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6581
6592
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6582
6593
|
let name = _ref2.name,
|
|
6583
6594
|
value = _ref2.value;
|
|
6584
|
-
return _objectSpread$
|
|
6595
|
+
return _objectSpread$O(_objectSpread$O({}, result), {}, {
|
|
6585
6596
|
[name]: value
|
|
6586
6597
|
});
|
|
6587
6598
|
}, {});
|
|
@@ -6665,7 +6676,7 @@ function ProductAttributeInput(props) {
|
|
|
6665
6676
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6666
6677
|
|
|
6667
6678
|
// eslint-disable-next-line import/prefer-default-export
|
|
6668
|
-
const messages$
|
|
6679
|
+
const messages$y = reactIntl.defineMessages({
|
|
6669
6680
|
aboveFifthLevelWarning: {
|
|
6670
6681
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6671
6682
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6678,23 +6689,23 @@ const messages$x = reactIntl.defineMessages({
|
|
|
6678
6689
|
}
|
|
6679
6690
|
});
|
|
6680
6691
|
|
|
6681
|
-
function ownKeys$
|
|
6682
|
-
function _objectSpread$
|
|
6692
|
+
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; }
|
|
6693
|
+
function _objectSpread$N(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$N(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$N(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6683
6694
|
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 } } } };
|
|
6684
6695
|
const mapAttributeDefinition = definition => {
|
|
6685
|
-
var _context, _definition$type,
|
|
6686
|
-
return _objectSpread$
|
|
6696
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6697
|
+
return _objectSpread$N(_objectSpread$N({}, definition), {}, {
|
|
6687
6698
|
required: definition.isRequired,
|
|
6688
6699
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6689
6700
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6690
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6691
|
-
elementType: _objectSpread$
|
|
6701
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 || (_definition$type = _definition$type.elementType) === null || _definition$type === void 0 ? void 0 : _definition$type.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6702
|
+
elementType: _objectSpread$N(_objectSpread$N({}, definition.type.elementType), {}, {
|
|
6692
6703
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6693
6704
|
key: value.key,
|
|
6694
6705
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6695
6706
|
}))
|
|
6696
6707
|
})
|
|
6697
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6708
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6698
6709
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6699
6710
|
key: value.key,
|
|
6700
6711
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6735,7 +6746,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6735
6746
|
};
|
|
6736
6747
|
}
|
|
6737
6748
|
|
|
6738
|
-
var messages$
|
|
6749
|
+
var messages$x = reactIntl.defineMessages({
|
|
6739
6750
|
updateButton: {
|
|
6740
6751
|
id: 'NestedAttributes.Details.updateButton',
|
|
6741
6752
|
description: 'Update button label',
|
|
@@ -6815,14 +6826,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
6815
6826
|
|
|
6816
6827
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6817
6828
|
|
|
6818
|
-
function ownKeys$
|
|
6819
|
-
function _objectSpread$
|
|
6829
|
+
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; }
|
|
6830
|
+
function _objectSpread$M(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$M(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$M(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6820
6831
|
const EditButton = props => {
|
|
6821
6832
|
const _useIntl = reactIntl.useIntl(),
|
|
6822
6833
|
formatMessage = _useIntl.formatMessage;
|
|
6823
6834
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
6824
6835
|
placement: "top",
|
|
6825
|
-
title: formatMessage(messages$
|
|
6836
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6826
6837
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
6827
6838
|
label: "Edit",
|
|
6828
6839
|
isDisabled: props.isDisabled,
|
|
@@ -6838,12 +6849,12 @@ const DropChangesConfirmation = props => {
|
|
|
6838
6849
|
formatMessage = _useIntl2.formatMessage;
|
|
6839
6850
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
6840
6851
|
isOpen: props.isOpen || false,
|
|
6841
|
-
title: formatMessage(messages$
|
|
6842
|
-
labelPrimary: formatMessage(messages$
|
|
6852
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6853
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6843
6854
|
onConfirm: props.onConfirm,
|
|
6844
6855
|
onCancel: props.onCancel,
|
|
6845
6856
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6846
|
-
intlMessage: messages$
|
|
6857
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6847
6858
|
})
|
|
6848
6859
|
});
|
|
6849
6860
|
};
|
|
@@ -6868,11 +6879,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6868
6879
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
6869
6880
|
isDisabled: !formik$1.dirty,
|
|
6870
6881
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
6871
|
-
label: formatMessage(messages$
|
|
6882
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6872
6883
|
onClick: formik$1.resetForm
|
|
6873
6884
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
6874
6885
|
isDisabled: !formik$1.dirty,
|
|
6875
|
-
label: formatMessage(messages$
|
|
6886
|
+
label: formatMessage(messages$x.updateButton),
|
|
6876
6887
|
onClick: formik$1.handleSubmit
|
|
6877
6888
|
})]
|
|
6878
6889
|
}),
|
|
@@ -6901,7 +6912,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6901
6912
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
6902
6913
|
title: "",
|
|
6903
6914
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6904
|
-
intlMessage: messages$
|
|
6915
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6905
6916
|
}),
|
|
6906
6917
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
6907
6918
|
});
|
|
@@ -6913,7 +6924,7 @@ const NestedInputControls = props => {
|
|
|
6913
6924
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
6914
6925
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6915
6926
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6916
|
-
intlMessage: messages$
|
|
6927
|
+
intlMessage: messages$x.emptyProductType,
|
|
6917
6928
|
tone: "secondary"
|
|
6918
6929
|
});
|
|
6919
6930
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -6927,7 +6938,7 @@ const NestedInputControls = props => {
|
|
|
6927
6938
|
children: props.productType.name
|
|
6928
6939
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
6929
6940
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
6930
|
-
children: formatMessage(messages$
|
|
6941
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6931
6942
|
})
|
|
6932
6943
|
})]
|
|
6933
6944
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -6963,13 +6974,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6963
6974
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6964
6975
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6965
6976
|
const openNestedAttributesForm = () => {
|
|
6966
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6977
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6967
6978
|
hideSaveToolbar: true
|
|
6968
6979
|
}));
|
|
6969
6980
|
attributesForm.openModal();
|
|
6970
6981
|
};
|
|
6971
6982
|
const closeNestedAttributesForm = () => {
|
|
6972
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6983
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6973
6984
|
hideSaveToolbar: false
|
|
6974
6985
|
}));
|
|
6975
6986
|
attributesForm.closeModal();
|
|
@@ -6989,7 +7000,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6989
7000
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
6990
7001
|
kind: 'success',
|
|
6991
7002
|
domain: constants.DOMAINS.SIDE,
|
|
6992
|
-
text: formatMessage(messages$
|
|
7003
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
6993
7004
|
});
|
|
6994
7005
|
setSubmitting(false);
|
|
6995
7006
|
},
|
|
@@ -7073,8 +7084,8 @@ const SetButtons = props => {
|
|
|
7073
7084
|
};
|
|
7074
7085
|
SetButtons.displayName = 'SetButtons';
|
|
7075
7086
|
|
|
7076
|
-
function ownKeys$
|
|
7077
|
-
function _objectSpread$
|
|
7087
|
+
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; }
|
|
7088
|
+
function _objectSpread$L(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$L(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$L(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7078
7089
|
const getDuplicateErrors = setValues => {
|
|
7079
7090
|
/* eslint-disable no-plusplus */
|
|
7080
7091
|
const result = [];
|
|
@@ -7131,7 +7142,7 @@ function CustomInputSet(props) {
|
|
|
7131
7142
|
touched = _useFormikContext.touched,
|
|
7132
7143
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7133
7144
|
dirty = _useFormikContext.dirty;
|
|
7134
|
-
const itemFieldDefinition = _objectSpread$
|
|
7145
|
+
const itemFieldDefinition = _objectSpread$L(_objectSpread$L({}, props.fieldDefinition), {}, {
|
|
7135
7146
|
type: props.fieldDefinition.type.elementType
|
|
7136
7147
|
});
|
|
7137
7148
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7291,7 +7302,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7291
7302
|
});
|
|
7292
7303
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7293
7304
|
|
|
7294
|
-
var messages$
|
|
7305
|
+
var messages$w = reactIntl.defineMessages({
|
|
7295
7306
|
referencedProductType: {
|
|
7296
7307
|
id: 'NestedAttributes.referencedProductType',
|
|
7297
7308
|
description: 'Product type referenced hint',
|
|
@@ -7299,10 +7310,10 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7299
7310
|
}
|
|
7300
7311
|
});
|
|
7301
7312
|
|
|
7302
|
-
function ownKeys$
|
|
7303
|
-
function _objectSpread$
|
|
7313
|
+
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; }
|
|
7314
|
+
function _objectSpread$K(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$K(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$K(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7304
7315
|
function ProductTypeReference(props) {
|
|
7305
|
-
const productTypeMessage = _objectSpread$
|
|
7316
|
+
const productTypeMessage = _objectSpread$K(_objectSpread$K({}, messages$w.referencedProductType), {}, {
|
|
7306
7317
|
values: {
|
|
7307
7318
|
productTypeName: props.productType.name
|
|
7308
7319
|
}
|
|
@@ -7348,9 +7359,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7348
7359
|
}
|
|
7349
7360
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7350
7361
|
|
|
7351
|
-
function ownKeys$
|
|
7352
|
-
function _objectSpread$
|
|
7353
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7362
|
+
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; }
|
|
7363
|
+
function _objectSpread$J(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$J(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$J(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7364
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$J(_objectSpread$J({}, result), itemErrors), {});
|
|
7354
7365
|
|
|
7355
7366
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7356
7367
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7361,15 +7372,15 @@ const CustomFieldErrors = props => {
|
|
|
7361
7372
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7362
7373
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7363
7374
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7364
|
-
intlMessage: messages$
|
|
7375
|
+
intlMessage: messages$K.required
|
|
7365
7376
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7366
|
-
intlMessage: messages$
|
|
7377
|
+
intlMessage: messages$K.unique
|
|
7367
7378
|
})]
|
|
7368
7379
|
});
|
|
7369
7380
|
};
|
|
7370
7381
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7371
7382
|
|
|
7372
|
-
var messages$
|
|
7383
|
+
var messages$v = reactIntl.defineMessages({
|
|
7373
7384
|
productReferenceLabel: {
|
|
7374
7385
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7375
7386
|
description: 'Label shown above the product picker input.',
|
|
@@ -7402,8 +7413,8 @@ var messages$u = reactIntl.defineMessages({
|
|
|
7402
7413
|
}
|
|
7403
7414
|
});
|
|
7404
7415
|
|
|
7405
|
-
function ownKeys$
|
|
7406
|
-
function _objectSpread$
|
|
7416
|
+
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; }
|
|
7417
|
+
function _objectSpread$I(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$I(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$I(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7407
7418
|
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 } } } };
|
|
7408
7419
|
const CustomFieldsLabelHint = _ref => {
|
|
7409
7420
|
var _type$name;
|
|
@@ -7433,7 +7444,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7433
7444
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7434
7445
|
size: "medium",
|
|
7435
7446
|
color: "warning"
|
|
7436
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7447
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$I({}, messages$v.cartDiscountMoreThan500))]
|
|
7437
7448
|
});
|
|
7438
7449
|
}
|
|
7439
7450
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7447,8 +7458,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7447
7458
|
formatMessage = _useIntl.formatMessage;
|
|
7448
7459
|
const _usePimStatus = usePimStatus(),
|
|
7449
7460
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7450
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7451
|
-
return formatMessage(messages$
|
|
7461
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7462
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7452
7463
|
}
|
|
7453
7464
|
|
|
7454
7465
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7464,7 +7475,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7464
7475
|
const referenceTypeId = type.referenceTypeId;
|
|
7465
7476
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7466
7477
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7467
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7478
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$v.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$v.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$v.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7468
7479
|
}
|
|
7469
7480
|
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
7470
7481
|
let name = _ref3.name,
|
|
@@ -7619,8 +7630,8 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7619
7630
|
}
|
|
7620
7631
|
});
|
|
7621
7632
|
|
|
7622
|
-
function ownKeys$
|
|
7623
|
-
function _objectSpread$
|
|
7633
|
+
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; }
|
|
7634
|
+
function _objectSpread$H(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$H(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$H(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7624
7635
|
const PRODUCT_SELECTION_TYPES = {
|
|
7625
7636
|
INCLUSION: 'individual',
|
|
7626
7637
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7634,7 +7645,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7634
7645
|
var _context;
|
|
7635
7646
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7636
7647
|
if (!ps) return undefined;
|
|
7637
|
-
return _objectSpread$
|
|
7648
|
+
return _objectSpread$H(_objectSpread$H({}, ps), {}, {
|
|
7638
7649
|
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getType(ps === null || ps === void 0 ? void 0 : ps.type), ")") : '')
|
|
7639
7650
|
});
|
|
7640
7651
|
};
|
|
@@ -7930,7 +7941,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7930
7941
|
fetchPolicy: 'network-only'
|
|
7931
7942
|
}),
|
|
7932
7943
|
data = _await$client$query.data;
|
|
7933
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7944
|
+
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 || (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
7934
7945
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7935
7946
|
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7936
7947
|
var _context2;
|
|
@@ -7985,12 +7996,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7985
7996
|
});
|
|
7986
7997
|
}
|
|
7987
7998
|
|
|
7988
|
-
function ownKeys$
|
|
7989
|
-
function _objectSpread$
|
|
7999
|
+
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; }
|
|
8000
|
+
function _objectSpread$G(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$G(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$G(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7990
8001
|
function TypeSelectInputOption(props) {
|
|
7991
8002
|
const data = props.data;
|
|
7992
8003
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
7993
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8004
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
7994
8005
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7995
8006
|
scale: "xs",
|
|
7996
8007
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8005,18 +8016,18 @@ function TypeSelectInputOption(props) {
|
|
|
8005
8016
|
}));
|
|
8006
8017
|
}
|
|
8007
8018
|
|
|
8008
|
-
function ownKeys$
|
|
8009
|
-
function _objectSpread$
|
|
8019
|
+
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; }
|
|
8020
|
+
function _objectSpread$F(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$F(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$F(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8010
8021
|
function ProductSelectionsPicker(props) {
|
|
8011
8022
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8012
8023
|
const components = React.useMemo(() => {
|
|
8013
8024
|
return {
|
|
8014
8025
|
Option: optionInnerProps => {
|
|
8015
8026
|
if (optionInnerProps.isDisabled) {
|
|
8016
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8027
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
8017
8028
|
}
|
|
8018
8029
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8019
|
-
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$
|
|
8030
|
+
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
8020
8031
|
}
|
|
8021
8032
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8022
8033
|
optionType: props.optionType,
|
|
@@ -8028,7 +8039,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8028
8039
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8029
8040
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8030
8041
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8031
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8042
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
8032
8043
|
components: components
|
|
8033
8044
|
}))
|
|
8034
8045
|
});
|
|
@@ -8051,7 +8062,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8051
8062
|
|
|
8052
8063
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8053
8064
|
|
|
8054
|
-
var messages$
|
|
8065
|
+
var messages$u = reactIntl.defineMessages({
|
|
8055
8066
|
countriesBasicSelectPlaceholder: {
|
|
8056
8067
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8057
8068
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8079,7 +8090,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8079
8090
|
value: props.value,
|
|
8080
8091
|
isRequired: props.isRequired,
|
|
8081
8092
|
description: props.description,
|
|
8082
|
-
placeholder: intl.formatMessage(messages$
|
|
8093
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8083
8094
|
options: props.options,
|
|
8084
8095
|
onChange: props.onChange,
|
|
8085
8096
|
isDisabled: props.isDisabled,
|
|
@@ -8089,10 +8100,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8089
8100
|
});
|
|
8090
8101
|
}
|
|
8091
8102
|
|
|
8092
|
-
function ownKeys$
|
|
8093
|
-
function _objectSpread$
|
|
8103
|
+
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; }
|
|
8104
|
+
function _objectSpread$E(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$E(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$E(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8094
8105
|
const emptyCountryOption = intl => [{
|
|
8095
|
-
label: intl.formatMessage(messages$
|
|
8106
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8096
8107
|
value: undefined,
|
|
8097
8108
|
isDisabled: true
|
|
8098
8109
|
}];
|
|
@@ -8117,7 +8128,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8117
8128
|
const onOptionChange = event => {
|
|
8118
8129
|
const countries = event.target.value;
|
|
8119
8130
|
props.onChange({
|
|
8120
|
-
target: _objectSpread$
|
|
8131
|
+
target: _objectSpread$E(_objectSpread$E({}, event.target), {}, {
|
|
8121
8132
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8122
8133
|
var _country$value;
|
|
8123
8134
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8138,7 +8149,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8138
8149
|
var _context3;
|
|
8139
8150
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8140
8151
|
}),
|
|
8141
|
-
placeholder: intl.formatMessage(messages$
|
|
8152
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8142
8153
|
loadOptions: handleLoadOptions,
|
|
8143
8154
|
onChange: onOptionChange,
|
|
8144
8155
|
isDisabled: props.isDisabled,
|
|
@@ -8148,13 +8159,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8148
8159
|
});
|
|
8149
8160
|
}
|
|
8150
8161
|
|
|
8151
|
-
function ownKeys$
|
|
8152
|
-
function _objectSpread$
|
|
8162
|
+
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; }
|
|
8163
|
+
function _objectSpread$D(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$D(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$D(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8153
8164
|
function CountriesPicker(props) {
|
|
8154
8165
|
var _props$options;
|
|
8155
8166
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8156
8167
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8157
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8168
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$D({}, props))
|
|
8158
8169
|
});
|
|
8159
8170
|
}
|
|
8160
8171
|
CountriesPicker.defaultProps = {
|
|
@@ -8164,7 +8175,7 @@ CountriesPicker.defaultProps = {
|
|
|
8164
8175
|
hasWarning: false
|
|
8165
8176
|
};
|
|
8166
8177
|
|
|
8167
|
-
var messages$
|
|
8178
|
+
var messages$t = reactIntl.defineMessages({
|
|
8168
8179
|
noCustomerGroupsFound: {
|
|
8169
8180
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8170
8181
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8255,8 +8266,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8255
8266
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8256
8267
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8257
8268
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8258
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8259
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8269
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8270
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
8260
8271
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8261
8272
|
max: "scale",
|
|
8262
8273
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -8266,7 +8277,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8266
8277
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8267
8278
|
id: name,
|
|
8268
8279
|
name: name,
|
|
8269
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8280
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8270
8281
|
loadOptions: loadOptionsDebounced,
|
|
8271
8282
|
defaultOptions: true,
|
|
8272
8283
|
showOptionGroupDivider: true,
|
|
@@ -8336,7 +8347,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8336
8347
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8337
8348
|
};
|
|
8338
8349
|
|
|
8339
|
-
var messages$
|
|
8350
|
+
var messages$s = reactIntl.defineMessages({
|
|
8340
8351
|
basicSelectInputPlaceholder: {
|
|
8341
8352
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8342
8353
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8362,6 +8373,11 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8362
8373
|
description: 'The message shown in search select input when matches are found',
|
|
8363
8374
|
defaultMessage: 'No matches found for your search term'
|
|
8364
8375
|
},
|
|
8376
|
+
searchSelectInputNoValueMessage: {
|
|
8377
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8378
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8379
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8380
|
+
},
|
|
8365
8381
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8366
8382
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8367
8383
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8369,8 +8385,8 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8369
8385
|
}
|
|
8370
8386
|
});
|
|
8371
8387
|
|
|
8372
|
-
function ownKeys$
|
|
8373
|
-
function _objectSpread$
|
|
8388
|
+
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; }
|
|
8389
|
+
function _objectSpread$C(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$C(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$C(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8374
8390
|
const hasErrors$2 = errors => {
|
|
8375
8391
|
var _context;
|
|
8376
8392
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8395,7 +8411,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8395
8411
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8396
8412
|
};
|
|
8397
8413
|
const emptyStoreOption = intl => [{
|
|
8398
|
-
label: intl.formatMessage(messages$
|
|
8414
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8399
8415
|
value: undefined,
|
|
8400
8416
|
isDisabled: true
|
|
8401
8417
|
}];
|
|
@@ -8442,10 +8458,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8442
8458
|
};
|
|
8443
8459
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8444
8460
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8445
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8461
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$C(_objectSpread$C({
|
|
8446
8462
|
id: props.id,
|
|
8447
8463
|
name: props.name,
|
|
8448
|
-
placeholder: intl.formatMessage(messages$
|
|
8464
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8449
8465
|
horizontalConstraint: props.horizontalConstraint,
|
|
8450
8466
|
loadOptions: handleLoadOptions,
|
|
8451
8467
|
defaultOptions: true,
|
|
@@ -8485,8 +8501,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8485
8501
|
shouldFetchProductSelections: false
|
|
8486
8502
|
};
|
|
8487
8503
|
|
|
8488
|
-
function ownKeys$
|
|
8489
|
-
function _objectSpread$
|
|
8504
|
+
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; }
|
|
8505
|
+
function _objectSpread$B(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$B(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$B(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8490
8506
|
const hasErrors$1 = errors => {
|
|
8491
8507
|
var _context;
|
|
8492
8508
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8534,10 +8550,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8534
8550
|
};
|
|
8535
8551
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8536
8552
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8537
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8553
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$B(_objectSpread$B({
|
|
8538
8554
|
id: props.id,
|
|
8539
8555
|
name: props.name,
|
|
8540
|
-
placeholder: intl.formatMessage(messages$
|
|
8556
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8541
8557
|
horizontalConstraint: props.horizontalConstraint,
|
|
8542
8558
|
options: mappedStoresListOptions,
|
|
8543
8559
|
isMulti: props.isMulti,
|
|
@@ -8630,8 +8646,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8630
8646
|
};
|
|
8631
8647
|
};
|
|
8632
8648
|
|
|
8633
|
-
function ownKeys$
|
|
8634
|
-
function _objectSpread$
|
|
8649
|
+
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; }
|
|
8650
|
+
function _objectSpread$A(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$A(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$A(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8635
8651
|
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 } } } };
|
|
8636
8652
|
const hasErrors = errors => {
|
|
8637
8653
|
var _context;
|
|
@@ -8733,10 +8749,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8733
8749
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8734
8750
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8735
8751
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8736
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8752
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8737
8753
|
id: props.id,
|
|
8738
8754
|
name: props.name,
|
|
8739
|
-
placeholder: intl.formatMessage(messages$
|
|
8755
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8740
8756
|
horizontalConstraint: props.horizontalConstraint,
|
|
8741
8757
|
loadOptions: loadOptionsDebounced,
|
|
8742
8758
|
defaultOptions: false,
|
|
@@ -8750,8 +8766,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8750
8766
|
}),
|
|
8751
8767
|
onChange: props.onChange,
|
|
8752
8768
|
onBlur: props.onBlur,
|
|
8753
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8754
|
-
noOptionsMessage:
|
|
8769
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8770
|
+
noOptionsMessage: _ref4 => {
|
|
8771
|
+
let inputValue = _ref4.inputValue;
|
|
8772
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8773
|
+
},
|
|
8755
8774
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8756
8775
|
isReadOnly: props.isReadOnly,
|
|
8757
8776
|
isClearable: props.isClearable,
|
|
@@ -8779,8 +8798,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8779
8798
|
shouldFetchProductSelections: false
|
|
8780
8799
|
};
|
|
8781
8800
|
|
|
8782
|
-
function ownKeys$
|
|
8783
|
-
function _objectSpread$
|
|
8801
|
+
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; }
|
|
8802
|
+
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; }
|
|
8784
8803
|
const StoreSelectInput = props => {
|
|
8785
8804
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8786
8805
|
const components = React.useMemo(() => {
|
|
@@ -8788,7 +8807,7 @@ const StoreSelectInput = props => {
|
|
|
8788
8807
|
// eslint-disable-next-line react/display-name
|
|
8789
8808
|
Option: optionInnerProps => {
|
|
8790
8809
|
if (optionInnerProps.isDisabled) {
|
|
8791
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8810
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$z({}, optionInnerProps));
|
|
8792
8811
|
}
|
|
8793
8812
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8794
8813
|
optionType: props.optionType,
|
|
@@ -8799,7 +8818,7 @@ const StoreSelectInput = props => {
|
|
|
8799
8818
|
}, [props.optionType]);
|
|
8800
8819
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8801
8820
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8802
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8821
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$z(_objectSpread$z({
|
|
8803
8822
|
projectKey: props.projectKey,
|
|
8804
8823
|
id: props.id,
|
|
8805
8824
|
name: props.name,
|
|
@@ -8839,11 +8858,22 @@ StoreSelectInput.defaultProps = {
|
|
|
8839
8858
|
shouldFetchProductSelections: false
|
|
8840
8859
|
};
|
|
8841
8860
|
|
|
8842
|
-
//
|
|
8861
|
+
// Values have to match enum values on core ws
|
|
8843
8862
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
8844
|
-
const
|
|
8863
|
+
const businessRoleConstants = {
|
|
8864
|
+
ExecutiveManagement: 'ExecutiveManagement',
|
|
8865
|
+
Architect: 'Architect',
|
|
8866
|
+
Engineer: 'Engineer',
|
|
8867
|
+
ProductProjectManagerOrOwner: 'ProductProjectManagerOrOwner',
|
|
8868
|
+
Marketing: 'Marketing',
|
|
8869
|
+
CustomerService: 'CustomerService',
|
|
8870
|
+
SalesAndECommerceManager: 'SalesAndECommerceManager',
|
|
8871
|
+
Other: 'Other'
|
|
8872
|
+
};
|
|
8845
8873
|
|
|
8846
|
-
|
|
8874
|
+
const businessRoleKeys = _Object$values__default["default"](businessRoleConstants);
|
|
8875
|
+
|
|
8876
|
+
var messages$r = reactIntl.defineMessages({
|
|
8847
8877
|
ExecutiveManagement: {
|
|
8848
8878
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8849
8879
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8901,7 +8931,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8901
8931
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
8902
8932
|
}
|
|
8903
8933
|
|
|
8904
|
-
const messages$
|
|
8934
|
+
const messages$q = reactIntl.defineMessages({
|
|
8905
8935
|
inputFieldError: {
|
|
8906
8936
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8907
8937
|
description: 'Error message for empty input field ',
|
|
@@ -8922,14 +8952,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8922
8952
|
if (validateSingleFilter({
|
|
8923
8953
|
value
|
|
8924
8954
|
})) {
|
|
8925
|
-
return intl.formatMessage(messages$
|
|
8955
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8926
8956
|
}
|
|
8927
8957
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8928
8958
|
value: value.currencyCode
|
|
8929
8959
|
}) || validateSingleFilter({
|
|
8930
8960
|
value: value.amount
|
|
8931
8961
|
}))) {
|
|
8932
|
-
return intl.formatMessage(messages$
|
|
8962
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8933
8963
|
}
|
|
8934
8964
|
return null;
|
|
8935
8965
|
};
|
|
@@ -8937,7 +8967,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8937
8967
|
let value = _ref.value;
|
|
8938
8968
|
if (!value || !value.type) {
|
|
8939
8969
|
return {
|
|
8940
|
-
type: intl.formatMessage(messages$
|
|
8970
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8941
8971
|
};
|
|
8942
8972
|
}
|
|
8943
8973
|
const typeName = value.type.name;
|
|
@@ -8945,7 +8975,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8945
8975
|
const filterValue = value.value;
|
|
8946
8976
|
if (hasOption && !value.option) {
|
|
8947
8977
|
return {
|
|
8948
|
-
option: intl.formatMessage(messages$
|
|
8978
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8949
8979
|
};
|
|
8950
8980
|
}
|
|
8951
8981
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8964,7 +8994,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8964
8994
|
} : null;
|
|
8965
8995
|
}
|
|
8966
8996
|
|
|
8967
|
-
const messages$
|
|
8997
|
+
const messages$p = reactIntl.defineMessages({
|
|
8968
8998
|
rangeMissingValue: {
|
|
8969
8999
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8970
9000
|
description: 'error message if missing a value in a range',
|
|
@@ -8989,25 +9019,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
8989
9019
|
if (validateSingleFilter({
|
|
8990
9020
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
8991
9021
|
})) return {
|
|
8992
|
-
from: intl.formatMessage(messages$
|
|
9022
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8993
9023
|
};
|
|
8994
9024
|
if (validateSingleFilter({
|
|
8995
9025
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
8996
9026
|
})) return {
|
|
8997
|
-
to: intl.formatMessage(messages$
|
|
9027
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8998
9028
|
};
|
|
8999
9029
|
if (moment__default$1["default"](value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
9000
|
-
from: intl.formatMessage(messages$
|
|
9030
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
9001
9031
|
};
|
|
9002
9032
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9003
9033
|
if (validateSingleFilter({
|
|
9004
9034
|
value
|
|
9005
|
-
})) return intl.formatMessage(messages$
|
|
9035
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
9006
9036
|
}
|
|
9007
9037
|
return null;
|
|
9008
9038
|
}
|
|
9009
9039
|
|
|
9010
|
-
const messages$
|
|
9040
|
+
const messages$o = reactIntl.defineMessages({
|
|
9011
9041
|
rangeMissingValue: {
|
|
9012
9042
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9013
9043
|
description: 'error message if missing a value in a range',
|
|
@@ -9026,30 +9056,30 @@ function validateFilter(_ref, intl) {
|
|
|
9026
9056
|
_ref$allowFloat = _ref.allowFloat,
|
|
9027
9057
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9028
9058
|
if (type !== 'range') {
|
|
9029
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9059
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
9030
9060
|
return null;
|
|
9031
9061
|
}
|
|
9032
9062
|
|
|
9033
9063
|
// only range types from here
|
|
9034
9064
|
|
|
9035
9065
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9036
|
-
from: intl.formatMessage(messages$
|
|
9066
|
+
from: intl.formatMessage(messages$K.integer)
|
|
9037
9067
|
};
|
|
9038
9068
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9039
|
-
to: intl.formatMessage(messages$
|
|
9069
|
+
to: intl.formatMessage(messages$K.integer)
|
|
9040
9070
|
};
|
|
9041
9071
|
if (validateSingleFilter({
|
|
9042
9072
|
value: value.from
|
|
9043
9073
|
})) return {
|
|
9044
|
-
from: intl.formatMessage(messages$
|
|
9074
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9045
9075
|
};
|
|
9046
9076
|
if (validateSingleFilter({
|
|
9047
9077
|
value: value.to
|
|
9048
9078
|
})) return {
|
|
9049
|
-
to: intl.formatMessage(messages$
|
|
9079
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9050
9080
|
};
|
|
9051
9081
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9052
|
-
from: intl.formatMessage(messages$
|
|
9082
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9053
9083
|
};
|
|
9054
9084
|
return null;
|
|
9055
9085
|
}
|
|
@@ -9343,10 +9373,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9343
9373
|
carts: 'carts'
|
|
9344
9374
|
};
|
|
9345
9375
|
|
|
9346
|
-
function ownKeys$
|
|
9347
|
-
function _objectSpread$
|
|
9376
|
+
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; }
|
|
9377
|
+
function _objectSpread$y(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$y(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$y(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9348
9378
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9349
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9379
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$y({
|
|
9350
9380
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9351
9381
|
}, previousIncludedLimits), {});
|
|
9352
9382
|
|
|
@@ -9408,7 +9438,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9408
9438
|
};
|
|
9409
9439
|
};
|
|
9410
9440
|
|
|
9411
|
-
var messages$
|
|
9441
|
+
var messages$n = reactIntl.defineMessages({
|
|
9412
9442
|
shippingMethods: {
|
|
9413
9443
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9414
9444
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9436,8 +9466,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9436
9466
|
}
|
|
9437
9467
|
});
|
|
9438
9468
|
|
|
9439
|
-
function ownKeys$
|
|
9440
|
-
function _objectSpread$
|
|
9469
|
+
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; }
|
|
9470
|
+
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; }
|
|
9441
9471
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9442
9472
|
isExternal: true,
|
|
9443
9473
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9448,7 +9478,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9448
9478
|
limit = _ref.limit;
|
|
9449
9479
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9450
9480
|
type: "warning",
|
|
9451
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9481
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$n[resource]), {}, {
|
|
9452
9482
|
values: {
|
|
9453
9483
|
limit,
|
|
9454
9484
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9461,7 +9491,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9461
9491
|
};
|
|
9462
9492
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9463
9493
|
|
|
9464
|
-
var messages$
|
|
9494
|
+
var messages$m = reactIntl.defineMessages({
|
|
9465
9495
|
shippingMethods: {
|
|
9466
9496
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9467
9497
|
description: 'error message about platform limit exceeded',
|
|
@@ -9489,8 +9519,8 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9489
9519
|
}
|
|
9490
9520
|
});
|
|
9491
9521
|
|
|
9492
|
-
function ownKeys$
|
|
9493
|
-
function _objectSpread$
|
|
9522
|
+
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; }
|
|
9523
|
+
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; }
|
|
9494
9524
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9495
9525
|
isExternal: true,
|
|
9496
9526
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9501,7 +9531,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9501
9531
|
limit = _ref.limit;
|
|
9502
9532
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9503
9533
|
type: "error",
|
|
9504
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9534
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w(_objectSpread$w({}, messages$m[resource]), {}, {
|
|
9505
9535
|
values: {
|
|
9506
9536
|
limit,
|
|
9507
9537
|
customersupport: getCustomerSupportLink
|
|
@@ -9519,8 +9549,8 @@ const Notifications = {
|
|
|
9519
9549
|
Error: PlatformLimitErrorNotification
|
|
9520
9550
|
};
|
|
9521
9551
|
|
|
9522
|
-
function ownKeys$
|
|
9523
|
-
function _objectSpread$
|
|
9552
|
+
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; }
|
|
9553
|
+
function _objectSpread$v(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$v(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$v(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9524
9554
|
const PlatformLimitsStatusText = _ref => {
|
|
9525
9555
|
let intlMessage = _ref.intlMessage,
|
|
9526
9556
|
children = _ref.children;
|
|
@@ -9529,7 +9559,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9529
9559
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9530
9560
|
size: "xs",
|
|
9531
9561
|
children: [jsxRuntime.jsx("span", {
|
|
9532
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9562
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$v({}, intlMessage))
|
|
9533
9563
|
}), jsxRuntime.jsx("span", {
|
|
9534
9564
|
children: children
|
|
9535
9565
|
})]
|
|
@@ -9630,7 +9660,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9630
9660
|
};
|
|
9631
9661
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9632
9662
|
|
|
9633
|
-
var messages$
|
|
9663
|
+
var messages$l = reactIntl.defineMessages({
|
|
9634
9664
|
shippingMethodsPlatformLimitReached: {
|
|
9635
9665
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9636
9666
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9638,17 +9668,17 @@ var messages$k = reactIntl.defineMessages({
|
|
|
9638
9668
|
}
|
|
9639
9669
|
});
|
|
9640
9670
|
|
|
9641
|
-
function ownKeys$
|
|
9642
|
-
function _objectSpread$
|
|
9671
|
+
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; }
|
|
9672
|
+
function _objectSpread$u(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$u(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$u(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9643
9673
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9644
9674
|
const intl = reactIntl.useIntl();
|
|
9645
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9646
|
-
title: intl.formatMessage(messages$
|
|
9675
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
9676
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9647
9677
|
}));
|
|
9648
9678
|
};
|
|
9649
9679
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9650
9680
|
|
|
9651
|
-
var messages$
|
|
9681
|
+
var messages$k = reactIntl.defineMessages({
|
|
9652
9682
|
shippingMethodsStatus: {
|
|
9653
9683
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9654
9684
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9657,15 +9687,15 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9657
9687
|
});
|
|
9658
9688
|
|
|
9659
9689
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9660
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9690
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9661
9691
|
let total = _ref.total;
|
|
9662
9692
|
const intl = reactIntl.useIntl();
|
|
9663
9693
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9664
9694
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9665
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9666
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9695
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 || (_platformLimits$shipp = _platformLimits$shipp.total) === null || _platformLimits$shipp === void 0 ? void 0 : _platformLimits$shipp.current;
|
|
9696
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp2 = platformLimits.shippingMethods) === null || _platformLimits$shipp2 === void 0 || (_platformLimits$shipp2 = _platformLimits$shipp2.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.limit;
|
|
9667
9697
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9668
|
-
intlMessage: messages$
|
|
9698
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9669
9699
|
children: getPlatformLimitsStatus({
|
|
9670
9700
|
limit,
|
|
9671
9701
|
current,
|
|
@@ -9696,15 +9726,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9696
9726
|
};
|
|
9697
9727
|
};
|
|
9698
9728
|
|
|
9699
|
-
function ownKeys$
|
|
9700
|
-
function _objectSpread$
|
|
9729
|
+
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; }
|
|
9730
|
+
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; }
|
|
9701
9731
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9702
9732
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9703
9733
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9704
9734
|
const shippingMethodsProps = {
|
|
9705
9735
|
platformLimits: shippingMethodsPlatformLimits
|
|
9706
9736
|
};
|
|
9707
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9737
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$t(_objectSpread$t({}, props), shippingMethodsProps));
|
|
9708
9738
|
};
|
|
9709
9739
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9710
9740
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9777,7 +9807,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9777
9807
|
};
|
|
9778
9808
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9779
9809
|
|
|
9780
|
-
var messages$
|
|
9810
|
+
var messages$j = reactIntl.defineMessages({
|
|
9781
9811
|
taxCategoriesPlatformLimitReached: {
|
|
9782
9812
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9783
9813
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9785,17 +9815,17 @@ var messages$i = reactIntl.defineMessages({
|
|
|
9785
9815
|
}
|
|
9786
9816
|
});
|
|
9787
9817
|
|
|
9788
|
-
function ownKeys$
|
|
9789
|
-
function _objectSpread$
|
|
9818
|
+
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; }
|
|
9819
|
+
function _objectSpread$s(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$s(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$s(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9790
9820
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9791
9821
|
const intl = reactIntl.useIntl();
|
|
9792
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9793
|
-
title: intl.formatMessage(messages$
|
|
9822
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9823
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9794
9824
|
}));
|
|
9795
9825
|
};
|
|
9796
9826
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9797
9827
|
|
|
9798
|
-
var messages$
|
|
9828
|
+
var messages$i = reactIntl.defineMessages({
|
|
9799
9829
|
taxCategoriesStatus: {
|
|
9800
9830
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9801
9831
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9804,15 +9834,15 @@ var messages$h = reactIntl.defineMessages({
|
|
|
9804
9834
|
});
|
|
9805
9835
|
|
|
9806
9836
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9807
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9837
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9808
9838
|
let total = _ref.total;
|
|
9809
9839
|
const intl = reactIntl.useIntl();
|
|
9810
9840
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9811
9841
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9812
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9813
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9842
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 || (_platformLimits$taxCa = _platformLimits$taxCa.total) === null || _platformLimits$taxCa === void 0 ? void 0 : _platformLimits$taxCa.current;
|
|
9843
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa2 = platformLimits.taxCategories) === null || _platformLimits$taxCa2 === void 0 || (_platformLimits$taxCa2 = _platformLimits$taxCa2.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.limit;
|
|
9814
9844
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9815
|
-
intlMessage: messages$
|
|
9845
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9816
9846
|
children: getPlatformLimitsStatus({
|
|
9817
9847
|
limit,
|
|
9818
9848
|
current,
|
|
@@ -9843,15 +9873,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9843
9873
|
};
|
|
9844
9874
|
};
|
|
9845
9875
|
|
|
9846
|
-
function ownKeys$
|
|
9847
|
-
function _objectSpread$
|
|
9876
|
+
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; }
|
|
9877
|
+
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; }
|
|
9848
9878
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9849
9879
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9850
9880
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9851
9881
|
const taxCategoriesProps = {
|
|
9852
9882
|
platformLimits: taxCategoriesPlatformLimits
|
|
9853
9883
|
};
|
|
9854
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9884
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), taxCategoriesProps));
|
|
9855
9885
|
};
|
|
9856
9886
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9857
9887
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9924,7 +9954,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9924
9954
|
};
|
|
9925
9955
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9926
9956
|
|
|
9927
|
-
var messages$
|
|
9957
|
+
var messages$h = reactIntl.defineMessages({
|
|
9928
9958
|
zonesPlatformLimitReached: {
|
|
9929
9959
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9930
9960
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9932,17 +9962,17 @@ var messages$g = reactIntl.defineMessages({
|
|
|
9932
9962
|
}
|
|
9933
9963
|
});
|
|
9934
9964
|
|
|
9935
|
-
function ownKeys$
|
|
9936
|
-
function _objectSpread$
|
|
9965
|
+
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; }
|
|
9966
|
+
function _objectSpread$q(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$q(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$q(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9937
9967
|
const PlatformLimitsZonesTooltip = props => {
|
|
9938
9968
|
const intl = reactIntl.useIntl();
|
|
9939
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9940
|
-
title: intl.formatMessage(messages$
|
|
9969
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9970
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9941
9971
|
}));
|
|
9942
9972
|
};
|
|
9943
9973
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9944
9974
|
|
|
9945
|
-
var messages$
|
|
9975
|
+
var messages$g = reactIntl.defineMessages({
|
|
9946
9976
|
zonesStatus: {
|
|
9947
9977
|
id: 'PlatformLimits.Status.zones',
|
|
9948
9978
|
description: 'The message for zones platform limit values',
|
|
@@ -9951,15 +9981,15 @@ var messages$f = reactIntl.defineMessages({
|
|
|
9951
9981
|
});
|
|
9952
9982
|
|
|
9953
9983
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9954
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
9984
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9955
9985
|
let total = _ref.total;
|
|
9956
9986
|
const intl = reactIntl.useIntl();
|
|
9957
9987
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9958
9988
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9959
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9960
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9989
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 || (_platformLimits$zones = _platformLimits$zones.total) === null || _platformLimits$zones === void 0 ? void 0 : _platformLimits$zones.current;
|
|
9990
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones2 = platformLimits.zones) === null || _platformLimits$zones2 === void 0 || (_platformLimits$zones2 = _platformLimits$zones2.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.limit;
|
|
9961
9991
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9962
|
-
intlMessage: messages$
|
|
9992
|
+
intlMessage: messages$g.zonesStatus,
|
|
9963
9993
|
children: getPlatformLimitsStatus({
|
|
9964
9994
|
limit,
|
|
9965
9995
|
current,
|
|
@@ -9990,15 +10020,15 @@ const useZonesLimits = () => {
|
|
|
9990
10020
|
};
|
|
9991
10021
|
};
|
|
9992
10022
|
|
|
9993
|
-
function ownKeys$
|
|
9994
|
-
function _objectSpread$
|
|
10023
|
+
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; }
|
|
10024
|
+
function _objectSpread$p(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$p(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$p(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9995
10025
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
9996
10026
|
const WithZonesPlatformLimits = props => {
|
|
9997
10027
|
const zonesPlatformLimits = useZonesLimits();
|
|
9998
10028
|
const zonesProps = {
|
|
9999
10029
|
platformLimits: zonesPlatformLimits
|
|
10000
10030
|
};
|
|
10001
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10031
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), zonesProps));
|
|
10002
10032
|
};
|
|
10003
10033
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10004
10034
|
return WithZonesPlatformLimits;
|
|
@@ -10084,7 +10114,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10084
10114
|
};
|
|
10085
10115
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10086
10116
|
|
|
10087
|
-
var messages$
|
|
10117
|
+
var messages$f = reactIntl.defineMessages({
|
|
10088
10118
|
customersPlatformLimitReached: {
|
|
10089
10119
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10090
10120
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10092,17 +10122,17 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10092
10122
|
}
|
|
10093
10123
|
});
|
|
10094
10124
|
|
|
10095
|
-
function ownKeys$
|
|
10096
|
-
function _objectSpread$
|
|
10125
|
+
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; }
|
|
10126
|
+
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; }
|
|
10097
10127
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10098
10128
|
const intl = reactIntl.useIntl();
|
|
10099
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10100
|
-
title: intl.formatMessage(messages$
|
|
10129
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
10130
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10101
10131
|
}));
|
|
10102
10132
|
};
|
|
10103
10133
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10104
10134
|
|
|
10105
|
-
var messages$
|
|
10135
|
+
var messages$e = reactIntl.defineMessages({
|
|
10106
10136
|
customersStatus: {
|
|
10107
10137
|
id: 'PlatformLimits.Status.customers',
|
|
10108
10138
|
description: 'The message for customers platform limit values',
|
|
@@ -10110,8 +10140,8 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10110
10140
|
}
|
|
10111
10141
|
});
|
|
10112
10142
|
|
|
10113
|
-
function ownKeys$
|
|
10114
|
-
function _objectSpread$
|
|
10143
|
+
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; }
|
|
10144
|
+
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; }
|
|
10115
10145
|
var styles$b = {
|
|
10116
10146
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10117
10147
|
};
|
|
@@ -10131,7 +10161,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10131
10161
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10132
10162
|
tone: "secondary",
|
|
10133
10163
|
isInline: true,
|
|
10134
|
-
intlMessage: _objectSpread$
|
|
10164
|
+
intlMessage: _objectSpread$n(_objectSpread$n({}, messages$e.customersStatus), {}, {
|
|
10135
10165
|
values: {
|
|
10136
10166
|
current: intl.formatNumber(current),
|
|
10137
10167
|
limit: intl.formatNumber(limit)
|
|
@@ -10142,7 +10172,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10142
10172
|
};
|
|
10143
10173
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10144
10174
|
|
|
10145
|
-
var messages$
|
|
10175
|
+
var messages$d = reactIntl.defineMessages({
|
|
10146
10176
|
title: {
|
|
10147
10177
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10148
10178
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10155,10 +10185,10 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10155
10185
|
}
|
|
10156
10186
|
});
|
|
10157
10187
|
|
|
10158
|
-
function ownKeys$
|
|
10159
|
-
function _objectSpread$
|
|
10188
|
+
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; }
|
|
10189
|
+
function _objectSpread$m(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$m(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$m(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10160
10190
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10161
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10191
|
+
return jsxRuntime.jsxs("svg", _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10162
10192
|
children: [jsxRuntime.jsx("defs", {
|
|
10163
10193
|
children: jsxRuntime.jsx("path", {
|
|
10164
10194
|
id: "a",
|
|
@@ -10266,7 +10296,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10266
10296
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10267
10297
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10268
10298
|
onClose: onClose,
|
|
10269
|
-
title: intl.formatMessage(messages$
|
|
10299
|
+
title: intl.formatMessage(messages$d.title),
|
|
10270
10300
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10271
10301
|
scale: "m",
|
|
10272
10302
|
alignItems: "center",
|
|
@@ -10275,7 +10305,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10275
10305
|
alignItems: "center",
|
|
10276
10306
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10277
10307
|
onClick: onClose,
|
|
10278
|
-
label: intl.formatMessage(messages$
|
|
10308
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10279
10309
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10280
10310
|
size: "medium",
|
|
10281
10311
|
color: "primary"
|
|
@@ -10330,15 +10360,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10330
10360
|
};
|
|
10331
10361
|
};
|
|
10332
10362
|
|
|
10333
|
-
function ownKeys$
|
|
10334
|
-
function _objectSpread$
|
|
10363
|
+
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; }
|
|
10364
|
+
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; }
|
|
10335
10365
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10336
10366
|
const WithCustomersPlatformLimits = props => {
|
|
10337
10367
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10338
10368
|
const customersProps = {
|
|
10339
10369
|
platformLimits: CustomersPlatformLimits
|
|
10340
10370
|
};
|
|
10341
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10371
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$l(_objectSpread$l({}, props), customersProps));
|
|
10342
10372
|
};
|
|
10343
10373
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10344
10374
|
return WithCustomersPlatformLimits;
|
|
@@ -10424,7 +10454,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10424
10454
|
};
|
|
10425
10455
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10426
10456
|
|
|
10427
|
-
var messages$
|
|
10457
|
+
var messages$c = reactIntl.defineMessages({
|
|
10428
10458
|
customerGroupsPlatformLimitReached: {
|
|
10429
10459
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10430
10460
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10432,17 +10462,17 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10432
10462
|
}
|
|
10433
10463
|
});
|
|
10434
10464
|
|
|
10435
|
-
function ownKeys$
|
|
10436
|
-
function _objectSpread$
|
|
10465
|
+
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; }
|
|
10466
|
+
function _objectSpread$k(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$k(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$k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10437
10467
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10438
10468
|
const intl = reactIntl.useIntl();
|
|
10439
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10440
|
-
title: intl.formatMessage(messages$
|
|
10469
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10470
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10441
10471
|
}));
|
|
10442
10472
|
};
|
|
10443
10473
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10444
10474
|
|
|
10445
|
-
var messages$
|
|
10475
|
+
var messages$b = reactIntl.defineMessages({
|
|
10446
10476
|
customerGroupsStatus: {
|
|
10447
10477
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10448
10478
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10450,8 +10480,8 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10450
10480
|
}
|
|
10451
10481
|
});
|
|
10452
10482
|
|
|
10453
|
-
function ownKeys$
|
|
10454
|
-
function _objectSpread$
|
|
10483
|
+
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; }
|
|
10484
|
+
function _objectSpread$j(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$j(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$j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10455
10485
|
var styles$9 = {
|
|
10456
10486
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10457
10487
|
};
|
|
@@ -10471,7 +10501,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10471
10501
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10472
10502
|
tone: "secondary",
|
|
10473
10503
|
isInline: true,
|
|
10474
|
-
intlMessage: _objectSpread$
|
|
10504
|
+
intlMessage: _objectSpread$j(_objectSpread$j({}, messages$b.customerGroupsStatus), {}, {
|
|
10475
10505
|
values: {
|
|
10476
10506
|
current: intl.formatNumber(current),
|
|
10477
10507
|
limit: intl.formatNumber(limit)
|
|
@@ -10482,7 +10512,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10482
10512
|
};
|
|
10483
10513
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10484
10514
|
|
|
10485
|
-
var messages$
|
|
10515
|
+
var messages$a = reactIntl.defineMessages({
|
|
10486
10516
|
title: {
|
|
10487
10517
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10488
10518
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10495,10 +10525,10 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
10495
10525
|
}
|
|
10496
10526
|
});
|
|
10497
10527
|
|
|
10498
|
-
function ownKeys$
|
|
10499
|
-
function _objectSpread$
|
|
10528
|
+
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; }
|
|
10529
|
+
function _objectSpread$i(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$i(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$i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10500
10530
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10501
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10531
|
+
return jsxRuntime.jsxs("svg", _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10502
10532
|
children: [jsxRuntime.jsx("defs", {
|
|
10503
10533
|
children: jsxRuntime.jsx("path", {
|
|
10504
10534
|
id: "a",
|
|
@@ -10606,7 +10636,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10606
10636
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10607
10637
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10608
10638
|
onClose: onClose,
|
|
10609
|
-
title: intl.formatMessage(messages$
|
|
10639
|
+
title: intl.formatMessage(messages$a.title),
|
|
10610
10640
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10611
10641
|
scale: "m",
|
|
10612
10642
|
alignItems: "center",
|
|
@@ -10615,7 +10645,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10615
10645
|
alignItems: "center",
|
|
10616
10646
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10617
10647
|
onClick: onClose,
|
|
10618
|
-
label: intl.formatMessage(messages$
|
|
10648
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10619
10649
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10620
10650
|
size: "medium",
|
|
10621
10651
|
color: "primary"
|
|
@@ -10670,15 +10700,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10670
10700
|
};
|
|
10671
10701
|
};
|
|
10672
10702
|
|
|
10673
|
-
function ownKeys$
|
|
10674
|
-
function _objectSpread$
|
|
10703
|
+
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; }
|
|
10704
|
+
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; }
|
|
10675
10705
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10676
10706
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10677
10707
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10678
10708
|
const customersProps = {
|
|
10679
10709
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10680
10710
|
};
|
|
10681
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10711
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$h(_objectSpread$h({}, props), customersProps));
|
|
10682
10712
|
};
|
|
10683
10713
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10684
10714
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10733,7 +10763,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10733
10763
|
}
|
|
10734
10764
|
});
|
|
10735
10765
|
|
|
10736
|
-
var messages$
|
|
10766
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10737
10767
|
indexingSucceed: {
|
|
10738
10768
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10739
10769
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10771,8 +10801,8 @@ const defaultValue = {
|
|
|
10771
10801
|
*/
|
|
10772
10802
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10773
10803
|
|
|
10774
|
-
function ownKeys$
|
|
10775
|
-
function _objectSpread$
|
|
10804
|
+
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; }
|
|
10805
|
+
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; }
|
|
10776
10806
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); 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); }; }
|
|
10777
10807
|
function _isNativeReflectConstruct$3() { 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; } }
|
|
10778
10808
|
var RefreshProductIndices = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "RefreshProductIndices" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "ids" } }, type: { kind: "NonNullType", 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: "refreshProducts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "ids" }, value: { kind: "Variable", name: { kind: "Name", value: "ids" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatedDocuments" }, 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: "deletedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "notFoundDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "unchangedDocuments" }, 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: "failedRefreshedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 1119, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -10858,7 +10888,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10858
10888
|
_this.props.notifications.showNotification({
|
|
10859
10889
|
kind: 'error',
|
|
10860
10890
|
domain: constants.DOMAINS.SIDE,
|
|
10861
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10891
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10862
10892
|
});
|
|
10863
10893
|
};
|
|
10864
10894
|
_this.getIndexingProgress = async () => {
|
|
@@ -10899,7 +10929,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10899
10929
|
_this.props.notifications.showNotification({
|
|
10900
10930
|
kind: 'success',
|
|
10901
10931
|
domain: constants.DOMAINS.SIDE,
|
|
10902
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10932
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10903
10933
|
},
|
|
10904
10934
|
// because the indexing may take so long, the success notification
|
|
10905
10935
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10948,7 +10978,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10948
10978
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10949
10979
|
}
|
|
10950
10980
|
});
|
|
10951
|
-
_this.setState(_objectSpread$
|
|
10981
|
+
_this.setState(_objectSpread$g(_objectSpread$g({
|
|
10952
10982
|
isLoading: false,
|
|
10953
10983
|
isProjectBeingIndexedByPim: true
|
|
10954
10984
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10973,7 +11003,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10973
11003
|
key: "render",
|
|
10974
11004
|
value: function render() {
|
|
10975
11005
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
10976
|
-
value: _objectSpread$
|
|
11006
|
+
value: _objectSpread$g(_objectSpread$g({}, this.state), {}, {
|
|
10977
11007
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
10978
11008
|
indexProject: this.indexProject
|
|
10979
11009
|
}),
|
|
@@ -11015,13 +11045,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11015
11045
|
}(React.PureComponent);
|
|
11016
11046
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11017
11047
|
|
|
11018
|
-
function ownKeys$
|
|
11019
|
-
function _objectSpread$
|
|
11048
|
+
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; }
|
|
11049
|
+
function _objectSpread$f(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$f(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$f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11020
11050
|
var injectPimIndexer = (function () {
|
|
11021
11051
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11022
11052
|
return Component => {
|
|
11023
11053
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11024
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11054
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
11025
11055
|
[propName]: pimIndexerProps
|
|
11026
11056
|
}))
|
|
11027
11057
|
});
|
|
@@ -11034,7 +11064,7 @@ function usePimIndexer() {
|
|
|
11034
11064
|
return React.useContext(PimIndexerContext);
|
|
11035
11065
|
}
|
|
11036
11066
|
|
|
11037
|
-
var messages$
|
|
11067
|
+
var messages$8 = reactIntl.defineMessages({
|
|
11038
11068
|
yes: {
|
|
11039
11069
|
id: 'BooleanField.yes',
|
|
11040
11070
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11056,8 +11086,8 @@ const BooleanField = props => {
|
|
|
11056
11086
|
var _context;
|
|
11057
11087
|
let selectedValue;
|
|
11058
11088
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray__default["default"](props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
11059
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11060
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11089
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11090
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11061
11091
|
const options = [{
|
|
11062
11092
|
value: 'yes',
|
|
11063
11093
|
label: yesLabel
|
|
@@ -11095,7 +11125,7 @@ function getBooleanValue(value) {
|
|
|
11095
11125
|
return value === false ? 'no' : 'yes';
|
|
11096
11126
|
}
|
|
11097
11127
|
|
|
11098
|
-
var messages$
|
|
11128
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11099
11129
|
label: {
|
|
11100
11130
|
id: 'MissingValueField.label',
|
|
11101
11131
|
description: 'The label text for the missing values option',
|
|
@@ -11103,20 +11133,20 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11103
11133
|
}
|
|
11104
11134
|
});
|
|
11105
11135
|
|
|
11106
|
-
function ownKeys$
|
|
11107
|
-
function _objectSpread$
|
|
11136
|
+
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; }
|
|
11137
|
+
function _objectSpread$e(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$e(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$e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11108
11138
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11109
11139
|
name: "missing-value",
|
|
11110
11140
|
isChecked: props.isChecked,
|
|
11111
11141
|
onChange: props.onChange,
|
|
11112
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11142
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$e({}, messages$7.label))
|
|
11113
11143
|
});
|
|
11114
11144
|
MissingValueField.defaultProps = {
|
|
11115
11145
|
isChecked: false
|
|
11116
11146
|
};
|
|
11117
11147
|
|
|
11118
|
-
function ownKeys$
|
|
11119
|
-
function _objectSpread$
|
|
11148
|
+
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; }
|
|
11149
|
+
function _objectSpread$d(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$d(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$d(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11120
11150
|
var styles$7 = {
|
|
11121
11151
|
"button": "button-module__button___1OzVf",
|
|
11122
11152
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11150,7 +11180,7 @@ const Button = props => {
|
|
|
11150
11180
|
|
|
11151
11181
|
// Pass only `data-*` props
|
|
11152
11182
|
const dataProps = filterDataAttributes(props);
|
|
11153
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11183
|
+
return jsxRuntime.jsx("button", _objectSpread$d(_objectSpread$d({
|
|
11154
11184
|
onClick: isDisabled ? null : onClick,
|
|
11155
11185
|
type: props.type,
|
|
11156
11186
|
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11165,7 +11195,7 @@ Button.defaultProps = {
|
|
|
11165
11195
|
type: 'button'
|
|
11166
11196
|
};
|
|
11167
11197
|
|
|
11168
|
-
var messages$
|
|
11198
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11169
11199
|
chooseFile: {
|
|
11170
11200
|
id: 'ButtonFileInput.chooseFile',
|
|
11171
11201
|
description: 'The label text of the field for upload local file',
|
|
@@ -11173,8 +11203,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
11173
11203
|
}
|
|
11174
11204
|
});
|
|
11175
11205
|
|
|
11176
|
-
function ownKeys$
|
|
11177
|
-
function _objectSpread$
|
|
11206
|
+
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; }
|
|
11207
|
+
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; }
|
|
11178
11208
|
var styles$6 = {
|
|
11179
11209
|
"button": "file-input-module__button___2KypN",
|
|
11180
11210
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11194,7 +11224,7 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11194
11224
|
});
|
|
11195
11225
|
FileInput.displayName = 'FileInput';
|
|
11196
11226
|
FileInput.defaultProps = {
|
|
11197
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11227
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$c({}, messages$6.chooseFile)),
|
|
11198
11228
|
allowMultiple: false,
|
|
11199
11229
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11200
11230
|
};
|
|
@@ -11241,7 +11271,7 @@ const ScrollToFieldError = () => {
|
|
|
11241
11271
|
return null;
|
|
11242
11272
|
};
|
|
11243
11273
|
|
|
11244
|
-
var messages$
|
|
11274
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11245
11275
|
buttonLabel: {
|
|
11246
11276
|
id: 'SearchInput.buttonLabel',
|
|
11247
11277
|
description: 'Label for "Search" button.',
|
|
@@ -11296,15 +11326,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11296
11326
|
});
|
|
11297
11327
|
},
|
|
11298
11328
|
onReset: props.onReset,
|
|
11299
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11329
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11300
11330
|
isDisabled: props.disabled
|
|
11301
11331
|
})
|
|
11302
11332
|
});
|
|
11303
11333
|
};
|
|
11304
11334
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11305
11335
|
|
|
11306
|
-
function ownKeys$
|
|
11307
|
-
function _objectSpread$
|
|
11336
|
+
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; }
|
|
11337
|
+
function _objectSpread$b(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$b(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$b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11308
11338
|
const StoreSelectField = props => {
|
|
11309
11339
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
11310
11340
|
max: props.horizontalConstraint,
|
|
@@ -11318,7 +11348,7 @@ const StoreSelectField = props => {
|
|
|
11318
11348
|
htmlFor: props.id,
|
|
11319
11349
|
hasRequiredIndicator: props.isRequired,
|
|
11320
11350
|
isBold: true
|
|
11321
|
-
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$
|
|
11351
|
+
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$b(_objectSpread$b({
|
|
11322
11352
|
projectKey: props.projectKey,
|
|
11323
11353
|
id: props.id,
|
|
11324
11354
|
name: props.name,
|
|
@@ -11358,8 +11388,8 @@ StoreSelectField.defaultProps = {
|
|
|
11358
11388
|
};
|
|
11359
11389
|
|
|
11360
11390
|
var _templateObject;
|
|
11361
|
-
function ownKeys$
|
|
11362
|
-
function _objectSpread$
|
|
11391
|
+
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; }
|
|
11392
|
+
function _objectSpread$a(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$a(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$a(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11363
11393
|
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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); }; }
|
|
11364
11394
|
function _isNativeReflectConstruct$1() { 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; } }
|
|
11365
11395
|
var styles$3 = {
|
|
@@ -11376,7 +11406,7 @@ const validateRequired = value => {
|
|
|
11376
11406
|
};
|
|
11377
11407
|
const VALIDATOR_REQUIRED = {
|
|
11378
11408
|
name: 'required',
|
|
11379
|
-
message: messages$
|
|
11409
|
+
message: messages$K.required,
|
|
11380
11410
|
permanent: true,
|
|
11381
11411
|
validators: {
|
|
11382
11412
|
change(value) {
|
|
@@ -11390,7 +11420,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11390
11420
|
};
|
|
11391
11421
|
const VALIDATOR_NUMERIC = {
|
|
11392
11422
|
name: 'numeric',
|
|
11393
|
-
message: messages$
|
|
11423
|
+
message: messages$K.numeric,
|
|
11394
11424
|
permanent: false,
|
|
11395
11425
|
validators: {
|
|
11396
11426
|
change: v => {
|
|
@@ -11405,7 +11435,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11405
11435
|
};
|
|
11406
11436
|
const VALIDATOR_INTEGER = {
|
|
11407
11437
|
name: 'integer',
|
|
11408
|
-
message: messages$
|
|
11438
|
+
message: messages$K.integer,
|
|
11409
11439
|
permanent: false,
|
|
11410
11440
|
validators: {
|
|
11411
11441
|
change: v => {
|
|
@@ -11420,7 +11450,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11420
11450
|
};
|
|
11421
11451
|
({
|
|
11422
11452
|
name: 'email',
|
|
11423
|
-
message: messages$
|
|
11453
|
+
message: messages$K.email,
|
|
11424
11454
|
permanent: false,
|
|
11425
11455
|
validators: {
|
|
11426
11456
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11503,7 +11533,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11503
11533
|
* so it must be an invalid numeric value
|
|
11504
11534
|
*/
|
|
11505
11535
|
_this.handleInvalid = () => {
|
|
11506
|
-
const nextValidStatus = _objectSpread$
|
|
11536
|
+
const nextValidStatus = _objectSpread$a({}, _this.state.validStatus);
|
|
11507
11537
|
if (has__default["default"](nextValidStatus, 'numeric')) {
|
|
11508
11538
|
nextValidStatus.numeric = false;
|
|
11509
11539
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11535,10 +11565,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11535
11565
|
key: "componentDidMount",
|
|
11536
11566
|
value: function componentDidMount() {
|
|
11537
11567
|
}
|
|
11538
|
-
// eslint-disable-next-line camelcase
|
|
11539
11568
|
}, {
|
|
11540
|
-
key: "
|
|
11541
|
-
value: function
|
|
11569
|
+
key: "componentDidUpdate",
|
|
11570
|
+
value: function componentDidUpdate() {
|
|
11571
|
+
const nextProps = this.props;
|
|
11542
11572
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11543
11573
|
this.resetValidity();
|
|
11544
11574
|
this.handleChange(nextProps.value, {
|
|
@@ -11553,7 +11583,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11553
11583
|
if (prev) return this.state.validStatus[v.name];
|
|
11554
11584
|
return prev;
|
|
11555
11585
|
}, true);
|
|
11556
|
-
const componentProps = _objectSpread$
|
|
11586
|
+
const componentProps = _objectSpread$a(_objectSpread$a({}, this.props), {}, {
|
|
11557
11587
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11558
11588
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11559
11589
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11570,7 +11600,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11570
11600
|
components: {
|
|
11571
11601
|
WrapperComponent: ToolTipWrapperComponent
|
|
11572
11602
|
},
|
|
11573
|
-
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$
|
|
11603
|
+
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$a({}, componentProps))
|
|
11574
11604
|
})
|
|
11575
11605
|
});
|
|
11576
11606
|
}
|
|
@@ -11625,7 +11655,7 @@ function simpleInput(type) {
|
|
|
11625
11655
|
}, _class;
|
|
11626
11656
|
}
|
|
11627
11657
|
|
|
11628
|
-
var messages$
|
|
11658
|
+
var messages$4 = reactIntl.defineMessages({
|
|
11629
11659
|
customFieldsError: {
|
|
11630
11660
|
id: 'CustomFieldsError.Error',
|
|
11631
11661
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11633,14 +11663,14 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
11633
11663
|
}
|
|
11634
11664
|
});
|
|
11635
11665
|
|
|
11636
|
-
function ownKeys$
|
|
11637
|
-
function _objectSpread$
|
|
11666
|
+
function ownKeys$9(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; }
|
|
11667
|
+
function _objectSpread$9(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$9(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$9(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11638
11668
|
const CustomFieldsErrorTextNotification = props => {
|
|
11639
11669
|
var _context;
|
|
11640
11670
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
11641
11671
|
scale: "s",
|
|
11642
11672
|
children: [jsxRuntime.jsx(uiKit.Text.Wrap, {
|
|
11643
|
-
intlMessage: _objectSpread$
|
|
11673
|
+
intlMessage: _objectSpread$9({}, messages$4.customFieldsError)
|
|
11644
11674
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
11645
11675
|
scale: "xs",
|
|
11646
11676
|
children: _mapInstanceProperty__default["default"](_context = props.formErrors).call(_context, formError => jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -11652,7 +11682,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11652
11682
|
};
|
|
11653
11683
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11654
11684
|
|
|
11655
|
-
const messages$
|
|
11685
|
+
const messages$3 = reactIntl.defineMessages({
|
|
11656
11686
|
from: {
|
|
11657
11687
|
id: 'LabelRange.from',
|
|
11658
11688
|
description: 'The label for "from" range',
|
|
@@ -11665,8 +11695,8 @@ const messages$2 = reactIntl.defineMessages({
|
|
|
11665
11695
|
}
|
|
11666
11696
|
});
|
|
11667
11697
|
|
|
11668
|
-
function ownKeys$
|
|
11669
|
-
function _objectSpread$
|
|
11698
|
+
function ownKeys$8(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; }
|
|
11699
|
+
function _objectSpread$8(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$8(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$8(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11670
11700
|
var styles$2 = {
|
|
11671
11701
|
"label": "label-range-module__label___3Tb0p"
|
|
11672
11702
|
};
|
|
@@ -11674,12 +11704,12 @@ const LabelRange = _ref => {
|
|
|
11674
11704
|
let type = _ref.type;
|
|
11675
11705
|
return jsxRuntime.jsx("label", {
|
|
11676
11706
|
className: styles$2.label,
|
|
11677
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11707
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$3[type]))
|
|
11678
11708
|
});
|
|
11679
11709
|
};
|
|
11680
11710
|
LabelRange.displayName = 'LabelRange';
|
|
11681
11711
|
|
|
11682
|
-
var messages$
|
|
11712
|
+
var messages$2 = reactIntl.defineMessages({
|
|
11683
11713
|
filterWholeInput: {
|
|
11684
11714
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11685
11715
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11692,8 +11722,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
11692
11722
|
}
|
|
11693
11723
|
});
|
|
11694
11724
|
|
|
11695
|
-
function ownKeys$
|
|
11696
|
-
function _objectSpread$
|
|
11725
|
+
function ownKeys$7(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; }
|
|
11726
|
+
function _objectSpread$7(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$7(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$7(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11697
11727
|
var styles$1 = {
|
|
11698
11728
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11699
11729
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11717,7 +11747,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11717
11747
|
}),
|
|
11718
11748
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11719
11749
|
truncate: true,
|
|
11720
|
-
intlMessage: _objectSpread$
|
|
11750
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterWholeInput), {}, {
|
|
11721
11751
|
values: {
|
|
11722
11752
|
values: "\"".concat(props.value, "\"")
|
|
11723
11753
|
}
|
|
@@ -11730,7 +11760,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11730
11760
|
}),
|
|
11731
11761
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11732
11762
|
truncate: true,
|
|
11733
|
-
intlMessage: _objectSpread$
|
|
11763
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterSeparateValues), {}, {
|
|
11734
11764
|
values: {
|
|
11735
11765
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11736
11766
|
}
|
|
@@ -11841,8 +11871,8 @@ const MultiValueSearchInput = props => {
|
|
|
11841
11871
|
};
|
|
11842
11872
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11843
11873
|
|
|
11844
|
-
function ownKeys$
|
|
11845
|
-
function _objectSpread$
|
|
11874
|
+
function ownKeys$6(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; }
|
|
11875
|
+
function _objectSpread$6(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$6(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$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11846
11876
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); 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); }; }
|
|
11847
11877
|
function _isNativeReflectConstruct() { 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; } }
|
|
11848
11878
|
var styles = {
|
|
@@ -11905,7 +11935,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11905
11935
|
value: function render() {
|
|
11906
11936
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11907
11937
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11908
|
-
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$
|
|
11938
|
+
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$6({
|
|
11909
11939
|
placeholder: this.props.placeholder,
|
|
11910
11940
|
htmlRef: this.registerInputRef,
|
|
11911
11941
|
options: {
|
|
@@ -12201,8 +12231,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12201
12231
|
}
|
|
12202
12232
|
};
|
|
12203
12233
|
|
|
12204
|
-
function ownKeys$
|
|
12205
|
-
function _objectSpread$
|
|
12234
|
+
function ownKeys$5(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; }
|
|
12235
|
+
function _objectSpread$5(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$5(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$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12206
12236
|
/**
|
|
12207
12237
|
* Creates reducer
|
|
12208
12238
|
* @param {Object} initialState
|
|
@@ -12218,13 +12248,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12218
12248
|
|
|
12219
12249
|
// In case reducer ignored action, avoid creating new object
|
|
12220
12250
|
const newSubstate = reduce(newState, action);
|
|
12221
|
-
if (newSubstate) return _objectSpread$
|
|
12251
|
+
if (newSubstate) return _objectSpread$5(_objectSpread$5({}, newState), newSubstate);
|
|
12222
12252
|
return newState;
|
|
12223
12253
|
};
|
|
12224
12254
|
}
|
|
12225
12255
|
|
|
12226
|
-
function ownKeys$
|
|
12227
|
-
function _objectSpread$
|
|
12256
|
+
function ownKeys$4(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; }
|
|
12257
|
+
function _objectSpread$4(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$4(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$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12228
12258
|
function updateStatusInList(mergeData) {
|
|
12229
12259
|
return (state, _ref) => {
|
|
12230
12260
|
let payload = _ref.payload;
|
|
@@ -12233,15 +12263,15 @@ function updateStatusInList(mergeData) {
|
|
|
12233
12263
|
results[index] = mergeData(payload, results[index]);
|
|
12234
12264
|
results[index].checked = false;
|
|
12235
12265
|
return {
|
|
12236
|
-
currentQueryResult: _objectSpread$
|
|
12266
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12237
12267
|
results
|
|
12238
12268
|
})
|
|
12239
12269
|
};
|
|
12240
12270
|
};
|
|
12241
12271
|
}
|
|
12242
12272
|
|
|
12243
|
-
function ownKeys$
|
|
12244
|
-
function _objectSpread$
|
|
12273
|
+
function ownKeys$3(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; }
|
|
12274
|
+
function _objectSpread$3(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$3(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$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12245
12275
|
const identity = value => value;
|
|
12246
12276
|
function createResourceReducer(options) {
|
|
12247
12277
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12251,7 +12281,7 @@ function createResourceReducer(options) {
|
|
|
12251
12281
|
_options$initialState = options.initialState,
|
|
12252
12282
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12253
12283
|
const mergeData = options.mergeData || identity;
|
|
12254
|
-
const initialState = _objectSpread$
|
|
12284
|
+
const initialState = _objectSpread$3({
|
|
12255
12285
|
currentQueryResult: {
|
|
12256
12286
|
count: 0,
|
|
12257
12287
|
offset: 0,
|
|
@@ -12271,7 +12301,7 @@ function createResourceReducer(options) {
|
|
|
12271
12301
|
let payload = _ref.payload;
|
|
12272
12302
|
const results = state.currentQueryResult.results;
|
|
12273
12303
|
return {
|
|
12274
|
-
currentQueryResult: _objectSpread$
|
|
12304
|
+
currentQueryResult: _objectSpread$3(_objectSpread$3({}, state.currentQueryResult), {}, {
|
|
12275
12305
|
results: _filterInstanceProperty__default["default"](results).call(results, _ref2 => {
|
|
12276
12306
|
let id = _ref2.id;
|
|
12277
12307
|
return id !== payload.id;
|
|
@@ -12349,17 +12379,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12349
12379
|
}
|
|
12350
12380
|
|
|
12351
12381
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12352
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12382
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12353
12383
|
return null;
|
|
12354
12384
|
};
|
|
12355
12385
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12356
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12386
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12357
12387
|
return null;
|
|
12358
12388
|
};
|
|
12359
12389
|
|
|
12360
12390
|
// eslint-disable-next-line import/prefer-default-export
|
|
12361
12391
|
const validateText = (text, intl) => {
|
|
12362
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12392
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12363
12393
|
return null;
|
|
12364
12394
|
};
|
|
12365
12395
|
|
|
@@ -12446,7 +12476,7 @@ const safelyAddFallback = function (string) {
|
|
|
12446
12476
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12447
12477
|
};
|
|
12448
12478
|
|
|
12449
|
-
var messages = reactIntl.defineMessages({
|
|
12479
|
+
var messages$1 = reactIntl.defineMessages({
|
|
12450
12480
|
booleanAttributeTrue: {
|
|
12451
12481
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12452
12482
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12639,7 +12669,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12639
12669
|
case 'boolean':
|
|
12640
12670
|
{
|
|
12641
12671
|
if (isNil__default["default"](value)) return constants.NO_VALUE_FALLBACK;
|
|
12642
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12672
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12643
12673
|
}
|
|
12644
12674
|
case 'reference':
|
|
12645
12675
|
return value.id || constants.NO_VALUE_FALLBACK;
|
|
@@ -12775,8 +12805,8 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
|
|
|
12775
12805
|
} else {
|
|
12776
12806
|
var _context3;
|
|
12777
12807
|
const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](timeZones)).call(_context3, timeZoneId => {
|
|
12778
|
-
var _timeZones$timeZoneId
|
|
12779
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12808
|
+
var _timeZones$timeZoneId;
|
|
12809
|
+
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0 || (_timeZones$timeZoneId = _timeZones$timeZoneId.translationFor) === null || _timeZones$timeZoneId === void 0 ? void 0 : _someInstanceProperty__default["default"](_timeZones$timeZoneId).call(_timeZones$timeZoneId, fallbackTimeZone => fallbackTimeZone === selectedTimeZone);
|
|
12780
12810
|
});
|
|
12781
12811
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12782
12812
|
return fallbackTimeZoneId.toString();
|
|
@@ -12792,8 +12822,8 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
12792
12822
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12793
12823
|
});
|
|
12794
12824
|
|
|
12795
|
-
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; }
|
|
12796
|
-
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; }
|
|
12825
|
+
function ownKeys$2(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; }
|
|
12826
|
+
function _objectSpread$2(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$2(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$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12797
12827
|
function withPendingRequests() {
|
|
12798
12828
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12799
12829
|
return Component => {
|
|
@@ -12802,13 +12832,184 @@ function withPendingRequests() {
|
|
|
12802
12832
|
const pendingProp = {
|
|
12803
12833
|
[propName]: pendingRequests
|
|
12804
12834
|
};
|
|
12805
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12835
|
+
return jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), pendingProp));
|
|
12806
12836
|
};
|
|
12807
12837
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12808
12838
|
return WrappedComponent;
|
|
12809
12839
|
};
|
|
12810
12840
|
}
|
|
12811
12841
|
|
|
12842
|
+
var messages = reactIntl.defineMessages({
|
|
12843
|
+
noCustomFields: {
|
|
12844
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12845
|
+
description: 'The label when there are no custom fields defined',
|
|
12846
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12847
|
+
},
|
|
12848
|
+
noCustomType: {
|
|
12849
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12850
|
+
description: 'The label when there is no custom type selected',
|
|
12851
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12852
|
+
},
|
|
12853
|
+
noTypes: {
|
|
12854
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12855
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12856
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12857
|
+
},
|
|
12858
|
+
title: {
|
|
12859
|
+
id: 'CustomTypesSubform.title',
|
|
12860
|
+
description: 'Fallback title for the subform',
|
|
12861
|
+
defaultMessage: 'Custom fields'
|
|
12862
|
+
},
|
|
12863
|
+
typesPlaceholder: {
|
|
12864
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12865
|
+
description: 'The placeholder for the types',
|
|
12866
|
+
defaultMessage: 'Select...'
|
|
12867
|
+
}
|
|
12868
|
+
});
|
|
12869
|
+
|
|
12870
|
+
function ownKeys$1(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; }
|
|
12871
|
+
function _objectSpread$1(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$1(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$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12872
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12873
|
+
return typeDefinitions.length > 0;
|
|
12874
|
+
};
|
|
12875
|
+
const typeDefinitionSelected = formValues => {
|
|
12876
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12877
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
12878
|
+
};
|
|
12879
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12880
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12881
|
+
};
|
|
12882
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12883
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12884
|
+
isReadOnly = _ref.isReadOnly;
|
|
12885
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12886
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12887
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12888
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noTypes));
|
|
12889
|
+
}
|
|
12890
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12891
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomType));
|
|
12892
|
+
}
|
|
12893
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12894
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomFields));
|
|
12895
|
+
}
|
|
12896
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12897
|
+
max: "scale",
|
|
12898
|
+
children: jsxRuntime.jsx(CustomFields, {
|
|
12899
|
+
isReadOnly: isReadOnly,
|
|
12900
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12901
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12902
|
+
})
|
|
12903
|
+
});
|
|
12904
|
+
};
|
|
12905
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12906
|
+
|
|
12907
|
+
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; }
|
|
12908
|
+
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; }
|
|
12909
|
+
const FIELD_NAME = 'custom';
|
|
12910
|
+
|
|
12911
|
+
// Creates dropdown options
|
|
12912
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12913
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12914
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12915
|
+
value: typeDefinition.type.key,
|
|
12916
|
+
label: l10n.formatLocalizedString(typeDefinition.type, {
|
|
12917
|
+
key: 'name',
|
|
12918
|
+
locale: language,
|
|
12919
|
+
fallbackOrder: languages
|
|
12920
|
+
})
|
|
12921
|
+
}));
|
|
12922
|
+
};
|
|
12923
|
+
|
|
12924
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12925
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12926
|
+
return {
|
|
12927
|
+
type: {
|
|
12928
|
+
id: selectedTypeDefinition.type.id,
|
|
12929
|
+
obj: {
|
|
12930
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12931
|
+
key: selectedTypeDefinition.type.key
|
|
12932
|
+
}
|
|
12933
|
+
},
|
|
12934
|
+
fields: {}
|
|
12935
|
+
};
|
|
12936
|
+
};
|
|
12937
|
+
const CustomTypeSubform = _ref => {
|
|
12938
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12939
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12940
|
+
isReadOnly = _ref.isReadOnly;
|
|
12941
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12942
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12943
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
12944
|
+
const _useIntl = reactIntl.useIntl(),
|
|
12945
|
+
formatMessage = _useIntl.formatMessage;
|
|
12946
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
12947
|
+
language: applicationContext.dataLocale,
|
|
12948
|
+
languages: applicationContext.project.languages
|
|
12949
|
+
})),
|
|
12950
|
+
language = _useApplicationContex.language,
|
|
12951
|
+
languages = _useApplicationContex.languages;
|
|
12952
|
+
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
12953
|
+
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12954
|
+
if (selectedTypeDefinition) {
|
|
12955
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12956
|
+
setFieldValue(FIELD_NAME, nextCustom);
|
|
12957
|
+
} else {
|
|
12958
|
+
// if the dropdown selector is cleared
|
|
12959
|
+
const emptyFormState = CustomFieldTypeDefinitionsConnector$1.createEmptyCustomFields(formValues[FIELD_NAME].type);
|
|
12960
|
+
setFieldValue(FIELD_NAME, emptyFormState);
|
|
12961
|
+
}
|
|
12962
|
+
}, [typeDefinitions, setFieldValue, formValues]);
|
|
12963
|
+
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
12964
|
+
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
12965
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.title))
|
|
12966
|
+
}),
|
|
12967
|
+
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
12968
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint10, ";" + ("" ), "" ),
|
|
12969
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
12970
|
+
isClearable: true,
|
|
12971
|
+
"data-testid": "custom-type-select",
|
|
12972
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12973
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 || (_formValues$FIELD_NAM = _formValues$FIELD_NAM.type) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.id),
|
|
12974
|
+
value: (_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.obj) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.key,
|
|
12975
|
+
onChange: handleTypeDefinitionSelect,
|
|
12976
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12977
|
+
isReadOnly: isReadOnly
|
|
12978
|
+
})
|
|
12979
|
+
}),
|
|
12980
|
+
headerControlsAlignment: "left",
|
|
12981
|
+
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
12982
|
+
typeDefinitions: typeDefinitions,
|
|
12983
|
+
isReadOnly: isReadOnly
|
|
12984
|
+
})
|
|
12985
|
+
});
|
|
12986
|
+
};
|
|
12987
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
12988
|
+
|
|
12989
|
+
const CustomFieldsFormField = _ref => {
|
|
12990
|
+
let resources = _ref.resources,
|
|
12991
|
+
isReadOnly = _ref.isReadOnly;
|
|
12992
|
+
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
12993
|
+
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
12994
|
+
resources: resources,
|
|
12995
|
+
projectKey: projectKey,
|
|
12996
|
+
children: _ref2 => {
|
|
12997
|
+
var _context;
|
|
12998
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
12999
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13000
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13001
|
+
if (isLoading) {
|
|
13002
|
+
return jsxRuntime.jsx(uiKit.LoadingSpinner, {});
|
|
13003
|
+
}
|
|
13004
|
+
const typeDefinitions = _mapInstanceProperty__default["default"](_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13005
|
+
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13006
|
+
typeDefinitions: typeDefinitions,
|
|
13007
|
+
isReadOnly: isReadOnly
|
|
13008
|
+
});
|
|
13009
|
+
}
|
|
13010
|
+
});
|
|
13011
|
+
};
|
|
13012
|
+
|
|
12812
13013
|
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 } } } };
|
|
12813
13014
|
|
|
12814
13015
|
exports.BooleanField = booleanField;
|
|
@@ -12820,9 +13021,10 @@ exports.CenteredLoadingSpinner = CenteredLoadingSpinner;
|
|
|
12820
13021
|
exports.ChannelPickerInput = ChannelPickerInput;
|
|
12821
13022
|
exports.CountriesPicker = CountriesPicker;
|
|
12822
13023
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
12823
|
-
exports.CustomFieldTypeDefinitionsConnector =
|
|
13024
|
+
exports.CustomFieldTypeDefinitionsConnector = CustomFieldTypeDefinitionsConnector$1;
|
|
12824
13025
|
exports.CustomFields = CustomFields;
|
|
12825
13026
|
exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification;
|
|
13027
|
+
exports.CustomFieldsFormField = CustomFieldsFormField;
|
|
12826
13028
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput;
|
|
12827
13029
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
12828
13030
|
exports.Divider = Divider;
|
|
@@ -12855,9 +13057,10 @@ exports.allowedProperties = allowedProperties;
|
|
|
12855
13057
|
exports.and = and;
|
|
12856
13058
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
12857
13059
|
exports.base64ToString = base64ToString;
|
|
12858
|
-
exports.booleanMessages = messages$
|
|
13060
|
+
exports.booleanMessages = messages$8;
|
|
12859
13061
|
exports.buildSearchQuery = buildSearchQuery;
|
|
12860
|
-
exports.
|
|
13062
|
+
exports.businessRoleConstants = businessRoleConstants;
|
|
13063
|
+
exports.businessRoleMessages = messages$r;
|
|
12861
13064
|
exports.businessRoles = businessRoleKeys;
|
|
12862
13065
|
exports.capitalizeFirst = capitalizeFirst;
|
|
12863
13066
|
exports.clone = clone;
|
|
@@ -12942,7 +13145,7 @@ exports.keepDisplayName = keepDisplayName;
|
|
|
12942
13145
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
12943
13146
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
12944
13147
|
exports.minusify = minusify;
|
|
12945
|
-
exports.missingValueMessages = messages$
|
|
13148
|
+
exports.missingValueMessages = messages$7;
|
|
12946
13149
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
12947
13150
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
12948
13151
|
exports.not = not;
|
|
@@ -12959,7 +13162,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
12959
13162
|
exports.safelyAddFallback = safelyAddFallback;
|
|
12960
13163
|
exports.sanitize = sanitize;
|
|
12961
13164
|
exports.searchCategories = searchCategories;
|
|
12962
|
-
exports.searchInputMessages = messages$
|
|
13165
|
+
exports.searchInputMessages = messages$F;
|
|
12963
13166
|
exports.setDisplayName = setDisplayName;
|
|
12964
13167
|
exports.setToArray = setToArray;
|
|
12965
13168
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13005,7 +13208,7 @@ exports.validateNumber = validateFilter;
|
|
|
13005
13208
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13006
13209
|
exports.validateText = validateText;
|
|
13007
13210
|
exports.validatedInput = validatedInput;
|
|
13008
|
-
exports.validationMessages = messages$
|
|
13211
|
+
exports.validationMessages = messages$K;
|
|
13009
13212
|
exports.withPendingRequests = withPendingRequests;
|
|
13010
13213
|
exports.withProps = withProps;
|
|
13011
13214
|
exports.withRedirectTo = withRedirectTo;
|