@commercetools-frontend/experimental-components 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +889 -312
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +889 -312
- package/dist/commercetools-frontend-experimental-components.esm.js +884 -311
- package/dist/styles.css +47 -47
- package/package.json +13 -13
|
@@ -41,11 +41,11 @@ import { NO_VALUE_FALLBACK, GRAPHQL_TARGETS, DOMAINS, MC_API_PROXY_TARGETS, SUPP
|
|
|
41
41
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
42
42
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
43
43
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
44
|
-
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput,
|
|
44
|
+
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, SelectableSearchInput, DataTable, Pagination, Stamp, ContentNotification, ListIcon, CheckboxInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
|
|
45
45
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
46
46
|
import { useShowNotification, useShowApiErrorNotification, useOnActionError, useHideAllPageNotifications } from '@commercetools-frontend/actions-global';
|
|
47
47
|
import PropTypes from 'prop-types';
|
|
48
|
-
import { useModalState, CustomFormModalPage, PageContentNarrow, ConfirmationDialog, InfoDialog } from '@commercetools-frontend/application-components';
|
|
48
|
+
import { useModalState, CustomFormModalPage, PageContentNarrow, ConfirmationDialog, PageContentFull, InfoDialog } from '@commercetools-frontend/application-components';
|
|
49
49
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
50
50
|
import { useApplicationContext, ApplicationContext, withApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
51
51
|
import { GtmContext, useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/application-shell';
|
|
@@ -72,7 +72,6 @@ import _reverseInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
72
72
|
import { useAsyncDispatch, actions } from '@commercetools-frontend/sdk';
|
|
73
73
|
import { useApolloClient as useApolloClient$1, useQuery as useQuery$2 } from '@apollo/client';
|
|
74
74
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
75
|
-
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
76
75
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
77
76
|
import omit from 'lodash/omit';
|
|
78
77
|
import isEmpty$3 from 'lodash/isEmpty';
|
|
@@ -80,6 +79,7 @@ import _Object$freeze from '@babel/runtime-corejs3/core-js-stable/object/freeze'
|
|
|
80
79
|
import originalOmitDeep from 'omit-deep';
|
|
81
80
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
82
81
|
import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
|
|
82
|
+
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
83
83
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
84
84
|
import omitBy from 'lodash/omitBy';
|
|
85
85
|
import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
@@ -98,6 +98,8 @@ import { ErrorMessage } from '@commercetools-frontend/ui-kit/';
|
|
|
98
98
|
import { CustomSelectInputOption } from '@commercetools-uikit/select-utils';
|
|
99
99
|
import memoize from 'memoize-one';
|
|
100
100
|
import { filterAriaAttributes, filterDataAttributes as filterDataAttributes$1 } from '@commercetools-uikit/utils';
|
|
101
|
+
import differenceBy from 'lodash/differenceBy';
|
|
102
|
+
import intersectionBy from 'lodash/intersectionBy';
|
|
101
103
|
import _parseFloat from '@babel/runtime-corejs3/core-js-stable/parse-float';
|
|
102
104
|
import flatMap from 'lodash/flatMap';
|
|
103
105
|
import { connect } from 'react-redux';
|
|
@@ -217,7 +219,7 @@ function filterDataAttributes(obj) {
|
|
|
217
219
|
}, {});
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
const messages$
|
|
222
|
+
const messages$O = defineMessages({
|
|
221
223
|
unique: {
|
|
222
224
|
id: 'Validation.unique',
|
|
223
225
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1614,8 +1616,8 @@ const getData = (code, field) => {
|
|
|
1614
1616
|
};
|
|
1615
1617
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1616
1618
|
|
|
1617
|
-
function ownKeys$
|
|
1618
|
-
function _objectSpread$
|
|
1619
|
+
function ownKeys$1q(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1620
|
+
function _objectSpread$1q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1q(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1619
1621
|
function formatMoneyRangeValue(value, intl) {
|
|
1620
1622
|
var _context;
|
|
1621
1623
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1625,7 +1627,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1625
1627
|
return '';
|
|
1626
1628
|
}
|
|
1627
1629
|
function formatMoneyValue(amount, currency, intl) {
|
|
1628
|
-
return formatMoney$1(_objectSpread$
|
|
1630
|
+
return formatMoney$1(_objectSpread$1q({
|
|
1629
1631
|
centAmount: amount,
|
|
1630
1632
|
fractionDigits: getFractionDigit(currency)
|
|
1631
1633
|
}, currency ? {
|
|
@@ -1642,14 +1644,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1642
1644
|
}
|
|
1643
1645
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1644
1646
|
var _moneyValue$fractione;
|
|
1645
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1647
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1q({
|
|
1646
1648
|
style: 'currency',
|
|
1647
1649
|
currency: moneyValue.currencyCode,
|
|
1648
1650
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1649
1651
|
}, options));
|
|
1650
1652
|
}
|
|
1651
1653
|
|
|
1652
|
-
var messages$
|
|
1654
|
+
var messages$N = defineMessages({
|
|
1653
1655
|
booleanYes: {
|
|
1654
1656
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1655
1657
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1732,7 +1734,7 @@ const formatDateTime = _ref7 => {
|
|
|
1732
1734
|
const formatBoolean = _ref8 => {
|
|
1733
1735
|
let value = _ref8.value,
|
|
1734
1736
|
intl = _ref8.intl;
|
|
1735
|
-
return value ? intl.formatMessage(messages$
|
|
1737
|
+
return value ? intl.formatMessage(messages$N.booleanYes) : intl.formatMessage(messages$N.booleanNo);
|
|
1736
1738
|
};
|
|
1737
1739
|
const formatNilType = _ref9 => {
|
|
1738
1740
|
let value = _ref9.value,
|
|
@@ -1894,8 +1896,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1894
1896
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1895
1897
|
};
|
|
1896
1898
|
|
|
1897
|
-
function ownKeys$
|
|
1898
|
-
function _objectSpread$
|
|
1899
|
+
function ownKeys$1p(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1900
|
+
function _objectSpread$1p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1p(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1899
1901
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1900
1902
|
const WithDataTablePaginationState = props => {
|
|
1901
1903
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1909,7 +1911,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1909
1911
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1910
1912
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1911
1913
|
});
|
|
1912
|
-
return jsx(Component, _objectSpread$
|
|
1914
|
+
return jsx(Component, _objectSpread$1p(_objectSpread$1p({}, props), {}, {
|
|
1913
1915
|
dataTablePaginationState: {
|
|
1914
1916
|
page,
|
|
1915
1917
|
perPage,
|
|
@@ -1921,8 +1923,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1921
1923
|
return WithDataTablePaginationState;
|
|
1922
1924
|
};
|
|
1923
1925
|
|
|
1924
|
-
function ownKeys$
|
|
1925
|
-
function _objectSpread$
|
|
1926
|
+
function ownKeys$1o(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1927
|
+
function _objectSpread$1o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1o(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1926
1928
|
const injectNotifications = function () {
|
|
1927
1929
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1928
1930
|
return Component => {
|
|
@@ -1937,7 +1939,7 @@ const injectNotifications = function () {
|
|
|
1937
1939
|
onActionError,
|
|
1938
1940
|
hideAllPageNotifications
|
|
1939
1941
|
};
|
|
1940
|
-
return jsx(Component, _objectSpread$
|
|
1942
|
+
return jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1941
1943
|
[propName]: notifications
|
|
1942
1944
|
}));
|
|
1943
1945
|
};
|
|
@@ -1946,22 +1948,22 @@ const injectNotifications = function () {
|
|
|
1946
1948
|
};
|
|
1947
1949
|
};
|
|
1948
1950
|
|
|
1949
|
-
function ownKeys$
|
|
1950
|
-
function _objectSpread$
|
|
1951
|
+
function ownKeys$1n(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1952
|
+
function _objectSpread$1n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1n(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1951
1953
|
function isPropsMapper(mapProps) {
|
|
1952
1954
|
return typeof mapProps === 'function';
|
|
1953
1955
|
}
|
|
1954
1956
|
const withProps = mapProps => Component => {
|
|
1955
1957
|
const EnhancedWithProps = ownProps => {
|
|
1956
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1957
|
-
return jsx(Component, _objectSpread$
|
|
1958
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps(ownProps)) : _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps);
|
|
1959
|
+
return jsx(Component, _objectSpread$1n({}, enhancedProps));
|
|
1958
1960
|
};
|
|
1959
1961
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1960
1962
|
return EnhancedWithProps;
|
|
1961
1963
|
};
|
|
1962
1964
|
|
|
1963
|
-
function ownKeys$
|
|
1964
|
-
function _objectSpread$
|
|
1965
|
+
function ownKeys$1m(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1966
|
+
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1m(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1965
1967
|
const useRedirectEffect = _ref => {
|
|
1966
1968
|
let goTo = _ref.goTo;
|
|
1967
1969
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1981,30 +1983,30 @@ const defaultOptions$5 = {
|
|
|
1981
1983
|
skip: () => false
|
|
1982
1984
|
};
|
|
1983
1985
|
const withRedirectTo = options => Component => {
|
|
1984
|
-
const mergedOptions = _objectSpread$
|
|
1986
|
+
const mergedOptions = _objectSpread$1m(_objectSpread$1m({}, defaultOptions$5), options);
|
|
1985
1987
|
const WithRedirectTo = props => {
|
|
1986
1988
|
if (!mergedOptions.skip(props)) {
|
|
1987
1989
|
return jsx(RedirectTo, {
|
|
1988
1990
|
goTo: options.selectGoTo(props)
|
|
1989
1991
|
});
|
|
1990
1992
|
}
|
|
1991
|
-
return jsx(Component, _objectSpread$
|
|
1993
|
+
return jsx(Component, _objectSpread$1m({}, props));
|
|
1992
1994
|
};
|
|
1993
1995
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1994
1996
|
return WithRedirectTo;
|
|
1995
1997
|
};
|
|
1996
1998
|
|
|
1997
|
-
function ownKeys$
|
|
1998
|
-
function _objectSpread$
|
|
1999
|
+
function ownKeys$1l(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2000
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1l(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1999
2001
|
const defaultOptions$4 = {
|
|
2000
2002
|
propName: 'modalState',
|
|
2001
2003
|
isInitiallyOpen: false
|
|
2002
2004
|
};
|
|
2003
2005
|
const injectModalState$1 = options => Component => {
|
|
2004
|
-
const mergedOptions = _objectSpread$
|
|
2006
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$4), options);
|
|
2005
2007
|
const WithModalState = props => {
|
|
2006
2008
|
const modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
2007
|
-
return jsx(Component, _objectSpread$
|
|
2009
|
+
return jsx(Component, _objectSpread$1l(_objectSpread$1l({}, props), {}, {
|
|
2008
2010
|
[mergedOptions.propName]: modalState
|
|
2009
2011
|
}));
|
|
2010
2012
|
};
|
|
@@ -2012,17 +2014,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2012
2014
|
return WithModalState;
|
|
2013
2015
|
};
|
|
2014
2016
|
|
|
2015
|
-
function ownKeys$
|
|
2016
|
-
function _objectSpread$
|
|
2017
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2018
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2017
2019
|
const defaultOptions$3 = {
|
|
2018
2020
|
propName: 'toggleState',
|
|
2019
2021
|
isInitiallyOpen: false
|
|
2020
2022
|
};
|
|
2021
2023
|
const injectModalState = options => Component => {
|
|
2022
|
-
const mergedOptions = _objectSpread$
|
|
2024
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$3), options);
|
|
2023
2025
|
const WithToggleState = props => {
|
|
2024
2026
|
const toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2025
|
-
return jsx(Component, _objectSpread$
|
|
2027
|
+
return jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2026
2028
|
[mergedOptions.propName]: toggleState
|
|
2027
2029
|
}));
|
|
2028
2030
|
};
|
|
@@ -2030,8 +2032,8 @@ const injectModalState = options => Component => {
|
|
|
2030
2032
|
return WithToggleState;
|
|
2031
2033
|
};
|
|
2032
2034
|
|
|
2033
|
-
function ownKeys$
|
|
2034
|
-
function _objectSpread$
|
|
2035
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2036
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1j(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1j(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2035
2037
|
const defaultOptions$2 = {
|
|
2036
2038
|
storageType: 'local',
|
|
2037
2039
|
segregateByUser: true
|
|
@@ -2049,7 +2051,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2049
2051
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2050
2052
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2051
2053
|
var _context;
|
|
2052
|
-
const mergedOptions = _objectSpread$
|
|
2054
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$2), options);
|
|
2053
2055
|
const userId = useApplicationContext(context => {
|
|
2054
2056
|
var _context$user;
|
|
2055
2057
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2097,8 +2099,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2097
2099
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2098
2100
|
};
|
|
2099
2101
|
|
|
2100
|
-
function ownKeys$
|
|
2101
|
-
function _objectSpread$
|
|
2102
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2103
|
+
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(_context = ownKeys$1i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1i(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2102
2104
|
const defaultOptions$1 = {
|
|
2103
2105
|
propName: 'storage',
|
|
2104
2106
|
storageKey: '',
|
|
@@ -2111,7 +2113,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2111
2113
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2112
2114
|
* argument position does not allow passing specification of option(s).
|
|
2113
2115
|
*/
|
|
2114
|
-
const mergedOptions = _objectSpread$
|
|
2116
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$1), options);
|
|
2115
2117
|
const WithStorage = props => {
|
|
2116
2118
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2117
2119
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2125,7 +2127,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2125
2127
|
readFromStorage
|
|
2126
2128
|
}
|
|
2127
2129
|
};
|
|
2128
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2130
|
+
return jsx(WrappedComponent, _objectSpread$1i(_objectSpread$1i({}, props), storageProp));
|
|
2129
2131
|
};
|
|
2130
2132
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2131
2133
|
return WithStorage;
|
|
@@ -2171,8 +2173,8 @@ const usePrevious = value => {
|
|
|
2171
2173
|
return ref.current;
|
|
2172
2174
|
};
|
|
2173
2175
|
|
|
2174
|
-
function ownKeys$
|
|
2175
|
-
function _objectSpread$
|
|
2176
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2177
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1h(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1h(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2176
2178
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1074, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2177
2179
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2178
2180
|
var _storesQueryResult$re;
|
|
@@ -2183,7 +2185,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2183
2185
|
offset: storesQueryResult.offset,
|
|
2184
2186
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2185
2187
|
var _store$productSelecti;
|
|
2186
|
-
return _objectSpread$
|
|
2188
|
+
return _objectSpread$1h(_objectSpread$1h({}, store), {}, {
|
|
2187
2189
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2188
2190
|
});
|
|
2189
2191
|
})
|
|
@@ -2191,7 +2193,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2191
2193
|
};
|
|
2192
2194
|
const createQueryVariables$8 = ownProps => {
|
|
2193
2195
|
var _context;
|
|
2194
|
-
return _objectSpread$
|
|
2196
|
+
return _objectSpread$1h(_objectSpread$1h({
|
|
2195
2197
|
limit: ownProps.limit,
|
|
2196
2198
|
offset: ownProps.offset,
|
|
2197
2199
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2346,8 +2348,8 @@ function useDidFormValidationFail() {
|
|
|
2346
2348
|
return Boolean(didFormValidationFail);
|
|
2347
2349
|
}
|
|
2348
2350
|
|
|
2349
|
-
function ownKeys$
|
|
2350
|
-
function _objectSpread$
|
|
2351
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2352
|
+
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(_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2351
2353
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2352
2354
|
const defaultOptions = {
|
|
2353
2355
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2375,7 +2377,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2375
2377
|
};
|
|
2376
2378
|
const usePersistedReminder = function () {
|
|
2377
2379
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2378
|
-
const mergedOptions = _objectSpread$
|
|
2380
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions), options);
|
|
2379
2381
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2380
2382
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2381
2383
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2421,7 +2423,7 @@ const usePersistedReminder = function () {
|
|
|
2421
2423
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2422
2424
|
};
|
|
2423
2425
|
|
|
2424
|
-
var messages$
|
|
2426
|
+
var messages$M = defineMessages({
|
|
2425
2427
|
profileUpdated: {
|
|
2426
2428
|
id: 'NotificationText.profileUpdated',
|
|
2427
2429
|
description: 'Label for the notification header',
|
|
@@ -2439,8 +2441,8 @@ var messages$I = defineMessages({
|
|
|
2439
2441
|
}
|
|
2440
2442
|
});
|
|
2441
2443
|
|
|
2442
|
-
function ownKeys$
|
|
2443
|
-
function _objectSpread$
|
|
2444
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2445
|
+
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(_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2444
2446
|
const LinkToProfile = props => {
|
|
2445
2447
|
const _useTrackingShared = useTrackingShared(),
|
|
2446
2448
|
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
@@ -2461,9 +2463,9 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2461
2463
|
children: [jsx(Text.Body, {
|
|
2462
2464
|
as: "p",
|
|
2463
2465
|
isBold: true,
|
|
2464
|
-
intlMessage: messages$
|
|
2466
|
+
intlMessage: messages$M.profileUpdated
|
|
2465
2467
|
}), jsx(Text.Body, {
|
|
2466
|
-
intlMessage: _objectSpread$
|
|
2468
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.addMoreInformation), {}, {
|
|
2467
2469
|
values: {
|
|
2468
2470
|
newline: getNewLine
|
|
2469
2471
|
}
|
|
@@ -2472,7 +2474,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2472
2474
|
}), jsx(Spacings.Stack, {
|
|
2473
2475
|
scale: "xs",
|
|
2474
2476
|
children: jsx(Text.Body, {
|
|
2475
|
-
intlMessage: _objectSpread$
|
|
2477
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.informationAndProfileLink), {}, {
|
|
2476
2478
|
values: {
|
|
2477
2479
|
newline: getNewLine,
|
|
2478
2480
|
link: getLinkToProfile
|
|
@@ -2634,7 +2636,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2634
2636
|
}, [ref]);
|
|
2635
2637
|
};
|
|
2636
2638
|
|
|
2637
|
-
var messages$
|
|
2639
|
+
var messages$L = defineMessages({
|
|
2638
2640
|
fallbackHint: {
|
|
2639
2641
|
id: 'KeyFallback.fallbackHint',
|
|
2640
2642
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2658,7 +2660,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2658
2660
|
return values => {
|
|
2659
2661
|
if (!values.resource) return null;
|
|
2660
2662
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2661
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2663
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2662
2664
|
key: values.resource.key
|
|
2663
2665
|
});
|
|
2664
2666
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2670,8 +2672,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2670
2672
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2671
2673
|
useCallback(debounce(promiseCallback, wait), [promiseCallback]);
|
|
2672
2674
|
|
|
2673
|
-
function ownKeys$
|
|
2674
|
-
function _objectSpread$
|
|
2675
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2676
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1e(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2675
2677
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2676
2678
|
const updatedColumnProps = {};
|
|
2677
2679
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2691,14 +2693,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2691
2693
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2692
2694
|
return _mapInstanceProperty(_context = _filterInstanceProperty(cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2693
2695
|
const initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2694
|
-
return _objectSpread$
|
|
2696
|
+
return _objectSpread$1e(_objectSpread$1e({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2695
2697
|
});
|
|
2696
2698
|
};
|
|
2697
2699
|
const handleCacheUpdate = _ref2 => {
|
|
2698
2700
|
let update = _ref2.update,
|
|
2699
2701
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2700
2702
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2701
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2703
|
+
return updateCachedTableConfiguration(_objectSpread$1e(_objectSpread$1e({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2702
2704
|
};
|
|
2703
2705
|
|
|
2704
2706
|
// Signature:
|
|
@@ -2727,7 +2729,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2727
2729
|
return {
|
|
2728
2730
|
columnsConfig: _mapInstanceProperty(initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2729
2731
|
const visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2730
|
-
return _objectSpread$
|
|
2732
|
+
return _objectSpread$1e({
|
|
2731
2733
|
key: visibleColumnKey
|
|
2732
2734
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2733
2735
|
}),
|
|
@@ -2798,14 +2800,14 @@ const handlers$6 = {
|
|
|
2798
2800
|
}
|
|
2799
2801
|
};
|
|
2800
2802
|
|
|
2801
|
-
function ownKeys$
|
|
2802
|
-
function _objectSpread$
|
|
2803
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2804
|
+
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(_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2803
2805
|
|
|
2804
2806
|
// eslint-disable-next-line import/prefer-default-export
|
|
2805
2807
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2806
2808
|
var _context;
|
|
2807
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2808
|
-
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2809
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1d(_objectSpread$1d({}, productSelections), {}, {
|
|
2810
|
+
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$1d({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2809
2811
|
from: 'nameAllLocales',
|
|
2810
2812
|
to: 'name'
|
|
2811
2813
|
}])))
|
|
@@ -2955,7 +2957,7 @@ const CenteredLoadingSpinner = () => jsx("div", {
|
|
|
2955
2957
|
});
|
|
2956
2958
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2957
2959
|
|
|
2958
|
-
var messages$
|
|
2960
|
+
var messages$K = defineMessages({
|
|
2959
2961
|
noChannelsFound: {
|
|
2960
2962
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2961
2963
|
description: 'The message to display when no channels were found',
|
|
@@ -3004,8 +3006,8 @@ const trackingEvents$4 = {
|
|
|
3004
3006
|
}
|
|
3005
3007
|
};
|
|
3006
3008
|
|
|
3007
|
-
function ownKeys$
|
|
3008
|
-
function _objectSpread$
|
|
3009
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3010
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3009
3011
|
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 } } } };
|
|
3010
3012
|
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 } } } };
|
|
3011
3013
|
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 } } } };
|
|
@@ -3033,7 +3035,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3033
3035
|
const _useIntl = useIntl(),
|
|
3034
3036
|
formatMessage = _useIntl.formatMessage;
|
|
3035
3037
|
const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3036
|
-
const variables = useMemo(() => _objectSpread$
|
|
3038
|
+
const variables = useMemo(() => _objectSpread$1c({
|
|
3037
3039
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3038
3040
|
}, role && {
|
|
3039
3041
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3094,7 +3096,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3094
3096
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3095
3097
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3096
3098
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3097
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3099
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$K.noChannelsFound), [loadingError, formatMessage]);
|
|
3098
3100
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3099
3101
|
return jsx(Constraints.Horizontal, {
|
|
3100
3102
|
max: "scale",
|
|
@@ -3105,7 +3107,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3105
3107
|
children: jsx(AsyncSelectInput, {
|
|
3106
3108
|
id: name,
|
|
3107
3109
|
name: name,
|
|
3108
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3110
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$K.placeholder),
|
|
3109
3111
|
loadOptions: loadOptionsDebounced,
|
|
3110
3112
|
defaultOptions: true,
|
|
3111
3113
|
showOptionGroupDivider: true,
|
|
@@ -3162,8 +3164,8 @@ var FormattedDateTime$1 = injectIntl(FormattedDateTime);
|
|
|
3162
3164
|
|
|
3163
3165
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3164
3166
|
|
|
3165
|
-
function ownKeys$
|
|
3166
|
-
function _objectSpread$
|
|
3167
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3168
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3167
3169
|
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(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3168
3170
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3169
3171
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3195,7 +3197,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3195
3197
|
handleMouseOver: this.handleMouseOver,
|
|
3196
3198
|
handleMouseOut: this.handleMouseOut
|
|
3197
3199
|
};
|
|
3198
|
-
return jsx(BaseComponent, _objectSpread$
|
|
3200
|
+
return jsx(BaseComponent, _objectSpread$1b({}, _objectSpread$1b(_objectSpread$1b({}, this.props), injectedProps)));
|
|
3199
3201
|
}
|
|
3200
3202
|
}]);
|
|
3201
3203
|
return WithMouseOverState;
|
|
@@ -3204,8 +3206,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3204
3206
|
return WithMouseOverState;
|
|
3205
3207
|
};
|
|
3206
3208
|
|
|
3207
|
-
function ownKeys$
|
|
3208
|
-
function _objectSpread$
|
|
3209
|
+
function ownKeys$1a(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3210
|
+
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(_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3209
3211
|
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(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3210
3212
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3211
3213
|
var styles$i = {
|
|
@@ -3316,7 +3318,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3316
3318
|
}, {
|
|
3317
3319
|
key: "render",
|
|
3318
3320
|
value: function render() {
|
|
3319
|
-
const commonProps = _objectSpread$
|
|
3321
|
+
const commonProps = _objectSpread$1a(_objectSpread$1a({
|
|
3320
3322
|
value: this.state.draftValue,
|
|
3321
3323
|
autoComplete: this.props.autoComplete,
|
|
3322
3324
|
onChange: this.handleChange,
|
|
@@ -3335,7 +3337,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3335
3337
|
htmlFor: inputId,
|
|
3336
3338
|
children: this.props.label
|
|
3337
3339
|
})
|
|
3338
|
-
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$
|
|
3340
|
+
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3339
3341
|
id: inputId,
|
|
3340
3342
|
className: classnames(styles$i.textarea, styles$i["textarea-".concat(this.props.style)], {
|
|
3341
3343
|
[styles$i.invalid]: !this.props.isValid,
|
|
@@ -3344,7 +3346,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3344
3346
|
rows: 1,
|
|
3345
3347
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3346
3348
|
cacheMeasurements: true
|
|
3347
|
-
})) : jsx("input", _objectSpread$
|
|
3349
|
+
})) : jsx("input", _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3348
3350
|
id: inputId,
|
|
3349
3351
|
ref: this.props.inputRef,
|
|
3350
3352
|
type: this.props.as,
|
|
@@ -3371,7 +3373,7 @@ ThrottledField.defaultProps = {
|
|
|
3371
3373
|
label: 'Throttled field'
|
|
3372
3374
|
};
|
|
3373
3375
|
|
|
3374
|
-
var messages$
|
|
3376
|
+
var messages$J = defineMessages({
|
|
3375
3377
|
buttonLabel: {
|
|
3376
3378
|
id: 'SearchInput.buttonLabel',
|
|
3377
3379
|
description: 'Label for "Search" button.',
|
|
@@ -3479,7 +3481,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3479
3481
|
"data-testid": this.props.testId || 'search-input',
|
|
3480
3482
|
value: this.state.text,
|
|
3481
3483
|
label: this.props.label,
|
|
3482
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3484
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$J.placeholder),
|
|
3483
3485
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3484
3486
|
"data-track-component": "Text",
|
|
3485
3487
|
"data-track-event": "change",
|
|
@@ -3698,7 +3700,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3698
3700
|
};
|
|
3699
3701
|
};
|
|
3700
3702
|
|
|
3701
|
-
var messages$
|
|
3703
|
+
var messages$I = defineMessages({
|
|
3702
3704
|
bottomOption: {
|
|
3703
3705
|
id: 'Products.Pickers.bottomOption',
|
|
3704
3706
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3706,11 +3708,11 @@ var messages$E = defineMessages({
|
|
|
3706
3708
|
}
|
|
3707
3709
|
});
|
|
3708
3710
|
|
|
3709
|
-
function ownKeys$
|
|
3710
|
-
function _objectSpread$
|
|
3711
|
+
function ownKeys$19(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3712
|
+
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(_context = ownKeys$19(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$19(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3711
3713
|
const getBottomOption = () => ({
|
|
3712
3714
|
options: [{
|
|
3713
|
-
label: messages$
|
|
3715
|
+
label: messages$I.bottomOption,
|
|
3714
3716
|
isBottomOption: true,
|
|
3715
3717
|
isDisabled: true
|
|
3716
3718
|
}]
|
|
@@ -3718,7 +3720,7 @@ const getBottomOption = () => ({
|
|
|
3718
3720
|
const Option$2 = props => {
|
|
3719
3721
|
const _useIntl = useIntl(),
|
|
3720
3722
|
formatMessage = _useIntl.formatMessage;
|
|
3721
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
3723
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$19(_objectSpread$19({}, props), {}, {
|
|
3722
3724
|
children: props.data.isBottomOption ? jsx(Text.Detail, {
|
|
3723
3725
|
tone: "secondary",
|
|
3724
3726
|
children: formatMessage(props.data.label)
|
|
@@ -3735,8 +3737,8 @@ const Option$2 = props => {
|
|
|
3735
3737
|
};
|
|
3736
3738
|
Option$2.displayName = 'Option';
|
|
3737
3739
|
|
|
3738
|
-
function ownKeys$
|
|
3739
|
-
function _objectSpread$
|
|
3740
|
+
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3741
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3740
3742
|
const useHandlers = (onChange, getTrackingEvent) => {
|
|
3741
3743
|
const _useTracking = useTracking(),
|
|
3742
3744
|
track = _useTracking.track;
|
|
@@ -3761,8 +3763,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3761
3763
|
if (event.target.value) {
|
|
3762
3764
|
doTrack();
|
|
3763
3765
|
}
|
|
3764
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3765
|
-
target: _objectSpread$
|
|
3766
|
+
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3767
|
+
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3766
3768
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3767
3769
|
})
|
|
3768
3770
|
});
|
|
@@ -3771,8 +3773,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3771
3773
|
return [handleInputChange, handleChange];
|
|
3772
3774
|
};
|
|
3773
3775
|
|
|
3774
|
-
function ownKeys$
|
|
3775
|
-
function _objectSpread$
|
|
3776
|
+
function ownKeys$17(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3777
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$17(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$17(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3776
3778
|
const constructPrefixSearchPredicate = function () {
|
|
3777
3779
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3778
3780
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3815,7 +3817,7 @@ const useLoadOptions = _ref => {
|
|
|
3815
3817
|
}();
|
|
3816
3818
|
return client.query({
|
|
3817
3819
|
query,
|
|
3818
|
-
variables: _objectSpread$
|
|
3820
|
+
variables: _objectSpread$17({
|
|
3819
3821
|
where
|
|
3820
3822
|
}, variables),
|
|
3821
3823
|
context: {
|
|
@@ -3869,7 +3871,7 @@ function useCurrentOption(_ref) {
|
|
|
3869
3871
|
};
|
|
3870
3872
|
}
|
|
3871
3873
|
|
|
3872
|
-
var messages$
|
|
3874
|
+
var messages$H = defineMessages({
|
|
3873
3875
|
noProductTypesFound: {
|
|
3874
3876
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3875
3877
|
description: 'The message to display when no product types were found',
|
|
@@ -3978,7 +3980,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3978
3980
|
children: jsx(AsyncSelectInput, {
|
|
3979
3981
|
id: name,
|
|
3980
3982
|
name: name,
|
|
3981
|
-
placeholder: formatMessage(messages$
|
|
3983
|
+
placeholder: formatMessage(messages$H.placeholder),
|
|
3982
3984
|
loadOptions: loadOptionsDebounced,
|
|
3983
3985
|
defaultOptions: [],
|
|
3984
3986
|
isClearable: isClearable,
|
|
@@ -3991,7 +3993,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3991
3993
|
onInputChange: handleInputChange,
|
|
3992
3994
|
onBlur: onBlur,
|
|
3993
3995
|
value: currentOption.data,
|
|
3994
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3996
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$H.noProductTypesFound),
|
|
3995
3997
|
hasError: hasError || isLoadingFailed
|
|
3996
3998
|
})
|
|
3997
3999
|
}), isLoadingFailed && jsx(Text.Body, {
|
|
@@ -4003,7 +4005,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4003
4005
|
};
|
|
4004
4006
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
4005
4007
|
|
|
4006
|
-
var messages$
|
|
4008
|
+
var messages$G = defineMessages({
|
|
4007
4009
|
noStatesFound: {
|
|
4008
4010
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
4009
4011
|
description: 'The message to display when no states were found',
|
|
@@ -4117,7 +4119,7 @@ const StatePickerInput = _ref => {
|
|
|
4117
4119
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4118
4120
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4119
4121
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4120
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4122
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$G.noStatesFound), [loadingError, formatMessage]);
|
|
4121
4123
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
4122
4124
|
return jsx(Constraints.Horizontal, {
|
|
4123
4125
|
max: "scale",
|
|
@@ -4129,7 +4131,7 @@ const StatePickerInput = _ref => {
|
|
|
4129
4131
|
id: name,
|
|
4130
4132
|
name: name,
|
|
4131
4133
|
horizontalConstraint: "scale",
|
|
4132
|
-
placeholder: formatMessage(messages$
|
|
4134
|
+
placeholder: formatMessage(messages$G.placeholder),
|
|
4133
4135
|
loadOptions: loadOptionsDebounced,
|
|
4134
4136
|
defaultOptions: true,
|
|
4135
4137
|
showOptionGroupDivider: true,
|
|
@@ -4155,9 +4157,9 @@ const StatePickerInput = _ref => {
|
|
|
4155
4157
|
};
|
|
4156
4158
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4157
4159
|
|
|
4158
|
-
function ownKeys$
|
|
4159
|
-
function _objectSpread$
|
|
4160
|
-
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$
|
|
4160
|
+
function ownKeys$16(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4161
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$16(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$16(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4162
|
+
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$16({
|
|
4161
4163
|
ref: ref,
|
|
4162
4164
|
style: {
|
|
4163
4165
|
display: 'block',
|
|
@@ -4295,8 +4297,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4295
4297
|
};
|
|
4296
4298
|
|
|
4297
4299
|
const _excluded = ["action"];
|
|
4298
|
-
function ownKeys$
|
|
4299
|
-
function _objectSpread$
|
|
4300
|
+
function ownKeys$15(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4301
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys$15(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys$15(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4300
4302
|
|
|
4301
4303
|
/**
|
|
4302
4304
|
* Checks if a value is a LocalizedString
|
|
@@ -4318,7 +4320,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4318
4320
|
*/
|
|
4319
4321
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4320
4322
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4321
|
-
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4323
|
+
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$15(_objectSpread$15({}, customFields), {}, {
|
|
4322
4324
|
[customField.name]: customField.value
|
|
4323
4325
|
}), {});
|
|
4324
4326
|
};
|
|
@@ -4342,7 +4344,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4342
4344
|
const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
|
|
4343
4345
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4344
4346
|
const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4345
|
-
return _objectSpread$
|
|
4347
|
+
return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, transformedData), parent ? {
|
|
4346
4348
|
parent
|
|
4347
4349
|
} : {}), ancestors ? {
|
|
4348
4350
|
ancestors
|
|
@@ -4484,9 +4486,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4484
4486
|
};
|
|
4485
4487
|
case 'setName':
|
|
4486
4488
|
return {
|
|
4487
|
-
[actionName]:
|
|
4488
|
-
name: _Array$isArray(actionPayload.name) ? actionPayload.name : transformLocalizedStringToLocalizedField(actionPayload.name)
|
|
4489
|
-
}
|
|
4489
|
+
[actionName]: getNameFromPayload(actionPayload)
|
|
4490
4490
|
};
|
|
4491
4491
|
case 'setLocalizedName':
|
|
4492
4492
|
return {
|
|
@@ -4558,7 +4558,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4558
4558
|
case 'addAttributeDefinition':
|
|
4559
4559
|
return {
|
|
4560
4560
|
[actionName]: {
|
|
4561
|
-
attributeDefinition: _objectSpread$
|
|
4561
|
+
attributeDefinition: _objectSpread$15(_objectSpread$15({}, actionPayload.attribute), {}, {
|
|
4562
4562
|
label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4563
4563
|
inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4564
4564
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4574,6 +4574,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4574
4574
|
includedInPrice: actionPayload.taxRate.includedInPrice,
|
|
4575
4575
|
amount: actionPayload.taxRate.amount,
|
|
4576
4576
|
state: actionPayload.taxRate.state,
|
|
4577
|
+
key: actionPayload.taxRate.key,
|
|
4577
4578
|
subRates: actionPayload.taxRate.subRates
|
|
4578
4579
|
},
|
|
4579
4580
|
taxRateId: actionPayload.taxRateId
|
|
@@ -4653,7 +4654,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4653
4654
|
return {
|
|
4654
4655
|
[actionName]: {
|
|
4655
4656
|
attributeName: actionPayload.attributeName,
|
|
4656
|
-
value: _objectSpread$
|
|
4657
|
+
value: _objectSpread$15(_objectSpread$15({}, actionPayload.value), {}, {
|
|
4657
4658
|
label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4658
4659
|
})
|
|
4659
4660
|
}
|
|
@@ -4662,7 +4663,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4662
4663
|
return {
|
|
4663
4664
|
[actionName]: {
|
|
4664
4665
|
attributeName: actionPayload.attributeName,
|
|
4665
|
-
newValue: _objectSpread$
|
|
4666
|
+
newValue: _objectSpread$15(_objectSpread$15({}, actionPayload.newValue), {}, {
|
|
4666
4667
|
label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4667
4668
|
})
|
|
4668
4669
|
}
|
|
@@ -4689,7 +4690,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4689
4690
|
name: transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4690
4691
|
taxCategory: actionPayload.taxCategory,
|
|
4691
4692
|
money: {
|
|
4692
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4693
|
+
[actionPayload.money.type]: _objectSpread$15({
|
|
4693
4694
|
centAmount: actionPayload.money.centAmount,
|
|
4694
4695
|
currencyCode: actionPayload.money.currencyCode
|
|
4695
4696
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4744,8 +4745,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4744
4745
|
fields: customFields
|
|
4745
4746
|
} : null;
|
|
4746
4747
|
return {
|
|
4747
|
-
[actionName]: _objectSpread$
|
|
4748
|
-
address: _objectSpread$
|
|
4748
|
+
[actionName]: _objectSpread$15(_objectSpread$15({}, actionPayload), {}, {
|
|
4749
|
+
address: _objectSpread$15(_objectSpread$15({}, omit(actionPayload.address, ['__typename'])), {}, {
|
|
4749
4750
|
custom
|
|
4750
4751
|
})
|
|
4751
4752
|
})
|
|
@@ -4821,8 +4822,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4821
4822
|
return originalOmitDeep(obj, fieldsToOmit);
|
|
4822
4823
|
}
|
|
4823
4824
|
|
|
4824
|
-
function ownKeys$
|
|
4825
|
-
function _objectSpread$
|
|
4825
|
+
function ownKeys$14(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4826
|
+
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(_context = ownKeys$14(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$14(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4826
4827
|
function getPriceChannelName(price) {
|
|
4827
4828
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4828
4829
|
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;
|
|
@@ -4836,11 +4837,11 @@ function getDiscountValue(price) {
|
|
|
4836
4837
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 ? void 0 : (_price$discounted$val = _price$discounted.value) === null || _price$discounted$val === void 0 ? void 0 : _price$discounted$val.type) === PRECISION_TYPES.centPrecision) {
|
|
4837
4838
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4838
4839
|
}
|
|
4839
|
-
return price.discounted ? _objectSpread$
|
|
4840
|
+
return price.discounted ? _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4840
4841
|
fractionedAmount,
|
|
4841
4842
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4842
4843
|
preciseAmount
|
|
4843
|
-
}) : _objectSpread$
|
|
4844
|
+
}) : _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4844
4845
|
centAmount: 0
|
|
4845
4846
|
});
|
|
4846
4847
|
}
|
|
@@ -4861,7 +4862,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4861
4862
|
}
|
|
4862
4863
|
let preciseAmount;
|
|
4863
4864
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4864
|
-
return _objectSpread$
|
|
4865
|
+
return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4865
4866
|
centAmount,
|
|
4866
4867
|
preciseAmount
|
|
4867
4868
|
});
|
|
@@ -4873,7 +4874,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4873
4874
|
const currencyCode = price.value.currencyCode;
|
|
4874
4875
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4875
4876
|
if (currencyCode && !isNil$1(fractionedAmount)) {
|
|
4876
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4877
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$14(_objectSpread$14({}, minPrices), {}, {
|
|
4877
4878
|
[currencyCode]: price.value
|
|
4878
4879
|
});
|
|
4879
4880
|
}
|
|
@@ -4882,8 +4883,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4882
4883
|
return _Object$values(minPricesByCurrency);
|
|
4883
4884
|
}
|
|
4884
4885
|
|
|
4885
|
-
function ownKeys$
|
|
4886
|
-
function _objectSpread$
|
|
4886
|
+
function ownKeys$13(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4887
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$13(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$13(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4887
4888
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4888
4889
|
var _context, _context4;
|
|
4889
4890
|
return {
|
|
@@ -4898,14 +4899,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4898
4899
|
return {
|
|
4899
4900
|
name: fieldDefinition.name,
|
|
4900
4901
|
required: fieldDefinition.required,
|
|
4901
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4902
|
-
elementType: _objectSpread$
|
|
4902
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4903
|
+
elementType: _objectSpread$13(_objectSpread$13({}, fieldDefinition.type.elementType), {}, {
|
|
4903
4904
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4904
4905
|
key: value.key,
|
|
4905
4906
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4906
4907
|
}))
|
|
4907
4908
|
})
|
|
4908
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4909
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4909
4910
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
4910
4911
|
key: value.key,
|
|
4911
4912
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4916,7 +4917,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4916
4917
|
})
|
|
4917
4918
|
}
|
|
4918
4919
|
},
|
|
4919
|
-
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4920
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$13(_objectSpread$13({}, fields), {}, {
|
|
4920
4921
|
[customField.name]: customField.value
|
|
4921
4922
|
}), {})
|
|
4922
4923
|
};
|
|
@@ -4928,7 +4929,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4928
4929
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4929
4930
|
// in either case we return null
|
|
4930
4931
|
if (!productSelection) return null;
|
|
4931
|
-
return _objectSpread$
|
|
4932
|
+
return _objectSpread$13(_objectSpread$13({}, applyTransformedLocalizedFields(productSelection, [{
|
|
4932
4933
|
from: 'nameAllLocales',
|
|
4933
4934
|
to: 'name'
|
|
4934
4935
|
}])), {}, {
|
|
@@ -4951,8 +4952,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4951
4952
|
return _mapInstanceProperty(_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4952
4953
|
};
|
|
4953
4954
|
|
|
4954
|
-
function ownKeys$
|
|
4955
|
-
function _objectSpread$
|
|
4955
|
+
function ownKeys$12(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4956
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$12(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$12(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4956
4957
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4957
4958
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4958
4959
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4969,7 +4970,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4969
4970
|
if (updateAction.action === 'setCustomField' && _Array$isArray(updateAction.value)) {
|
|
4970
4971
|
const definition = _findInstanceProperty(fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4971
4972
|
const definitionName = definition.type.elementType.name;
|
|
4972
|
-
return _objectSpread$
|
|
4973
|
+
return _objectSpread$12(_objectSpread$12({}, updateAction), {}, {
|
|
4973
4974
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4974
4975
|
});
|
|
4975
4976
|
}
|
|
@@ -5043,8 +5044,8 @@ function omitSetsOfSets() {
|
|
|
5043
5044
|
|
|
5044
5045
|
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 } } } };
|
|
5045
5046
|
|
|
5046
|
-
function ownKeys
|
|
5047
|
-
function _objectSpread
|
|
5047
|
+
function ownKeys$11(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5048
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$11(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$11(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5048
5049
|
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(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5049
5050
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5050
5051
|
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 } } } };
|
|
@@ -5104,7 +5105,7 @@ const mapDataToProps = _ref => {
|
|
|
5104
5105
|
return {
|
|
5105
5106
|
fetchTypeDefinitionsQuery: {
|
|
5106
5107
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5107
|
-
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread
|
|
5108
|
+
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$11({}, applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5108
5109
|
isImmutable: true
|
|
5109
5110
|
}), [{
|
|
5110
5111
|
from: 'labelAllLocales',
|
|
@@ -5132,12 +5133,12 @@ const handlers$4 = {
|
|
|
5132
5133
|
}
|
|
5133
5134
|
};
|
|
5134
5135
|
|
|
5135
|
-
function ownKeys$
|
|
5136
|
-
function _objectSpread$
|
|
5136
|
+
function ownKeys$10(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5137
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$10(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$10(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5137
5138
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5138
5139
|
return {
|
|
5139
5140
|
fields: customFieldsFromRestResponse.fields,
|
|
5140
|
-
type: _objectSpread$
|
|
5141
|
+
type: _objectSpread$10({
|
|
5141
5142
|
id: customFieldsFromRestResponse.type.id
|
|
5142
5143
|
}, customFieldsFromRestResponse.type.obj)
|
|
5143
5144
|
};
|
|
@@ -5156,14 +5157,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5156
5157
|
name: fieldDefinition.name,
|
|
5157
5158
|
required: fieldDefinition.required,
|
|
5158
5159
|
inputHint: fieldDefinition.inputHint,
|
|
5159
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5160
|
-
elementType: _objectSpread$
|
|
5160
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5161
|
+
elementType: _objectSpread$10(_objectSpread$10({}, fieldDefinition.type.elementType), {}, {
|
|
5161
5162
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5162
5163
|
key: value.key,
|
|
5163
5164
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5164
5165
|
}))
|
|
5165
5166
|
})
|
|
5166
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5167
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5167
5168
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
5168
5169
|
key: value.key,
|
|
5169
5170
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5179,7 +5180,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5179
5180
|
type: {
|
|
5180
5181
|
id: formCustomFields.type.id,
|
|
5181
5182
|
typeId: 'type',
|
|
5182
|
-
obj: _objectSpread$
|
|
5183
|
+
obj: _objectSpread$10({}, formCustomFields.type)
|
|
5183
5184
|
},
|
|
5184
5185
|
fields: formCustomFields.fields
|
|
5185
5186
|
});
|
|
@@ -5187,7 +5188,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5187
5188
|
type: {
|
|
5188
5189
|
id: formCustomFields.type.id,
|
|
5189
5190
|
typeId: 'type',
|
|
5190
|
-
obj: _objectSpread$
|
|
5191
|
+
obj: _objectSpread$10({}, omit(formCustomFields.type, ['id']))
|
|
5191
5192
|
},
|
|
5192
5193
|
fields: omitBy(formCustomFields.fields || {}, isNil$1)
|
|
5193
5194
|
});
|
|
@@ -5318,8 +5319,8 @@ const REFERENCED_TYPES = {
|
|
|
5318
5319
|
zone: 'zone'
|
|
5319
5320
|
};
|
|
5320
5321
|
|
|
5321
|
-
function ownKeys
|
|
5322
|
-
function _objectSpread
|
|
5322
|
+
function ownKeys$$(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5323
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$$(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$$(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5323
5324
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5324
5325
|
let validatedValues = [];
|
|
5325
5326
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5386,8 +5387,8 @@ function validations (formValues, language, languages) {
|
|
|
5386
5387
|
var _context2;
|
|
5387
5388
|
// Collect all required and set type fields
|
|
5388
5389
|
const fieldDefinitionsToValidate = _filterInstanceProperty(_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5389
|
-
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread
|
|
5390
|
-
[fieldDefinition.name]: _objectSpread
|
|
5390
|
+
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$$(_objectSpread$$({}, acc), {}, {
|
|
5391
|
+
[fieldDefinition.name]: _objectSpread$$(_objectSpread$$({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5391
5392
|
}), {});
|
|
5392
5393
|
return withoutEmptyErrorsByField(errors);
|
|
5393
5394
|
}
|
|
@@ -5414,8 +5415,8 @@ function CustomTextInput(props) {
|
|
|
5414
5415
|
}
|
|
5415
5416
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5416
5417
|
|
|
5417
|
-
function ownKeys$
|
|
5418
|
-
function _objectSpread$
|
|
5418
|
+
function ownKeys$_(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5419
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5419
5420
|
const getSubfieldLanguage = subfieldName => {
|
|
5420
5421
|
const lastDotIndex = _lastIndexOfInstanceProperty(subfieldName).call(subfieldName, '.');
|
|
5421
5422
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5439,7 +5440,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5439
5440
|
// as a whole.
|
|
5440
5441
|
|
|
5441
5442
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5442
|
-
const newValue = _objectSpread$
|
|
5443
|
+
const newValue = _objectSpread$_(_objectSpread$_({}, props.value), {}, {
|
|
5443
5444
|
[fieldLanguage]: rawValue
|
|
5444
5445
|
});
|
|
5445
5446
|
const nullifiedIfNeeded = LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5506,21 +5507,21 @@ function CustomNumberInput(props) {
|
|
|
5506
5507
|
}
|
|
5507
5508
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5508
5509
|
|
|
5509
|
-
function ownKeys$
|
|
5510
|
-
function _objectSpread$
|
|
5510
|
+
function ownKeys$Z(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5511
|
+
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(_context = ownKeys$Z(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$Z(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5511
5512
|
var styles$g = {
|
|
5512
5513
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5513
5514
|
};
|
|
5514
5515
|
const fixCurrencyCode = (value, currencies) => {
|
|
5515
5516
|
if (value.currencyCode) return value;
|
|
5516
5517
|
const firstCurrency = currencies[0];
|
|
5517
|
-
return _objectSpread$
|
|
5518
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5518
5519
|
currencyCode: firstCurrency
|
|
5519
5520
|
});
|
|
5520
5521
|
};
|
|
5521
5522
|
const fixAmount = value => {
|
|
5522
5523
|
if (!value.amount) {
|
|
5523
|
-
return _objectSpread$
|
|
5524
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5524
5525
|
amount: '0'
|
|
5525
5526
|
});
|
|
5526
5527
|
}
|
|
@@ -5562,7 +5563,7 @@ function CustomMoneyInput(props) {
|
|
|
5562
5563
|
}
|
|
5563
5564
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5564
5565
|
const isAmount = _endsWithInstanceProperty(subfieldName).call(subfieldName, 'amount');
|
|
5565
|
-
const newValue = _objectSpread$
|
|
5566
|
+
const newValue = _objectSpread$Z({}, internalValue.current);
|
|
5566
5567
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5567
5568
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5568
5569
|
internalValue.current = fixedValue;
|
|
@@ -5843,7 +5844,7 @@ function ReferenceSearch(props) {
|
|
|
5843
5844
|
});
|
|
5844
5845
|
}
|
|
5845
5846
|
|
|
5846
|
-
const messages$
|
|
5847
|
+
const messages$F = defineMessages({
|
|
5847
5848
|
placeholder: {
|
|
5848
5849
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5849
5850
|
description: 'Placeholder for search for a category',
|
|
@@ -5876,8 +5877,8 @@ const messages$B = defineMessages({
|
|
|
5876
5877
|
}
|
|
5877
5878
|
});
|
|
5878
5879
|
|
|
5879
|
-
function ownKeys$
|
|
5880
|
-
function _objectSpread$
|
|
5880
|
+
function ownKeys$Y(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5881
|
+
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(_context3 = ownKeys$Y(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$Y(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5881
5882
|
function Option$1(props) {
|
|
5882
5883
|
var _context, _context2;
|
|
5883
5884
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
@@ -5889,7 +5890,7 @@ function Option$1(props) {
|
|
|
5889
5890
|
const _useIntl = useIntl(),
|
|
5890
5891
|
formatMessage = _useIntl.formatMessage;
|
|
5891
5892
|
const category = props.data;
|
|
5892
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5893
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5893
5894
|
children: jsxs("div", {
|
|
5894
5895
|
"data-testid": "category-option",
|
|
5895
5896
|
children: [jsx(Text.Body, {
|
|
@@ -5900,7 +5901,7 @@ function Option$1(props) {
|
|
|
5900
5901
|
fallbackOrder: languages
|
|
5901
5902
|
})
|
|
5902
5903
|
}), category.parent && jsx(Text.Detail, {
|
|
5903
|
-
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$
|
|
5904
|
+
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$F.parentCategory), ": ")).call(_context, formatLocalizedString(category.parent, {
|
|
5904
5905
|
key: 'name',
|
|
5905
5906
|
locale: language,
|
|
5906
5907
|
fallbackOrder: languages
|
|
@@ -5912,14 +5913,14 @@ function Option$1(props) {
|
|
|
5912
5913
|
fallbackOrder: languages
|
|
5913
5914
|
}))
|
|
5914
5915
|
}), category.externalId && jsx(Text.Detail, {
|
|
5915
|
-
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$
|
|
5916
|
+
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$F.externalId), ": ")).call(_context2, category.externalId || NO_VALUE_FALLBACK)
|
|
5916
5917
|
})]
|
|
5917
5918
|
})
|
|
5918
5919
|
}));
|
|
5919
5920
|
}
|
|
5920
5921
|
|
|
5921
|
-
function ownKeys$
|
|
5922
|
-
function _objectSpread$
|
|
5922
|
+
function ownKeys$X(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5923
|
+
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(_context = ownKeys$X(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$X(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5923
5924
|
const filterOption$1 = () => true;
|
|
5924
5925
|
function CategoryReferenceSearch(props) {
|
|
5925
5926
|
const _useIntl = useIntl(),
|
|
@@ -5931,7 +5932,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5931
5932
|
})),
|
|
5932
5933
|
language = _useApplicationContex.language,
|
|
5933
5934
|
languages = _useApplicationContex.languages;
|
|
5934
|
-
const mapItemToOption = useCallback(category => _objectSpread$
|
|
5935
|
+
const mapItemToOption = useCallback(category => _objectSpread$X(_objectSpread$X({}, category), {}, {
|
|
5935
5936
|
value: category.id,
|
|
5936
5937
|
label: formatLocalizedString(category, {
|
|
5937
5938
|
key: 'name',
|
|
@@ -5949,7 +5950,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5949
5950
|
}), [apolloClient]);
|
|
5950
5951
|
return jsx(ReferenceSearch, {
|
|
5951
5952
|
id: props.id,
|
|
5952
|
-
components: _objectSpread$
|
|
5953
|
+
components: _objectSpread$X({
|
|
5953
5954
|
Option: Option$1
|
|
5954
5955
|
}, props.components),
|
|
5955
5956
|
isClearable: props.isClearable,
|
|
@@ -5960,10 +5961,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5960
5961
|
onBlur: props.onBlur,
|
|
5961
5962
|
onChange: props.onChange,
|
|
5962
5963
|
value: props.value,
|
|
5963
|
-
placeholderLabel: formatMessage(messages$
|
|
5964
|
-
searchPromptLabel: formatMessage(messages$
|
|
5965
|
-
noResultsLabel: formatMessage(messages$
|
|
5966
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5964
|
+
placeholderLabel: formatMessage(messages$F.placeholder),
|
|
5965
|
+
searchPromptLabel: formatMessage(messages$F.searchPrompt),
|
|
5966
|
+
noResultsLabel: formatMessage(messages$F.noResults),
|
|
5967
|
+
referenceIsMissingLabel: formatMessage(messages$F.isMissing),
|
|
5967
5968
|
mapItemToOption: mapItemToOption,
|
|
5968
5969
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5969
5970
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6039,7 +6040,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
6039
6040
|
});
|
|
6040
6041
|
}
|
|
6041
6042
|
|
|
6042
|
-
const messages$
|
|
6043
|
+
const messages$E = defineMessages({
|
|
6043
6044
|
placeholder: {
|
|
6044
6045
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
6045
6046
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6067,8 +6068,8 @@ const messages$A = defineMessages({
|
|
|
6067
6068
|
}
|
|
6068
6069
|
});
|
|
6069
6070
|
|
|
6070
|
-
function ownKeys$
|
|
6071
|
-
function _objectSpread$
|
|
6071
|
+
function ownKeys$W(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6072
|
+
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(_context = ownKeys$W(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$W(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6072
6073
|
function Option(props) {
|
|
6073
6074
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
6074
6075
|
language: applicationContext.dataLocale,
|
|
@@ -6079,7 +6080,7 @@ function Option(props) {
|
|
|
6079
6080
|
const _useIntl = useIntl(),
|
|
6080
6081
|
formatMessage = _useIntl.formatMessage;
|
|
6081
6082
|
const cartDiscount = props.data;
|
|
6082
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
6083
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$W(_objectSpread$W({}, props), {}, {
|
|
6083
6084
|
children: jsxs("div", {
|
|
6084
6085
|
"data-testid": "cart-discount-option",
|
|
6085
6086
|
children: [jsx(Text.Detail, {
|
|
@@ -6090,14 +6091,14 @@ function Option(props) {
|
|
|
6090
6091
|
fallbackOrder: languages
|
|
6091
6092
|
})
|
|
6092
6093
|
}), jsxs(Text.Detail, {
|
|
6093
|
-
children: [formatMessage(messages$
|
|
6094
|
+
children: [formatMessage(messages$E.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
|
|
6094
6095
|
})]
|
|
6095
6096
|
})
|
|
6096
6097
|
}));
|
|
6097
6098
|
}
|
|
6098
6099
|
|
|
6099
|
-
function ownKeys$
|
|
6100
|
-
function _objectSpread$
|
|
6100
|
+
function ownKeys$V(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6101
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$V(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$V(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6101
6102
|
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 } } } };
|
|
6102
6103
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6103
6104
|
const filterOption = (option, text) => {
|
|
@@ -6123,7 +6124,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6123
6124
|
})),
|
|
6124
6125
|
language = _useApplicationContex.language,
|
|
6125
6126
|
languages = _useApplicationContex.languages;
|
|
6126
|
-
const mapItemToOption = useCallback(cartDiscount => _objectSpread$
|
|
6127
|
+
const mapItemToOption = useCallback(cartDiscount => _objectSpread$V(_objectSpread$V({}, cartDiscount), {}, {
|
|
6127
6128
|
value: cartDiscount.id,
|
|
6128
6129
|
key: cartDiscount.key,
|
|
6129
6130
|
label: formatLocalizedString(cartDiscount, {
|
|
@@ -6166,10 +6167,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6166
6167
|
onBlur: props.onBlur,
|
|
6167
6168
|
onChange: props.onChange,
|
|
6168
6169
|
value: returnNullIfEmpty(props.value),
|
|
6169
|
-
placeholderLabel: formatMessage(messages$
|
|
6170
|
-
searchPromptLabel: formatMessage(messages$
|
|
6171
|
-
noResultsLabel: formatMessage(messages$
|
|
6172
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6170
|
+
placeholderLabel: formatMessage(messages$E.placeholder),
|
|
6171
|
+
searchPromptLabel: formatMessage(messages$E.searchPrompt),
|
|
6172
|
+
noResultsLabel: formatMessage(messages$E.noResults),
|
|
6173
|
+
referenceIsMissingLabel: formatMessage(messages$E.isMissing),
|
|
6173
6174
|
mapItemToOption: mapItemToOption,
|
|
6174
6175
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6175
6176
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6230,7 +6231,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6230
6231
|
});
|
|
6231
6232
|
}
|
|
6232
6233
|
|
|
6233
|
-
var messages$
|
|
6234
|
+
var messages$D = defineMessages({
|
|
6234
6235
|
noProductsFound: {
|
|
6235
6236
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6236
6237
|
description: 'The message to display when no products were found',
|
|
@@ -6354,7 +6355,7 @@ const ProductPickerInput = _ref => {
|
|
|
6354
6355
|
children: jsx(AsyncSelectInput, {
|
|
6355
6356
|
id: name,
|
|
6356
6357
|
name: name,
|
|
6357
|
-
placeholder: formatMessage(messages$
|
|
6358
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
6358
6359
|
loadOptions: loadOptionsDebounced,
|
|
6359
6360
|
defaultOptions: [],
|
|
6360
6361
|
isClearable: isClearable,
|
|
@@ -6368,7 +6369,7 @@ const ProductPickerInput = _ref => {
|
|
|
6368
6369
|
onInputChange: handleInputChange,
|
|
6369
6370
|
onBlur: onBlur,
|
|
6370
6371
|
value: currentOption.data,
|
|
6371
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6372
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$D.noProductsFound),
|
|
6372
6373
|
hasError: hasError || isLoadingFailed
|
|
6373
6374
|
})
|
|
6374
6375
|
}), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
|
|
@@ -6686,8 +6687,8 @@ const SetButtons = props => {
|
|
|
6686
6687
|
};
|
|
6687
6688
|
SetButtons.displayName = 'SetButtons';
|
|
6688
6689
|
|
|
6689
|
-
function ownKeys$
|
|
6690
|
-
function _objectSpread$
|
|
6690
|
+
function ownKeys$U(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6691
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$U(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$U(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6691
6692
|
const getDuplicateErrors = setValues => {
|
|
6692
6693
|
/* eslint-disable no-plusplus */
|
|
6693
6694
|
const result = [];
|
|
@@ -6744,7 +6745,7 @@ function CustomInputSet(props) {
|
|
|
6744
6745
|
touched = _useFormikContext.touched,
|
|
6745
6746
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
6746
6747
|
dirty = _useFormikContext.dirty;
|
|
6747
|
-
const itemFieldDefintion = _objectSpread$
|
|
6748
|
+
const itemFieldDefintion = _objectSpread$U(_objectSpread$U({}, props.fieldDefinition), {}, {
|
|
6748
6749
|
type: props.fieldDefinition.type.elementType
|
|
6749
6750
|
});
|
|
6750
6751
|
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -6857,7 +6858,7 @@ function CustomInputSet(props) {
|
|
|
6857
6858
|
}
|
|
6858
6859
|
CustomInputSet.displayName = 'CustomInputSet';
|
|
6859
6860
|
|
|
6860
|
-
var messages$
|
|
6861
|
+
var messages$C = defineMessages({
|
|
6861
6862
|
referencedProductType: {
|
|
6862
6863
|
id: 'NestedAttributes.referencedProductType',
|
|
6863
6864
|
description: 'Product type referenced hint',
|
|
@@ -6865,10 +6866,10 @@ var messages$y = defineMessages({
|
|
|
6865
6866
|
}
|
|
6866
6867
|
});
|
|
6867
6868
|
|
|
6868
|
-
function ownKeys$
|
|
6869
|
-
function _objectSpread$
|
|
6869
|
+
function ownKeys$T(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6870
|
+
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(_context = ownKeys$T(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$T(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6870
6871
|
function ProductTypeReference(props) {
|
|
6871
|
-
const productTypeMessage = _objectSpread$
|
|
6872
|
+
const productTypeMessage = _objectSpread$T(_objectSpread$T({}, messages$C.referencedProductType), {}, {
|
|
6872
6873
|
values: {
|
|
6873
6874
|
productTypeName: props.productType.name
|
|
6874
6875
|
}
|
|
@@ -6879,23 +6880,23 @@ function ProductTypeReference(props) {
|
|
|
6879
6880
|
}
|
|
6880
6881
|
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
6881
6882
|
|
|
6882
|
-
function ownKeys$
|
|
6883
|
-
function _objectSpread$
|
|
6883
|
+
function ownKeys$S(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6884
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$S(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$S(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6884
6885
|
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 } } } };
|
|
6885
6886
|
const mapAttributeDefinition = definition => {
|
|
6886
6887
|
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6887
|
-
return _objectSpread$
|
|
6888
|
+
return _objectSpread$S(_objectSpread$S({}, definition), {}, {
|
|
6888
6889
|
required: definition.isRequired,
|
|
6889
6890
|
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6890
6891
|
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6891
|
-
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$
|
|
6892
|
-
elementType: _objectSpread$
|
|
6892
|
+
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6893
|
+
elementType: _objectSpread$S(_objectSpread$S({}, definition.type.elementType), {}, {
|
|
6893
6894
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6894
6895
|
key: value.key,
|
|
6895
6896
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6896
6897
|
}))
|
|
6897
6898
|
})
|
|
6898
|
-
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6899
|
+
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6899
6900
|
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6900
6901
|
key: value.key,
|
|
6901
6902
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6971,9 +6972,9 @@ function CustomNestedFieldInput(props) {
|
|
|
6971
6972
|
}
|
|
6972
6973
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
6973
6974
|
|
|
6974
|
-
function ownKeys$
|
|
6975
|
-
function _objectSpread$
|
|
6976
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
6975
|
+
function ownKeys$R(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6976
|
+
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(_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6977
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$R(_objectSpread$R({}, result), itemErrors), {});
|
|
6977
6978
|
|
|
6978
6979
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
6979
6980
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -6984,15 +6985,15 @@ const CustomFieldErrors = props => {
|
|
|
6984
6985
|
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
6985
6986
|
return jsxs(Fragment, {
|
|
6986
6987
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
6987
|
-
intlMessage: messages$
|
|
6988
|
+
intlMessage: messages$O.required
|
|
6988
6989
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
6989
|
-
intlMessage: messages$
|
|
6990
|
+
intlMessage: messages$O.unique
|
|
6990
6991
|
})]
|
|
6991
6992
|
});
|
|
6992
6993
|
};
|
|
6993
6994
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
6994
6995
|
|
|
6995
|
-
var messages$
|
|
6996
|
+
var messages$B = defineMessages({
|
|
6996
6997
|
productReferenceLabel: {
|
|
6997
6998
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
6998
6999
|
description: 'Label shown above the product picker input.',
|
|
@@ -7025,8 +7026,8 @@ var messages$x = defineMessages({
|
|
|
7025
7026
|
}
|
|
7026
7027
|
});
|
|
7027
7028
|
|
|
7028
|
-
function ownKeys$
|
|
7029
|
-
function _objectSpread$
|
|
7029
|
+
function ownKeys$Q(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7030
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$Q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$Q(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7030
7031
|
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 } } } };
|
|
7031
7032
|
const CustomFieldsLabelHint = _ref => {
|
|
7032
7033
|
var _type$name;
|
|
@@ -7058,14 +7059,14 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7058
7059
|
children: [jsx(WarningIcon, {
|
|
7059
7060
|
size: "medium",
|
|
7060
7061
|
color: "warning"
|
|
7061
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7062
|
+
}), jsx(FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7062
7063
|
}) : jsx(Spacings.Inset, {
|
|
7063
7064
|
scale: "xs",
|
|
7064
7065
|
children: jsxs(Spacings.Inline, {
|
|
7065
7066
|
alignItems: "flex-start",
|
|
7066
7067
|
children: [jsx(InformationIcon, {
|
|
7067
7068
|
size: "medium"
|
|
7068
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7069
|
+
}), jsx(FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7069
7070
|
})
|
|
7070
7071
|
});
|
|
7071
7072
|
}
|
|
@@ -7080,8 +7081,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7080
7081
|
formatMessage = _useIntl.formatMessage;
|
|
7081
7082
|
const _usePimStatus = usePimStatus(),
|
|
7082
7083
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7083
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7084
|
-
return formatMessage(messages$
|
|
7084
|
+
if (isProjectIndexed) return formatMessage(messages$B.productTypeReferenceLabelI);
|
|
7085
|
+
return formatMessage(messages$B.productTypeReferenceLabel);
|
|
7085
7086
|
}
|
|
7086
7087
|
|
|
7087
7088
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7097,7 +7098,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7097
7098
|
const referenceTypeId = type.referenceTypeId;
|
|
7098
7099
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7099
7100
|
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7100
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7101
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$B.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$B.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$B.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7101
7102
|
}
|
|
7102
7103
|
const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
7103
7104
|
let name = _ref3.name,
|
|
@@ -7205,8 +7206,8 @@ const ThemedCustomFieldsInternal = props => {
|
|
|
7205
7206
|
};
|
|
7206
7207
|
ThemedCustomFieldsInternal.displayName = 'ThemedCustomFieldsInternal';
|
|
7207
7208
|
|
|
7208
|
-
function ownKeys$
|
|
7209
|
-
function _objectSpread$
|
|
7209
|
+
function ownKeys$P(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7210
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$P(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$P(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7210
7211
|
const getTypeName = type => type.name.toLowerCase();
|
|
7211
7212
|
const findLabel = (enumType, key) => {
|
|
7212
7213
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -7255,7 +7256,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
7255
7256
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty(pairs).call(pairs, (result, _ref2) => {
|
|
7256
7257
|
let name = _ref2.name,
|
|
7257
7258
|
value = _ref2.value;
|
|
7258
|
-
return _objectSpread$
|
|
7259
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
7259
7260
|
[name]: value
|
|
7260
7261
|
});
|
|
7261
7262
|
}, {});
|
|
@@ -7362,7 +7363,7 @@ const customFieldsMessages = defineMessages({
|
|
|
7362
7363
|
}
|
|
7363
7364
|
});
|
|
7364
7365
|
|
|
7365
|
-
var messages$
|
|
7366
|
+
var messages$A = defineMessages({
|
|
7366
7367
|
updateButton: {
|
|
7367
7368
|
id: 'NestedAttributes.Details.updateButton',
|
|
7368
7369
|
description: 'Update button label',
|
|
@@ -7442,14 +7443,14 @@ var messages$w = defineMessages({
|
|
|
7442
7443
|
|
|
7443
7444
|
const NestingLevelContext = /*#__PURE__*/createContext(0);
|
|
7444
7445
|
|
|
7445
|
-
function ownKeys$
|
|
7446
|
-
function _objectSpread$
|
|
7446
|
+
function ownKeys$O(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7447
|
+
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(_context = ownKeys$O(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$O(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7447
7448
|
const EditButton = props => {
|
|
7448
7449
|
const _useIntl = useIntl(),
|
|
7449
7450
|
formatMessage = _useIntl.formatMessage;
|
|
7450
7451
|
return jsx(Tooltip, {
|
|
7451
7452
|
placement: "top",
|
|
7452
|
-
title: formatMessage(messages$
|
|
7453
|
+
title: formatMessage(messages$A.editTooltip),
|
|
7453
7454
|
children: jsx(IconButton, {
|
|
7454
7455
|
label: "Edit",
|
|
7455
7456
|
isDisabled: props.isDisabled,
|
|
@@ -7465,12 +7466,12 @@ const DropChangesConfirmation = props => {
|
|
|
7465
7466
|
formatMessage = _useIntl2.formatMessage;
|
|
7466
7467
|
return jsx(ConfirmationDialog, {
|
|
7467
7468
|
isOpen: props.isOpen || false,
|
|
7468
|
-
title: formatMessage(messages$
|
|
7469
|
-
labelPrimary: formatMessage(messages$
|
|
7469
|
+
title: formatMessage(messages$A.confirmationDialogTitle),
|
|
7470
|
+
labelPrimary: formatMessage(messages$A.nestedAttributesConfirmLabel),
|
|
7470
7471
|
onConfirm: props.onConfirm,
|
|
7471
7472
|
onCancel: props.onCancel,
|
|
7472
7473
|
children: jsx(Text.Body, {
|
|
7473
|
-
intlMessage: messages$
|
|
7474
|
+
intlMessage: messages$A.confirmationDialogBody
|
|
7474
7475
|
})
|
|
7475
7476
|
});
|
|
7476
7477
|
};
|
|
@@ -7499,11 +7500,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7499
7500
|
children: [jsx(SecondaryButton, {
|
|
7500
7501
|
isDisabled: !formik.dirty,
|
|
7501
7502
|
iconLeft: jsx(RevertIcon, {}),
|
|
7502
|
-
label: formatMessage(messages$
|
|
7503
|
+
label: formatMessage(messages$A.cancelButton),
|
|
7503
7504
|
onClick: formik.resetForm
|
|
7504
7505
|
}), jsx(CustomFormModalPage.FormPrimaryButton, {
|
|
7505
7506
|
isDisabled: !formik.dirty,
|
|
7506
|
-
label: formatMessage(messages$
|
|
7507
|
+
label: formatMessage(messages$A.updateButton),
|
|
7507
7508
|
onClick: formik.handleSubmit
|
|
7508
7509
|
})]
|
|
7509
7510
|
}),
|
|
@@ -7544,7 +7545,7 @@ const NestedInputControls = props => {
|
|
|
7544
7545
|
if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
|
|
7545
7546
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7546
7547
|
if (!hasAttributes) return jsx(Text.Body, {
|
|
7547
|
-
intlMessage: messages$
|
|
7548
|
+
intlMessage: messages$A.emptyProductType,
|
|
7548
7549
|
tone: "secondary"
|
|
7549
7550
|
});
|
|
7550
7551
|
return jsxs(Spacings.Inline, {
|
|
@@ -7594,13 +7595,13 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7594
7595
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7595
7596
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7596
7597
|
const openNestedAttributesForm = () => {
|
|
7597
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7598
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7598
7599
|
hideSaveToolbar: true
|
|
7599
7600
|
}));
|
|
7600
7601
|
attributesForm.openModal();
|
|
7601
7602
|
};
|
|
7602
7603
|
const closeNestedAttributesForm = () => {
|
|
7603
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7604
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7604
7605
|
hideSaveToolbar: false
|
|
7605
7606
|
}));
|
|
7606
7607
|
attributesForm.closeModal();
|
|
@@ -7620,7 +7621,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7620
7621
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7621
7622
|
kind: 'success',
|
|
7622
7623
|
domain: DOMAINS.SIDE,
|
|
7623
|
-
text: formatMessage(messages$
|
|
7624
|
+
text: formatMessage(messages$A.attributeUpdateSucceeded)
|
|
7624
7625
|
});
|
|
7625
7626
|
setSubmitting(false);
|
|
7626
7627
|
},
|
|
@@ -8051,8 +8052,8 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8051
8052
|
});
|
|
8052
8053
|
}
|
|
8053
8054
|
|
|
8054
|
-
function ownKeys$
|
|
8055
|
-
function _objectSpread$
|
|
8055
|
+
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8056
|
+
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(_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8056
8057
|
const components = {
|
|
8057
8058
|
// eslint-disable-next-line react/display-name
|
|
8058
8059
|
Option: optionInnerProps => jsx(CustomSelectInputOption, {
|
|
@@ -8065,7 +8066,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8065
8066
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8066
8067
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8067
8068
|
return jsx(Spacings.Stack, {
|
|
8068
|
-
children: jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8069
|
+
children: jsx(CustomProductSelectionsPicker, _objectSpread$N(_objectSpread$N({}, props), {}, {
|
|
8069
8070
|
components: components
|
|
8070
8071
|
}))
|
|
8071
8072
|
});
|
|
@@ -8082,7 +8083,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8082
8083
|
|
|
8083
8084
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8084
8085
|
|
|
8085
|
-
var messages$
|
|
8086
|
+
var messages$z = defineMessages({
|
|
8086
8087
|
countriesBasicSelectPlaceholder: {
|
|
8087
8088
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8088
8089
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8110,7 +8111,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8110
8111
|
value: props.value,
|
|
8111
8112
|
isRequired: props.isRequired,
|
|
8112
8113
|
description: props.description,
|
|
8113
|
-
placeholder: intl.formatMessage(messages$
|
|
8114
|
+
placeholder: intl.formatMessage(messages$z.countriesBasicSelectPlaceholder),
|
|
8114
8115
|
options: props.options,
|
|
8115
8116
|
onChange: props.onChange,
|
|
8116
8117
|
isDisabled: props.isDisabled,
|
|
@@ -8120,10 +8121,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8120
8121
|
});
|
|
8121
8122
|
}
|
|
8122
8123
|
|
|
8123
|
-
function ownKeys$
|
|
8124
|
-
function _objectSpread$
|
|
8124
|
+
function ownKeys$M(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8125
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$M(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$M(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8125
8126
|
const emptyCountryOption = intl => [{
|
|
8126
|
-
label: intl.formatMessage(messages$
|
|
8127
|
+
label: intl.formatMessage(messages$z.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8127
8128
|
value: undefined,
|
|
8128
8129
|
isDisabled: true
|
|
8129
8130
|
}];
|
|
@@ -8148,7 +8149,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8148
8149
|
const onOptionChange = event => {
|
|
8149
8150
|
const countries = event.target.value;
|
|
8150
8151
|
props.onChange({
|
|
8151
|
-
target: _objectSpread$
|
|
8152
|
+
target: _objectSpread$M(_objectSpread$M({}, event.target), {}, {
|
|
8152
8153
|
value: _mapInstanceProperty(countries).call(countries, country => {
|
|
8153
8154
|
var _country$value;
|
|
8154
8155
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8169,7 +8170,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8169
8170
|
var _context3;
|
|
8170
8171
|
return _findInstanceProperty(_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8171
8172
|
}),
|
|
8172
|
-
placeholder: intl.formatMessage(messages$
|
|
8173
|
+
placeholder: intl.formatMessage(messages$z.countriesAsyncSelectPlaceholder),
|
|
8173
8174
|
loadOptions: handleLoadOptions,
|
|
8174
8175
|
onChange: onOptionChange,
|
|
8175
8176
|
isDisabled: props.isDisabled,
|
|
@@ -8179,13 +8180,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8179
8180
|
});
|
|
8180
8181
|
}
|
|
8181
8182
|
|
|
8182
|
-
function ownKeys$
|
|
8183
|
-
function _objectSpread$
|
|
8183
|
+
function ownKeys$L(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8184
|
+
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(_context = ownKeys$L(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$L(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8184
8185
|
function CountriesPicker(props) {
|
|
8185
8186
|
var _props$options;
|
|
8186
8187
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8187
8188
|
return jsx(Spacings.Stack, {
|
|
8188
|
-
children: jsx(CustomCountriesPicker, _objectSpread$
|
|
8189
|
+
children: jsx(CustomCountriesPicker, _objectSpread$L({}, props))
|
|
8189
8190
|
});
|
|
8190
8191
|
}
|
|
8191
8192
|
CountriesPicker.defaultProps = {
|
|
@@ -8195,7 +8196,7 @@ CountriesPicker.defaultProps = {
|
|
|
8195
8196
|
hasWarning: false
|
|
8196
8197
|
};
|
|
8197
8198
|
|
|
8198
|
-
var messages$
|
|
8199
|
+
var messages$y = defineMessages({
|
|
8199
8200
|
noCustomerGroupsFound: {
|
|
8200
8201
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8201
8202
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8320,7 +8321,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8320
8321
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8321
8322
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8322
8323
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8323
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8324
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$y.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8324
8325
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8325
8326
|
return jsx(Constraints.Horizontal, {
|
|
8326
8327
|
max: "scale",
|
|
@@ -8331,7 +8332,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8331
8332
|
children: jsx(AsyncSelectInput, {
|
|
8332
8333
|
id: name,
|
|
8333
8334
|
name: name,
|
|
8334
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8335
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$y.placeholder),
|
|
8335
8336
|
loadOptions: loadOptionsDebounced,
|
|
8336
8337
|
defaultOptions: true,
|
|
8337
8338
|
showOptionGroupDivider: true,
|
|
@@ -8401,7 +8402,7 @@ const getFirst60Options$1 = (storesOptions, currentValues) => {
|
|
|
8401
8402
|
return _sliceInstanceProperty(storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8402
8403
|
};
|
|
8403
8404
|
|
|
8404
|
-
var messages$
|
|
8405
|
+
var messages$x = defineMessages({
|
|
8405
8406
|
basicSelectInputPlaceholder: {
|
|
8406
8407
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8407
8408
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8434,8 +8435,8 @@ var messages$t = defineMessages({
|
|
|
8434
8435
|
}
|
|
8435
8436
|
});
|
|
8436
8437
|
|
|
8437
|
-
function ownKeys$
|
|
8438
|
-
function _objectSpread$
|
|
8438
|
+
function ownKeys$K(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8439
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$K(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$K(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8439
8440
|
const hasErrors$5 = errors => {
|
|
8440
8441
|
var _context;
|
|
8441
8442
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8460,7 +8461,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8460
8461
|
return _findInstanceProperty(mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8461
8462
|
};
|
|
8462
8463
|
const emptyStoreOption = intl => [{
|
|
8463
|
-
label: intl.formatMessage(messages$
|
|
8464
|
+
label: intl.formatMessage(messages$x.asyncSelectDropdownTypeAheadPrompt),
|
|
8464
8465
|
value: undefined,
|
|
8465
8466
|
isDisabled: true
|
|
8466
8467
|
}];
|
|
@@ -8507,10 +8508,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8507
8508
|
};
|
|
8508
8509
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8509
8510
|
return jsxs(Fragment, {
|
|
8510
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
8511
|
+
children: [jsx(AsyncSelectInput, _objectSpread$K(_objectSpread$K({
|
|
8511
8512
|
id: props.id,
|
|
8512
8513
|
name: props.name,
|
|
8513
|
-
placeholder: intl.formatMessage(messages$
|
|
8514
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8514
8515
|
horizontalConstraint: props.horizontalConstraint,
|
|
8515
8516
|
loadOptions: handleLoadOptions,
|
|
8516
8517
|
defaultOptions: true,
|
|
@@ -8549,8 +8550,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8549
8550
|
shouldFetchProductSelections: false
|
|
8550
8551
|
};
|
|
8551
8552
|
|
|
8552
|
-
function ownKeys$
|
|
8553
|
-
function _objectSpread$
|
|
8553
|
+
function ownKeys$J(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8554
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$J(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$J(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8554
8555
|
const hasErrors$4 = errors => {
|
|
8555
8556
|
var _context;
|
|
8556
8557
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8598,10 +8599,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8598
8599
|
};
|
|
8599
8600
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8600
8601
|
return jsxs(Fragment, {
|
|
8601
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
8602
|
+
children: [jsx(SelectInput, _objectSpread$J(_objectSpread$J({
|
|
8602
8603
|
id: props.id,
|
|
8603
8604
|
name: props.name,
|
|
8604
|
-
placeholder: intl.formatMessage(messages$
|
|
8605
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8605
8606
|
horizontalConstraint: props.horizontalConstraint,
|
|
8606
8607
|
options: mappedStoresListOptions,
|
|
8607
8608
|
isMulti: props.isMulti,
|
|
@@ -8693,8 +8694,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8693
8694
|
};
|
|
8694
8695
|
};
|
|
8695
8696
|
|
|
8696
|
-
function ownKeys$
|
|
8697
|
-
function _objectSpread$
|
|
8697
|
+
function ownKeys$I(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8698
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$I(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$I(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8698
8699
|
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 } } } };
|
|
8699
8700
|
const hasErrors$3 = errors => {
|
|
8700
8701
|
var _context;
|
|
@@ -8796,10 +8797,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8796
8797
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8797
8798
|
if (storesByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8798
8799
|
return jsxs(Fragment, {
|
|
8799
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
8800
|
+
children: [jsx(SearchSelectInput, _objectSpread$I(_objectSpread$I({
|
|
8800
8801
|
id: props.id,
|
|
8801
8802
|
name: props.name,
|
|
8802
|
-
placeholder: intl.formatMessage(messages$
|
|
8803
|
+
placeholder: intl.formatMessage(messages$x.searchSelectInputPlaceholder),
|
|
8803
8804
|
horizontalConstraint: props.horizontalConstraint,
|
|
8804
8805
|
loadOptions: loadOptionsDebounced,
|
|
8805
8806
|
defaultOptions: false,
|
|
@@ -8813,8 +8814,8 @@ const StoresSearchSelectInput = props => {
|
|
|
8813
8814
|
}),
|
|
8814
8815
|
onChange: props.onChange,
|
|
8815
8816
|
onBlur: props.onBlur,
|
|
8816
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8817
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
8817
|
+
loadingMessage: intl.formatMessage(messages$x.searchSelectInputLoadingMessage),
|
|
8818
|
+
noOptionsMessage: () => intl.formatMessage(messages$x.searchSelectInputNoOptionsFoundMessage),
|
|
8818
8819
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8819
8820
|
isReadOnly: props.isReadOnly,
|
|
8820
8821
|
isClearable: props.isClearable,
|
|
@@ -8841,8 +8842,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8841
8842
|
shouldFetchProductSelections: false
|
|
8842
8843
|
};
|
|
8843
8844
|
|
|
8844
|
-
function ownKeys$
|
|
8845
|
-
function _objectSpread$
|
|
8845
|
+
function ownKeys$H(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8846
|
+
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(_context = ownKeys$H(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$H(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8846
8847
|
const StoreSelectInput = props => {
|
|
8847
8848
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8848
8849
|
const components = useMemo(() => {
|
|
@@ -8850,7 +8851,7 @@ const StoreSelectInput = props => {
|
|
|
8850
8851
|
// eslint-disable-next-line react/display-name
|
|
8851
8852
|
Option: optionInnerProps => {
|
|
8852
8853
|
if (optionInnerProps.isDisabled) {
|
|
8853
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
8854
|
+
return jsx(SelectInput.Option, _objectSpread$H({}, optionInnerProps));
|
|
8854
8855
|
}
|
|
8855
8856
|
return jsx(CustomSelectInputOption, {
|
|
8856
8857
|
optionType: props.optionType,
|
|
@@ -8861,7 +8862,7 @@ const StoreSelectInput = props => {
|
|
|
8861
8862
|
}, [props.optionType]);
|
|
8862
8863
|
if (totalNumberOfStoresFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8863
8864
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8864
|
-
return jsx(CustomStoreSelectInput, _objectSpread$
|
|
8865
|
+
return jsx(CustomStoreSelectInput, _objectSpread$H(_objectSpread$H({
|
|
8865
8866
|
projectKey: props.projectKey,
|
|
8866
8867
|
id: props.id,
|
|
8867
8868
|
name: props.name,
|
|
@@ -8900,12 +8901,12 @@ StoreSelectInput.defaultProps = {
|
|
|
8900
8901
|
shouldFetchProductSelections: false
|
|
8901
8902
|
};
|
|
8902
8903
|
|
|
8903
|
-
function ownKeys$
|
|
8904
|
-
function _objectSpread$
|
|
8904
|
+
function ownKeys$G(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8905
|
+
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(_context2 = ownKeys$G(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$G(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8905
8906
|
var FetchBusinessUnitsListQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsListQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnits" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 340, source: { body: "query FetchBusinessUnitsListQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n) {\n businessUnits(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...BusinessUnitBasicInfo\n }\n }\n}\n\nfragment BusinessUnitBasicInfo on BusinessUnit {\n id\n key\n name\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8906
8907
|
const createQueryVariables$3 = ownProps => {
|
|
8907
8908
|
var _context;
|
|
8908
|
-
return _objectSpread$
|
|
8909
|
+
return _objectSpread$G(_objectSpread$G({
|
|
8909
8910
|
limit: ownProps.limit,
|
|
8910
8911
|
offset: ownProps.offset,
|
|
8911
8912
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -8978,7 +8979,7 @@ const getFirst60Options = (businessUnitOptions, currentValues) => {
|
|
|
8978
8979
|
return _sliceInstanceProperty(businessUnitOptions).call(businessUnitOptions, 0, LOWER_BUSINESS_UNITS_LIMIT + currentValuesLength);
|
|
8979
8980
|
};
|
|
8980
8981
|
|
|
8981
|
-
var messages$
|
|
8982
|
+
var messages$w = defineMessages({
|
|
8982
8983
|
asyncSelectInputPlaceholder: {
|
|
8983
8984
|
id: 'Shared.BusinessUnitSelectInput.asyncSelectInputPlaceholder',
|
|
8984
8985
|
description: 'The placeholder shown for async select input',
|
|
@@ -9006,8 +9007,8 @@ var messages$s = defineMessages({
|
|
|
9006
9007
|
}
|
|
9007
9008
|
});
|
|
9008
9009
|
|
|
9009
|
-
function ownKeys$
|
|
9010
|
-
function _objectSpread$
|
|
9010
|
+
function ownKeys$F(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9011
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$F(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$F(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9011
9012
|
const hasErrors$2 = errors => {
|
|
9012
9013
|
var _context;
|
|
9013
9014
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -9049,10 +9050,10 @@ const BusinessUnitAsyncSelectInput = props => {
|
|
|
9049
9050
|
};
|
|
9050
9051
|
if (businessUnitsListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9051
9052
|
return jsxs(Fragment, {
|
|
9052
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
9053
|
+
children: [jsx(AsyncSelectInput, _objectSpread$F(_objectSpread$F({
|
|
9053
9054
|
id: props.id,
|
|
9054
9055
|
name: props.name,
|
|
9055
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9056
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.asyncSelectInputPlaceholder),
|
|
9056
9057
|
horizontalConstraint: props.horizontalConstraint,
|
|
9057
9058
|
loadOptions: handleLoadOptions,
|
|
9058
9059
|
defaultOptions: getDefaultOptions(),
|
|
@@ -9085,8 +9086,8 @@ BusinessUnitAsyncSelectInput.defaultProps = {
|
|
|
9085
9086
|
shouldFetchProductSelections: false
|
|
9086
9087
|
};
|
|
9087
9088
|
|
|
9088
|
-
function ownKeys$
|
|
9089
|
-
function _objectSpread$
|
|
9089
|
+
function ownKeys$E(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9090
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$E(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$E(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9090
9091
|
const hasErrors$1 = errors => {
|
|
9091
9092
|
var _context;
|
|
9092
9093
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -9113,10 +9114,10 @@ const BusinessUnitBasicSelectInput = props => {
|
|
|
9113
9114
|
};
|
|
9114
9115
|
if (businessUnitsListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9115
9116
|
return jsxs(Fragment, {
|
|
9116
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
9117
|
+
children: [jsx(SelectInput, _objectSpread$E(_objectSpread$E({
|
|
9117
9118
|
id: props.id,
|
|
9118
9119
|
name: props.name,
|
|
9119
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9120
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.basicSelectInputPlaceholder),
|
|
9120
9121
|
horizontalConstraint: props.horizontalConstraint,
|
|
9121
9122
|
options: mappedBusinessUnitsOptions,
|
|
9122
9123
|
value: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.value,
|
|
@@ -9200,8 +9201,8 @@ const handlers$1 = {
|
|
|
9200
9201
|
}
|
|
9201
9202
|
};
|
|
9202
9203
|
|
|
9203
|
-
function ownKeys$
|
|
9204
|
-
function _objectSpread$
|
|
9204
|
+
function ownKeys$D(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9205
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$D(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$D(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9205
9206
|
var FetchBusinessUnitsByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "businessUnitsByWherePredicate" }, name: { kind: "Name", value: "businessUnits" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 180, source: { body: "query FetchBusinessUnitsByWherePredicate($where: String!) {\n businessUnitsByWherePredicate: businessUnits(where: $where) {\n results {\n id\n key\n name\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9206
9207
|
const hasErrors = errors => {
|
|
9207
9208
|
var _context;
|
|
@@ -9250,18 +9251,18 @@ const BusinessUnitSearchSelectInput = props => {
|
|
|
9250
9251
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
9251
9252
|
if (businessUnitsByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9252
9253
|
return jsxs(Fragment, {
|
|
9253
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
9254
|
+
children: [jsx(SearchSelectInput, _objectSpread$D(_objectSpread$D({
|
|
9254
9255
|
id: props.id,
|
|
9255
9256
|
name: props.name,
|
|
9256
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9257
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.searchSelectInputPlaceholder),
|
|
9257
9258
|
horizontalConstraint: props.horizontalConstraint,
|
|
9258
9259
|
loadOptions: loadOptionsDebounced,
|
|
9259
9260
|
defaultOptions: false,
|
|
9260
9261
|
value: props.value,
|
|
9261
9262
|
onChange: handleChange,
|
|
9262
9263
|
onBlur: props.onBlur,
|
|
9263
|
-
loadingMessage: intl.formatMessage(messages$
|
|
9264
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
9264
|
+
loadingMessage: intl.formatMessage(messages$w.searchSelectInputLoadingMessage),
|
|
9265
|
+
noOptionsMessage: () => intl.formatMessage(messages$w.searchSelectInputNoOptionsFoundMessage),
|
|
9265
9266
|
isDisabled: props.isDisabled || businessUnitsByFieldFetcher.isLoading,
|
|
9266
9267
|
isReadOnly: props.isReadOnly,
|
|
9267
9268
|
isClearable: props.isClearable,
|
|
@@ -9288,8 +9289,8 @@ BusinessUnitSearchSelectInput.defaultProps = {
|
|
|
9288
9289
|
shouldFetchProductSelections: false
|
|
9289
9290
|
};
|
|
9290
9291
|
|
|
9291
|
-
function ownKeys$
|
|
9292
|
-
function _objectSpread$
|
|
9292
|
+
function ownKeys$C(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9293
|
+
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(_context = ownKeys$C(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$C(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9293
9294
|
const BusinessUnitSelectInput = props => {
|
|
9294
9295
|
const totalNumberOfBusinessUnitsFetcher = useTotalNumberOfBusinessUnitsFetcher();
|
|
9295
9296
|
const components = useMemo(() => {
|
|
@@ -9297,7 +9298,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9297
9298
|
// eslint-disable-next-line react/display-name
|
|
9298
9299
|
Option: optionInnerProps => {
|
|
9299
9300
|
if (optionInnerProps.isDisabled) {
|
|
9300
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
9301
|
+
return jsx(SelectInput.Option, _objectSpread$C({}, optionInnerProps));
|
|
9301
9302
|
}
|
|
9302
9303
|
return jsx(CustomSelectInputOption, {
|
|
9303
9304
|
optionType: props.optionType,
|
|
@@ -9308,7 +9309,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9308
9309
|
}, [props.optionType]);
|
|
9309
9310
|
if (totalNumberOfBusinessUnitsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9310
9311
|
const CustomSelectInput = totalNumberOfBusinessUnitsFetcher.total <= props.lowerBusinessUnitsLimit ? BusinessUnitBasicSelectInput : totalNumberOfBusinessUnitsFetcher.total <= props.upperBusinessUnitsLimit ? BusinessUnitAsyncSelectInput : BusinessUnitSearchSelectInput;
|
|
9311
|
-
return jsx(CustomSelectInput, _objectSpread$
|
|
9312
|
+
return jsx(CustomSelectInput, _objectSpread$C(_objectSpread$C({
|
|
9312
9313
|
id: props.id,
|
|
9313
9314
|
name: props.name,
|
|
9314
9315
|
components: components,
|
|
@@ -9349,7 +9350,7 @@ BusinessUnitSelectInput.defaultProps = {
|
|
|
9349
9350
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
9350
9351
|
const businessRoleKeys = ['ExecutiveManagement', 'BusinessIntelligence', 'BuyingPlanningAndInventoryManagement', 'DataQualityAndContentManagement', 'CustomerService', 'FinanceAndAccounting', 'LegalAndPeople', 'LogisticsAndSupplyChain', 'FulfillmentAndOperationsManagement', 'OfflineRetailStore', 'Marketing', 'BusinessDevSalesAndAccountManagement', 'UXUIDesign', 'TechProductManagement', 'TechProjectAndProgramManagement', 'SoftwareDevelopmentAndSolutionsArchitect', 'OperationsITAndSupportEngineering', 'Other'];
|
|
9351
9352
|
|
|
9352
|
-
var messages$
|
|
9353
|
+
var messages$v = defineMessages({
|
|
9353
9354
|
ExecutiveManagement: {
|
|
9354
9355
|
id: 'Shared.businessRoles.executiveManagement',
|
|
9355
9356
|
description: 'The label for one of the selectable business roles',
|
|
@@ -9442,6 +9443,573 @@ var messages$r = defineMessages({
|
|
|
9442
9443
|
}
|
|
9443
9444
|
});
|
|
9444
9445
|
|
|
9446
|
+
const safelyAddFallback = function (string) {
|
|
9447
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NO_VALUE_FALLBACK;
|
|
9448
|
+
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
9449
|
+
};
|
|
9450
|
+
|
|
9451
|
+
const ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES = 'businessUnitsAssociateRoles';
|
|
9452
|
+
|
|
9453
|
+
const ASSOCIATE_ROLE_SOURCES = {
|
|
9454
|
+
EXPLICIT: 'Explicit',
|
|
9455
|
+
INHERITED: 'Inherited'
|
|
9456
|
+
};
|
|
9457
|
+
const SEARCH_FIELDS = {
|
|
9458
|
+
ALL_FIELDS: 'allFields',
|
|
9459
|
+
NAME: 'name',
|
|
9460
|
+
EMAIL: 'email'
|
|
9461
|
+
};
|
|
9462
|
+
|
|
9463
|
+
var messages$u = defineMessages({
|
|
9464
|
+
allFieldsFilterOption: {
|
|
9465
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.allFields',
|
|
9466
|
+
description: 'Label for the filter option all fields',
|
|
9467
|
+
defaultMessage: 'All fields'
|
|
9468
|
+
},
|
|
9469
|
+
allFieldsFilterPlaceholder: {
|
|
9470
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.allFields',
|
|
9471
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9472
|
+
defaultMessage: 'Search by name or email'
|
|
9473
|
+
},
|
|
9474
|
+
emailFilterOption: {
|
|
9475
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.email',
|
|
9476
|
+
description: 'Label for the filter option email',
|
|
9477
|
+
defaultMessage: 'Email'
|
|
9478
|
+
},
|
|
9479
|
+
emailFilterPlaceholder: {
|
|
9480
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.email',
|
|
9481
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9482
|
+
defaultMessage: 'Search by email'
|
|
9483
|
+
},
|
|
9484
|
+
nameFilterOption: {
|
|
9485
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.name',
|
|
9486
|
+
description: 'Label for the filter option name',
|
|
9487
|
+
defaultMessage: 'Name'
|
|
9488
|
+
},
|
|
9489
|
+
nameFilterPlaceholder: {
|
|
9490
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.name',
|
|
9491
|
+
description: 'Label for the searchbar placeholder for name option',
|
|
9492
|
+
defaultMessage: 'Search by name'
|
|
9493
|
+
}
|
|
9494
|
+
});
|
|
9495
|
+
|
|
9496
|
+
function ownKeys$B(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9497
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$B(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$B(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9498
|
+
const BusinessUnitAssociatesSearchbar = props => {
|
|
9499
|
+
const intl = useIntl();
|
|
9500
|
+
const searchOptions = useMemo(() => [{
|
|
9501
|
+
value: SEARCH_FIELDS.ALL_FIELDS,
|
|
9502
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterOption")])
|
|
9503
|
+
}, {
|
|
9504
|
+
value: SEARCH_FIELDS.NAME,
|
|
9505
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterOption")])
|
|
9506
|
+
}, {
|
|
9507
|
+
value: SEARCH_FIELDS.EMAIL,
|
|
9508
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterOption")])
|
|
9509
|
+
}], [intl]);
|
|
9510
|
+
const seachPlaceholderMessages = useMemo(() => ({
|
|
9511
|
+
[SEARCH_FIELDS.ALL_FIELDS]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterPlaceholder")]),
|
|
9512
|
+
[SEARCH_FIELDS.EMAIL]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterPlaceholder")]),
|
|
9513
|
+
[SEARCH_FIELDS.NAME]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterPlaceholder")])
|
|
9514
|
+
}), [intl]);
|
|
9515
|
+
const _useState = useState({
|
|
9516
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9517
|
+
text: ''
|
|
9518
|
+
}),
|
|
9519
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9520
|
+
searchValue = _useState2[0],
|
|
9521
|
+
setSearchValue = _useState2[1];
|
|
9522
|
+
return jsx(SelectableSearchInput, {
|
|
9523
|
+
horizontalConstraint: 15,
|
|
9524
|
+
isDisabled: props.isDisabled,
|
|
9525
|
+
onChange: event => {
|
|
9526
|
+
var _context;
|
|
9527
|
+
if (_endsWithInstanceProperty(_context = event.target.id).call(_context, 'dropdown')) {
|
|
9528
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9529
|
+
option: event.target.value
|
|
9530
|
+
}));
|
|
9531
|
+
} else {
|
|
9532
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9533
|
+
text: event.target.value
|
|
9534
|
+
}));
|
|
9535
|
+
}
|
|
9536
|
+
},
|
|
9537
|
+
onReset: () => {
|
|
9538
|
+
setSearchValue({
|
|
9539
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9540
|
+
text: ''
|
|
9541
|
+
});
|
|
9542
|
+
props.onSubmit({
|
|
9543
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9544
|
+
text: ''
|
|
9545
|
+
});
|
|
9546
|
+
},
|
|
9547
|
+
onSubmit: props.onSubmit,
|
|
9548
|
+
options: searchOptions,
|
|
9549
|
+
placeholder: seachPlaceholderMessages[searchValue.option],
|
|
9550
|
+
value: searchValue
|
|
9551
|
+
});
|
|
9552
|
+
};
|
|
9553
|
+
BusinessUnitAssociatesSearchbar.displayName = 'BusinessUnitAssociatesSearchbar';
|
|
9554
|
+
|
|
9555
|
+
var messages$t = defineMessages({
|
|
9556
|
+
addAnAssociate: {
|
|
9557
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.addAnAssociate',
|
|
9558
|
+
description: 'The label for add an associate link button',
|
|
9559
|
+
defaultMessage: 'Add an associate'
|
|
9560
|
+
},
|
|
9561
|
+
noAssociates: {
|
|
9562
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.noAssociates',
|
|
9563
|
+
description: 'The message displayed when there are no associates available',
|
|
9564
|
+
defaultMessage: 'There are no associates.'
|
|
9565
|
+
}
|
|
9566
|
+
});
|
|
9567
|
+
|
|
9568
|
+
const EmptyListMessage = props => {
|
|
9569
|
+
const intl = useIntl();
|
|
9570
|
+
return jsxs(Spacings.Inset, {
|
|
9571
|
+
scale: "xs",
|
|
9572
|
+
children: [jsxs(Spacings.Stack, {
|
|
9573
|
+
scale: "l",
|
|
9574
|
+
children: [jsx(Divider, {
|
|
9575
|
+
size: "m"
|
|
9576
|
+
}), jsx(Text.Body, {
|
|
9577
|
+
intlMessage: messages$t.noAssociates
|
|
9578
|
+
})]
|
|
9579
|
+
}), jsx(FlatButton, {
|
|
9580
|
+
isDisabled: !props.canManageBusinessUnits,
|
|
9581
|
+
label: intl.formatMessage(messages$t.addAnAssociate),
|
|
9582
|
+
onClick: props.onAddAssociateClick,
|
|
9583
|
+
tone: "primary"
|
|
9584
|
+
})]
|
|
9585
|
+
});
|
|
9586
|
+
};
|
|
9587
|
+
EmptyListMessage.displayName = 'EmptyListMessage';
|
|
9588
|
+
|
|
9589
|
+
var messages$s = defineMessages({
|
|
9590
|
+
noResultsTitle: {
|
|
9591
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsTitle',
|
|
9592
|
+
description: 'Message for no search result for customers.',
|
|
9593
|
+
defaultMessage: 'There are no results that match your search and/or filter combination.'
|
|
9594
|
+
},
|
|
9595
|
+
noResultsSuggestionsTitle: {
|
|
9596
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestionsTitle',
|
|
9597
|
+
description: 'Suggestions title',
|
|
9598
|
+
defaultMessage: 'Suggestions:'
|
|
9599
|
+
},
|
|
9600
|
+
noResultsSuggestion1: {
|
|
9601
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion1',
|
|
9602
|
+
description: 'One of suggestions when no results are found.',
|
|
9603
|
+
defaultMessage: 'Make sure to select the search field in the dropdown next to the search input.'
|
|
9604
|
+
},
|
|
9605
|
+
noResultsSuggestion2: {
|
|
9606
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion2',
|
|
9607
|
+
description: 'One of suggestions when no results are found.',
|
|
9608
|
+
defaultMessage: 'Check the spelling, search by entering the exact value.'
|
|
9609
|
+
},
|
|
9610
|
+
noResultsSuggestion3: {
|
|
9611
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion3',
|
|
9612
|
+
description: 'One of suggestions when no results are found.',
|
|
9613
|
+
defaultMessage: 'Use the filter to search for further values.'
|
|
9614
|
+
}
|
|
9615
|
+
});
|
|
9616
|
+
|
|
9617
|
+
const EmptySearchResultsMessage = () => jsx(Spacings.Inset, {
|
|
9618
|
+
scale: "xs",
|
|
9619
|
+
children: jsxs(Spacings.Stack, {
|
|
9620
|
+
scale: "s",
|
|
9621
|
+
children: [jsx(Text.Body, {
|
|
9622
|
+
tone: "secondary",
|
|
9623
|
+
intlMessage: messages$s.noResultsTitle,
|
|
9624
|
+
isBold: true
|
|
9625
|
+
}), jsx(Text.Body, {
|
|
9626
|
+
tone: "secondary",
|
|
9627
|
+
intlMessage: messages$s.noResultsSuggestionsTitle
|
|
9628
|
+
}), jsxs("ul", {
|
|
9629
|
+
children: [jsx("li", {
|
|
9630
|
+
children: jsx(Text.Body, {
|
|
9631
|
+
intlMessage: messages$s.noResultsSuggestion1,
|
|
9632
|
+
tone: "secondary"
|
|
9633
|
+
})
|
|
9634
|
+
}), jsx("li", {
|
|
9635
|
+
children: jsx(Text.Body, {
|
|
9636
|
+
intlMessage: messages$s.noResultsSuggestion2,
|
|
9637
|
+
tone: "secondary"
|
|
9638
|
+
})
|
|
9639
|
+
}), jsx("li", {
|
|
9640
|
+
children: jsx(Text.Body, {
|
|
9641
|
+
intlMessage: messages$s.noResultsSuggestion3,
|
|
9642
|
+
tone: "secondary"
|
|
9643
|
+
})
|
|
9644
|
+
})]
|
|
9645
|
+
})]
|
|
9646
|
+
})
|
|
9647
|
+
});
|
|
9648
|
+
EmptySearchResultsMessage.displayName = 'EmptySearchResultsMessage';
|
|
9649
|
+
|
|
9650
|
+
const filterByAllFields = (associates, searchValue) => {
|
|
9651
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9652
|
+
return _filterInstanceProperty(associates).call(associates, associate => {
|
|
9653
|
+
return _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9654
|
+
var _context, _context2, _context3;
|
|
9655
|
+
return _includesInstanceProperty(_context = associate.customer.firstName.toLowerCase()).call(_context, term) || _includesInstanceProperty(_context2 = associate.customer.lastName.toLowerCase()).call(_context2, term) || _includesInstanceProperty(_context3 = associate.customer.email.toLowerCase()).call(_context3, term);
|
|
9656
|
+
});
|
|
9657
|
+
});
|
|
9658
|
+
};
|
|
9659
|
+
const filterByEmail = (associates, searchValue) => {
|
|
9660
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9661
|
+
return _filterInstanceProperty(associates).call(associates, associate => _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9662
|
+
var _context4;
|
|
9663
|
+
return _includesInstanceProperty(_context4 = associate.customer.email.toLowerCase()).call(_context4, term);
|
|
9664
|
+
}));
|
|
9665
|
+
};
|
|
9666
|
+
const filterByName = (associates, searchValue) => {
|
|
9667
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9668
|
+
return _filterInstanceProperty(associates).call(associates, associate => {
|
|
9669
|
+
return _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9670
|
+
var _context5, _context6;
|
|
9671
|
+
return _includesInstanceProperty(_context5 = associate.customer.firstName.toLowerCase()).call(_context5, term) || _includesInstanceProperty(_context6 = associate.customer.lastName.toLowerCase()).call(_context6, term);
|
|
9672
|
+
});
|
|
9673
|
+
});
|
|
9674
|
+
};
|
|
9675
|
+
const FILTER_FUNCTIONS = {
|
|
9676
|
+
[SEARCH_FIELDS.ALL_FIELDS]: filterByAllFields,
|
|
9677
|
+
[SEARCH_FIELDS.EMAIL]: filterByEmail,
|
|
9678
|
+
[SEARCH_FIELDS.NAME]: filterByName
|
|
9679
|
+
};
|
|
9680
|
+
const filterAssociates = (associates, searchValue) => FILTER_FUNCTIONS[searchValue.option](associates, searchValue);
|
|
9681
|
+
|
|
9682
|
+
const mergeOverwritten = (inherited, explicit) => {
|
|
9683
|
+
var _context;
|
|
9684
|
+
const onlyExplicit = differenceBy(explicit.associateRoleAssignments, inherited.associateRoleAssignments, 'associateRole.key') || [];
|
|
9685
|
+
const onlyInherited = differenceBy(inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9686
|
+
const overwritten = intersectionBy(inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9687
|
+
const allExplicit = _mapInstanceProperty(_context = _concatInstanceProperty(onlyExplicit).call(onlyExplicit, overwritten)).call(_context, _ref => {
|
|
9688
|
+
let associateRole = _ref.associateRole;
|
|
9689
|
+
return {
|
|
9690
|
+
name: associateRole.name || associateRole.key,
|
|
9691
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9692
|
+
};
|
|
9693
|
+
});
|
|
9694
|
+
const allInherited = _mapInstanceProperty(onlyInherited).call(onlyInherited, _ref2 => {
|
|
9695
|
+
let associateRole = _ref2.associateRole;
|
|
9696
|
+
return {
|
|
9697
|
+
name: associateRole.name || associateRole.key,
|
|
9698
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9699
|
+
};
|
|
9700
|
+
});
|
|
9701
|
+
return {
|
|
9702
|
+
id: inherited.customer.id,
|
|
9703
|
+
customer: inherited.customer,
|
|
9704
|
+
roles: _concatInstanceProperty(allExplicit).call(allExplicit, allInherited)
|
|
9705
|
+
};
|
|
9706
|
+
};
|
|
9707
|
+
const mergeAssociates = businessUnit => {
|
|
9708
|
+
var _context2;
|
|
9709
|
+
const _businessUnit$associa = businessUnit.associates,
|
|
9710
|
+
associates = _businessUnit$associa === void 0 ? [] : _businessUnit$associa,
|
|
9711
|
+
_businessUnit$inherit = businessUnit.inheritedAssociates,
|
|
9712
|
+
inheritedAssociates = _businessUnit$inherit === void 0 ? [] : _businessUnit$inherit;
|
|
9713
|
+
const overwrittenOnExplicit = intersectionBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
9714
|
+
const overwrittenOnInherited = intersectionBy(inheritedAssociates, associates, 'customer.id') || [];
|
|
9715
|
+
const onlyExplicit = differenceBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
9716
|
+
const onlyInherited = differenceBy(inheritedAssociates, associates, 'customer.id') || [];
|
|
9717
|
+
const explicit = _mapInstanceProperty(onlyExplicit).call(onlyExplicit, associate => {
|
|
9718
|
+
var _associate$associateR;
|
|
9719
|
+
return {
|
|
9720
|
+
id: associate.customer.id,
|
|
9721
|
+
customer: associate.customer,
|
|
9722
|
+
roles: (_associate$associateR = associate.associateRoleAssignments) === null || _associate$associateR === void 0 ? void 0 : _mapInstanceProperty(_associate$associateR).call(_associate$associateR, _ref3 => {
|
|
9723
|
+
let associateRole = _ref3.associateRole;
|
|
9724
|
+
return {
|
|
9725
|
+
name: associateRole.name || associateRole.key,
|
|
9726
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9727
|
+
};
|
|
9728
|
+
})
|
|
9729
|
+
};
|
|
9730
|
+
});
|
|
9731
|
+
const inherited = _mapInstanceProperty(onlyInherited).call(onlyInherited, associate => {
|
|
9732
|
+
var _associate$associateR2;
|
|
9733
|
+
return {
|
|
9734
|
+
id: associate.customer.id,
|
|
9735
|
+
customer: associate.customer,
|
|
9736
|
+
roles: (_associate$associateR2 = associate.associateRoleAssignments) === null || _associate$associateR2 === void 0 ? void 0 : _mapInstanceProperty(_associate$associateR2).call(_associate$associateR2, _ref4 => {
|
|
9737
|
+
let associateRole = _ref4.associateRole;
|
|
9738
|
+
return {
|
|
9739
|
+
name: associateRole.name || associateRole.key,
|
|
9740
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9741
|
+
};
|
|
9742
|
+
})
|
|
9743
|
+
};
|
|
9744
|
+
});
|
|
9745
|
+
const overwritten = _mapInstanceProperty(overwrittenOnInherited).call(overwrittenOnInherited, inherited => {
|
|
9746
|
+
const explicit = _findInstanceProperty(overwrittenOnExplicit).call(overwrittenOnExplicit, explicitAssociate => explicitAssociate.customer.id === inherited.customer.id);
|
|
9747
|
+
return mergeOverwritten(inherited, explicit);
|
|
9748
|
+
});
|
|
9749
|
+
return _concatInstanceProperty(_context2 = _concatInstanceProperty(explicit).call(explicit, inherited)).call(_context2, overwritten);
|
|
9750
|
+
};
|
|
9751
|
+
|
|
9752
|
+
var messages$r = defineMessages({
|
|
9753
|
+
columnFirstName: {
|
|
9754
|
+
id: 'Shared.BusinessUnitAssociates.columnFirstName',
|
|
9755
|
+
description: 'The column label (First name)',
|
|
9756
|
+
defaultMessage: 'First name'
|
|
9757
|
+
},
|
|
9758
|
+
columnLastName: {
|
|
9759
|
+
id: 'Shared.BusinessUnitAssociates.columnLastName',
|
|
9760
|
+
description: 'The column label (Last name)',
|
|
9761
|
+
defaultMessage: 'Last name'
|
|
9762
|
+
},
|
|
9763
|
+
columnRole: {
|
|
9764
|
+
id: 'Shared.BusinessUnitAssociates.columnRole',
|
|
9765
|
+
description: 'The column label (Role)',
|
|
9766
|
+
defaultMessage: 'Role'
|
|
9767
|
+
},
|
|
9768
|
+
columnEmail: {
|
|
9769
|
+
id: 'Shared.BusinessUnitAssociates.columnEmail',
|
|
9770
|
+
description: 'The column label (Email)',
|
|
9771
|
+
defaultMessage: 'Email'
|
|
9772
|
+
},
|
|
9773
|
+
companyUnitType: {
|
|
9774
|
+
id: 'Shared.BusinessUnitAssociates.unitType.company',
|
|
9775
|
+
description: 'Label for the business unit type company',
|
|
9776
|
+
defaultMessage: 'Company'
|
|
9777
|
+
},
|
|
9778
|
+
divisionUnitType: {
|
|
9779
|
+
id: 'Shared.BusinessUnitAssociates.unitType.division',
|
|
9780
|
+
description: 'Label for the business unit type division',
|
|
9781
|
+
defaultMessage: 'Division'
|
|
9782
|
+
},
|
|
9783
|
+
labelExplicit: {
|
|
9784
|
+
id: 'Shared.BusinessUnitAssociates.labelExplicit',
|
|
9785
|
+
description: 'Label for explicit roles',
|
|
9786
|
+
defaultMessage: 'Explicit'
|
|
9787
|
+
},
|
|
9788
|
+
labelInherited: {
|
|
9789
|
+
id: 'Shared.BusinessUnitAssociates.labelInherited',
|
|
9790
|
+
description: 'Label for explicit roles',
|
|
9791
|
+
defaultMessage: 'Inherited'
|
|
9792
|
+
},
|
|
9793
|
+
roleEnumAdmin: {
|
|
9794
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.admin',
|
|
9795
|
+
description: 'Label for the business unit associate rol Admin',
|
|
9796
|
+
defaultMessage: 'Admin'
|
|
9797
|
+
},
|
|
9798
|
+
roleEnumBuyer: {
|
|
9799
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.buyer',
|
|
9800
|
+
description: 'Label for the business unit associate rol Buyer',
|
|
9801
|
+
defaultMessage: 'Buyer'
|
|
9802
|
+
},
|
|
9803
|
+
searchResultsCount: {
|
|
9804
|
+
id: 'Shared.BusinessUnitAssociates.searchResultsCount',
|
|
9805
|
+
description: 'Total results coming from search',
|
|
9806
|
+
defaultMessage: '{totalResults} results'
|
|
9807
|
+
}
|
|
9808
|
+
});
|
|
9809
|
+
|
|
9810
|
+
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9811
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9812
|
+
const BusinessUnitAssociatesListView = props => {
|
|
9813
|
+
var _props$values, _props$values$associa;
|
|
9814
|
+
const intl = useIntl();
|
|
9815
|
+
const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
9816
|
+
const totalAssociates = (_props$values = _valuesInstanceProperty(props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length;
|
|
9817
|
+
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
9818
|
+
const _usePaginationState = usePaginationState({
|
|
9819
|
+
perPage: 20
|
|
9820
|
+
}),
|
|
9821
|
+
page = _usePaginationState.page,
|
|
9822
|
+
perPage = _usePaginationState.perPage;
|
|
9823
|
+
const _useState = useState({
|
|
9824
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9825
|
+
text: ''
|
|
9826
|
+
}),
|
|
9827
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9828
|
+
searchValue = _useState2[0],
|
|
9829
|
+
setSearchValue = _useState2[1];
|
|
9830
|
+
const associates = useMemo(() => {
|
|
9831
|
+
var _props$values2, _context, _context2;
|
|
9832
|
+
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty(props)) : (_props$values2 = _valuesInstanceProperty(props)) === null || _props$values2 === void 0 ? void 0 : _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _props$values2.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
|
|
9833
|
+
id: associate.customer.id
|
|
9834
|
+
}));
|
|
9835
|
+
}, [_valuesInstanceProperty(props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
9836
|
+
const tableColumns = useMemo(() => [{
|
|
9837
|
+
key: 'firstName',
|
|
9838
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnFirstName)),
|
|
9839
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9840
|
+
}, {
|
|
9841
|
+
key: 'lastName',
|
|
9842
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnLastName)),
|
|
9843
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9844
|
+
}, {
|
|
9845
|
+
key: 'roles',
|
|
9846
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnRole)),
|
|
9847
|
+
shouldIgnoreRowClick: isBusinessUnitCreation,
|
|
9848
|
+
width: 'max-content'
|
|
9849
|
+
}, {
|
|
9850
|
+
key: 'email',
|
|
9851
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnEmail)),
|
|
9852
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9853
|
+
}], [isBusinessUnitCreation]);
|
|
9854
|
+
const filteredAssociates = useMemo(() => {
|
|
9855
|
+
return filterAssociates(associates, searchValue);
|
|
9856
|
+
}, [associates, searchValue]);
|
|
9857
|
+
const associatesToShow = useMemo(() => {
|
|
9858
|
+
const from = (page.value - 1) * perPage.value;
|
|
9859
|
+
const to = from + perPage.value;
|
|
9860
|
+
return _sliceInstanceProperty(filteredAssociates).call(filteredAssociates, from, to);
|
|
9861
|
+
}, [filteredAssociates, perPage.value, page.value]);
|
|
9862
|
+
const renderAssociate = (associate, _ref) => {
|
|
9863
|
+
let columnKey = _ref.key;
|
|
9864
|
+
let formattedValue;
|
|
9865
|
+
if (!(associate !== null && associate !== void 0 && associate.customer)) return null;
|
|
9866
|
+
switch (columnKey) {
|
|
9867
|
+
case 'roles':
|
|
9868
|
+
const roles = associate[columnKey];
|
|
9869
|
+
formattedValue = jsx(Fragment, {
|
|
9870
|
+
children: (roles === null || roles === void 0 ? void 0 : roles.length) > 0 ? businessUnitsAssociateRolesFeatureEnabled ? jsx(Grid, {
|
|
9871
|
+
gridGap: customProperties.spacingM,
|
|
9872
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
9873
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty(roles).call(roles, (associateRole, index) => {
|
|
9874
|
+
return jsxs(Fragment, {
|
|
9875
|
+
children: [jsx(Grid.Item, {
|
|
9876
|
+
children: jsx(Text.Detail, {
|
|
9877
|
+
children: associateRole.name
|
|
9878
|
+
}, associateRole.name)
|
|
9879
|
+
}, "role-grid-item-".concat(index)), jsx(Grid.Item, {
|
|
9880
|
+
children: jsx(Stamp, {
|
|
9881
|
+
isCondensed: true,
|
|
9882
|
+
label: intl.formatMessage(messages$r["label".concat(associateRole.source)]),
|
|
9883
|
+
tone: associateRole.source === ASSOCIATE_ROLE_SOURCES.EXPLICIT ? 'information' : 'secondary'
|
|
9884
|
+
})
|
|
9885
|
+
}, "".concat(associateRole.name, "-source"))]
|
|
9886
|
+
});
|
|
9887
|
+
})
|
|
9888
|
+
}) : jsx(Spacings.Inline, {
|
|
9889
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty(roles).call(roles, role => jsx(Stamp, {
|
|
9890
|
+
isCondensed: true,
|
|
9891
|
+
label: intl.formatMessage(messages$r["roleEnum".concat(role)]),
|
|
9892
|
+
tone: "primary"
|
|
9893
|
+
}, role))
|
|
9894
|
+
}) : NO_VALUE_FALLBACK
|
|
9895
|
+
});
|
|
9896
|
+
break;
|
|
9897
|
+
default:
|
|
9898
|
+
formattedValue = associate.customer[columnKey] || NO_VALUE_FALLBACK;
|
|
9899
|
+
}
|
|
9900
|
+
return safelyAddFallback(formattedValue);
|
|
9901
|
+
};
|
|
9902
|
+
return jsx(PageContentFull, {
|
|
9903
|
+
children: jsx(Spacings.Stack, {
|
|
9904
|
+
scale: "m",
|
|
9905
|
+
children: totalAssociates ? jsxs(Spacings.Stack, {
|
|
9906
|
+
scale: "s",
|
|
9907
|
+
children: [jsxs(Spacings.Inline, {
|
|
9908
|
+
alignItems: "center",
|
|
9909
|
+
scale: "l",
|
|
9910
|
+
children: [jsx(BusinessUnitAssociatesSearchbar, {
|
|
9911
|
+
onSubmit: setSearchValue
|
|
9912
|
+
}), searchValue.text.length > 0 && jsx(Text.Body, {
|
|
9913
|
+
intlMessage: _objectSpread$A(_objectSpread$A({}, messages$r.searchResultsCount), {}, {
|
|
9914
|
+
values: {
|
|
9915
|
+
totalResults: filteredAssociates.length
|
|
9916
|
+
}
|
|
9917
|
+
})
|
|
9918
|
+
})]
|
|
9919
|
+
}), filteredAssociates.length ? jsxs(Spacings.Stack, {
|
|
9920
|
+
scale: "xxxl",
|
|
9921
|
+
children: [jsx(Constraints.Horizontal, {
|
|
9922
|
+
max: "scale",
|
|
9923
|
+
children: jsx(DataTable, {
|
|
9924
|
+
columns: tableColumns,
|
|
9925
|
+
itemRenderer: renderAssociate,
|
|
9926
|
+
maxHeight: "calc(100vh - (".concat(customProperties.constraint7, " + 240px))"),
|
|
9927
|
+
onRowClick: (_, rowIndex) => {
|
|
9928
|
+
var _associate$customer;
|
|
9929
|
+
const associate = associates[rowIndex];
|
|
9930
|
+
if (isBusinessUnitCreation || !(associate !== null && associate !== void 0 && associate.id) || !(associate !== null && associate !== void 0 && (_associate$customer = associate.customer) !== null && _associate$customer !== void 0 && _associate$customer.id)) return;
|
|
9931
|
+
props.onAssociateRowClick({
|
|
9932
|
+
customerId: associate.customer.id
|
|
9933
|
+
});
|
|
9934
|
+
},
|
|
9935
|
+
rows: associatesToShow,
|
|
9936
|
+
wrapHeaderLabels: false
|
|
9937
|
+
})
|
|
9938
|
+
}), jsx(Pagination, {
|
|
9939
|
+
onPageChange: page.onChange,
|
|
9940
|
+
onPerPageChange: perPage.onChange,
|
|
9941
|
+
page: page.value,
|
|
9942
|
+
perPage: perPage.value,
|
|
9943
|
+
perPageRange: "m",
|
|
9944
|
+
totalItems: filteredAssociates.length
|
|
9945
|
+
})]
|
|
9946
|
+
}) : jsx(EmptySearchResultsMessage, {})]
|
|
9947
|
+
}) : jsx(EmptyListMessage, {
|
|
9948
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
9949
|
+
onAddAssociateClick: props.onAddAssociateClick
|
|
9950
|
+
})
|
|
9951
|
+
})
|
|
9952
|
+
});
|
|
9953
|
+
};
|
|
9954
|
+
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
9955
|
+
|
|
9956
|
+
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 577, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9957
|
+
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
9958
|
+
let id = _ref.id,
|
|
9959
|
+
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
9960
|
+
shouldExcludeAssociateRoleAssignmentsRoles = _ref.shouldExcludeAssociateRoleAssignmentsRoles;
|
|
9961
|
+
const _useQuery = useQuery$1(BusinessUnitAssociatesQuery, {
|
|
9962
|
+
context: {
|
|
9963
|
+
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
9964
|
+
},
|
|
9965
|
+
variables: {
|
|
9966
|
+
id,
|
|
9967
|
+
shouldExcludeRoles,
|
|
9968
|
+
shouldExcludeAssociateRoleAssignmentsRoles
|
|
9969
|
+
}
|
|
9970
|
+
}),
|
|
9971
|
+
loading = _useQuery.loading,
|
|
9972
|
+
data = _useQuery.data;
|
|
9973
|
+
return {
|
|
9974
|
+
isLoading: loading,
|
|
9975
|
+
businessUnit: data === null || data === void 0 ? void 0 : data.businessUnit
|
|
9976
|
+
};
|
|
9977
|
+
};
|
|
9978
|
+
|
|
9979
|
+
const useBusinessUnitAssociates = _ref => {
|
|
9980
|
+
let businessUnitId = _ref.businessUnitId,
|
|
9981
|
+
businessUnitsAssociateRolesFeatureEnabled = _ref.businessUnitsAssociateRolesFeatureEnabled;
|
|
9982
|
+
const businessUnitAssociatesFetcher = useBusinessUnitAssociatesFetcher({
|
|
9983
|
+
id: businessUnitId,
|
|
9984
|
+
shouldExcludeRoles: businessUnitsAssociateRolesFeatureEnabled,
|
|
9985
|
+
shouldExcludeAssociateRoleAssignmentsRoles: !businessUnitsAssociateRolesFeatureEnabled
|
|
9986
|
+
});
|
|
9987
|
+
return {
|
|
9988
|
+
businessUnitAssociatesFetcher: {
|
|
9989
|
+
isLoading: businessUnitAssociatesFetcher.isLoading,
|
|
9990
|
+
businessUnit: businessUnitAssociatesFetcher.businessUnit
|
|
9991
|
+
}
|
|
9992
|
+
};
|
|
9993
|
+
};
|
|
9994
|
+
|
|
9995
|
+
const BusinessUnitAssociatesList = props => {
|
|
9996
|
+
const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
9997
|
+
const _useBusinessUnitAssoc = useBusinessUnitAssociates({
|
|
9998
|
+
businessUnitId: props.businessUnitId,
|
|
9999
|
+
businessUnitsAssociateRolesFeatureEnabled
|
|
10000
|
+
}),
|
|
10001
|
+
businessUnitAssociatesFetcher = _useBusinessUnitAssoc.businessUnitAssociatesFetcher;
|
|
10002
|
+
if (businessUnitAssociatesFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
10003
|
+
return jsx(BusinessUnitAssociatesListView, {
|
|
10004
|
+
businessUnitId: props.businessUnitId,
|
|
10005
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
10006
|
+
onAddAssociateClick: props.onAddAssociateClick,
|
|
10007
|
+
onAssociateRowClick: props.onAssociateRowClick,
|
|
10008
|
+
values: businessUnitAssociatesFetcher === null || businessUnitAssociatesFetcher === void 0 ? void 0 : businessUnitAssociatesFetcher.businessUnit
|
|
10009
|
+
});
|
|
10010
|
+
};
|
|
10011
|
+
BusinessUnitAssociatesList.displayName = 'BusinessUnitAssociatesList';
|
|
10012
|
+
|
|
9445
10013
|
function formatDiscount(discount, currencyCode, intl) {
|
|
9446
10014
|
var _context;
|
|
9447
10015
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
@@ -9579,17 +10147,17 @@ function validateFilter(_ref, intl) {
|
|
|
9579
10147
|
_ref$allowFloat = _ref.allowFloat,
|
|
9580
10148
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9581
10149
|
if (type !== 'range') {
|
|
9582
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
10150
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$O.integer);
|
|
9583
10151
|
return null;
|
|
9584
10152
|
}
|
|
9585
10153
|
|
|
9586
10154
|
// only range types from here
|
|
9587
10155
|
|
|
9588
10156
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9589
|
-
from: intl.formatMessage(messages$
|
|
10157
|
+
from: intl.formatMessage(messages$O.integer)
|
|
9590
10158
|
};
|
|
9591
10159
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9592
|
-
to: intl.formatMessage(messages$
|
|
10160
|
+
to: intl.formatMessage(messages$O.integer)
|
|
9593
10161
|
};
|
|
9594
10162
|
if (validateSingleFilter({
|
|
9595
10163
|
value: value.from
|
|
@@ -10077,9 +10645,16 @@ function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
10077
10645
|
const PlatformLimitsStatusText = _ref => {
|
|
10078
10646
|
let intlMessage = _ref.intlMessage,
|
|
10079
10647
|
children = _ref.children;
|
|
10080
|
-
return
|
|
10081
|
-
as: "
|
|
10082
|
-
children:
|
|
10648
|
+
return jsx(Text.Headline, {
|
|
10649
|
+
as: "h2",
|
|
10650
|
+
children: jsxs(Spacings.Inline, {
|
|
10651
|
+
size: "xs",
|
|
10652
|
+
children: [jsx("span", {
|
|
10653
|
+
children: intlMessage && jsx(FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
10654
|
+
}), jsx("span", {
|
|
10655
|
+
children: children
|
|
10656
|
+
})]
|
|
10657
|
+
})
|
|
10083
10658
|
});
|
|
10084
10659
|
};
|
|
10085
10660
|
PlatformLimitsStatusText.displayName = 'PlatformLimitsStatusText';
|
|
@@ -10203,7 +10778,7 @@ var messages$k = defineMessages({
|
|
|
10203
10778
|
});
|
|
10204
10779
|
|
|
10205
10780
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
10206
|
-
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4
|
|
10781
|
+
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4;
|
|
10207
10782
|
let total = _ref.total;
|
|
10208
10783
|
const intl = useIntl();
|
|
10209
10784
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
@@ -10211,12 +10786,13 @@ const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
|
10211
10786
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 ? void 0 : (_platformLimits$shipp2 = _platformLimits$shipp.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.current;
|
|
10212
10787
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp3 = platformLimits.shippingMethods) === null || _platformLimits$shipp3 === void 0 ? void 0 : (_platformLimits$shipp4 = _platformLimits$shipp3.total) === null || _platformLimits$shipp4 === void 0 ? void 0 : _platformLimits$shipp4.limit;
|
|
10213
10788
|
return jsx(PlatformLimitsStatusText, {
|
|
10214
|
-
|
|
10789
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
10790
|
+
children: getPlatformLimitsStatus({
|
|
10215
10791
|
limit,
|
|
10216
10792
|
current,
|
|
10217
10793
|
total,
|
|
10218
10794
|
intl
|
|
10219
|
-
})
|
|
10795
|
+
})
|
|
10220
10796
|
});
|
|
10221
10797
|
};
|
|
10222
10798
|
PlatformLimitsShippingMethodsStatus.displayName = 'PlatformLimitsShippingMethodsStatus';
|
|
@@ -10349,7 +10925,7 @@ var messages$i = defineMessages({
|
|
|
10349
10925
|
});
|
|
10350
10926
|
|
|
10351
10927
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
10352
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4
|
|
10928
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4;
|
|
10353
10929
|
let total = _ref.total;
|
|
10354
10930
|
const intl = useIntl();
|
|
10355
10931
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
@@ -10357,12 +10933,13 @@ const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
|
10357
10933
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 ? void 0 : (_platformLimits$taxCa2 = _platformLimits$taxCa.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.current;
|
|
10358
10934
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa3 = platformLimits.taxCategories) === null || _platformLimits$taxCa3 === void 0 ? void 0 : (_platformLimits$taxCa4 = _platformLimits$taxCa3.total) === null || _platformLimits$taxCa4 === void 0 ? void 0 : _platformLimits$taxCa4.limit;
|
|
10359
10935
|
return jsx(PlatformLimitsStatusText, {
|
|
10360
|
-
|
|
10936
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
10937
|
+
children: getPlatformLimitsStatus({
|
|
10361
10938
|
limit,
|
|
10362
10939
|
current,
|
|
10363
10940
|
total,
|
|
10364
10941
|
intl
|
|
10365
|
-
})
|
|
10942
|
+
})
|
|
10366
10943
|
});
|
|
10367
10944
|
};
|
|
10368
10945
|
PlatformLimitsTaxCategoriesStatus.displayName = 'PlatformLimitsTaxCategoriesStatus';
|
|
@@ -10490,12 +11067,12 @@ var messages$g = defineMessages({
|
|
|
10490
11067
|
zonesStatus: {
|
|
10491
11068
|
id: 'PlatformLimits.Status.zones',
|
|
10492
11069
|
description: 'The message for zones platform limit values',
|
|
10493
|
-
defaultMessage: 'Zones
|
|
11070
|
+
defaultMessage: 'Zones'
|
|
10494
11071
|
}
|
|
10495
11072
|
});
|
|
10496
11073
|
|
|
10497
11074
|
const PlatformLimitsZonesStatus = _ref => {
|
|
10498
|
-
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4
|
|
11075
|
+
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4;
|
|
10499
11076
|
let total = _ref.total;
|
|
10500
11077
|
const intl = useIntl();
|
|
10501
11078
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
@@ -10503,12 +11080,13 @@ const PlatformLimitsZonesStatus = _ref => {
|
|
|
10503
11080
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 ? void 0 : (_platformLimits$zones2 = _platformLimits$zones.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.current;
|
|
10504
11081
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones3 = platformLimits.zones) === null || _platformLimits$zones3 === void 0 ? void 0 : (_platformLimits$zones4 = _platformLimits$zones3.total) === null || _platformLimits$zones4 === void 0 ? void 0 : _platformLimits$zones4.limit;
|
|
10505
11082
|
return jsx(PlatformLimitsStatusText, {
|
|
10506
|
-
|
|
11083
|
+
intlMessage: messages$g.zonesStatus,
|
|
11084
|
+
children: getPlatformLimitsStatus({
|
|
10507
11085
|
limit,
|
|
10508
11086
|
current,
|
|
10509
11087
|
total,
|
|
10510
11088
|
intl
|
|
10511
|
-
})
|
|
11089
|
+
})
|
|
10512
11090
|
});
|
|
10513
11091
|
};
|
|
10514
11092
|
PlatformLimitsZonesStatus.displayName = 'PlatformLimitsZonesStatus';
|
|
@@ -12111,7 +12689,7 @@ const validateRequired = value => {
|
|
|
12111
12689
|
};
|
|
12112
12690
|
const VALIDATOR_REQUIRED = {
|
|
12113
12691
|
name: 'required',
|
|
12114
|
-
message: messages$
|
|
12692
|
+
message: messages$O.required,
|
|
12115
12693
|
permanent: true,
|
|
12116
12694
|
validators: {
|
|
12117
12695
|
change(value) {
|
|
@@ -12125,7 +12703,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
12125
12703
|
};
|
|
12126
12704
|
const VALIDATOR_NUMERIC = {
|
|
12127
12705
|
name: 'numeric',
|
|
12128
|
-
message: messages$
|
|
12706
|
+
message: messages$O.numeric,
|
|
12129
12707
|
permanent: false,
|
|
12130
12708
|
validators: {
|
|
12131
12709
|
change: v => {
|
|
@@ -12140,7 +12718,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
12140
12718
|
};
|
|
12141
12719
|
const VALIDATOR_INTEGER = {
|
|
12142
12720
|
name: 'integer',
|
|
12143
|
-
message: messages$
|
|
12721
|
+
message: messages$O.integer,
|
|
12144
12722
|
permanent: false,
|
|
12145
12723
|
validators: {
|
|
12146
12724
|
change: v => {
|
|
@@ -12155,7 +12733,7 @@ const VALIDATOR_INTEGER = {
|
|
|
12155
12733
|
};
|
|
12156
12734
|
({
|
|
12157
12735
|
name: 'email',
|
|
12158
|
-
message: messages$
|
|
12736
|
+
message: messages$O.email,
|
|
12159
12737
|
permanent: false,
|
|
12160
12738
|
validators: {
|
|
12161
12739
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -13091,17 +13669,17 @@ function isValidISODateTime(_ref3) {
|
|
|
13091
13669
|
}
|
|
13092
13670
|
|
|
13093
13671
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
13094
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
13672
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$O.required);
|
|
13095
13673
|
return null;
|
|
13096
13674
|
};
|
|
13097
13675
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
13098
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
13676
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$O.required);
|
|
13099
13677
|
return null;
|
|
13100
13678
|
};
|
|
13101
13679
|
|
|
13102
13680
|
// eslint-disable-next-line import/prefer-default-export
|
|
13103
13681
|
const validateText = (text, intl) => {
|
|
13104
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
13682
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$O.required);
|
|
13105
13683
|
return null;
|
|
13106
13684
|
};
|
|
13107
13685
|
|
|
@@ -13183,11 +13761,6 @@ const not = function () {
|
|
|
13183
13761
|
};
|
|
13184
13762
|
};
|
|
13185
13763
|
|
|
13186
|
-
const safelyAddFallback = function (string) {
|
|
13187
|
-
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NO_VALUE_FALLBACK;
|
|
13188
|
-
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
13189
|
-
};
|
|
13190
|
-
|
|
13191
13764
|
var messages = defineMessages({
|
|
13192
13765
|
booleanAttributeTrue: {
|
|
13193
13766
|
id: 'Products.ProductList.column.booleanTrue',
|
|
@@ -13577,4 +14150,4 @@ function withPendingRequests() {
|
|
|
13577
14150
|
|
|
13578
14151
|
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 } } } };
|
|
13579
14152
|
|
|
13580
|
-
export { booleanField as BooleanField, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$
|
|
14153
|
+
export { booleanField as BooleanField, BusinessUnitAssociatesList, BusinessUnitAssociatesListView, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$v as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$4 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$5 as productSelectionsFetcherMockHandler, handlers$6 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$J as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$7 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, trackMenuClick, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, handlers$2 as useBusinessUnitsListFetcherMockHandler, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, handlers$1 as useTotalNumberOfBusinessUnitsFetcherHandlers, useTotalNumberOfStoresFetcher, handlers$3 as useTotalNumberOfStoresFetcherHandlers, useTracking, useTracking as useTrackingContext, useTrackingShared, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$O as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|