@commercetools-frontend/experimental-components 6.2.0 → 6.2.2
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 +105 -217
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +104 -216
- package/dist/commercetools-frontend-experimental-components.esm.js +109 -214
- package/dist/styles.css +14 -9
- package/package.json +27 -20
- package/test-utils/dist/commercetools-frontend-experimental-components-test-utils.cjs.dev.js +219 -0
- package/test-utils/dist/commercetools-frontend-experimental-components-test-utils.cjs.js +7 -0
- package/test-utils/dist/commercetools-frontend-experimental-components-test-utils.cjs.prod.js +219 -0
- package/test-utils/dist/commercetools-frontend-experimental-components-test-utils.esm.js +193 -0
- package/test-utils/package.json +4 -0
|
@@ -46,10 +46,7 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
46
46
|
var l10n = require('@commercetools-frontend/l10n');
|
|
47
47
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
48
48
|
var hooks = require('@apollo/client/react/hooks');
|
|
49
|
-
var msw = require('msw');
|
|
50
49
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
51
|
-
var _lastIndexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/last-index-of');
|
|
52
|
-
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
53
50
|
var camelCase = require('lodash/camelCase');
|
|
54
51
|
var get = require('lodash/get');
|
|
55
52
|
var formik = require('formik');
|
|
@@ -60,6 +57,7 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
60
57
|
var pick = require('lodash/pick');
|
|
61
58
|
var oneLine = require('common-tags/lib/oneLine');
|
|
62
59
|
var moment = require('moment');
|
|
60
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
63
61
|
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
64
62
|
var moment$1 = require('moment-timezone');
|
|
65
63
|
var isNil$1 = require('lodash/isNil');
|
|
@@ -82,6 +80,7 @@ var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
|
82
80
|
var keyBy = require('lodash/keyBy');
|
|
83
81
|
var _ = require('@commercetools-frontend/ui-kit/');
|
|
84
82
|
var omitBy = require('lodash/omitBy');
|
|
83
|
+
var _lastIndexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/last-index-of');
|
|
85
84
|
var merge = require('lodash/merge');
|
|
86
85
|
var set = require('lodash/set');
|
|
87
86
|
var times = require('lodash/times');
|
|
@@ -141,8 +140,6 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
141
140
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
142
141
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
143
142
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
144
|
-
var _lastIndexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_lastIndexOfInstanceProperty);
|
|
145
|
-
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
146
143
|
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
147
144
|
var get__default = /*#__PURE__*/_interopDefault(get);
|
|
148
145
|
var _Date$now__default = /*#__PURE__*/_interopDefault(_Date$now);
|
|
@@ -151,6 +148,7 @@ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceP
|
|
|
151
148
|
var pick__default = /*#__PURE__*/_interopDefault(pick);
|
|
152
149
|
var oneLine__default = /*#__PURE__*/_interopDefault(oneLine);
|
|
153
150
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
151
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
154
152
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
155
153
|
var moment__default$1 = /*#__PURE__*/_interopDefault(moment$1);
|
|
156
154
|
var isNil__default = /*#__PURE__*/_interopDefault(isNil$1);
|
|
@@ -171,6 +169,7 @@ var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanc
|
|
|
171
169
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
172
170
|
var keyBy__default = /*#__PURE__*/_interopDefault(keyBy);
|
|
173
171
|
var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
172
|
+
var _lastIndexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_lastIndexOfInstanceProperty);
|
|
174
173
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
175
174
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
176
175
|
var times__default = /*#__PURE__*/_interopDefault(times);
|
|
@@ -196,7 +195,7 @@ var compact__default = /*#__PURE__*/_interopDefault(compact);
|
|
|
196
195
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
197
196
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
198
197
|
|
|
199
|
-
var styles$
|
|
198
|
+
var styles$k = {
|
|
200
199
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
201
200
|
};
|
|
202
201
|
/**
|
|
@@ -204,7 +203,7 @@ var styles$j = {
|
|
|
204
203
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
205
204
|
*/
|
|
206
205
|
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
207
|
-
className: styles$
|
|
206
|
+
className: styles$k['loading-container'],
|
|
208
207
|
"data-testid": "centered-loading-spinner",
|
|
209
208
|
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
210
209
|
});
|
|
@@ -246,6 +245,7 @@ const INTERVALS_IN_SECONDS = {
|
|
|
246
245
|
[REMINDER_OPTION_10_DAY]: 864000
|
|
247
246
|
};
|
|
248
247
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
248
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
|
|
249
249
|
|
|
250
250
|
// TODO: apply a more robust solution to overlaying issues
|
|
251
251
|
const Z_INDEX_DROPDOWN = 30000;
|
|
@@ -1070,7 +1070,7 @@ function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
|
|
|
1070
1070
|
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1071
1071
|
function _callSuper$7(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1072
1072
|
function _isNativeReflectConstruct$7() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$7 = function () { return !!t; })(); }
|
|
1073
|
-
var styles$
|
|
1073
|
+
var styles$j = {
|
|
1074
1074
|
"size": "throttled-field-module__size___324jx",
|
|
1075
1075
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
1076
1076
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -1179,9 +1179,9 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1179
1179
|
})
|
|
1180
1180
|
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1l(_objectSpread$1l({}, commonProps), {}, {
|
|
1181
1181
|
id: inputId,
|
|
1182
|
-
className: classnames__default["default"](styles$
|
|
1183
|
-
[styles$
|
|
1184
|
-
[styles$
|
|
1182
|
+
className: classnames__default["default"](styles$j.textarea, styles$j[`textarea-${this.props.style}`], {
|
|
1183
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1184
|
+
[styles$j.disabled]: this.props.disabled
|
|
1185
1185
|
}),
|
|
1186
1186
|
rows: 1,
|
|
1187
1187
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
@@ -1190,10 +1190,10 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1190
1190
|
id: inputId,
|
|
1191
1191
|
ref: this.props.inputRef,
|
|
1192
1192
|
type: this.props.as,
|
|
1193
|
-
className: classnames__default["default"](styles$
|
|
1194
|
-
[styles$
|
|
1195
|
-
[styles$
|
|
1196
|
-
[styles$
|
|
1193
|
+
className: classnames__default["default"](styles$j[`input-${this.props.style}`], {
|
|
1194
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1195
|
+
[styles$j.disabled]: this.props.disabled,
|
|
1196
|
+
[styles$j.granular]: this.props.isGranular
|
|
1197
1197
|
})
|
|
1198
1198
|
}))]
|
|
1199
1199
|
});
|
|
@@ -1238,7 +1238,7 @@ var messages$G = reactIntl.defineMessages({
|
|
|
1238
1238
|
|
|
1239
1239
|
function _callSuper$6(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1240
1240
|
function _isNativeReflectConstruct$6() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$6 = function () { return !!t; })(); }
|
|
1241
|
-
var styles$
|
|
1241
|
+
var styles$i = {
|
|
1242
1242
|
"block": "search-input-module__block___1uM-y",
|
|
1243
1243
|
"container": "search-input-module__container___9u6if",
|
|
1244
1244
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -1313,14 +1313,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1313
1313
|
key: "render",
|
|
1314
1314
|
value: function render() {
|
|
1315
1315
|
return jsxRuntime.jsx("div", {
|
|
1316
|
-
className: classnames__default["default"](this.props.blockClassName, styles$
|
|
1316
|
+
className: classnames__default["default"](this.props.blockClassName, styles$i.block),
|
|
1317
1317
|
children: jsxRuntime.jsxs("div", {
|
|
1318
|
-
className: classnames__default["default"](this.props.containerClassName, styles$
|
|
1318
|
+
className: classnames__default["default"](this.props.containerClassName, styles$i.container),
|
|
1319
1319
|
children: [jsxRuntime.jsx("div", {
|
|
1320
|
-
className: classnames__default["default"](styles$
|
|
1321
|
-
[styles$
|
|
1322
|
-
[styles$
|
|
1323
|
-
[styles$
|
|
1320
|
+
className: classnames__default["default"](styles$i['input-container'], {
|
|
1321
|
+
[styles$i['input-container-hoverable']]: !this.props.disabled,
|
|
1322
|
+
[styles$i['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
1323
|
+
[styles$i['input-container-granular']]: this.props.isGranular
|
|
1324
1324
|
}),
|
|
1325
1325
|
children: jsxRuntime.jsx(ThrottledField, {
|
|
1326
1326
|
style: "primary",
|
|
@@ -1338,8 +1338,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1338
1338
|
isGranular: this.props.isGranular
|
|
1339
1339
|
})
|
|
1340
1340
|
}), this.state.text && jsxRuntime.jsx(uiKit.SecondaryIconButton, {
|
|
1341
|
-
className: classnames__default["default"](styles$
|
|
1342
|
-
[styles$
|
|
1341
|
+
className: classnames__default["default"](styles$i['clear-icon-container'], {
|
|
1342
|
+
[styles$i['clear-icon-container-granular']]: this.props.isGranular
|
|
1343
1343
|
}),
|
|
1344
1344
|
icon: jsxRuntime.jsx(uiKit.CloseIcon, {}),
|
|
1345
1345
|
size: "30",
|
|
@@ -1347,9 +1347,9 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1347
1347
|
onClick: this.handleClear
|
|
1348
1348
|
}), jsxRuntime.jsx("div", {
|
|
1349
1349
|
"data-testid": "search-button",
|
|
1350
|
-
className: classnames__default["default"](styles$
|
|
1351
|
-
[styles$
|
|
1352
|
-
[styles$
|
|
1350
|
+
className: classnames__default["default"](styles$i['search-icon-container'], {
|
|
1351
|
+
[styles$i['search-icon-container-hoverable']]: !this.props.disabled,
|
|
1352
|
+
[styles$i['search-icon-container-granular']]: this.props.isGranular
|
|
1353
1353
|
}),
|
|
1354
1354
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
1355
1355
|
label: "search-button",
|
|
@@ -1769,42 +1769,6 @@ const useIsFieldDuplicated = () => {
|
|
|
1769
1769
|
};
|
|
1770
1770
|
};
|
|
1771
1771
|
|
|
1772
|
-
const graphqlQueries = {
|
|
1773
|
-
ASSOCIATE_ROLE: 'associateRoles',
|
|
1774
|
-
ATTRIBUTE_GROUP: 'attributeGroups',
|
|
1775
|
-
BUSINESS_UNIT: 'businessUnits',
|
|
1776
|
-
CART: 'carts',
|
|
1777
|
-
CART_DISCOUNT: 'cartDiscounts',
|
|
1778
|
-
CATEGORY: 'categories',
|
|
1779
|
-
CHANNEL: 'channels',
|
|
1780
|
-
CUSTOMER: 'customers',
|
|
1781
|
-
CUSTOMER_GROUP: 'customerGroups',
|
|
1782
|
-
DISCOUNT_CODE: 'discountCodes',
|
|
1783
|
-
INVENTORY_ENTRY: 'inventoryEntries',
|
|
1784
|
-
ORDER: 'orders',
|
|
1785
|
-
PAYMENT: 'payments',
|
|
1786
|
-
PRODUCT: 'products',
|
|
1787
|
-
PRODUCT_DISCOUNT: 'productDiscounts',
|
|
1788
|
-
PRODUCT_SELECTION: 'productSelections',
|
|
1789
|
-
PRODUCT_TYPE: 'productTypes',
|
|
1790
|
-
SHIPPING_METHOD: 'shippingMethods',
|
|
1791
|
-
STORE: 'stores',
|
|
1792
|
-
TAX_CATEGORY: 'taxCategories',
|
|
1793
|
-
ZONE: 'zones'
|
|
1794
|
-
};
|
|
1795
|
-
const handlers$6 = {
|
|
1796
|
-
DuplicatedField: {
|
|
1797
|
-
total: (total, resourceType) => msw.graphql.query('FetchResourceTypeDuplicatedField', (req, res, ctx) => {
|
|
1798
|
-
if (!graphqlQueries[resourceType]) return res(ctx.data({}));
|
|
1799
|
-
return res(ctx.data({
|
|
1800
|
-
[graphqlQueries[resourceType]]: {
|
|
1801
|
-
total
|
|
1802
|
-
}
|
|
1803
|
-
}));
|
|
1804
|
-
})
|
|
1805
|
-
}
|
|
1806
|
-
};
|
|
1807
|
-
|
|
1808
1772
|
const usePrevious = value => {
|
|
1809
1773
|
const ref = React.useRef();
|
|
1810
1774
|
React.useEffect(() => {
|
|
@@ -1880,59 +1844,6 @@ const useStoresListFetcher = props => {
|
|
|
1880
1844
|
};
|
|
1881
1845
|
};
|
|
1882
1846
|
|
|
1883
|
-
const extractKeysFromWherePredicateClause = function () {
|
|
1884
|
-
let whereClause = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1885
|
-
return whereClause.substring(_lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '("') + 1, _lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '")')).replace(/["]/g, '').split(', ');
|
|
1886
|
-
};
|
|
1887
|
-
const handlers$5 = {
|
|
1888
|
-
StoresList: {
|
|
1889
|
-
all: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1890
|
-
// GIVEN req.variables.where is specified
|
|
1891
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1892
|
-
// ELSE return all the stores (without filtering any)
|
|
1893
|
-
if (req.variables.where) {
|
|
1894
|
-
var _context;
|
|
1895
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1896
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context = stores.results).call(_context, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1897
|
-
return res(ctx.data({
|
|
1898
|
-
stores: {
|
|
1899
|
-
offset: 0,
|
|
1900
|
-
total: filteredStoreResults.length,
|
|
1901
|
-
count: filteredStoreResults.length,
|
|
1902
|
-
results: filteredStoreResults,
|
|
1903
|
-
__typename: 'StoresQueryResult'
|
|
1904
|
-
}
|
|
1905
|
-
}));
|
|
1906
|
-
}
|
|
1907
|
-
return res(ctx.data({
|
|
1908
|
-
stores
|
|
1909
|
-
}));
|
|
1910
|
-
}),
|
|
1911
|
-
withProductSelections: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1912
|
-
// GIVEN req.variables.where is specified
|
|
1913
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1914
|
-
// ELSE return all the stores (without filtering any)
|
|
1915
|
-
if (req.variables.where) {
|
|
1916
|
-
var _context2;
|
|
1917
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1918
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context2 = stores.results).call(_context2, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1919
|
-
return res(ctx.data({
|
|
1920
|
-
stores: {
|
|
1921
|
-
offset: 0,
|
|
1922
|
-
total: filteredStoreResults.length,
|
|
1923
|
-
count: filteredStoreResults.length,
|
|
1924
|
-
results: filteredStoreResults,
|
|
1925
|
-
__typename: 'StoresQueryResult'
|
|
1926
|
-
}
|
|
1927
|
-
}));
|
|
1928
|
-
}
|
|
1929
|
-
return res(ctx.data({
|
|
1930
|
-
stores
|
|
1931
|
-
}));
|
|
1932
|
-
})
|
|
1933
|
-
}
|
|
1934
|
-
};
|
|
1935
|
-
|
|
1936
1847
|
const toPermission = (permission, resourceName) => camelCase__default["default"](`can ${permission} ${resourceName}`);
|
|
1937
1848
|
const createPermissionsComposePath = permission =>
|
|
1938
1849
|
// e.g applicationContext.permissions?.canViewOrders
|
|
@@ -2386,17 +2297,6 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2386
2297
|
};
|
|
2387
2298
|
};
|
|
2388
2299
|
|
|
2389
|
-
const handlers$4 = {
|
|
2390
|
-
ProductSelections: {
|
|
2391
|
-
total: total => msw.graphql.query('FetchProductSelectionsTotal', (req, res, ctx) => res(ctx.data({
|
|
2392
|
-
productSelections: {
|
|
2393
|
-
total,
|
|
2394
|
-
__typename: 'ProductSelectionQueryResult'
|
|
2395
|
-
}
|
|
2396
|
-
})))
|
|
2397
|
-
}
|
|
2398
|
-
};
|
|
2399
|
-
|
|
2400
2300
|
function ownKeys$17(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2401
2301
|
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$17(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2402
2302
|
|
|
@@ -2445,14 +2345,6 @@ const useProductSelectionsFetcher = props => {
|
|
|
2445
2345
|
};
|
|
2446
2346
|
};
|
|
2447
2347
|
|
|
2448
|
-
const handlers$3 = {
|
|
2449
|
-
ProductSelections: {
|
|
2450
|
-
all: productSelections => msw.graphql.query('FetchProductSelections', (req, res, ctx) => res(ctx.data({
|
|
2451
|
-
productSelections
|
|
2452
|
-
})))
|
|
2453
|
-
}
|
|
2454
|
-
};
|
|
2455
|
-
|
|
2456
2348
|
const setToArray = function () {
|
|
2457
2349
|
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
2458
2350
|
return `id in (${_mapInstanceProperty__default["default"](values).call(values, value => `"${value}"`).join(', ')})`;
|
|
@@ -2596,10 +2488,10 @@ function defaultFilterValidator$1(_ref2) {
|
|
|
2596
2488
|
return true;
|
|
2597
2489
|
}
|
|
2598
2490
|
|
|
2599
|
-
var localizedTextTransformer =
|
|
2491
|
+
var localizedTextTransformer = localizedString => {
|
|
2600
2492
|
var _context;
|
|
2601
2493
|
return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
|
|
2602
|
-
}
|
|
2494
|
+
};
|
|
2603
2495
|
|
|
2604
2496
|
const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${uiKit.MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
|
|
2605
2497
|
function moneyTransformer(value, option, locale) {
|
|
@@ -5268,7 +5160,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5268
5160
|
}).then(response => response.data?.cartDiscount ? transformLocalizedFieldsForCartDiscount(response.data.cartDiscount) : null);
|
|
5269
5161
|
}
|
|
5270
5162
|
|
|
5271
|
-
var styles$
|
|
5163
|
+
var styles$h = {
|
|
5272
5164
|
"container": "reference-search-module__container___3-iK3",
|
|
5273
5165
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5274
5166
|
}; // This is a hashmap of loaded items used to map a value to an item
|
|
@@ -5375,9 +5267,9 @@ function ReferenceSearch(props) {
|
|
|
5375
5267
|
props.onChange(option);
|
|
5376
5268
|
};
|
|
5377
5269
|
return jsxRuntime.jsxs("div", {
|
|
5378
|
-
className: styles$
|
|
5270
|
+
className: styles$h.container,
|
|
5379
5271
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
5380
|
-
className: styles$
|
|
5272
|
+
className: styles$h['missing-label'],
|
|
5381
5273
|
children: props.referenceIsMissingLabel
|
|
5382
5274
|
}), jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5383
5275
|
title: tooltipTitle,
|
|
@@ -5697,7 +5589,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5697
5589
|
|
|
5698
5590
|
function ownKeys$Z(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5699
5591
|
function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Z(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Z(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5700
|
-
var styles$
|
|
5592
|
+
var styles$g = {
|
|
5701
5593
|
"button": "button-module__button___1OzVf",
|
|
5702
5594
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
5703
5595
|
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
@@ -5733,7 +5625,7 @@ const Button = props => {
|
|
|
5733
5625
|
return jsxRuntime.jsx("button", _objectSpread$Z(_objectSpread$Z({
|
|
5734
5626
|
onClick: isDisabled ? null : onClick,
|
|
5735
5627
|
type: props.type,
|
|
5736
|
-
className: classnames__default["default"](styles$
|
|
5628
|
+
className: classnames__default["default"](styles$g.button, isDisabled ? styles$g.disabled : null, className),
|
|
5737
5629
|
disabled: isDisabled,
|
|
5738
5630
|
"aria-label": props['aria-label']
|
|
5739
5631
|
}, dataProps), {}, {
|
|
@@ -5755,15 +5647,15 @@ var messages$z = reactIntl.defineMessages({
|
|
|
5755
5647
|
|
|
5756
5648
|
function ownKeys$Y(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5757
5649
|
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Y(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Y(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5758
|
-
var styles$
|
|
5650
|
+
var styles$f = {
|
|
5759
5651
|
"button": "file-input-module__button___2KypN",
|
|
5760
5652
|
"input": "file-input-module__input___3MP4D"
|
|
5761
5653
|
};
|
|
5762
5654
|
const FileInput = props => jsxRuntime.jsx("label", {
|
|
5763
5655
|
children: jsxRuntime.jsxs("span", {
|
|
5764
|
-
className: styles$
|
|
5656
|
+
className: styles$f.button,
|
|
5765
5657
|
children: [jsxRuntime.jsx("input", {
|
|
5766
|
-
className: styles$
|
|
5658
|
+
className: styles$f.input,
|
|
5767
5659
|
type: "file",
|
|
5768
5660
|
accept: props.acceptTypes,
|
|
5769
5661
|
name: props.name,
|
|
@@ -6016,7 +5908,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6016
5908
|
};
|
|
6017
5909
|
CustomerGroupPickerInput.displayName = 'CustomerGroupPickerInput';
|
|
6018
5910
|
|
|
6019
|
-
var styles$
|
|
5911
|
+
var styles$e = {
|
|
6020
5912
|
"divider": "divider-module__divider___4-vdy",
|
|
6021
5913
|
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
6022
5914
|
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
@@ -6029,10 +5921,10 @@ function Divider(_ref) {
|
|
|
6029
5921
|
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
6030
5922
|
return jsxRuntime.jsx("hr", {
|
|
6031
5923
|
className: classnames__default["default"]({
|
|
6032
|
-
[styles$
|
|
6033
|
-
[styles$
|
|
6034
|
-
[styles$
|
|
6035
|
-
[styles$
|
|
5924
|
+
[styles$e['divider-solid']]: !isDashed,
|
|
5925
|
+
[styles$e['divider-dashed']]: isDashed,
|
|
5926
|
+
[styles$e['divider-horizontal']]: orientation === 'horizontal',
|
|
5927
|
+
[styles$e['divider-vertical']]: orientation === 'vertical'
|
|
6036
5928
|
})
|
|
6037
5929
|
});
|
|
6038
5930
|
}
|
|
@@ -6176,7 +6068,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
|
|
|
6176
6068
|
}) : null;
|
|
6177
6069
|
ExpandButton.displayName = 'ExpandButton';
|
|
6178
6070
|
|
|
6179
|
-
var styles$
|
|
6071
|
+
var styles$d = {
|
|
6180
6072
|
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6181
6073
|
"gap": "set-buttons-module__gap___38Qr0"
|
|
6182
6074
|
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
@@ -6197,7 +6089,7 @@ const SetButtons = props => {
|
|
|
6197
6089
|
size: "big",
|
|
6198
6090
|
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
6199
6091
|
}) : jsxRuntime.jsx("div", {
|
|
6200
|
-
className: styles$
|
|
6092
|
+
className: styles$d.gap
|
|
6201
6093
|
})]
|
|
6202
6094
|
})
|
|
6203
6095
|
});
|
|
@@ -6443,7 +6335,7 @@ const convertTypeValuesToOptions$1 = reselect.defaultMemoize(typeValues => _mapI
|
|
|
6443
6335
|
function CustomEnumInput(props) {
|
|
6444
6336
|
const options = convertTypeValuesToOptions$1(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
|
|
6445
6337
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6446
|
-
props.setFieldValue(props.name, rawValue);
|
|
6338
|
+
props.setFieldValue(props.name, !rawValue ? undefined : rawValue);
|
|
6447
6339
|
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6448
6340
|
});
|
|
6449
6341
|
const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
|
|
@@ -6567,7 +6459,7 @@ CustomLocalizedTextInput.displayName = 'CustomLocalizedTextInput';
|
|
|
6567
6459
|
|
|
6568
6460
|
function ownKeys$S(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6569
6461
|
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$S(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$S(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6570
|
-
var styles$
|
|
6462
|
+
var styles$c = {
|
|
6571
6463
|
"container": "custom-money-input-module__container___1fdO2"
|
|
6572
6464
|
};
|
|
6573
6465
|
const fixCurrencyCode = (value, currencies) => {
|
|
@@ -6632,7 +6524,7 @@ function CustomMoneyInput(props) {
|
|
|
6632
6524
|
|
|
6633
6525
|
// TODO(pa3): fix setting proper id in UIKit
|
|
6634
6526
|
return jsxRuntime.jsxs("div", {
|
|
6635
|
-
className: styles$
|
|
6527
|
+
className: styles$c.container,
|
|
6636
6528
|
"aria-labelledby": props.name,
|
|
6637
6529
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
6638
6530
|
children: jsxRuntime.jsx("label", {
|
|
@@ -6659,7 +6551,7 @@ function CustomMoneyInput(props) {
|
|
|
6659
6551
|
CustomMoneyInput.displayName = 'CustomMoneyInput';
|
|
6660
6552
|
|
|
6661
6553
|
function ownKeys$R(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6662
|
-
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
6554
|
+
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$R(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$R(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6663
6555
|
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 } } } };
|
|
6664
6556
|
const mapAttributeDefinition = definition => {
|
|
6665
6557
|
var _context, _context2, _context3, _context4;
|
|
@@ -6698,15 +6590,14 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6698
6590
|
loading = _useQuery.loading,
|
|
6699
6591
|
error = _useQuery.error;
|
|
6700
6592
|
if (!loading && !error) {
|
|
6701
|
-
|
|
6702
|
-
const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6593
|
+
const attributeDefinitions = data.productType?.attributeDefinitions.results.map(mapAttributeDefinition);
|
|
6703
6594
|
return {
|
|
6704
6595
|
loading: false,
|
|
6705
6596
|
error: false,
|
|
6706
|
-
productType: {
|
|
6597
|
+
productType: data.productType ? {
|
|
6707
6598
|
name: data.productType.name,
|
|
6708
6599
|
attributeDefinitions
|
|
6709
|
-
}
|
|
6600
|
+
} : null
|
|
6710
6601
|
};
|
|
6711
6602
|
}
|
|
6712
6603
|
return {
|
|
@@ -7832,10 +7723,15 @@ const useDnDContext = () => {
|
|
|
7832
7723
|
const _excluded$1 = ["WrapperComponent"];
|
|
7833
7724
|
function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7834
7725
|
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7726
|
+
const textAttributeTypes = ['text', 'ltext'];
|
|
7835
7727
|
const getFieldName = (parentName, fieldName) => {
|
|
7836
7728
|
if (!parentName) return fieldName;
|
|
7837
7729
|
return `${parentName}.${fieldName}`;
|
|
7838
7730
|
};
|
|
7731
|
+
const isTextAttribute = function () {
|
|
7732
|
+
let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7733
|
+
return _includesInstanceProperty__default["default"](textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
|
|
7734
|
+
};
|
|
7839
7735
|
const isNested = fieldDefinition => {
|
|
7840
7736
|
const type = fieldDefinition.type;
|
|
7841
7737
|
const typeName = type.name.toLowerCase();
|
|
@@ -7854,6 +7750,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7854
7750
|
values = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
7855
7751
|
handleBlur = _useFormikContext.handleBlur,
|
|
7856
7752
|
status = _useFormikContext.status;
|
|
7753
|
+
const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
|
|
7857
7754
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7858
7755
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7859
7756
|
const _useDnDContext = useDnDContext(),
|
|
@@ -7867,6 +7764,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7867
7764
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7868
7765
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7869
7766
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7767
|
+
const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
|
|
7870
7768
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7871
7769
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7872
7770
|
|
|
@@ -7884,7 +7782,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7884
7782
|
name: fieldName,
|
|
7885
7783
|
value: value,
|
|
7886
7784
|
fieldDefinition: fieldDefinition,
|
|
7887
|
-
isDisabled:
|
|
7785
|
+
isDisabled: isFieldDisabled || isDnDMode,
|
|
7888
7786
|
isReadOnly: props.isReadOnly,
|
|
7889
7787
|
onBlur: handleBlur,
|
|
7890
7788
|
setFieldValue: props.setFieldValue,
|
|
@@ -7942,7 +7840,7 @@ const findLabel = (enumType, key) => {
|
|
|
7942
7840
|
};
|
|
7943
7841
|
const convertEnumValues = (value, attributeDefinition) => {
|
|
7944
7842
|
var _context2, _context3;
|
|
7945
|
-
if (
|
|
7843
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7946
7844
|
const typeName = getTypeName(attributeDefinition.type);
|
|
7947
7845
|
if (_includesInstanceProperty__default["default"](_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
7948
7846
|
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, _ref => {
|
|
@@ -7953,7 +7851,7 @@ const convertEnumValues = (value, attributeDefinition) => {
|
|
|
7953
7851
|
};
|
|
7954
7852
|
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
7955
7853
|
var _context4, _context5;
|
|
7956
|
-
if (
|
|
7854
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7957
7855
|
if (!attributeDefinition) return value;
|
|
7958
7856
|
const type = attributeDefinition.type;
|
|
7959
7857
|
const typeName = getTypeName(type);
|
|
@@ -8526,7 +8424,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8526
8424
|
};
|
|
8527
8425
|
|
|
8528
8426
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
8529
|
-
var styles$
|
|
8427
|
+
var styles$b = {
|
|
8530
8428
|
"colored": "required-indicator-module__colored____YUFm",
|
|
8531
8429
|
"indicatorAsterisk": "required-indicator-module__indicatorAsterisk___3lEdX"
|
|
8532
8430
|
};
|
|
@@ -8534,8 +8432,8 @@ const RequiredIndicator = _ref => {
|
|
|
8534
8432
|
let uncolored = _ref.uncolored;
|
|
8535
8433
|
return jsxRuntime.jsx("em", {
|
|
8536
8434
|
className: classnames__default["default"]({
|
|
8537
|
-
[styles$
|
|
8538
|
-
[styles$
|
|
8435
|
+
[styles$b.colored]: !uncolored,
|
|
8436
|
+
[styles$b.indicatorAsterisk]: true
|
|
8539
8437
|
}),
|
|
8540
8438
|
children: '*'
|
|
8541
8439
|
});
|
|
@@ -8590,7 +8488,7 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8590
8488
|
}
|
|
8591
8489
|
});
|
|
8592
8490
|
|
|
8593
|
-
var styles$
|
|
8491
|
+
var styles$a = {
|
|
8594
8492
|
"container": "selectable-field-search-input-module__container___z2ltR",
|
|
8595
8493
|
"search-mode-menu": "selectable-field-search-input-module__search-mode-menu___Od6Le"
|
|
8596
8494
|
};
|
|
@@ -8601,7 +8499,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
8601
8499
|
setSearchText = _useState2[1];
|
|
8602
8500
|
const intl = reactIntl.useIntl();
|
|
8603
8501
|
return jsxRuntime.jsx("div", {
|
|
8604
|
-
className: styles$
|
|
8502
|
+
className: styles$a.container,
|
|
8605
8503
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
8606
8504
|
menuHorizontalConstraint: 5,
|
|
8607
8505
|
options: props.options,
|
|
@@ -8956,18 +8854,6 @@ const useTotalNumberOfStoresFetcher = projectKey => {
|
|
|
8956
8854
|
};
|
|
8957
8855
|
};
|
|
8958
8856
|
|
|
8959
|
-
const handlers$2 = {
|
|
8960
|
-
TotalNumberOfStores: {
|
|
8961
|
-
all: total => msw.graphql.query('TotalNumberOfStores', (req, res, ctx) => {
|
|
8962
|
-
return res(ctx.data({
|
|
8963
|
-
totalNumberOfStores: {
|
|
8964
|
-
total
|
|
8965
|
-
}
|
|
8966
|
-
}));
|
|
8967
|
-
})
|
|
8968
|
-
}
|
|
8969
|
-
};
|
|
8970
|
-
|
|
8971
8857
|
var FetchStoresByField = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByField" }, 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: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByField" }, name: { kind: "Name", value: "stores" }, 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" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "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: 473, source: { body: "query FetchStoresByField(\n $where: String!\n $excludeProductSelections: Boolean!\n $limit: Int\n) {\n storesByField: stores(where: $where, limit: $limit) {\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 } } } };
|
|
8972
8858
|
const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => ({
|
|
8973
8859
|
where: `${predicateField} in (${_mapInstanceProperty__default["default"](stores).call(stores, store => `"${store}"`).join(', ')})`,
|
|
@@ -8998,7 +8884,7 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8998
8884
|
function ownKeys$C(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8999
8885
|
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$C(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$C(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
9000
8886
|
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 } } } };
|
|
9001
|
-
var styles$
|
|
8887
|
+
var styles$9 = {
|
|
9002
8888
|
"renderLabelContainer": "stores-search-selector-module__renderLabelContainer___3_PBc",
|
|
9003
8889
|
"customLabel": "stores-search-selector-module__customLabel___1Xse8"
|
|
9004
8890
|
}; // check wether there are any errors
|
|
@@ -9112,9 +8998,9 @@ const StoresSearchSelectInput = props => {
|
|
|
9112
8998
|
const renderNoOptions = _ref4 => {
|
|
9113
8999
|
let inputValue = _ref4.inputValue;
|
|
9114
9000
|
return jsxRuntime.jsxs("div", {
|
|
9115
|
-
className: styles$
|
|
9001
|
+
className: styles$9.renderLabelContainer,
|
|
9116
9002
|
children: [jsxRuntime.jsx("div", {
|
|
9117
|
-
className: styles$
|
|
9003
|
+
className: styles$9.customLabel,
|
|
9118
9004
|
children: props?.renderLabel && props?.renderLabel
|
|
9119
9005
|
}), jsxRuntime.jsx("div", {
|
|
9120
9006
|
children: intl.formatMessage(inputValue ? messages$q.searchSelectInputNoOptionsFoundMessage : messages$q.searchSelectInputNoValueMessage)
|
|
@@ -9173,6 +9059,9 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
9173
9059
|
|
|
9174
9060
|
function ownKeys$B(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9175
9061
|
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$B(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$B(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
9062
|
+
var styles$8 = {
|
|
9063
|
+
"customOption": "store-select-input-module__customOption___2SC00"
|
|
9064
|
+
};
|
|
9176
9065
|
const StoreSelectInput = props => {
|
|
9177
9066
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
9178
9067
|
const components = React.useMemo(() => {
|
|
@@ -9182,13 +9071,17 @@ const StoreSelectInput = props => {
|
|
|
9182
9071
|
if (optionInnerProps.isDisabled) {
|
|
9183
9072
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$B({}, optionInnerProps));
|
|
9184
9073
|
}
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9074
|
+
const isSearchSelectInput = totalNumberOfStoresFetcher.total > props.upperStoresLimit;
|
|
9075
|
+
return jsxRuntime.jsx("div", {
|
|
9076
|
+
className: isSearchSelectInput ? styles$8.customOption : '',
|
|
9077
|
+
children: jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9078
|
+
optionType: props.optionType,
|
|
9079
|
+
optionInnerProps: optionInnerProps
|
|
9080
|
+
})
|
|
9188
9081
|
});
|
|
9189
9082
|
}
|
|
9190
9083
|
};
|
|
9191
|
-
}, [props.optionType]);
|
|
9084
|
+
}, [props.optionType, totalNumberOfStoresFetcher.total, props.upperStoresLimit]);
|
|
9192
9085
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9193
9086
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
9194
9087
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$B(_objectSpread$B({
|
|
@@ -9645,14 +9538,6 @@ var customFieldDefinitionsConnector = flowRight__default["default"](hoc.graphql(
|
|
|
9645
9538
|
props: mapDataToProps
|
|
9646
9539
|
}))(CustomFieldDefinitionsConnector);
|
|
9647
9540
|
|
|
9648
|
-
const handlers$1 = {
|
|
9649
|
-
TypeDefinitions: {
|
|
9650
|
-
all: typeDefinitions => msw.graphql.query('FetchTypeDefinitionsQuery', (req, res, ctx) => res(ctx.data({
|
|
9651
|
-
typeDefinitions
|
|
9652
|
-
})))
|
|
9653
|
-
}
|
|
9654
|
-
};
|
|
9655
|
-
|
|
9656
9541
|
function ownKeys$x(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9657
9542
|
function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$x(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$x(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
9658
9543
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
@@ -10104,7 +9989,9 @@ const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selec
|
|
|
10104
9989
|
}));
|
|
10105
9990
|
};
|
|
10106
9991
|
|
|
10107
|
-
|
|
9992
|
+
/**
|
|
9993
|
+
* Creates a new form state based on the selected type definition from the dropdown.
|
|
9994
|
+
*/
|
|
10108
9995
|
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
10109
9996
|
return {
|
|
10110
9997
|
type: {
|
|
@@ -10127,7 +10014,8 @@ const CustomTypeSubform = _ref => {
|
|
|
10127
10014
|
const _useFormikContext = formik.useFormikContext(),
|
|
10128
10015
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
10129
10016
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
10130
|
-
validateForm = _useFormikContext.validateForm
|
|
10017
|
+
validateForm = _useFormikContext.validateForm,
|
|
10018
|
+
initialValues = _useFormikContext.initialValues;
|
|
10131
10019
|
const _useIntl = reactIntl.useIntl(),
|
|
10132
10020
|
formatMessage = _useIntl.formatMessage;
|
|
10133
10021
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -10140,8 +10028,23 @@ const CustomTypeSubform = _ref => {
|
|
|
10140
10028
|
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
10141
10029
|
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
10142
10030
|
if (selectedTypeDefinition) {
|
|
10143
|
-
const
|
|
10144
|
-
|
|
10031
|
+
const initialValueCustomType = initialValues[rootFieldName];
|
|
10032
|
+
const selectedCustomTypeKey = selectedTypeDefinition?.type.key;
|
|
10033
|
+
let newFieldValue;
|
|
10034
|
+
|
|
10035
|
+
/**
|
|
10036
|
+
* If the user selects the same custom type that was already selected, we need to reset the `custom` field
|
|
10037
|
+
* back to its initial value to ensure that the form state is consistent with the initial values.
|
|
10038
|
+
*/
|
|
10039
|
+
if (initialValueCustomType?.type?.obj?.key === selectedCustomTypeKey) {
|
|
10040
|
+
newFieldValue = initialValueCustomType;
|
|
10041
|
+
/**
|
|
10042
|
+
* Otherwise, set the `custom` field to the new custom type definition.
|
|
10043
|
+
*/
|
|
10044
|
+
} else {
|
|
10045
|
+
newFieldValue = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
10046
|
+
}
|
|
10047
|
+
setFieldValue(rootFieldName, newFieldValue).then(() => {
|
|
10145
10048
|
validateForm();
|
|
10146
10049
|
});
|
|
10147
10050
|
} else {
|
|
@@ -10163,7 +10066,7 @@ const CustomTypeSubform = _ref => {
|
|
|
10163
10066
|
children: panelTitle || jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$s({}, messages$o.title))
|
|
10164
10067
|
}),
|
|
10165
10068
|
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
10166
|
-
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
10069
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBJb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0LCBnZXRJbiB9IGZyb20gJ2Zvcm1payc7XG5pbXBvcnQgeyBGb3JtYXR0ZWRNZXNzYWdlLCB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyB1c2VBcHBsaWNhdGlvbkNvbnRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9hcHBsaWNhdGlvbi1zaGVsbC1jb25uZWN0b3JzJztcbmltcG9ydCB7IGZvcm1hdExvY2FsaXplZFN0cmluZyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2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HtkZXNpZ25Ub2tlbnMuY29uc3RyYWludDExfTtcbiAgICAgICAgICAgIGB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPFNlbGVjdElucHV0XG4gICAgICAgICAgICAgIGlzQ2xlYXJhYmxlXG4gICAgICAgICAgICAgIGRhdGEtdGVzdGlkPVwiY3VzdG9tLXR5cGUtc2VsZWN0XCJcbiAgICAgICAgICAgICAgbmFtZT17YCR7cm9vdEZpZWxkTmFtZX0udHlwZS5vYmoua2V5YH1cbiAgICAgICAgICAgICAgb3B0aW9ucz17bWFwVHlwZURlZmluaXRpb25zVG9PcHRpb25zKFxuICAgICAgICAgICAgICAgIHR5cGVEZWZpbml0aW9ucyxcbiAgICAgICAgICAgICAgICBsYW5ndWFnZSxcbiAgICAgICAgICAgICAgICBsYW5ndWFnZXMsXG5cbiAgICAgICAgICAgICAgICBnZXRJbihmb3JtVmFsdWVzLCByb290RmllbGROYW1lKT8udHlwZT8uaWRcbiAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgdmFsdWU9e2dldEluKGZvcm1WYWx1ZXMsIHJvb3RGaWVsZE5hbWUpPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwicmlnaHRcIlxuICAgID5cbiAgICAgIDxDdXN0b21GaWVsZHNJbnB1dFdyYXBwZXJcbiAgICAgICAgdHlwZURlZmluaXRpb25zPXt0eXBlRGVmaW5pdGlvbnN9XG4gICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgIGhpZGVFbXB0eUZpZWxkcz17aGlkZUVtcHR5RmllbGRzfVxuICAgICAgICByb290Rm9ybVN0YXRlRmllbGROYW1lPXtyb290Rm9ybVN0YXRlRmllbGROYW1lfVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG4gIGhpZGVFbXB0eUZpZWxkczogUHJvcFR5cGVzLmJvb2wsXG4gIHJvb3RGb3JtU3RhdGVGaWVsZE5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gIHBhbmVsVGl0bGU6IFByb3BUeXBlcy5ub2RlLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ3VzdG9tVHlwZVN1YmZvcm07XG4iXX0= */"),
|
|
10167
10070
|
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
10168
10071
|
isClearable: true,
|
|
10169
10072
|
"data-testid": "custom-type-select",
|
|
@@ -10246,7 +10149,7 @@ const defaultValue = {
|
|
|
10246
10149
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10247
10150
|
|
|
10248
10151
|
var FetchIndicesExist = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchIndicesExist" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indicesExist" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "products" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 191, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10249
|
-
var fetchPimIndexStatus = (
|
|
10152
|
+
var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
10250
10153
|
try {
|
|
10251
10154
|
await dispatch(sdk.actions.head({
|
|
10252
10155
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.PIM_SEARCH,
|
|
@@ -10284,7 +10187,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10284
10187
|
status: 'unreachable'
|
|
10285
10188
|
};
|
|
10286
10189
|
}
|
|
10287
|
-
}
|
|
10190
|
+
};
|
|
10288
10191
|
|
|
10289
10192
|
var messages$n = reactIntl.defineMessages({
|
|
10290
10193
|
indexingSucceed: {
|
|
@@ -11906,14 +11809,6 @@ const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
|
11906
11809
|
return WithCustomerGroupsPlatformLimits;
|
|
11907
11810
|
};
|
|
11908
11811
|
|
|
11909
|
-
const handlers = {
|
|
11910
|
-
PlatformLimits: {
|
|
11911
|
-
all: platformLimiits => msw.graphql.query('PlatformLimitsFetcherQuery', (req, res, ctx) => res(ctx.data({
|
|
11912
|
-
limits: platformLimiits
|
|
11913
|
-
})))
|
|
11914
|
-
}
|
|
11915
|
-
};
|
|
11916
|
-
|
|
11917
11812
|
var messages$8 = reactIntl.defineMessages({
|
|
11918
11813
|
yes: {
|
|
11919
11814
|
id: 'BooleanField.yes',
|
|
@@ -13717,7 +13612,6 @@ exports.createGraphQlUpdateActions = createGraphQlUpdateActions;
|
|
|
13717
13612
|
exports.createNextSortDefinition = createNextSortDefinition;
|
|
13718
13613
|
exports.createReducer = createReducer;
|
|
13719
13614
|
exports.createResourceReducer = createResourceReducer;
|
|
13720
|
-
exports.customFieldDefinitionsMockHanders = handlers$1;
|
|
13721
13615
|
exports.customFieldsTransformer = customFields;
|
|
13722
13616
|
exports.dateTransformer = dateTransformer$1;
|
|
13723
13617
|
exports.exact = exact;
|
|
@@ -13781,7 +13675,6 @@ exports.injectToggleState = injectModalState;
|
|
|
13781
13675
|
exports.injectZonesPlatformLimits = injectZonesPlatformLimits;
|
|
13782
13676
|
exports.isEmpty = isEmptyFilter;
|
|
13783
13677
|
exports.isEmptyValue = isEmptyValue;
|
|
13784
|
-
exports.isFieldDuplicatedMockHandlers = handlers$6;
|
|
13785
13678
|
exports.isUUID = isUUID;
|
|
13786
13679
|
exports.isValidISODate = isValidISODate;
|
|
13787
13680
|
exports.isValidISODateTime = isValidISODateTime;
|
|
@@ -13798,9 +13691,6 @@ exports.omitDeep = omitDeep;
|
|
|
13798
13691
|
exports.omitSetsOfSets = omitSetsOfSets;
|
|
13799
13692
|
exports.or = or;
|
|
13800
13693
|
exports.pickerMessages = pickerMessages$1;
|
|
13801
|
-
exports.platformLimitsMockHandlers = handlers;
|
|
13802
|
-
exports.productSelectionsFetcherMockHandler = handlers$3;
|
|
13803
|
-
exports.productSelectionsTotalFetcherMockHandler = handlers$4;
|
|
13804
13694
|
exports.range = range;
|
|
13805
13695
|
exports.reorderArrayItems = reorderArrayItems;
|
|
13806
13696
|
exports.resolveStatusType = resolveStatusType;
|
|
@@ -13816,7 +13706,6 @@ exports.slugify = slugify;
|
|
|
13816
13706
|
exports.sortDataByIdsArray = sortDataByIdsArray;
|
|
13817
13707
|
exports.sortRequiresLanguage = sortRequiresLanguage;
|
|
13818
13708
|
exports.splitVariantAttributesByConstraint = splitVariantAttributesByConstraint;
|
|
13819
|
-
exports.storesListConnectorMockHandlers = handlers$5;
|
|
13820
13709
|
exports.stringToBase64 = stringToBase64;
|
|
13821
13710
|
exports.swapArrayItems = swapArrayItems;
|
|
13822
13711
|
exports.transformAllToProperNounCase = transformAllToProperNounCase;
|
|
@@ -13848,7 +13737,6 @@ exports.useStoreKeysInDataFences = useStoreKeysInDataFences;
|
|
|
13848
13737
|
exports.useStoresListFetcher = useStoresListFetcher;
|
|
13849
13738
|
exports.useTaxCategoriesPlatformLimits = useTaxCategoriesLimits;
|
|
13850
13739
|
exports.useTotalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher;
|
|
13851
|
-
exports.useTotalNumberOfStoresFetcherHandlers = handlers$2;
|
|
13852
13740
|
exports.validateCustomField = validateFilter$2;
|
|
13853
13741
|
exports.validateCustomFields = validations;
|
|
13854
13742
|
exports.validateDate = validateFilter$1;
|