@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.
@@ -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);
@@ -1769,42 +1768,6 @@ const useIsFieldDuplicated = () => {
1769
1768
  };
1770
1769
  };
1771
1770
 
1772
- const graphqlQueries = {
1773
- ASSOCIATE_ROLE: 'associateRoles',
1774
- ATTRIBUTE_GROUP: 'attributeGroups',
1775
- BUSINESS_UNIT: 'businessUnits',
1776
- CART: 'carts',
1777
- CART_DISCOUNT: 'cartDiscounts',
1778
- CATEGORY: 'categories',
1779
- CHANNEL: 'channels',
1780
- CUSTOMER: 'customers',
1781
- CUSTOMER_GROUP: 'customerGroups',
1782
- DISCOUNT_CODE: 'discountCodes',
1783
- INVENTORY_ENTRY: 'inventoryEntries',
1784
- ORDER: 'orders',
1785
- PAYMENT: 'payments',
1786
- PRODUCT: 'products',
1787
- PRODUCT_DISCOUNT: 'productDiscounts',
1788
- PRODUCT_SELECTION: 'productSelections',
1789
- PRODUCT_TYPE: 'productTypes',
1790
- SHIPPING_METHOD: 'shippingMethods',
1791
- STORE: 'stores',
1792
- TAX_CATEGORY: 'taxCategories',
1793
- ZONE: 'zones'
1794
- };
1795
- const handlers$6 = {
1796
- DuplicatedField: {
1797
- total: (total, resourceType) => msw.graphql.query('FetchResourceTypeDuplicatedField', (req, res, ctx) => {
1798
- if (!graphqlQueries[resourceType]) return res(ctx.data({}));
1799
- return res(ctx.data({
1800
- [graphqlQueries[resourceType]]: {
1801
- total
1802
- }
1803
- }));
1804
- })
1805
- }
1806
- };
1807
-
1808
1771
  const usePrevious = value => {
1809
1772
  const ref = React.useRef();
1810
1773
  React.useEffect(() => {
@@ -1880,59 +1843,6 @@ const useStoresListFetcher = props => {
1880
1843
  };
1881
1844
  };
1882
1845
 
1883
- const extractKeysFromWherePredicateClause = function () {
1884
- let whereClause = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1885
- return whereClause.substring(_lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '("') + 1, _lastIndexOfInstanceProperty__default["default"](whereClause).call(whereClause, '")')).replace(/["]/g, '').split(', ');
1886
- };
1887
- const handlers$5 = {
1888
- StoresList: {
1889
- all: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
1890
- // GIVEN req.variables.where is specified
1891
- // THEN return only stores that are being requested (filtering stores based on IDs)
1892
- // ELSE return all the stores (without filtering any)
1893
- if (req.variables.where) {
1894
- var _context;
1895
- const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
1896
- const filteredStoreResults = _filterInstanceProperty__default["default"](_context = stores.results).call(_context, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
1897
- return res(ctx.data({
1898
- stores: {
1899
- offset: 0,
1900
- total: filteredStoreResults.length,
1901
- count: filteredStoreResults.length,
1902
- results: filteredStoreResults,
1903
- __typename: 'StoresQueryResult'
1904
- }
1905
- }));
1906
- }
1907
- return res(ctx.data({
1908
- stores
1909
- }));
1910
- }),
1911
- withProductSelections: stores => msw.graphql.query('FetchStoresQuery', (req, res, ctx) => {
1912
- // GIVEN req.variables.where is specified
1913
- // THEN return only stores that are being requested (filtering stores based on IDs)
1914
- // ELSE return all the stores (without filtering any)
1915
- if (req.variables.where) {
1916
- var _context2;
1917
- const requestedStoreKeys = extractKeysFromWherePredicateClause(req.variables.where);
1918
- const filteredStoreResults = _filterInstanceProperty__default["default"](_context2 = stores.results).call(_context2, store => _includesInstanceProperty__default["default"](requestedStoreKeys).call(requestedStoreKeys, store.key));
1919
- return res(ctx.data({
1920
- stores: {
1921
- offset: 0,
1922
- total: filteredStoreResults.length,
1923
- count: filteredStoreResults.length,
1924
- results: filteredStoreResults,
1925
- __typename: 'StoresQueryResult'
1926
- }
1927
- }));
1928
- }
1929
- return res(ctx.data({
1930
- stores
1931
- }));
1932
- })
1933
- }
1934
- };
1935
-
1936
1846
  const toPermission = (permission, resourceName) => camelCase__default["default"](`can ${permission} ${resourceName}`);
1937
1847
  const createPermissionsComposePath = permission =>
1938
1848
  // e.g applicationContext.permissions?.canViewOrders
@@ -2386,17 +2296,6 @@ const useProductSelectionsTotalFetcher = props => {
2386
2296
  };
2387
2297
  };
2388
2298
 
2389
- const handlers$4 = {
2390
- ProductSelections: {
2391
- total: total => msw.graphql.query('FetchProductSelectionsTotal', (req, res, ctx) => res(ctx.data({
2392
- productSelections: {
2393
- total,
2394
- __typename: 'ProductSelectionQueryResult'
2395
- }
2396
- })))
2397
- }
2398
- };
2399
-
2400
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; }
2401
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; }
2402
2301
 
@@ -2445,14 +2344,6 @@ const useProductSelectionsFetcher = props => {
2445
2344
  };
2446
2345
  };
2447
2346
 
2448
- const handlers$3 = {
2449
- ProductSelections: {
2450
- all: productSelections => msw.graphql.query('FetchProductSelections', (req, res, ctx) => res(ctx.data({
2451
- productSelections
2452
- })))
2453
- }
2454
- };
2455
-
2456
2347
  const setToArray = function () {
2457
2348
  let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2458
2349
  return `id in (${_mapInstanceProperty__default["default"](values).call(values, value => `"${value}"`).join(', ')})`;
@@ -6443,7 +6334,7 @@ const convertTypeValuesToOptions$1 = reselect.defaultMemoize(typeValues => _mapI
6443
6334
  function CustomEnumInput(props) {
6444
6335
  const options = convertTypeValuesToOptions$1(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
6445
6336
  const handleChange = makeChangeHandler(rawValue => {
6446
- props.setFieldValue(props.name, rawValue);
6337
+ props.setFieldValue(props.name, !rawValue ? undefined : rawValue);
6447
6338
  props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6448
6339
  });
6449
6340
  const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
@@ -6659,7 +6550,7 @@ function CustomMoneyInput(props) {
6659
6550
  CustomMoneyInput.displayName = 'CustomMoneyInput';
6660
6551
 
6661
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; }
6662
- function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$R(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$R(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
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; }
6663
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 } } } };
6664
6555
  const mapAttributeDefinition = definition => {
6665
6556
  var _context, _context2, _context3, _context4;
@@ -6698,15 +6589,14 @@ function useNestedProductType(fieldDefinition) {
6698
6589
  loading = _useQuery.loading,
6699
6590
  error = _useQuery.error;
6700
6591
  if (!loading && !error) {
6701
- var _context5;
6702
- const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
6592
+ const attributeDefinitions = data.productType?.attributeDefinitions.results.map(mapAttributeDefinition);
6703
6593
  return {
6704
6594
  loading: false,
6705
6595
  error: false,
6706
- productType: {
6596
+ productType: data.productType ? {
6707
6597
  name: data.productType.name,
6708
6598
  attributeDefinitions
6709
- }
6599
+ } : null
6710
6600
  };
6711
6601
  }
6712
6602
  return {
@@ -8951,18 +8841,6 @@ const useTotalNumberOfStoresFetcher = projectKey => {
8951
8841
  };
8952
8842
  };
8953
8843
 
8954
- const handlers$2 = {
8955
- TotalNumberOfStores: {
8956
- all: total => msw.graphql.query('TotalNumberOfStores', (req, res, ctx) => {
8957
- return res(ctx.data({
8958
- totalNumberOfStores: {
8959
- total
8960
- }
8961
- }));
8962
- })
8963
- }
8964
- };
8965
-
8966
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 } } } };
8967
8845
  const createQueryVariables$2 = (stores, predicateField, shouldFetchProductSelections) => ({
8968
8846
  where: `${predicateField} in (${_mapInstanceProperty__default["default"](stores).call(stores, store => `"${store}"`).join(', ')})`,
@@ -9639,14 +9517,6 @@ var customFieldDefinitionsConnector = flowRight__default["default"](hoc.graphql(
9639
9517
  props: mapDataToProps
9640
9518
  }))(CustomFieldDefinitionsConnector);
9641
9519
 
9642
- const handlers$1 = {
9643
- TypeDefinitions: {
9644
- all: typeDefinitions => msw.graphql.query('FetchTypeDefinitionsQuery', (req, res, ctx) => res(ctx.data({
9645
- typeDefinitions
9646
- })))
9647
- }
9648
- };
9649
-
9650
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; }
9651
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; }
9652
9522
  const restDocToForm = customFieldsFromRestResponse => {
@@ -11918,14 +11788,6 @@ const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
11918
11788
  return WithCustomerGroupsPlatformLimits;
11919
11789
  };
11920
11790
 
11921
- const handlers = {
11922
- PlatformLimits: {
11923
- all: platformLimiits => msw.graphql.query('PlatformLimitsFetcherQuery', (req, res, ctx) => res(ctx.data({
11924
- limits: platformLimiits
11925
- })))
11926
- }
11927
- };
11928
-
11929
11791
  var messages$8 = reactIntl.defineMessages({
11930
11792
  yes: {
11931
11793
  id: 'BooleanField.yes',
@@ -13729,7 +13591,6 @@ exports.createGraphQlUpdateActions = createGraphQlUpdateActions;
13729
13591
  exports.createNextSortDefinition = createNextSortDefinition;
13730
13592
  exports.createReducer = createReducer;
13731
13593
  exports.createResourceReducer = createResourceReducer;
13732
- exports.customFieldDefinitionsMockHanders = handlers$1;
13733
13594
  exports.customFieldsTransformer = customFields;
13734
13595
  exports.dateTransformer = dateTransformer$1;
13735
13596
  exports.exact = exact;
@@ -13793,7 +13654,6 @@ exports.injectToggleState = injectModalState;
13793
13654
  exports.injectZonesPlatformLimits = injectZonesPlatformLimits;
13794
13655
  exports.isEmpty = isEmptyFilter;
13795
13656
  exports.isEmptyValue = isEmptyValue;
13796
- exports.isFieldDuplicatedMockHandlers = handlers$6;
13797
13657
  exports.isUUID = isUUID;
13798
13658
  exports.isValidISODate = isValidISODate;
13799
13659
  exports.isValidISODateTime = isValidISODateTime;
@@ -13810,9 +13670,6 @@ exports.omitDeep = omitDeep;
13810
13670
  exports.omitSetsOfSets = omitSetsOfSets;
13811
13671
  exports.or = or;
13812
13672
  exports.pickerMessages = pickerMessages$1;
13813
- exports.platformLimitsMockHandlers = handlers;
13814
- exports.productSelectionsFetcherMockHandler = handlers$3;
13815
- exports.productSelectionsTotalFetcherMockHandler = handlers$4;
13816
13673
  exports.range = range;
13817
13674
  exports.reorderArrayItems = reorderArrayItems;
13818
13675
  exports.resolveStatusType = resolveStatusType;
@@ -13828,7 +13685,6 @@ exports.slugify = slugify;
13828
13685
  exports.sortDataByIdsArray = sortDataByIdsArray;
13829
13686
  exports.sortRequiresLanguage = sortRequiresLanguage;
13830
13687
  exports.splitVariantAttributesByConstraint = splitVariantAttributesByConstraint;
13831
- exports.storesListConnectorMockHandlers = handlers$5;
13832
13688
  exports.stringToBase64 = stringToBase64;
13833
13689
  exports.swapArrayItems = swapArrayItems;
13834
13690
  exports.transformAllToProperNounCase = transformAllToProperNounCase;
@@ -13860,7 +13716,6 @@ exports.useStoreKeysInDataFences = useStoreKeysInDataFences;
13860
13716
  exports.useStoresListFetcher = useStoresListFetcher;
13861
13717
  exports.useTaxCategoriesPlatformLimits = useTaxCategoriesLimits;
13862
13718
  exports.useTotalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher;
13863
- exports.useTotalNumberOfStoresFetcherHandlers = handlers$2;
13864
13719
  exports.validateCustomField = validateFilter$2;
13865
13720
  exports.validateCustomFields = validations;
13866
13721
  exports.validateDate = validateFilter$1;