@commercetools-frontend/experimental-components 6.2.1 → 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 +9 -154
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +9 -154
- package/dist/commercetools-frontend-experimental-components.esm.js +13 -151
- package/dist/styles.css +18 -18
- package/package.json +22 -15
- 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);
|
|
@@ -1770,42 +1769,6 @@ const useIsFieldDuplicated = () => {
|
|
|
1770
1769
|
};
|
|
1771
1770
|
};
|
|
1772
1771
|
|
|
1773
|
-
const graphqlQueries = {
|
|
1774
|
-
ASSOCIATE_ROLE: 'associateRoles',
|
|
1775
|
-
ATTRIBUTE_GROUP: 'attributeGroups',
|
|
1776
|
-
BUSINESS_UNIT: 'businessUnits',
|
|
1777
|
-
CART: 'carts',
|
|
1778
|
-
CART_DISCOUNT: 'cartDiscounts',
|
|
1779
|
-
CATEGORY: 'categories',
|
|
1780
|
-
CHANNEL: 'channels',
|
|
1781
|
-
CUSTOMER: 'customers',
|
|
1782
|
-
CUSTOMER_GROUP: 'customerGroups',
|
|
1783
|
-
DISCOUNT_CODE: 'discountCodes',
|
|
1784
|
-
INVENTORY_ENTRY: 'inventoryEntries',
|
|
1785
|
-
ORDER: 'orders',
|
|
1786
|
-
PAYMENT: 'payments',
|
|
1787
|
-
PRODUCT: 'products',
|
|
1788
|
-
PRODUCT_DISCOUNT: 'productDiscounts',
|
|
1789
|
-
PRODUCT_SELECTION: 'productSelections',
|
|
1790
|
-
PRODUCT_TYPE: 'productTypes',
|
|
1791
|
-
SHIPPING_METHOD: 'shippingMethods',
|
|
1792
|
-
STORE: 'stores',
|
|
1793
|
-
TAX_CATEGORY: 'taxCategories',
|
|
1794
|
-
ZONE: 'zones'
|
|
1795
|
-
};
|
|
1796
|
-
const handlers$6 = {
|
|
1797
|
-
DuplicatedField: {
|
|
1798
|
-
total: (total, resourceType) => msw.graphql.query('FetchResourceTypeDuplicatedField', (req, res, ctx) => {
|
|
1799
|
-
if (!graphqlQueries[resourceType]) return res(ctx.data({}));
|
|
1800
|
-
return res(ctx.data({
|
|
1801
|
-
[graphqlQueries[resourceType]]: {
|
|
1802
|
-
total
|
|
1803
|
-
}
|
|
1804
|
-
}));
|
|
1805
|
-
})
|
|
1806
|
-
}
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
1772
|
const usePrevious = value => {
|
|
1810
1773
|
const ref = React.useRef();
|
|
1811
1774
|
React.useEffect(() => {
|
|
@@ -1881,59 +1844,6 @@ const useStoresListFetcher = props => {
|
|
|
1881
1844
|
};
|
|
1882
1845
|
};
|
|
1883
1846
|
|
|
1884
|
-
const extractKeysFromWherePredicateClause = function () {
|
|
1885
|
-
let whereClause = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1886
|
-
return whereClause.substring(_lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '("') + 1, _lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '")')).replace(/["]/g, '').split(', ');
|
|
1887
|
-
};
|
|
1888
|
-
const handlers$5 = {
|
|
1889
|
-
StoresList: {
|
|
1890
|
-
all: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1891
|
-
// GIVEN req.variables.where is specified
|
|
1892
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1893
|
-
// ELSE return all the stores (without filtering any)
|
|
1894
|
-
if (req.variables.where) {
|
|
1895
|
-
var _context;
|
|
1896
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1897
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context = stores.results).call(_context, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1898
|
-
return res(ctx.data({
|
|
1899
|
-
stores: {
|
|
1900
|
-
offset: 0,
|
|
1901
|
-
total: filteredStoreResults.length,
|
|
1902
|
-
count: filteredStoreResults.length,
|
|
1903
|
-
results: filteredStoreResults,
|
|
1904
|
-
__typename: 'StoresQueryResult'
|
|
1905
|
-
}
|
|
1906
|
-
}));
|
|
1907
|
-
}
|
|
1908
|
-
return res(ctx.data({
|
|
1909
|
-
stores
|
|
1910
|
-
}));
|
|
1911
|
-
}),
|
|
1912
|
-
withProductSelections: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
|
|
1913
|
-
// GIVEN req.variables.where is specified
|
|
1914
|
-
// THEN return only stores that are being requested (filtering stores based on IDs)
|
|
1915
|
-
// ELSE return all the stores (without filtering any)
|
|
1916
|
-
if (req.variables.where) {
|
|
1917
|
-
var _context2;
|
|
1918
|
-
const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
|
|
1919
|
-
const filteredStoreResults = _filterInstanceProperty__default["default"](_context2 = stores.results).call(_context2, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
|
|
1920
|
-
return res(ctx.data({
|
|
1921
|
-
stores: {
|
|
1922
|
-
offset: 0,
|
|
1923
|
-
total: filteredStoreResults.length,
|
|
1924
|
-
count: filteredStoreResults.length,
|
|
1925
|
-
results: filteredStoreResults,
|
|
1926
|
-
__typename: 'StoresQueryResult'
|
|
1927
|
-
}
|
|
1928
|
-
}));
|
|
1929
|
-
}
|
|
1930
|
-
return res(ctx.data({
|
|
1931
|
-
stores
|
|
1932
|
-
}));
|
|
1933
|
-
})
|
|
1934
|
-
}
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
1847
|
const toPermission = (permission, resourceName) => camelCase__default["default"](`can ${permission} ${resourceName}`);
|
|
1938
1848
|
const createPermissionsComposePath = permission =>
|
|
1939
1849
|
// e.g applicationContext.permissions?.canViewOrders
|
|
@@ -2387,17 +2297,6 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2387
2297
|
};
|
|
2388
2298
|
};
|
|
2389
2299
|
|
|
2390
|
-
const handlers$4 = {
|
|
2391
|
-
ProductSelections: {
|
|
2392
|
-
total: total => msw.graphql.query('FetchProductSelectionsTotal', (req, res, ctx) => res(ctx.data({
|
|
2393
|
-
productSelections: {
|
|
2394
|
-
total,
|
|
2395
|
-
__typename: 'ProductSelectionQueryResult'
|
|
2396
|
-
}
|
|
2397
|
-
})))
|
|
2398
|
-
}
|
|
2399
|
-
};
|
|
2400
|
-
|
|
2401
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; }
|
|
2402
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; }
|
|
2403
2302
|
|
|
@@ -2446,14 +2345,6 @@ const useProductSelectionsFetcher = props => {
|
|
|
2446
2345
|
};
|
|
2447
2346
|
};
|
|
2448
2347
|
|
|
2449
|
-
const handlers$3 = {
|
|
2450
|
-
ProductSelections: {
|
|
2451
|
-
all: productSelections => msw.graphql.query('FetchProductSelections', (req, res, ctx) => res(ctx.data({
|
|
2452
|
-
productSelections
|
|
2453
|
-
})))
|
|
2454
|
-
}
|
|
2455
|
-
};
|
|
2456
|
-
|
|
2457
2348
|
const setToArray = function () {
|
|
2458
2349
|
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
2459
2350
|
return `id in (${_mapInstanceProperty__default["default"](values).call(values, value => `"${value}"`).join(', ')})`;
|
|
@@ -6444,7 +6335,7 @@ const convertTypeValuesToOptions$1 = reselect.defaultMemoize(typeValues => _mapI
|
|
|
6444
6335
|
function CustomEnumInput(props) {
|
|
6445
6336
|
const options = convertTypeValuesToOptions$1(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
|
|
6446
6337
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6447
|
-
props.setFieldValue(props.name, rawValue);
|
|
6338
|
+
props.setFieldValue(props.name, !rawValue ? undefined : rawValue);
|
|
6448
6339
|
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6449
6340
|
});
|
|
6450
6341
|
const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
|
|
@@ -6660,7 +6551,7 @@ function CustomMoneyInput(props) {
|
|
|
6660
6551
|
CustomMoneyInput.displayName = 'CustomMoneyInput';
|
|
6661
6552
|
|
|
6662
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; }
|
|
6663
|
-
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; }
|
|
6664
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 } } } };
|
|
6665
6556
|
const mapAttributeDefinition = definition => {
|
|
6666
6557
|
var _context, _context2, _context3, _context4;
|
|
@@ -6699,15 +6590,14 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6699
6590
|
loading = _useQuery.loading,
|
|
6700
6591
|
error = _useQuery.error;
|
|
6701
6592
|
if (!loading && !error) {
|
|
6702
|
-
|
|
6703
|
-
const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6593
|
+
const attributeDefinitions = data.productType?.attributeDefinitions.results.map(mapAttributeDefinition);
|
|
6704
6594
|
return {
|
|
6705
6595
|
loading: false,
|
|
6706
6596
|
error: false,
|
|
6707
|
-
productType: {
|
|
6597
|
+
productType: data.productType ? {
|
|
6708
6598
|
name: data.productType.name,
|
|
6709
6599
|
attributeDefinitions
|
|
6710
|
-
}
|
|
6600
|
+
} : null
|
|
6711
6601
|
};
|
|
6712
6602
|
}
|
|
6713
6603
|
return {
|
|
@@ -8964,18 +8854,6 @@ const useTotalNumberOfStoresFetcher = projectKey => {
|
|
|
8964
8854
|
};
|
|
8965
8855
|
};
|
|
8966
8856
|
|
|
8967
|
-
const handlers$2 = {
|
|
8968
|
-
TotalNumberOfStores: {
|
|
8969
|
-
all: total => msw.graphql.query('TotalNumberOfStores', (req, res, ctx) => {
|
|
8970
|
-
return res(ctx.data({
|
|
8971
|
-
totalNumberOfStores: {
|
|
8972
|
-
total
|
|
8973
|
-
}
|
|
8974
|
-
}));
|
|
8975
|
-
})
|
|
8976
|
-
}
|
|
8977
|
-
};
|
|
8978
|
-
|
|
8979
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 } } } };
|
|
8980
8858
|
const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => ({
|
|
8981
8859
|
where: `${predicateField} in (${_mapInstanceProperty__default["default"](stores).call(stores, store => `"${store}"`).join(', ')})`,
|
|
@@ -9660,14 +9538,6 @@ var customFieldDefinitionsConnector = flowRight__default["default"](hoc.graphql(
|
|
|
9660
9538
|
props: mapDataToProps
|
|
9661
9539
|
}))(CustomFieldDefinitionsConnector);
|
|
9662
9540
|
|
|
9663
|
-
const handlers$1 = {
|
|
9664
|
-
TypeDefinitions: {
|
|
9665
|
-
all: typeDefinitions => msw.graphql.query('FetchTypeDefinitionsQuery', (req, res, ctx) => res(ctx.data({
|
|
9666
|
-
typeDefinitions
|
|
9667
|
-
})))
|
|
9668
|
-
}
|
|
9669
|
-
};
|
|
9670
|
-
|
|
9671
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; }
|
|
9672
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; }
|
|
9673
9543
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
@@ -11939,14 +11809,6 @@ const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
|
11939
11809
|
return WithCustomerGroupsPlatformLimits;
|
|
11940
11810
|
};
|
|
11941
11811
|
|
|
11942
|
-
const handlers = {
|
|
11943
|
-
PlatformLimits: {
|
|
11944
|
-
all: platformLimiits => msw.graphql.query('PlatformLimitsFetcherQuery', (req, res, ctx) => res(ctx.data({
|
|
11945
|
-
limits: platformLimiits
|
|
11946
|
-
})))
|
|
11947
|
-
}
|
|
11948
|
-
};
|
|
11949
|
-
|
|
11950
11812
|
var messages$8 = reactIntl.defineMessages({
|
|
11951
11813
|
yes: {
|
|
11952
11814
|
id: 'BooleanField.yes',
|
|
@@ -13750,7 +13612,6 @@ exports.createGraphQlUpdateActions = createGraphQlUpdateActions;
|
|
|
13750
13612
|
exports.createNextSortDefinition = createNextSortDefinition;
|
|
13751
13613
|
exports.createReducer = createReducer;
|
|
13752
13614
|
exports.createResourceReducer = createResourceReducer;
|
|
13753
|
-
exports.customFieldDefinitionsMockHanders = handlers$1;
|
|
13754
13615
|
exports.customFieldsTransformer = customFields;
|
|
13755
13616
|
exports.dateTransformer = dateTransformer$1;
|
|
13756
13617
|
exports.exact = exact;
|
|
@@ -13814,7 +13675,6 @@ exports.injectToggleState = injectModalState;
|
|
|
13814
13675
|
exports.injectZonesPlatformLimits = injectZonesPlatformLimits;
|
|
13815
13676
|
exports.isEmpty = isEmptyFilter;
|
|
13816
13677
|
exports.isEmptyValue = isEmptyValue;
|
|
13817
|
-
exports.isFieldDuplicatedMockHandlers = handlers$6;
|
|
13818
13678
|
exports.isUUID = isUUID;
|
|
13819
13679
|
exports.isValidISODate = isValidISODate;
|
|
13820
13680
|
exports.isValidISODateTime = isValidISODateTime;
|
|
@@ -13831,9 +13691,6 @@ exports.omitDeep = omitDeep;
|
|
|
13831
13691
|
exports.omitSetsOfSets = omitSetsOfSets;
|
|
13832
13692
|
exports.or = or;
|
|
13833
13693
|
exports.pickerMessages = pickerMessages$1;
|
|
13834
|
-
exports.platformLimitsMockHandlers = handlers;
|
|
13835
|
-
exports.productSelectionsFetcherMockHandler = handlers$3;
|
|
13836
|
-
exports.productSelectionsTotalFetcherMockHandler = handlers$4;
|
|
13837
13694
|
exports.range = range;
|
|
13838
13695
|
exports.reorderArrayItems = reorderArrayItems;
|
|
13839
13696
|
exports.resolveStatusType = resolveStatusType;
|
|
@@ -13849,7 +13706,6 @@ exports.slugify = slugify;
|
|
|
13849
13706
|
exports.sortDataByIdsArray = sortDataByIdsArray;
|
|
13850
13707
|
exports.sortRequiresLanguage = sortRequiresLanguage;
|
|
13851
13708
|
exports.splitVariantAttributesByConstraint = splitVariantAttributesByConstraint;
|
|
13852
|
-
exports.storesListConnectorMockHandlers = handlers$5;
|
|
13853
13709
|
exports.stringToBase64 = stringToBase64;
|
|
13854
13710
|
exports.swapArrayItems = swapArrayItems;
|
|
13855
13711
|
exports.transformAllToProperNounCase = transformAllToProperNounCase;
|
|
@@ -13881,7 +13737,6 @@ exports.useStoreKeysInDataFences = useStoreKeysInDataFences;
|
|
|
13881
13737
|
exports.useStoresListFetcher = useStoresListFetcher;
|
|
13882
13738
|
exports.useTaxCategoriesPlatformLimits = useTaxCategoriesLimits;
|
|
13883
13739
|
exports.useTotalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher;
|
|
13884
|
-
exports.useTotalNumberOfStoresFetcherHandlers = handlers$2;
|
|
13885
13740
|
exports.validateCustomField = validateFilter$2;
|
|
13886
13741
|
exports.validateCustomFields = validations;
|
|
13887
13742
|
exports.validateDate = validateFilter$1;
|