@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);
|
|
@@ -195,7 +194,7 @@ var compact__default = /*#__PURE__*/_interopDefault(compact);
|
|
|
195
194
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
196
195
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
197
196
|
|
|
198
|
-
var styles$
|
|
197
|
+
var styles$k = {
|
|
199
198
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
200
199
|
};
|
|
201
200
|
/**
|
|
@@ -203,7 +202,7 @@ var styles$j = {
|
|
|
203
202
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
204
203
|
*/
|
|
205
204
|
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
206
|
-
className: styles$
|
|
205
|
+
className: styles$k['loading-container'],
|
|
207
206
|
"data-testid": "centered-loading-spinner",
|
|
208
207
|
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
209
208
|
});
|
|
@@ -245,6 +244,7 @@ const INTERVALS_IN_SECONDS = {
|
|
|
245
244
|
[REMINDER_OPTION_10_DAY]: 864000
|
|
246
245
|
};
|
|
247
246
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
247
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
|
|
248
248
|
|
|
249
249
|
// TODO: apply a more robust solution to overlaying issues
|
|
250
250
|
const Z_INDEX_DROPDOWN = 30000;
|
|
@@ -1069,7 +1069,7 @@ function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
|
|
|
1069
1069
|
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; }
|
|
1070
1070
|
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)); }
|
|
1071
1071
|
function _isNativeReflectConstruct$7() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$7 = function () { return !!t; })(); }
|
|
1072
|
-
var styles$
|
|
1072
|
+
var styles$j = {
|
|
1073
1073
|
"size": "throttled-field-module__size___324jx",
|
|
1074
1074
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
1075
1075
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -1178,9 +1178,9 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1178
1178
|
})
|
|
1179
1179
|
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1l(_objectSpread$1l({}, commonProps), {}, {
|
|
1180
1180
|
id: inputId,
|
|
1181
|
-
className: classnames__default["default"](styles$
|
|
1182
|
-
[styles$
|
|
1183
|
-
[styles$
|
|
1181
|
+
className: classnames__default["default"](styles$j.textarea, styles$j[`textarea-${this.props.style}`], {
|
|
1182
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1183
|
+
[styles$j.disabled]: this.props.disabled
|
|
1184
1184
|
}),
|
|
1185
1185
|
rows: 1,
|
|
1186
1186
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
@@ -1189,10 +1189,10 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1189
1189
|
id: inputId,
|
|
1190
1190
|
ref: this.props.inputRef,
|
|
1191
1191
|
type: this.props.as,
|
|
1192
|
-
className: classnames__default["default"](styles$
|
|
1193
|
-
[styles$
|
|
1194
|
-
[styles$
|
|
1195
|
-
[styles$
|
|
1192
|
+
className: classnames__default["default"](styles$j[`input-${this.props.style}`], {
|
|
1193
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1194
|
+
[styles$j.disabled]: this.props.disabled,
|
|
1195
|
+
[styles$j.granular]: this.props.isGranular
|
|
1196
1196
|
})
|
|
1197
1197
|
}))]
|
|
1198
1198
|
});
|
|
@@ -1237,7 +1237,7 @@ var messages$G = reactIntl.defineMessages({
|
|
|
1237
1237
|
|
|
1238
1238
|
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)); }
|
|
1239
1239
|
function _isNativeReflectConstruct$6() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$6 = function () { return !!t; })(); }
|
|
1240
|
-
var styles$
|
|
1240
|
+
var styles$i = {
|
|
1241
1241
|
"block": "search-input-module__block___1uM-y",
|
|
1242
1242
|
"container": "search-input-module__container___9u6if",
|
|
1243
1243
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -1312,14 +1312,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1312
1312
|
key: "render",
|
|
1313
1313
|
value: function render() {
|
|
1314
1314
|
return jsxRuntime.jsx("div", {
|
|
1315
|
-
className: classnames__default["default"](this.props.blockClassName, styles$
|
|
1315
|
+
className: classnames__default["default"](this.props.blockClassName, styles$i.block),
|
|
1316
1316
|
children: jsxRuntime.jsxs("div", {
|
|
1317
|
-
className: classnames__default["default"](this.props.containerClassName, styles$
|
|
1317
|
+
className: classnames__default["default"](this.props.containerClassName, styles$i.container),
|
|
1318
1318
|
children: [jsxRuntime.jsx("div", {
|
|
1319
|
-
className: classnames__default["default"](styles$
|
|
1320
|
-
[styles$
|
|
1321
|
-
[styles$
|
|
1322
|
-
[styles$
|
|
1319
|
+
className: classnames__default["default"](styles$i['input-container'], {
|
|
1320
|
+
[styles$i['input-container-hoverable']]: !this.props.disabled,
|
|
1321
|
+
[styles$i['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
1322
|
+
[styles$i['input-container-granular']]: this.props.isGranular
|
|
1323
1323
|
}),
|
|
1324
1324
|
children: jsxRuntime.jsx(ThrottledField, {
|
|
1325
1325
|
style: "primary",
|
|
@@ -1337,8 +1337,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1337
1337
|
isGranular: this.props.isGranular
|
|
1338
1338
|
})
|
|
1339
1339
|
}), this.state.text && jsxRuntime.jsx(uiKit.SecondaryIconButton, {
|
|
1340
|
-
className: classnames__default["default"](styles$
|
|
1341
|
-
[styles$
|
|
1340
|
+
className: classnames__default["default"](styles$i['clear-icon-container'], {
|
|
1341
|
+
[styles$i['clear-icon-container-granular']]: this.props.isGranular
|
|
1342
1342
|
}),
|
|
1343
1343
|
icon: jsxRuntime.jsx(uiKit.CloseIcon, {}),
|
|
1344
1344
|
size: "30",
|
|
@@ -1346,9 +1346,9 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1346
1346
|
onClick: this.handleClear
|
|
1347
1347
|
}), jsxRuntime.jsx("div", {
|
|
1348
1348
|
"data-testid": "search-button",
|
|
1349
|
-
className: classnames__default["default"](styles$
|
|
1350
|
-
[styles$
|
|
1351
|
-
[styles$
|
|
1349
|
+
className: classnames__default["default"](styles$i['search-icon-container'], {
|
|
1350
|
+
[styles$i['search-icon-container-hoverable']]: !this.props.disabled,
|
|
1351
|
+
[styles$i['search-icon-container-granular']]: this.props.isGranular
|
|
1352
1352
|
}),
|
|
1353
1353
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
1354
1354
|
label: "search-button",
|
|
@@ -1768,42 +1768,6 @@ const useIsFieldDuplicated = () => {
|
|
|
1768
1768
|
};
|
|
1769
1769
|
};
|
|
1770
1770
|
|
|
1771
|
-
const graphqlQueries = {
|
|
1772
|
-
ASSOCIATE_ROLE: 'associateRoles',
|
|
1773
|
-
ATTRIBUTE_GROUP: 'attributeGroups',
|
|
1774
|
-
BUSINESS_UNIT: 'businessUnits',
|
|
1775
|
-
CART: 'carts',
|
|
1776
|
-
CART_DISCOUNT: 'cartDiscounts',
|
|
1777
|
-
CATEGORY: 'categories',
|
|
1778
|
-
CHANNEL: 'channels',
|
|
1779
|
-
CUSTOMER: 'customers',
|
|
1780
|
-
CUSTOMER_GROUP: 'customerGroups',
|
|
1781
|
-
DISCOUNT_CODE: 'discountCodes',
|
|
1782
|
-
INVENTORY_ENTRY: 'inventoryEntries',
|
|
1783
|
-
ORDER: 'orders',
|
|
1784
|
-
PAYMENT: 'payments',
|
|
1785
|
-
PRODUCT: 'products',
|
|
1786
|
-
PRODUCT_DISCOUNT: 'productDiscounts',
|
|
1787
|
-
PRODUCT_SELECTION: 'productSelections',
|
|
1788
|
-
PRODUCT_TYPE: 'productTypes',
|
|
1789
|
-
SHIPPING_METHOD: 'shippingMethods',
|
|
1790
|
-
STORE: 'stores',
|
|
1791
|
-
TAX_CATEGORY: 'taxCategories',
|
|
1792
|
-
ZONE: 'zones'
|
|
1793
|
-
};
|
|
1794
|
-
const handlers$6 = {
|
|
1795
|
-
DuplicatedField: {
|
|
1796
|
-
total: (total, resourceType) => msw.graphql.query('FetchResourceTypeDuplicatedField', (req, res, ctx) => {
|
|
1797
|
-
if (!graphqlQueries[resourceType]) return res(ctx.data({}));
|
|
1798
|
-
return res(ctx.data({
|
|
1799
|
-
[graphqlQueries[resourceType]]: {
|
|
1800
|
-
total
|
|
1801
|
-
}
|
|
1802
|
-
}));
|
|
1803
|
-
})
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
|
|
1807
1771
|
const usePrevious = value => {
|
|
1808
1772
|
const ref = React.useRef();
|
|
1809
1773
|
React.useEffect(() => {
|
|
@@ -1879,59 +1843,6 @@ const useStoresListFetcher = props => {
|
|
|
1879
1843
|
};
|
|
1880
1844
|
};
|
|
1881
1845
|
|
|
1882
|
-
const extractKeysFromWherePredicateClause = function () {
|
|
1883
|
-
let whereClause = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1884
|
-
return whereClause.substring(_lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '("') + 1, _lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '")')).replace(/["]/g, '').split(', ');
|
|
1885
|
-
};
|
|
1886
|
-
const handlers$5 = {
|
|
1887
|
-
StoresList: {
|
|
1888
|
-
all: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1889
|
-
// GIVEN req.variables.where is specified
|
|
1890
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1891
|
-
// ELSE return all the stores (without filtering any)
|
|
1892
|
-
if (req.variables.where) {
|
|
1893
|
-
var _context;
|
|
1894
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1895
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context = stores.results).call(_context, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1896
|
-
return res(ctx.data({
|
|
1897
|
-
stores: {
|
|
1898
|
-
offset: 0,
|
|
1899
|
-
total: filteredStoreResults.length,
|
|
1900
|
-
count: filteredStoreResults.length,
|
|
1901
|
-
results: filteredStoreResults,
|
|
1902
|
-
__typename: 'StoresQueryResult'
|
|
1903
|
-
}
|
|
1904
|
-
}));
|
|
1905
|
-
}
|
|
1906
|
-
return res(ctx.data({
|
|
1907
|
-
stores
|
|
1908
|
-
}));
|
|
1909
|
-
}),
|
|
1910
|
-
withProductSelections: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1911
|
-
// GIVEN req.variables.where is specified
|
|
1912
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1913
|
-
// ELSE return all the stores (without filtering any)
|
|
1914
|
-
if (req.variables.where) {
|
|
1915
|
-
var _context2;
|
|
1916
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1917
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context2 = stores.results).call(_context2, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1918
|
-
return res(ctx.data({
|
|
1919
|
-
stores: {
|
|
1920
|
-
offset: 0,
|
|
1921
|
-
total: filteredStoreResults.length,
|
|
1922
|
-
count: filteredStoreResults.length,
|
|
1923
|
-
results: filteredStoreResults,
|
|
1924
|
-
__typename: 'StoresQueryResult'
|
|
1925
|
-
}
|
|
1926
|
-
}));
|
|
1927
|
-
}
|
|
1928
|
-
return res(ctx.data({
|
|
1929
|
-
stores
|
|
1930
|
-
}));
|
|
1931
|
-
})
|
|
1932
|
-
}
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
1846
|
const toPermission = (permission, resourceName) => camelCase__default["default"](`can ${permission} ${resourceName}`);
|
|
1936
1847
|
const createPermissionsComposePath = permission =>
|
|
1937
1848
|
// e.g applicationContext.permissions?.canViewOrders
|
|
@@ -2385,17 +2296,6 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2385
2296
|
};
|
|
2386
2297
|
};
|
|
2387
2298
|
|
|
2388
|
-
const handlers$4 = {
|
|
2389
|
-
ProductSelections: {
|
|
2390
|
-
total: total => msw.graphql.query('FetchProductSelectionsTotal', (req, res, ctx) => res(ctx.data({
|
|
2391
|
-
productSelections: {
|
|
2392
|
-
total,
|
|
2393
|
-
__typename: 'ProductSelectionQueryResult'
|
|
2394
|
-
}
|
|
2395
|
-
})))
|
|
2396
|
-
}
|
|
2397
|
-
};
|
|
2398
|
-
|
|
2399
2299
|
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; }
|
|
2400
2300
|
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; }
|
|
2401
2301
|
|
|
@@ -2444,14 +2344,6 @@ const useProductSelectionsFetcher = props => {
|
|
|
2444
2344
|
};
|
|
2445
2345
|
};
|
|
2446
2346
|
|
|
2447
|
-
const handlers$3 = {
|
|
2448
|
-
ProductSelections: {
|
|
2449
|
-
all: productSelections => msw.graphql.query('FetchProductSelections', (req, res, ctx) => res(ctx.data({
|
|
2450
|
-
productSelections
|
|
2451
|
-
})))
|
|
2452
|
-
}
|
|
2453
|
-
};
|
|
2454
|
-
|
|
2455
2347
|
const setToArray = function () {
|
|
2456
2348
|
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
2457
2349
|
return `id in (${_mapInstanceProperty__default["default"](values).call(values, value => `"${value}"`).join(', ')})`;
|
|
@@ -2595,10 +2487,10 @@ function defaultFilterValidator$1(_ref2) {
|
|
|
2595
2487
|
return true;
|
|
2596
2488
|
}
|
|
2597
2489
|
|
|
2598
|
-
var localizedTextTransformer =
|
|
2490
|
+
var localizedTextTransformer = localizedString => {
|
|
2599
2491
|
var _context;
|
|
2600
2492
|
return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
|
|
2601
|
-
}
|
|
2493
|
+
};
|
|
2602
2494
|
|
|
2603
2495
|
const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${uiKit.MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
|
|
2604
2496
|
function moneyTransformer(value, option, locale) {
|
|
@@ -5267,7 +5159,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5267
5159
|
}).then(response => response.data?.cartDiscount ? transformLocalizedFieldsForCartDiscount(response.data.cartDiscount) : null);
|
|
5268
5160
|
}
|
|
5269
5161
|
|
|
5270
|
-
var styles$
|
|
5162
|
+
var styles$h = {
|
|
5271
5163
|
"container": "reference-search-module__container___3-iK3",
|
|
5272
5164
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5273
5165
|
}; // This is a hashmap of loaded items used to map a value to an item
|
|
@@ -5374,9 +5266,9 @@ function ReferenceSearch(props) {
|
|
|
5374
5266
|
props.onChange(option);
|
|
5375
5267
|
};
|
|
5376
5268
|
return jsxRuntime.jsxs("div", {
|
|
5377
|
-
className: styles$
|
|
5269
|
+
className: styles$h.container,
|
|
5378
5270
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
5379
|
-
className: styles$
|
|
5271
|
+
className: styles$h['missing-label'],
|
|
5380
5272
|
children: props.referenceIsMissingLabel
|
|
5381
5273
|
}), jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5382
5274
|
title: tooltipTitle,
|
|
@@ -5696,7 +5588,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5696
5588
|
|
|
5697
5589
|
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; }
|
|
5698
5590
|
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; }
|
|
5699
|
-
var styles$
|
|
5591
|
+
var styles$g = {
|
|
5700
5592
|
"button": "button-module__button___1OzVf",
|
|
5701
5593
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
5702
5594
|
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
@@ -5732,7 +5624,7 @@ const Button = props => {
|
|
|
5732
5624
|
return jsxRuntime.jsx("button", _objectSpread$Z(_objectSpread$Z({
|
|
5733
5625
|
onClick: isDisabled ? null : onClick,
|
|
5734
5626
|
type: props.type,
|
|
5735
|
-
className: classnames__default["default"](styles$
|
|
5627
|
+
className: classnames__default["default"](styles$g.button, isDisabled ? styles$g.disabled : null, className),
|
|
5736
5628
|
disabled: isDisabled,
|
|
5737
5629
|
"aria-label": props['aria-label']
|
|
5738
5630
|
}, dataProps), {}, {
|
|
@@ -5754,15 +5646,15 @@ var messages$z = reactIntl.defineMessages({
|
|
|
5754
5646
|
|
|
5755
5647
|
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; }
|
|
5756
5648
|
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; }
|
|
5757
|
-
var styles$
|
|
5649
|
+
var styles$f = {
|
|
5758
5650
|
"button": "file-input-module__button___2KypN",
|
|
5759
5651
|
"input": "file-input-module__input___3MP4D"
|
|
5760
5652
|
};
|
|
5761
5653
|
const FileInput = props => jsxRuntime.jsx("label", {
|
|
5762
5654
|
children: jsxRuntime.jsxs("span", {
|
|
5763
|
-
className: styles$
|
|
5655
|
+
className: styles$f.button,
|
|
5764
5656
|
children: [jsxRuntime.jsx("input", {
|
|
5765
|
-
className: styles$
|
|
5657
|
+
className: styles$f.input,
|
|
5766
5658
|
type: "file",
|
|
5767
5659
|
accept: props.acceptTypes,
|
|
5768
5660
|
name: props.name,
|
|
@@ -6015,7 +5907,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6015
5907
|
};
|
|
6016
5908
|
CustomerGroupPickerInput.displayName = 'CustomerGroupPickerInput';
|
|
6017
5909
|
|
|
6018
|
-
var styles$
|
|
5910
|
+
var styles$e = {
|
|
6019
5911
|
"divider": "divider-module__divider___4-vdy",
|
|
6020
5912
|
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
6021
5913
|
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
@@ -6028,10 +5920,10 @@ function Divider(_ref) {
|
|
|
6028
5920
|
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
6029
5921
|
return jsxRuntime.jsx("hr", {
|
|
6030
5922
|
className: classnames__default["default"]({
|
|
6031
|
-
[styles$
|
|
6032
|
-
[styles$
|
|
6033
|
-
[styles$
|
|
6034
|
-
[styles$
|
|
5923
|
+
[styles$e['divider-solid']]: !isDashed,
|
|
5924
|
+
[styles$e['divider-dashed']]: isDashed,
|
|
5925
|
+
[styles$e['divider-horizontal']]: orientation === 'horizontal',
|
|
5926
|
+
[styles$e['divider-vertical']]: orientation === 'vertical'
|
|
6035
5927
|
})
|
|
6036
5928
|
});
|
|
6037
5929
|
}
|
|
@@ -6175,7 +6067,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
|
|
|
6175
6067
|
}) : null;
|
|
6176
6068
|
ExpandButton.displayName = 'ExpandButton';
|
|
6177
6069
|
|
|
6178
|
-
var styles$
|
|
6070
|
+
var styles$d = {
|
|
6179
6071
|
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6180
6072
|
"gap": "set-buttons-module__gap___38Qr0"
|
|
6181
6073
|
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
@@ -6196,7 +6088,7 @@ const SetButtons = props => {
|
|
|
6196
6088
|
size: "big",
|
|
6197
6089
|
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
6198
6090
|
}) : jsxRuntime.jsx("div", {
|
|
6199
|
-
className: styles$
|
|
6091
|
+
className: styles$d.gap
|
|
6200
6092
|
})]
|
|
6201
6093
|
})
|
|
6202
6094
|
});
|
|
@@ -6442,7 +6334,7 @@ const convertTypeValuesToOptions$1 = reselect.defaultMemoize(typeValues => _mapI
|
|
|
6442
6334
|
function CustomEnumInput(props) {
|
|
6443
6335
|
const options = convertTypeValuesToOptions$1(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
|
|
6444
6336
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6445
|
-
props.setFieldValue(props.name, rawValue);
|
|
6337
|
+
props.setFieldValue(props.name, !rawValue ? undefined : rawValue);
|
|
6446
6338
|
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6447
6339
|
});
|
|
6448
6340
|
const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
|
|
@@ -6566,7 +6458,7 @@ CustomLocalizedTextInput.displayName = 'CustomLocalizedTextInput';
|
|
|
6566
6458
|
|
|
6567
6459
|
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; }
|
|
6568
6460
|
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; }
|
|
6569
|
-
var styles$
|
|
6461
|
+
var styles$c = {
|
|
6570
6462
|
"container": "custom-money-input-module__container___1fdO2"
|
|
6571
6463
|
};
|
|
6572
6464
|
const fixCurrencyCode = (value, currencies) => {
|
|
@@ -6631,7 +6523,7 @@ function CustomMoneyInput(props) {
|
|
|
6631
6523
|
|
|
6632
6524
|
// TODO(pa3): fix setting proper id in UIKit
|
|
6633
6525
|
return jsxRuntime.jsxs("div", {
|
|
6634
|
-
className: styles$
|
|
6526
|
+
className: styles$c.container,
|
|
6635
6527
|
"aria-labelledby": props.name,
|
|
6636
6528
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
6637
6529
|
children: jsxRuntime.jsx("label", {
|
|
@@ -6658,7 +6550,7 @@ function CustomMoneyInput(props) {
|
|
|
6658
6550
|
CustomMoneyInput.displayName = 'CustomMoneyInput';
|
|
6659
6551
|
|
|
6660
6552
|
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; }
|
|
6661
|
-
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
6553
|
+
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; }
|
|
6662
6554
|
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 } } } };
|
|
6663
6555
|
const mapAttributeDefinition = definition => {
|
|
6664
6556
|
var _context, _context2, _context3, _context4;
|
|
@@ -6697,15 +6589,14 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6697
6589
|
loading = _useQuery.loading,
|
|
6698
6590
|
error = _useQuery.error;
|
|
6699
6591
|
if (!loading && !error) {
|
|
6700
|
-
|
|
6701
|
-
const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6592
|
+
const attributeDefinitions = data.productType?.attributeDefinitions.results.map(mapAttributeDefinition);
|
|
6702
6593
|
return {
|
|
6703
6594
|
loading: false,
|
|
6704
6595
|
error: false,
|
|
6705
|
-
productType: {
|
|
6596
|
+
productType: data.productType ? {
|
|
6706
6597
|
name: data.productType.name,
|
|
6707
6598
|
attributeDefinitions
|
|
6708
|
-
}
|
|
6599
|
+
} : null
|
|
6709
6600
|
};
|
|
6710
6601
|
}
|
|
6711
6602
|
return {
|
|
@@ -7819,10 +7710,15 @@ const useDnDContext = () => {
|
|
|
7819
7710
|
const _excluded$1 = ["WrapperComponent"];
|
|
7820
7711
|
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; }
|
|
7821
7712
|
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; }
|
|
7713
|
+
const textAttributeTypes = ['text', 'ltext'];
|
|
7822
7714
|
const getFieldName = (parentName, fieldName) => {
|
|
7823
7715
|
if (!parentName) return fieldName;
|
|
7824
7716
|
return `${parentName}.${fieldName}`;
|
|
7825
7717
|
};
|
|
7718
|
+
const isTextAttribute = function () {
|
|
7719
|
+
let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7720
|
+
return _includesInstanceProperty__default["default"](textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
|
|
7721
|
+
};
|
|
7826
7722
|
const isNested = fieldDefinition => {
|
|
7827
7723
|
const type = fieldDefinition.type;
|
|
7828
7724
|
const typeName = type.name.toLowerCase();
|
|
@@ -7841,6 +7737,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7841
7737
|
values = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
7842
7738
|
handleBlur = _useFormikContext.handleBlur,
|
|
7843
7739
|
status = _useFormikContext.status;
|
|
7740
|
+
const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
|
|
7844
7741
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7845
7742
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7846
7743
|
const _useDnDContext = useDnDContext(),
|
|
@@ -7854,6 +7751,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7854
7751
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7855
7752
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7856
7753
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7754
|
+
const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
|
|
7857
7755
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7858
7756
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7859
7757
|
|
|
@@ -7871,7 +7769,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7871
7769
|
name: fieldName,
|
|
7872
7770
|
value: value,
|
|
7873
7771
|
fieldDefinition: fieldDefinition,
|
|
7874
|
-
isDisabled:
|
|
7772
|
+
isDisabled: isFieldDisabled || isDnDMode,
|
|
7875
7773
|
isReadOnly: props.isReadOnly,
|
|
7876
7774
|
onBlur: handleBlur,
|
|
7877
7775
|
setFieldValue: props.setFieldValue,
|
|
@@ -7929,7 +7827,7 @@ const findLabel = (enumType, key) => {
|
|
|
7929
7827
|
};
|
|
7930
7828
|
const convertEnumValues = (value, attributeDefinition) => {
|
|
7931
7829
|
var _context2, _context3;
|
|
7932
|
-
if (
|
|
7830
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7933
7831
|
const typeName = getTypeName(attributeDefinition.type);
|
|
7934
7832
|
if (_includesInstanceProperty__default["default"](_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
7935
7833
|
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, _ref => {
|
|
@@ -7940,7 +7838,7 @@ const convertEnumValues = (value, attributeDefinition) => {
|
|
|
7940
7838
|
};
|
|
7941
7839
|
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
7942
7840
|
var _context4, _context5;
|
|
7943
|
-
if (
|
|
7841
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7944
7842
|
if (!attributeDefinition) return value;
|
|
7945
7843
|
const type = attributeDefinition.type;
|
|
7946
7844
|
const typeName = getTypeName(type);
|
|
@@ -8513,7 +8411,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8513
8411
|
};
|
|
8514
8412
|
|
|
8515
8413
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
8516
|
-
var styles$
|
|
8414
|
+
var styles$b = {
|
|
8517
8415
|
"colored": "required-indicator-module__colored____YUFm",
|
|
8518
8416
|
"indicatorAsterisk": "required-indicator-module__indicatorAsterisk___3lEdX"
|
|
8519
8417
|
};
|
|
@@ -8521,8 +8419,8 @@ const RequiredIndicator = _ref => {
|
|
|
8521
8419
|
let uncolored = _ref.uncolored;
|
|
8522
8420
|
return jsxRuntime.jsx("em", {
|
|
8523
8421
|
className: classnames__default["default"]({
|
|
8524
|
-
[styles$
|
|
8525
|
-
[styles$
|
|
8422
|
+
[styles$b.colored]: !uncolored,
|
|
8423
|
+
[styles$b.indicatorAsterisk]: true
|
|
8526
8424
|
}),
|
|
8527
8425
|
children: '*'
|
|
8528
8426
|
});
|
|
@@ -8577,7 +8475,7 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8577
8475
|
}
|
|
8578
8476
|
});
|
|
8579
8477
|
|
|
8580
|
-
var styles$
|
|
8478
|
+
var styles$a = {
|
|
8581
8479
|
"container": "selectable-field-search-input-module__container___z2ltR",
|
|
8582
8480
|
"search-mode-menu": "selectable-field-search-input-module__search-mode-menu___Od6Le"
|
|
8583
8481
|
};
|
|
@@ -8588,7 +8486,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
8588
8486
|
setSearchText = _useState2[1];
|
|
8589
8487
|
const intl = reactIntl.useIntl();
|
|
8590
8488
|
return jsxRuntime.jsx("div", {
|
|
8591
|
-
className: styles$
|
|
8489
|
+
className: styles$a.container,
|
|
8592
8490
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
8593
8491
|
menuHorizontalConstraint: 5,
|
|
8594
8492
|
options: props.options,
|
|
@@ -8943,18 +8841,6 @@ const useTotalNumberOfStoresFetcher = projectKey => {
|
|
|
8943
8841
|
};
|
|
8944
8842
|
};
|
|
8945
8843
|
|
|
8946
|
-
const handlers$2 = {
|
|
8947
|
-
TotalNumberOfStores: {
|
|
8948
|
-
all: total => msw.graphql.query('TotalNumberOfStores', (req, res, ctx) => {
|
|
8949
|
-
return res(ctx.data({
|
|
8950
|
-
totalNumberOfStores: {
|
|
8951
|
-
total
|
|
8952
|
-
}
|
|
8953
|
-
}));
|
|
8954
|
-
})
|
|
8955
|
-
}
|
|
8956
|
-
};
|
|
8957
|
-
|
|
8958
8844
|
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 } } } };
|
|
8959
8845
|
const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => ({
|
|
8960
8846
|
where: `${predicateField} in (${_mapInstanceProperty__default["default"](stores).call(stores, store => `"${store}"`).join(', ')})`,
|
|
@@ -8985,7 +8871,7 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8985
8871
|
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; }
|
|
8986
8872
|
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; }
|
|
8987
8873
|
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 } } } };
|
|
8988
|
-
var styles$
|
|
8874
|
+
var styles$9 = {
|
|
8989
8875
|
"renderLabelContainer": "stores-search-selector-module__renderLabelContainer___3_PBc",
|
|
8990
8876
|
"customLabel": "stores-search-selector-module__customLabel___1Xse8"
|
|
8991
8877
|
}; // check wether there are any errors
|
|
@@ -9099,9 +8985,9 @@ const StoresSearchSelectInput = props => {
|
|
|
9099
8985
|
const renderNoOptions = _ref4 => {
|
|
9100
8986
|
let inputValue = _ref4.inputValue;
|
|
9101
8987
|
return jsxRuntime.jsxs("div", {
|
|
9102
|
-
className: styles$
|
|
8988
|
+
className: styles$9.renderLabelContainer,
|
|
9103
8989
|
children: [jsxRuntime.jsx("div", {
|
|
9104
|
-
className: styles$
|
|
8990
|
+
className: styles$9.customLabel,
|
|
9105
8991
|
children: props?.renderLabel && props?.renderLabel
|
|
9106
8992
|
}), jsxRuntime.jsx("div", {
|
|
9107
8993
|
children: intl.formatMessage(inputValue ? messages$q.searchSelectInputNoOptionsFoundMessage : messages$q.searchSelectInputNoValueMessage)
|
|
@@ -9160,6 +9046,9 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
9160
9046
|
|
|
9161
9047
|
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; }
|
|
9162
9048
|
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; }
|
|
9049
|
+
var styles$8 = {
|
|
9050
|
+
"customOption": "store-select-input-module__customOption___2SC00"
|
|
9051
|
+
};
|
|
9163
9052
|
const StoreSelectInput = props => {
|
|
9164
9053
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
9165
9054
|
const components = React.useMemo(() => {
|
|
@@ -9169,13 +9058,17 @@ const StoreSelectInput = props => {
|
|
|
9169
9058
|
if (optionInnerProps.isDisabled) {
|
|
9170
9059
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$B({}, optionInnerProps));
|
|
9171
9060
|
}
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9061
|
+
const isSearchSelectInput = totalNumberOfStoresFetcher.total > props.upperStoresLimit;
|
|
9062
|
+
return jsxRuntime.jsx("div", {
|
|
9063
|
+
className: isSearchSelectInput ? styles$8.customOption : '',
|
|
9064
|
+
children: jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9065
|
+
optionType: props.optionType,
|
|
9066
|
+
optionInnerProps: optionInnerProps
|
|
9067
|
+
})
|
|
9175
9068
|
});
|
|
9176
9069
|
}
|
|
9177
9070
|
};
|
|
9178
|
-
}, [props.optionType]);
|
|
9071
|
+
}, [props.optionType, totalNumberOfStoresFetcher.total, props.upperStoresLimit]);
|
|
9179
9072
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9180
9073
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
9181
9074
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$B(_objectSpread$B({
|
|
@@ -9624,14 +9517,6 @@ var customFieldDefinitionsConnector = flowRight__default["default"](hoc.graphql(
|
|
|
9624
9517
|
props: mapDataToProps
|
|
9625
9518
|
}))(CustomFieldDefinitionsConnector);
|
|
9626
9519
|
|
|
9627
|
-
const handlers$1 = {
|
|
9628
|
-
TypeDefinitions: {
|
|
9629
|
-
all: typeDefinitions => msw.graphql.query('FetchTypeDefinitionsQuery', (req, res, ctx) => res(ctx.data({
|
|
9630
|
-
typeDefinitions
|
|
9631
|
-
})))
|
|
9632
|
-
}
|
|
9633
|
-
};
|
|
9634
|
-
|
|
9635
9520
|
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; }
|
|
9636
9521
|
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; }
|
|
9637
9522
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
@@ -10083,7 +9968,9 @@ const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selec
|
|
|
10083
9968
|
}));
|
|
10084
9969
|
};
|
|
10085
9970
|
|
|
10086
|
-
|
|
9971
|
+
/**
|
|
9972
|
+
* Creates a new form state based on the selected type definition from the dropdown.
|
|
9973
|
+
*/
|
|
10087
9974
|
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
10088
9975
|
return {
|
|
10089
9976
|
type: {
|
|
@@ -10106,7 +9993,8 @@ const CustomTypeSubform = _ref => {
|
|
|
10106
9993
|
const _useFormikContext = formik.useFormikContext(),
|
|
10107
9994
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
10108
9995
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
10109
|
-
validateForm = _useFormikContext.validateForm
|
|
9996
|
+
validateForm = _useFormikContext.validateForm,
|
|
9997
|
+
initialValues = _useFormikContext.initialValues;
|
|
10110
9998
|
const _useIntl = reactIntl.useIntl(),
|
|
10111
9999
|
formatMessage = _useIntl.formatMessage;
|
|
10112
10000
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -10119,8 +10007,23 @@ const CustomTypeSubform = _ref => {
|
|
|
10119
10007
|
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
10120
10008
|
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
10121
10009
|
if (selectedTypeDefinition) {
|
|
10122
|
-
const
|
|
10123
|
-
|
|
10010
|
+
const initialValueCustomType = initialValues[rootFieldName];
|
|
10011
|
+
const selectedCustomTypeKey = selectedTypeDefinition?.type.key;
|
|
10012
|
+
let newFieldValue;
|
|
10013
|
+
|
|
10014
|
+
/**
|
|
10015
|
+
* If the user selects the same custom type that was already selected, we need to reset the `custom` field
|
|
10016
|
+
* back to its initial value to ensure that the form state is consistent with the initial values.
|
|
10017
|
+
*/
|
|
10018
|
+
if (initialValueCustomType?.type?.obj?.key === selectedCustomTypeKey) {
|
|
10019
|
+
newFieldValue = initialValueCustomType;
|
|
10020
|
+
/**
|
|
10021
|
+
* Otherwise, set the `custom` field to the new custom type definition.
|
|
10022
|
+
*/
|
|
10023
|
+
} else {
|
|
10024
|
+
newFieldValue = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
10025
|
+
}
|
|
10026
|
+
setFieldValue(rootFieldName, newFieldValue).then(() => {
|
|
10124
10027
|
validateForm();
|
|
10125
10028
|
});
|
|
10126
10029
|
} else {
|
|
@@ -10225,7 +10128,7 @@ const defaultValue = {
|
|
|
10225
10128
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10226
10129
|
|
|
10227
10130
|
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 } } } };
|
|
10228
|
-
var fetchPimIndexStatus = (
|
|
10131
|
+
var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
10229
10132
|
try {
|
|
10230
10133
|
await dispatch(sdk.actions.head({
|
|
10231
10134
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.PIM_SEARCH,
|
|
@@ -10263,7 +10166,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10263
10166
|
status: 'unreachable'
|
|
10264
10167
|
};
|
|
10265
10168
|
}
|
|
10266
|
-
}
|
|
10169
|
+
};
|
|
10267
10170
|
|
|
10268
10171
|
var messages$n = reactIntl.defineMessages({
|
|
10269
10172
|
indexingSucceed: {
|
|
@@ -11885,14 +11788,6 @@ const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
|
11885
11788
|
return WithCustomerGroupsPlatformLimits;
|
|
11886
11789
|
};
|
|
11887
11790
|
|
|
11888
|
-
const handlers = {
|
|
11889
|
-
PlatformLimits: {
|
|
11890
|
-
all: platformLimiits => msw.graphql.query('PlatformLimitsFetcherQuery', (req, res, ctx) => res(ctx.data({
|
|
11891
|
-
limits: platformLimiits
|
|
11892
|
-
})))
|
|
11893
|
-
}
|
|
11894
|
-
};
|
|
11895
|
-
|
|
11896
11791
|
var messages$8 = reactIntl.defineMessages({
|
|
11897
11792
|
yes: {
|
|
11898
11793
|
id: 'BooleanField.yes',
|
|
@@ -13696,7 +13591,6 @@ exports.createGraphQlUpdateActions = createGraphQlUpdateActions;
|
|
|
13696
13591
|
exports.createNextSortDefinition = createNextSortDefinition;
|
|
13697
13592
|
exports.createReducer = createReducer;
|
|
13698
13593
|
exports.createResourceReducer = createResourceReducer;
|
|
13699
|
-
exports.customFieldDefinitionsMockHanders = handlers$1;
|
|
13700
13594
|
exports.customFieldsTransformer = customFields;
|
|
13701
13595
|
exports.dateTransformer = dateTransformer$1;
|
|
13702
13596
|
exports.exact = exact;
|
|
@@ -13760,7 +13654,6 @@ exports.injectToggleState = injectModalState;
|
|
|
13760
13654
|
exports.injectZonesPlatformLimits = injectZonesPlatformLimits;
|
|
13761
13655
|
exports.isEmpty = isEmptyFilter;
|
|
13762
13656
|
exports.isEmptyValue = isEmptyValue;
|
|
13763
|
-
exports.isFieldDuplicatedMockHandlers = handlers$6;
|
|
13764
13657
|
exports.isUUID = isUUID;
|
|
13765
13658
|
exports.isValidISODate = isValidISODate;
|
|
13766
13659
|
exports.isValidISODateTime = isValidISODateTime;
|
|
@@ -13777,9 +13670,6 @@ exports.omitDeep = omitDeep;
|
|
|
13777
13670
|
exports.omitSetsOfSets = omitSetsOfSets;
|
|
13778
13671
|
exports.or = or;
|
|
13779
13672
|
exports.pickerMessages = pickerMessages$1;
|
|
13780
|
-
exports.platformLimitsMockHandlers = handlers;
|
|
13781
|
-
exports.productSelectionsFetcherMockHandler = handlers$3;
|
|
13782
|
-
exports.productSelectionsTotalFetcherMockHandler = handlers$4;
|
|
13783
13673
|
exports.range = range;
|
|
13784
13674
|
exports.reorderArrayItems = reorderArrayItems;
|
|
13785
13675
|
exports.resolveStatusType = resolveStatusType;
|
|
@@ -13795,7 +13685,6 @@ exports.slugify = slugify;
|
|
|
13795
13685
|
exports.sortDataByIdsArray = sortDataByIdsArray;
|
|
13796
13686
|
exports.sortRequiresLanguage = sortRequiresLanguage;
|
|
13797
13687
|
exports.splitVariantAttributesByConstraint = splitVariantAttributesByConstraint;
|
|
13798
|
-
exports.storesListConnectorMockHandlers = handlers$5;
|
|
13799
13688
|
exports.stringToBase64 = stringToBase64;
|
|
13800
13689
|
exports.swapArrayItems = swapArrayItems;
|
|
13801
13690
|
exports.transformAllToProperNounCase = transformAllToProperNounCase;
|
|
@@ -13827,7 +13716,6 @@ exports.useStoreKeysInDataFences = useStoreKeysInDataFences;
|
|
|
13827
13716
|
exports.useStoresListFetcher = useStoresListFetcher;
|
|
13828
13717
|
exports.useTaxCategoriesPlatformLimits = useTaxCategoriesLimits;
|
|
13829
13718
|
exports.useTotalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher;
|
|
13830
|
-
exports.useTotalNumberOfStoresFetcherHandlers = handlers$2;
|
|
13831
13719
|
exports.validateCustomField = validateFilter$2;
|
|
13832
13720
|
exports.validateCustomFields = validations;
|
|
13833
13721
|
exports.validateDate = validateFilter$1;
|