@commercetools-frontend/experimental-components 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -196,7 +196,7 @@ var compact__default = /*#__PURE__*/_interopDefault(compact);
|
|
|
196
196
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
197
197
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
198
198
|
|
|
199
|
-
var styles$
|
|
199
|
+
var styles$k = {
|
|
200
200
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
201
201
|
};
|
|
202
202
|
/**
|
|
@@ -204,7 +204,7 @@ var styles$j = {
|
|
|
204
204
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
205
205
|
*/
|
|
206
206
|
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
207
|
-
className: styles$
|
|
207
|
+
className: styles$k['loading-container'],
|
|
208
208
|
"data-testid": "centered-loading-spinner",
|
|
209
209
|
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
210
210
|
});
|
|
@@ -246,6 +246,7 @@ const INTERVALS_IN_SECONDS = {
|
|
|
246
246
|
[REMINDER_OPTION_10_DAY]: 864000
|
|
247
247
|
};
|
|
248
248
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
249
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
|
|
249
250
|
|
|
250
251
|
// TODO: apply a more robust solution to overlaying issues
|
|
251
252
|
const Z_INDEX_DROPDOWN = 30000;
|
|
@@ -1070,7 +1071,7 @@ function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
|
|
|
1070
1071
|
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1071
1072
|
function _callSuper$7(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1072
1073
|
function _isNativeReflectConstruct$7() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$7 = function () { return !!t; })(); }
|
|
1073
|
-
var styles$
|
|
1074
|
+
var styles$j = {
|
|
1074
1075
|
"size": "throttled-field-module__size___324jx",
|
|
1075
1076
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
1076
1077
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -1179,9 +1180,9 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1179
1180
|
})
|
|
1180
1181
|
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1l(_objectSpread$1l({}, commonProps), {}, {
|
|
1181
1182
|
id: inputId,
|
|
1182
|
-
className: classnames__default["default"](styles$
|
|
1183
|
-
[styles$
|
|
1184
|
-
[styles$
|
|
1183
|
+
className: classnames__default["default"](styles$j.textarea, styles$j[`textarea-${this.props.style}`], {
|
|
1184
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1185
|
+
[styles$j.disabled]: this.props.disabled
|
|
1185
1186
|
}),
|
|
1186
1187
|
rows: 1,
|
|
1187
1188
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
@@ -1190,10 +1191,10 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
1190
1191
|
id: inputId,
|
|
1191
1192
|
ref: this.props.inputRef,
|
|
1192
1193
|
type: this.props.as,
|
|
1193
|
-
className: classnames__default["default"](styles$
|
|
1194
|
-
[styles$
|
|
1195
|
-
[styles$
|
|
1196
|
-
[styles$
|
|
1194
|
+
className: classnames__default["default"](styles$j[`input-${this.props.style}`], {
|
|
1195
|
+
[styles$j.invalid]: !this.props.isValid,
|
|
1196
|
+
[styles$j.disabled]: this.props.disabled,
|
|
1197
|
+
[styles$j.granular]: this.props.isGranular
|
|
1197
1198
|
})
|
|
1198
1199
|
}))]
|
|
1199
1200
|
});
|
|
@@ -1238,7 +1239,7 @@ var messages$G = reactIntl.defineMessages({
|
|
|
1238
1239
|
|
|
1239
1240
|
function _callSuper$6(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1240
1241
|
function _isNativeReflectConstruct$6() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$6 = function () { return !!t; })(); }
|
|
1241
|
-
var styles$
|
|
1242
|
+
var styles$i = {
|
|
1242
1243
|
"block": "search-input-module__block___1uM-y",
|
|
1243
1244
|
"container": "search-input-module__container___9u6if",
|
|
1244
1245
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -1313,14 +1314,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1313
1314
|
key: "render",
|
|
1314
1315
|
value: function render() {
|
|
1315
1316
|
return jsxRuntime.jsx("div", {
|
|
1316
|
-
className: classnames__default["default"](this.props.blockClassName, styles$
|
|
1317
|
+
className: classnames__default["default"](this.props.blockClassName, styles$i.block),
|
|
1317
1318
|
children: jsxRuntime.jsxs("div", {
|
|
1318
|
-
className: classnames__default["default"](this.props.containerClassName, styles$
|
|
1319
|
+
className: classnames__default["default"](this.props.containerClassName, styles$i.container),
|
|
1319
1320
|
children: [jsxRuntime.jsx("div", {
|
|
1320
|
-
className: classnames__default["default"](styles$
|
|
1321
|
-
[styles$
|
|
1322
|
-
[styles$
|
|
1323
|
-
[styles$
|
|
1321
|
+
className: classnames__default["default"](styles$i['input-container'], {
|
|
1322
|
+
[styles$i['input-container-hoverable']]: !this.props.disabled,
|
|
1323
|
+
[styles$i['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
1324
|
+
[styles$i['input-container-granular']]: this.props.isGranular
|
|
1324
1325
|
}),
|
|
1325
1326
|
children: jsxRuntime.jsx(ThrottledField, {
|
|
1326
1327
|
style: "primary",
|
|
@@ -1338,8 +1339,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1338
1339
|
isGranular: this.props.isGranular
|
|
1339
1340
|
})
|
|
1340
1341
|
}), this.state.text && jsxRuntime.jsx(uiKit.SecondaryIconButton, {
|
|
1341
|
-
className: classnames__default["default"](styles$
|
|
1342
|
-
[styles$
|
|
1342
|
+
className: classnames__default["default"](styles$i['clear-icon-container'], {
|
|
1343
|
+
[styles$i['clear-icon-container-granular']]: this.props.isGranular
|
|
1343
1344
|
}),
|
|
1344
1345
|
icon: jsxRuntime.jsx(uiKit.CloseIcon, {}),
|
|
1345
1346
|
size: "30",
|
|
@@ -1347,9 +1348,9 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1347
1348
|
onClick: this.handleClear
|
|
1348
1349
|
}), jsxRuntime.jsx("div", {
|
|
1349
1350
|
"data-testid": "search-button",
|
|
1350
|
-
className: classnames__default["default"](styles$
|
|
1351
|
-
[styles$
|
|
1352
|
-
[styles$
|
|
1351
|
+
className: classnames__default["default"](styles$i['search-icon-container'], {
|
|
1352
|
+
[styles$i['search-icon-container-hoverable']]: !this.props.disabled,
|
|
1353
|
+
[styles$i['search-icon-container-granular']]: this.props.isGranular
|
|
1353
1354
|
}),
|
|
1354
1355
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
1355
1356
|
label: "search-button",
|
|
@@ -2596,10 +2597,10 @@ function defaultFilterValidator$1(_ref2) {
|
|
|
2596
2597
|
return true;
|
|
2597
2598
|
}
|
|
2598
2599
|
|
|
2599
|
-
var localizedTextTransformer =
|
|
2600
|
+
var localizedTextTransformer = localizedString => {
|
|
2600
2601
|
var _context;
|
|
2601
2602
|
return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
|
|
2602
|
-
}
|
|
2603
|
+
};
|
|
2603
2604
|
|
|
2604
2605
|
const getCentAmountClause = (value, operator, locale) => `centAmount ${operator} ${uiKit.MoneyInput.convertToMoneyValue(value, locale).centAmount}`;
|
|
2605
2606
|
function moneyTransformer(value, option, locale) {
|
|
@@ -5268,7 +5269,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5268
5269
|
}).then(response => response.data?.cartDiscount ? transformLocalizedFieldsForCartDiscount(response.data.cartDiscount) : null);
|
|
5269
5270
|
}
|
|
5270
5271
|
|
|
5271
|
-
var styles$
|
|
5272
|
+
var styles$h = {
|
|
5272
5273
|
"container": "reference-search-module__container___3-iK3",
|
|
5273
5274
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5274
5275
|
}; // This is a hashmap of loaded items used to map a value to an item
|
|
@@ -5375,9 +5376,9 @@ function ReferenceSearch(props) {
|
|
|
5375
5376
|
props.onChange(option);
|
|
5376
5377
|
};
|
|
5377
5378
|
return jsxRuntime.jsxs("div", {
|
|
5378
|
-
className: styles$
|
|
5379
|
+
className: styles$h.container,
|
|
5379
5380
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
5380
|
-
className: styles$
|
|
5381
|
+
className: styles$h['missing-label'],
|
|
5381
5382
|
children: props.referenceIsMissingLabel
|
|
5382
5383
|
}), jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5383
5384
|
title: tooltipTitle,
|
|
@@ -5697,7 +5698,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5697
5698
|
|
|
5698
5699
|
function ownKeys$Z(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5699
5700
|
function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Z(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Z(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5700
|
-
var styles$
|
|
5701
|
+
var styles$g = {
|
|
5701
5702
|
"button": "button-module__button___1OzVf",
|
|
5702
5703
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
5703
5704
|
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
@@ -5733,7 +5734,7 @@ const Button = props => {
|
|
|
5733
5734
|
return jsxRuntime.jsx("button", _objectSpread$Z(_objectSpread$Z({
|
|
5734
5735
|
onClick: isDisabled ? null : onClick,
|
|
5735
5736
|
type: props.type,
|
|
5736
|
-
className: classnames__default["default"](styles$
|
|
5737
|
+
className: classnames__default["default"](styles$g.button, isDisabled ? styles$g.disabled : null, className),
|
|
5737
5738
|
disabled: isDisabled,
|
|
5738
5739
|
"aria-label": props['aria-label']
|
|
5739
5740
|
}, dataProps), {}, {
|
|
@@ -5755,15 +5756,15 @@ var messages$z = reactIntl.defineMessages({
|
|
|
5755
5756
|
|
|
5756
5757
|
function ownKeys$Y(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5757
5758
|
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Y(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Y(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5758
|
-
var styles$
|
|
5759
|
+
var styles$f = {
|
|
5759
5760
|
"button": "file-input-module__button___2KypN",
|
|
5760
5761
|
"input": "file-input-module__input___3MP4D"
|
|
5761
5762
|
};
|
|
5762
5763
|
const FileInput = props => jsxRuntime.jsx("label", {
|
|
5763
5764
|
children: jsxRuntime.jsxs("span", {
|
|
5764
|
-
className: styles$
|
|
5765
|
+
className: styles$f.button,
|
|
5765
5766
|
children: [jsxRuntime.jsx("input", {
|
|
5766
|
-
className: styles$
|
|
5767
|
+
className: styles$f.input,
|
|
5767
5768
|
type: "file",
|
|
5768
5769
|
accept: props.acceptTypes,
|
|
5769
5770
|
name: props.name,
|
|
@@ -6016,7 +6017,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6016
6017
|
};
|
|
6017
6018
|
CustomerGroupPickerInput.displayName = 'CustomerGroupPickerInput';
|
|
6018
6019
|
|
|
6019
|
-
var styles$
|
|
6020
|
+
var styles$e = {
|
|
6020
6021
|
"divider": "divider-module__divider___4-vdy",
|
|
6021
6022
|
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
6022
6023
|
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
@@ -6029,10 +6030,10 @@ function Divider(_ref) {
|
|
|
6029
6030
|
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
6030
6031
|
return jsxRuntime.jsx("hr", {
|
|
6031
6032
|
className: classnames__default["default"]({
|
|
6032
|
-
[styles$
|
|
6033
|
-
[styles$
|
|
6034
|
-
[styles$
|
|
6035
|
-
[styles$
|
|
6033
|
+
[styles$e['divider-solid']]: !isDashed,
|
|
6034
|
+
[styles$e['divider-dashed']]: isDashed,
|
|
6035
|
+
[styles$e['divider-horizontal']]: orientation === 'horizontal',
|
|
6036
|
+
[styles$e['divider-vertical']]: orientation === 'vertical'
|
|
6036
6037
|
})
|
|
6037
6038
|
});
|
|
6038
6039
|
}
|
|
@@ -6176,7 +6177,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
|
|
|
6176
6177
|
}) : null;
|
|
6177
6178
|
ExpandButton.displayName = 'ExpandButton';
|
|
6178
6179
|
|
|
6179
|
-
var styles$
|
|
6180
|
+
var styles$d = {
|
|
6180
6181
|
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6181
6182
|
"gap": "set-buttons-module__gap___38Qr0"
|
|
6182
6183
|
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
@@ -6197,7 +6198,7 @@ const SetButtons = props => {
|
|
|
6197
6198
|
size: "big",
|
|
6198
6199
|
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
6199
6200
|
}) : jsxRuntime.jsx("div", {
|
|
6200
|
-
className: styles$
|
|
6201
|
+
className: styles$d.gap
|
|
6201
6202
|
})]
|
|
6202
6203
|
})
|
|
6203
6204
|
});
|
|
@@ -6567,7 +6568,7 @@ CustomLocalizedTextInput.displayName = 'CustomLocalizedTextInput';
|
|
|
6567
6568
|
|
|
6568
6569
|
function ownKeys$S(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6569
6570
|
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$S(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$S(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6570
|
-
var styles$
|
|
6571
|
+
var styles$c = {
|
|
6571
6572
|
"container": "custom-money-input-module__container___1fdO2"
|
|
6572
6573
|
};
|
|
6573
6574
|
const fixCurrencyCode = (value, currencies) => {
|
|
@@ -6632,7 +6633,7 @@ function CustomMoneyInput(props) {
|
|
|
6632
6633
|
|
|
6633
6634
|
// TODO(pa3): fix setting proper id in UIKit
|
|
6634
6635
|
return jsxRuntime.jsxs("div", {
|
|
6635
|
-
className: styles$
|
|
6636
|
+
className: styles$c.container,
|
|
6636
6637
|
"aria-labelledby": props.name,
|
|
6637
6638
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
6638
6639
|
children: jsxRuntime.jsx("label", {
|
|
@@ -7832,10 +7833,15 @@ const useDnDContext = () => {
|
|
|
7832
7833
|
const _excluded$1 = ["WrapperComponent"];
|
|
7833
7834
|
function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7834
7835
|
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; }
|
|
7836
|
+
const textAttributeTypes = ['text', 'ltext'];
|
|
7835
7837
|
const getFieldName = (parentName, fieldName) => {
|
|
7836
7838
|
if (!parentName) return fieldName;
|
|
7837
7839
|
return `${parentName}.${fieldName}`;
|
|
7838
7840
|
};
|
|
7841
|
+
const isTextAttribute = function () {
|
|
7842
|
+
let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7843
|
+
return _includesInstanceProperty__default["default"](textAttributeTypes).call(textAttributeTypes, fieldDefinitionType.name);
|
|
7844
|
+
};
|
|
7839
7845
|
const isNested = fieldDefinition => {
|
|
7840
7846
|
const type = fieldDefinition.type;
|
|
7841
7847
|
const typeName = type.name.toLowerCase();
|
|
@@ -7854,6 +7860,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7854
7860
|
values = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
7855
7861
|
handleBlur = _useFormikContext.handleBlur,
|
|
7856
7862
|
status = _useFormikContext.status;
|
|
7863
|
+
const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
|
|
7857
7864
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7858
7865
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7859
7866
|
const _useDnDContext = useDnDContext(),
|
|
@@ -7867,6 +7874,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7867
7874
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7868
7875
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7869
7876
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7877
|
+
const isFieldDisabled = props.isDisabled && !(isTextAttribute(fieldDefinition.type) && isTailoringAttributesEnabled);
|
|
7870
7878
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7871
7879
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7872
7880
|
|
|
@@ -7884,7 +7892,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7884
7892
|
name: fieldName,
|
|
7885
7893
|
value: value,
|
|
7886
7894
|
fieldDefinition: fieldDefinition,
|
|
7887
|
-
isDisabled:
|
|
7895
|
+
isDisabled: isFieldDisabled || isDnDMode,
|
|
7888
7896
|
isReadOnly: props.isReadOnly,
|
|
7889
7897
|
onBlur: handleBlur,
|
|
7890
7898
|
setFieldValue: props.setFieldValue,
|
|
@@ -7942,7 +7950,7 @@ const findLabel = (enumType, key) => {
|
|
|
7942
7950
|
};
|
|
7943
7951
|
const convertEnumValues = (value, attributeDefinition) => {
|
|
7944
7952
|
var _context2, _context3;
|
|
7945
|
-
if (
|
|
7953
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7946
7954
|
const typeName = getTypeName(attributeDefinition.type);
|
|
7947
7955
|
if (_includesInstanceProperty__default["default"](_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
7948
7956
|
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, _ref => {
|
|
@@ -7953,7 +7961,7 @@ const convertEnumValues = (value, attributeDefinition) => {
|
|
|
7953
7961
|
};
|
|
7954
7962
|
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
7955
7963
|
var _context4, _context5;
|
|
7956
|
-
if (
|
|
7964
|
+
if (isEmpty__default["default"](value)) return value;
|
|
7957
7965
|
if (!attributeDefinition) return value;
|
|
7958
7966
|
const type = attributeDefinition.type;
|
|
7959
7967
|
const typeName = getTypeName(type);
|
|
@@ -8526,7 +8534,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8526
8534
|
};
|
|
8527
8535
|
|
|
8528
8536
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
8529
|
-
var styles$
|
|
8537
|
+
var styles$b = {
|
|
8530
8538
|
"colored": "required-indicator-module__colored____YUFm",
|
|
8531
8539
|
"indicatorAsterisk": "required-indicator-module__indicatorAsterisk___3lEdX"
|
|
8532
8540
|
};
|
|
@@ -8534,8 +8542,8 @@ const RequiredIndicator = _ref => {
|
|
|
8534
8542
|
let uncolored = _ref.uncolored;
|
|
8535
8543
|
return jsxRuntime.jsx("em", {
|
|
8536
8544
|
className: classnames__default["default"]({
|
|
8537
|
-
[styles$
|
|
8538
|
-
[styles$
|
|
8545
|
+
[styles$b.colored]: !uncolored,
|
|
8546
|
+
[styles$b.indicatorAsterisk]: true
|
|
8539
8547
|
}),
|
|
8540
8548
|
children: '*'
|
|
8541
8549
|
});
|
|
@@ -8590,7 +8598,7 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8590
8598
|
}
|
|
8591
8599
|
});
|
|
8592
8600
|
|
|
8593
|
-
var styles$
|
|
8601
|
+
var styles$a = {
|
|
8594
8602
|
"container": "selectable-field-search-input-module__container___z2ltR",
|
|
8595
8603
|
"search-mode-menu": "selectable-field-search-input-module__search-mode-menu___Od6Le"
|
|
8596
8604
|
};
|
|
@@ -8601,7 +8609,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
8601
8609
|
setSearchText = _useState2[1];
|
|
8602
8610
|
const intl = reactIntl.useIntl();
|
|
8603
8611
|
return jsxRuntime.jsx("div", {
|
|
8604
|
-
className: styles$
|
|
8612
|
+
className: styles$a.container,
|
|
8605
8613
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
8606
8614
|
menuHorizontalConstraint: 5,
|
|
8607
8615
|
options: props.options,
|
|
@@ -8998,7 +9006,7 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8998
9006
|
function ownKeys$C(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8999
9007
|
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$C(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$C(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
9000
9008
|
var FetchStoresByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByWherePredicate" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 525, source: { body: "query FetchStoresByWherePredicate(\n $where: String!\n $skipFetchingStores: Boolean!\n $excludeProductSelections: Boolean!\n) {\n storesByWherePredicate: stores(where: $where) @skip(if: $skipFetchingStores) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9001
|
-
var styles$
|
|
9009
|
+
var styles$9 = {
|
|
9002
9010
|
"renderLabelContainer": "stores-search-selector-module__renderLabelContainer___3_PBc",
|
|
9003
9011
|
"customLabel": "stores-search-selector-module__customLabel___1Xse8"
|
|
9004
9012
|
}; // check wether there are any errors
|
|
@@ -9112,9 +9120,9 @@ const StoresSearchSelectInput = props => {
|
|
|
9112
9120
|
const renderNoOptions = _ref4 => {
|
|
9113
9121
|
let inputValue = _ref4.inputValue;
|
|
9114
9122
|
return jsxRuntime.jsxs("div", {
|
|
9115
|
-
className: styles$
|
|
9123
|
+
className: styles$9.renderLabelContainer,
|
|
9116
9124
|
children: [jsxRuntime.jsx("div", {
|
|
9117
|
-
className: styles$
|
|
9125
|
+
className: styles$9.customLabel,
|
|
9118
9126
|
children: props?.renderLabel && props?.renderLabel
|
|
9119
9127
|
}), jsxRuntime.jsx("div", {
|
|
9120
9128
|
children: intl.formatMessage(inputValue ? messages$q.searchSelectInputNoOptionsFoundMessage : messages$q.searchSelectInputNoValueMessage)
|
|
@@ -9173,6 +9181,9 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
9173
9181
|
|
|
9174
9182
|
function ownKeys$B(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9175
9183
|
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; }
|
|
9184
|
+
var styles$8 = {
|
|
9185
|
+
"customOption": "store-select-input-module__customOption___2SC00"
|
|
9186
|
+
};
|
|
9176
9187
|
const StoreSelectInput = props => {
|
|
9177
9188
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
9178
9189
|
const components = React.useMemo(() => {
|
|
@@ -9182,13 +9193,17 @@ const StoreSelectInput = props => {
|
|
|
9182
9193
|
if (optionInnerProps.isDisabled) {
|
|
9183
9194
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$B({}, optionInnerProps));
|
|
9184
9195
|
}
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9196
|
+
const isSearchSelectInput = totalNumberOfStoresFetcher.total > props.upperStoresLimit;
|
|
9197
|
+
return jsxRuntime.jsx("div", {
|
|
9198
|
+
className: isSearchSelectInput ? styles$8.customOption : '',
|
|
9199
|
+
children: jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9200
|
+
optionType: props.optionType,
|
|
9201
|
+
optionInnerProps: optionInnerProps
|
|
9202
|
+
})
|
|
9188
9203
|
});
|
|
9189
9204
|
}
|
|
9190
9205
|
};
|
|
9191
|
-
}, [props.optionType]);
|
|
9206
|
+
}, [props.optionType, totalNumberOfStoresFetcher.total, props.upperStoresLimit]);
|
|
9192
9207
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
9193
9208
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
9194
9209
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$B(_objectSpread$B({
|
|
@@ -10104,7 +10119,9 @@ const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selec
|
|
|
10104
10119
|
}));
|
|
10105
10120
|
};
|
|
10106
10121
|
|
|
10107
|
-
|
|
10122
|
+
/**
|
|
10123
|
+
* Creates a new form state based on the selected type definition from the dropdown.
|
|
10124
|
+
*/
|
|
10108
10125
|
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
10109
10126
|
return {
|
|
10110
10127
|
type: {
|
|
@@ -10127,7 +10144,8 @@ const CustomTypeSubform = _ref => {
|
|
|
10127
10144
|
const _useFormikContext = formik.useFormikContext(),
|
|
10128
10145
|
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
10129
10146
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
10130
|
-
validateForm = _useFormikContext.validateForm
|
|
10147
|
+
validateForm = _useFormikContext.validateForm,
|
|
10148
|
+
initialValues = _useFormikContext.initialValues;
|
|
10131
10149
|
const _useIntl = reactIntl.useIntl(),
|
|
10132
10150
|
formatMessage = _useIntl.formatMessage;
|
|
10133
10151
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -10140,8 +10158,23 @@ const CustomTypeSubform = _ref => {
|
|
|
10140
10158
|
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
10141
10159
|
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
10142
10160
|
if (selectedTypeDefinition) {
|
|
10143
|
-
const
|
|
10144
|
-
|
|
10161
|
+
const initialValueCustomType = initialValues[rootFieldName];
|
|
10162
|
+
const selectedCustomTypeKey = selectedTypeDefinition?.type.key;
|
|
10163
|
+
let newFieldValue;
|
|
10164
|
+
|
|
10165
|
+
/**
|
|
10166
|
+
* If the user selects the same custom type that was already selected, we need to reset the `custom` field
|
|
10167
|
+
* back to its initial value to ensure that the form state is consistent with the initial values.
|
|
10168
|
+
*/
|
|
10169
|
+
if (initialValueCustomType?.type?.obj?.key === selectedCustomTypeKey) {
|
|
10170
|
+
newFieldValue = initialValueCustomType;
|
|
10171
|
+
/**
|
|
10172
|
+
* Otherwise, set the `custom` field to the new custom type definition.
|
|
10173
|
+
*/
|
|
10174
|
+
} else {
|
|
10175
|
+
newFieldValue = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
10176
|
+
}
|
|
10177
|
+
setFieldValue(rootFieldName, newFieldValue).then(() => {
|
|
10145
10178
|
validateForm();
|
|
10146
10179
|
});
|
|
10147
10180
|
} else {
|
|
@@ -10163,7 +10196,7 @@ const CustomTypeSubform = _ref => {
|
|
|
10163
10196
|
children: panelTitle || jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$s({}, messages$o.title))
|
|
10164
10197
|
}),
|
|
10165
10198
|
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
10166
|
-
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
10199
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBJb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0LCBnZXRJbiB9IGZyb20gJ2Zvcm1payc7XG5pbXBvcnQgeyBGb3JtYXR0ZWRNZXNzYWdlLCB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyB1c2VBcHBsaWNhdGlvbkNvbnRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9hcHBsaWNhdGlvbi1zaGVsbC1jb25uZWN0b3JzJztcbmltcG9ydCB7IGZvcm1hdExvY2FsaXplZFN0cmluZyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2wxMG4nO1xuaW1wb3J0IHtcbiAgQ29sbGFwc2libGVQYW5lbCxcbiAgU2VsZWN0SW5wdXQsXG4gIGRlc2lnblRva2Vucyxcbn0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvdWkta2l0JztcbmltcG9ydCBDdXN0b21GaWVsZHNJbnB1dFdyYXBwZXIgZnJvbSAnLi9jdXN0b20tZmllbGRzLWlucHV0LXdyYXBwZXInO1xuaW1wb3J0IG1lc3N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moua2V5YH1cbiAgICAgICAgICAgICAgb3B0aW9ucz17bWFwVHlwZURlZmluaXRpb25zVG9PcHRpb25zKFxuICAgICAgICAgICAgICAgIHR5cGVEZWZpbml0aW9ucyxcbiAgICAgICAgICAgICAgICBsYW5ndWFnZSxcbiAgICAgICAgICAgICAgICBsYW5ndWFnZXMsXG5cbiAgICAgICAgICAgICAgICBnZXRJbihmb3JtVmFsdWVzLCByb290RmllbGROYW1lKT8udHlwZT8uaWRcbiAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgdmFsdWU9e2dldEluKGZvcm1WYWx1ZXMsIHJvb3RGaWVsZE5hbWUpPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwicmlnaHRcIlxuICAgID5cbiAgICAgIDxDdXN0b21GaWVsZHNJbnB1dFdyYXBwZXJcbiAgICAgICAgdHlwZURlZmluaXRpb25zPXt0eXBlRGVmaW5pdGlvbnN9XG4gICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgIGhpZGVFbXB0eUZpZWxkcz17aGlkZUVtcHR5RmllbGRzfVxuICAgICAgICByb290Rm9ybVN0YXRlRmllbGROYW1lPXtyb290Rm9ybVN0YXRlRmllbGROYW1lfVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG4gIGhpZGVFbXB0eUZpZWxkczogUHJvcFR5cGVzLmJvb2wsXG4gIHJvb3RGb3JtU3RhdGVGaWVsZE5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gIHBhbmVsVGl0bGU6IFByb3BUeXBlcy5ub2RlLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ3VzdG9tVHlwZVN1YmZvcm07XG4iXX0= */"),
|
|
10167
10200
|
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
10168
10201
|
isClearable: true,
|
|
10169
10202
|
"data-testid": "custom-type-select",
|
|
@@ -10246,7 +10279,7 @@ const defaultValue = {
|
|
|
10246
10279
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10247
10280
|
|
|
10248
10281
|
var FetchIndicesExist = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchIndicesExist" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indicesExist" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "products" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 191, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10249
|
-
var fetchPimIndexStatus = (
|
|
10282
|
+
var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
10250
10283
|
try {
|
|
10251
10284
|
await dispatch(sdk.actions.head({
|
|
10252
10285
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.PIM_SEARCH,
|
|
@@ -10284,7 +10317,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10284
10317
|
status: 'unreachable'
|
|
10285
10318
|
};
|
|
10286
10319
|
}
|
|
10287
|
-
}
|
|
10320
|
+
};
|
|
10288
10321
|
|
|
10289
10322
|
var messages$n = reactIntl.defineMessages({
|
|
10290
10323
|
indexingSucceed: {
|