@commercetools-frontend/experimental-components 6.3.1 → 6.4.0
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 +350 -235
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +350 -235
- package/dist/commercetools-frontend-experimental-components.esm.js +350 -235
- package/dist/styles.css +24 -23
- package/package.json +26 -24
|
@@ -264,6 +264,8 @@ const INTERVALS_IN_SECONDS = {
|
|
|
264
264
|
};
|
|
265
265
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
266
266
|
const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
|
|
267
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT = 'productTailoringForAttributesTypesOtherThanText';
|
|
268
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES = 'productTailoringForAttributesFallbackValues';
|
|
267
269
|
|
|
268
270
|
// TODO: apply a more robust solution to overlaying issues
|
|
269
271
|
const Z_INDEX_DROPDOWN = 30000;
|
|
@@ -281,7 +283,7 @@ var pickerMessages$1 = reactIntl.defineMessages({
|
|
|
281
283
|
}
|
|
282
284
|
});
|
|
283
285
|
|
|
284
|
-
var messages$
|
|
286
|
+
var messages$R = reactIntl.defineMessages({
|
|
285
287
|
noChannelsFound: {
|
|
286
288
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
287
289
|
description: 'The message to display when no channels were found',
|
|
@@ -365,7 +367,7 @@ const ChannelPickerInput = _ref => {
|
|
|
365
367
|
return inputValue.length === 0 && data.channels.total > 60 ? [...channels, getBottomOption()] : channels;
|
|
366
368
|
}).catch(error => {
|
|
367
369
|
setLoadingError(error);
|
|
368
|
-
onError(error);
|
|
370
|
+
onError && onError(error);
|
|
369
371
|
}), [loadOptions, convertChannelToOption, onError]);
|
|
370
372
|
const loadOptionsDebounced = useDebouncedPromiseCallback$1(handleLoadOptions, 300);
|
|
371
373
|
const _useHandlers = useHandlers$1(onChange),
|
|
@@ -378,10 +380,10 @@ const ChannelPickerInput = _ref => {
|
|
|
378
380
|
}, [handleInternalInputChange]);
|
|
379
381
|
const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
|
|
380
382
|
React.useEffect(() => {
|
|
381
|
-
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
383
|
+
if (isCurrentOptionLoadingFailed && onError) onError(currentOption.error);
|
|
382
384
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
383
385
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
384
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
386
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$R.noChannelsFound), [loadingError, formatMessage]);
|
|
385
387
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
386
388
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
387
389
|
max: "scale",
|
|
@@ -392,7 +394,7 @@ const ChannelPickerInput = _ref => {
|
|
|
392
394
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
393
395
|
id: name,
|
|
394
396
|
name: name,
|
|
395
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
397
|
+
placeholder: placeholder ?? formatMessage(messages$R.placeholder),
|
|
396
398
|
loadOptions: loadOptionsDebounced,
|
|
397
399
|
defaultOptions: true,
|
|
398
400
|
showOptionGroupDivider: true,
|
|
@@ -448,7 +450,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
448
450
|
FormattedDateTime.displayName = 'FormattedDateTime';
|
|
449
451
|
var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
450
452
|
|
|
451
|
-
var messages$
|
|
453
|
+
var messages$Q = reactIntl.defineMessages({
|
|
452
454
|
noProductTypesFound: {
|
|
453
455
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
454
456
|
description: 'The message to display when no product types were found',
|
|
@@ -537,7 +539,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
537
539
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
538
540
|
id: name,
|
|
539
541
|
name: name,
|
|
540
|
-
placeholder: formatMessage(messages$
|
|
542
|
+
placeholder: formatMessage(messages$Q.placeholder),
|
|
541
543
|
loadOptions: loadOptionsDebounced,
|
|
542
544
|
defaultOptions: [],
|
|
543
545
|
isClearable: isClearable,
|
|
@@ -550,7 +552,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
550
552
|
onInputChange: handleInputChange,
|
|
551
553
|
onBlur: onBlur,
|
|
552
554
|
value: currentOption.data,
|
|
553
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
555
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$Q.noProductTypesFound),
|
|
554
556
|
hasError: hasError || isLoadingFailed,
|
|
555
557
|
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
556
558
|
menuPortalTarget: document.body,
|
|
@@ -566,7 +568,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
566
568
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
567
569
|
var ProductTypePickerInput$1 = ProductTypePickerInput;
|
|
568
570
|
|
|
569
|
-
var messages$
|
|
571
|
+
var messages$P = reactIntl.defineMessages({
|
|
570
572
|
noStatesFound: {
|
|
571
573
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
572
574
|
description: 'The message to display when no states were found',
|
|
@@ -650,7 +652,7 @@ const StatePickerInput = _ref => {
|
|
|
650
652
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
651
653
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
652
654
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
653
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
655
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$P.noStatesFound), [loadingError, formatMessage]);
|
|
654
656
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
655
657
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
656
658
|
max: "scale",
|
|
@@ -662,7 +664,7 @@ const StatePickerInput = _ref => {
|
|
|
662
664
|
id: name,
|
|
663
665
|
name: name,
|
|
664
666
|
horizontalConstraint: "scale",
|
|
665
|
-
placeholder: formatMessage(messages$
|
|
667
|
+
placeholder: formatMessage(messages$P.placeholder),
|
|
666
668
|
loadOptions: loadOptionsDebounced,
|
|
667
669
|
defaultOptions: true,
|
|
668
670
|
showOptionGroupDivider: true,
|
|
@@ -719,7 +721,7 @@ const CustomFieldTooltip = _ref => {
|
|
|
719
721
|
};
|
|
720
722
|
var CustomFieldTooltip$1 = CustomFieldTooltip;
|
|
721
723
|
|
|
722
|
-
var messages$
|
|
724
|
+
var messages$O = reactIntl.defineMessages({
|
|
723
725
|
bottomOption: {
|
|
724
726
|
id: 'Products.Pickers.bottomOption',
|
|
725
727
|
description: 'The message to display at the end of the options menu',
|
|
@@ -731,7 +733,7 @@ function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
|
|
|
731
733
|
function _objectSpread$1p(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$1p(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$1p(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
732
734
|
const getBottomOption = formatMessage => ({
|
|
733
735
|
options: [{
|
|
734
|
-
label: formatMessage ? formatMessage(messages$
|
|
736
|
+
label: formatMessage ? formatMessage(messages$O.bottomOption) : messages$O.bottomOption,
|
|
735
737
|
isBottomOption: true,
|
|
736
738
|
isDisabled: true
|
|
737
739
|
}]
|
|
@@ -778,7 +780,7 @@ const useHandlers = onChange => {
|
|
|
778
780
|
};
|
|
779
781
|
var useHandlers$1 = useHandlers;
|
|
780
782
|
|
|
781
|
-
const _excluded$
|
|
783
|
+
const _excluded$e = ["extraWhere"];
|
|
782
784
|
function ownKeys$1n(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; }
|
|
783
785
|
function _objectSpread$1n(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$1n(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$1n(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
784
786
|
const constructPrefixSearchPredicate$1 = function () {
|
|
@@ -821,7 +823,7 @@ const useLoadOptions = _ref => {
|
|
|
821
823
|
}
|
|
822
824
|
const _ref2 = variables ?? {},
|
|
823
825
|
extraWhere = _ref2.extraWhere,
|
|
824
|
-
restVariables = _objectWithoutProperties(_ref2, _excluded$
|
|
826
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$e);
|
|
825
827
|
if (typeof extraWhere === 'string') {
|
|
826
828
|
where = where ? `(${where}) and ${variables.extraWhere}` : variables.extraWhere;
|
|
827
829
|
}
|
|
@@ -840,7 +842,7 @@ const useLoadOptions = _ref => {
|
|
|
840
842
|
};
|
|
841
843
|
var useLoadOptions$1 = useLoadOptions;
|
|
842
844
|
|
|
843
|
-
var FetchIndicesExist$1 = { 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:
|
|
845
|
+
var FetchIndicesExist$1 = { 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: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: 269, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n productSelections {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
844
846
|
const useExecuteGraphQLRequest = () => {
|
|
845
847
|
const apolloClient = react.useApolloClient();
|
|
846
848
|
return React.useCallback((query, variables, context, fetchPolicy) => {
|
|
@@ -1254,7 +1256,7 @@ ThrottledField.defaultProps = {
|
|
|
1254
1256
|
};
|
|
1255
1257
|
var ThrottledField$1 = ThrottledField;
|
|
1256
1258
|
|
|
1257
|
-
var messages$
|
|
1259
|
+
var messages$N = reactIntl.defineMessages({
|
|
1258
1260
|
buttonLabel: {
|
|
1259
1261
|
id: 'SearchInput.buttonLabel',
|
|
1260
1262
|
description: 'Label for "Search" button.',
|
|
@@ -1359,7 +1361,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1359
1361
|
"data-testid": this.props.testId || 'search-input',
|
|
1360
1362
|
value: this.state.text,
|
|
1361
1363
|
label: this.props.label,
|
|
1362
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
1364
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$N.placeholder),
|
|
1363
1365
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
1364
1366
|
onChange: this.handleInputChange,
|
|
1365
1367
|
onEnter: this.handleEnter,
|
|
@@ -2028,7 +2030,7 @@ const usePersistedReminder = function () {
|
|
|
2028
2030
|
};
|
|
2029
2031
|
var usePersistedReminder$1 = usePersistedReminder;
|
|
2030
2032
|
|
|
2031
|
-
var messages$
|
|
2033
|
+
var messages$M = reactIntl.defineMessages({
|
|
2032
2034
|
profileUpdated: {
|
|
2033
2035
|
id: 'NotificationText.profileUpdated',
|
|
2034
2036
|
description: 'Label for the notification header',
|
|
@@ -2065,9 +2067,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2065
2067
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2066
2068
|
as: "p",
|
|
2067
2069
|
isBold: true,
|
|
2068
|
-
intlMessage: messages$
|
|
2070
|
+
intlMessage: messages$M.profileUpdated
|
|
2069
2071
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2070
|
-
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$
|
|
2072
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.addMoreInformation), {}, {
|
|
2071
2073
|
values: {
|
|
2072
2074
|
newline: getNewLine
|
|
2073
2075
|
}
|
|
@@ -2076,7 +2078,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2076
2078
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2077
2079
|
scale: "xs",
|
|
2078
2080
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2079
|
-
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$
|
|
2081
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.informationAndProfileLink), {}, {
|
|
2080
2082
|
values: {
|
|
2081
2083
|
newline: getNewLine,
|
|
2082
2084
|
link: getLinkToProfile
|
|
@@ -2201,7 +2203,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2201
2203
|
};
|
|
2202
2204
|
var useEventCallback$1 = useEventCallback;
|
|
2203
2205
|
|
|
2204
|
-
var messages$
|
|
2206
|
+
var messages$L = reactIntl.defineMessages({
|
|
2205
2207
|
fallbackHint: {
|
|
2206
2208
|
id: 'KeyFallback.fallbackHint',
|
|
2207
2209
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2225,7 +2227,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2225
2227
|
return values => {
|
|
2226
2228
|
if (!values.resource) return null;
|
|
2227
2229
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2228
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2230
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2229
2231
|
key: values.resource.key
|
|
2230
2232
|
});
|
|
2231
2233
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -3882,7 +3884,7 @@ function formatMoney$2(moneyValue, intl, options) {
|
|
|
3882
3884
|
}, options));
|
|
3883
3885
|
}
|
|
3884
3886
|
|
|
3885
|
-
var messages$
|
|
3887
|
+
var messages$K = reactIntl.defineMessages({
|
|
3886
3888
|
booleanYes: {
|
|
3887
3889
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
3888
3890
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -3964,7 +3966,7 @@ const formatDateTime = _ref7 => {
|
|
|
3964
3966
|
const formatBoolean = _ref8 => {
|
|
3965
3967
|
let value = _ref8.value,
|
|
3966
3968
|
intl = _ref8.intl;
|
|
3967
|
-
return value ? intl.formatMessage(messages$
|
|
3969
|
+
return value ? intl.formatMessage(messages$K.booleanYes) : intl.formatMessage(messages$K.booleanNo);
|
|
3968
3970
|
};
|
|
3969
3971
|
const formatNilType = _ref9 => {
|
|
3970
3972
|
let value = _ref9.value,
|
|
@@ -4123,9 +4125,9 @@ const getPrefixSearchBounds = input => {
|
|
|
4123
4125
|
};
|
|
4124
4126
|
var getPrefixSearchBounds$1 = getPrefixSearchBounds;
|
|
4125
4127
|
|
|
4126
|
-
const _excluded$
|
|
4128
|
+
const _excluded$d = ["action"];
|
|
4127
4129
|
function ownKeys$15(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; }
|
|
4128
|
-
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
4130
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context10 = ownKeys$15(Object(t), !0)).call(_context10, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context11 = ownKeys$15(Object(t))).call(_context11, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4129
4131
|
|
|
4130
4132
|
/**
|
|
4131
4133
|
* Checks if a value is a LocalizedString
|
|
@@ -4262,6 +4264,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4262
4264
|
const formatMoney = valueType => money => {
|
|
4263
4265
|
switch (valueType) {
|
|
4264
4266
|
case 'fixed':
|
|
4267
|
+
case 'fixedCart':
|
|
4265
4268
|
return {
|
|
4266
4269
|
[money.type]: _objectSpread$15({
|
|
4267
4270
|
centAmount: money.centAmount,
|
|
@@ -4293,6 +4296,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4293
4296
|
absolute: ['money'],
|
|
4294
4297
|
absoluteCart: ['money', 'applicationMode'],
|
|
4295
4298
|
fixed: ['money'],
|
|
4299
|
+
fixedCart: ['money', 'applicationMode'],
|
|
4296
4300
|
giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
|
|
4297
4301
|
};
|
|
4298
4302
|
const filteredValue = pick__default["default"](actionPayload.value, possibleTypeKeys[valueType]);
|
|
@@ -4316,7 +4320,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4316
4320
|
* as its dynamic content can not be typed in SDL for the mutation.
|
|
4317
4321
|
*/
|
|
4318
4322
|
const convertAction = (actionName, actionPayload) => {
|
|
4319
|
-
var _context3, _context4, _context5;
|
|
4323
|
+
var _context3, _context4, _context5, _context6, _context7;
|
|
4320
4324
|
const getNameFromPayload = payload => {
|
|
4321
4325
|
// changeName for `Organizations`
|
|
4322
4326
|
if (typeof payload.name === 'string') return payload;
|
|
@@ -4597,18 +4601,26 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4597
4601
|
return {
|
|
4598
4602
|
[actionName]: {
|
|
4599
4603
|
target: {
|
|
4600
|
-
[actionPayload.target.type]: omit__default["default"](actionPayload.target, ['type', '__typename'])
|
|
4604
|
+
[actionPayload.target.type]: _objectSpread$15(_objectSpread$15(_objectSpread$15({}, omit__default["default"](actionPayload.target, ['type', '__typename'])), actionPayload.target.triggerPattern && {
|
|
4605
|
+
triggerPattern: _mapInstanceProperty__default["default"](_context6 = actionPayload.target.triggerPattern).call(_context6, pattern => ({
|
|
4606
|
+
[pattern.type]: omit__default["default"](pattern, ['type', '__typename'])
|
|
4607
|
+
}))
|
|
4608
|
+
}), actionPayload.target.targetPattern && {
|
|
4609
|
+
targetPattern: _mapInstanceProperty__default["default"](_context7 = actionPayload.target.targetPattern).call(_context7, pattern => ({
|
|
4610
|
+
[pattern.type]: omit__default["default"](pattern, ['type', '__typename'])
|
|
4611
|
+
}))
|
|
4612
|
+
})
|
|
4601
4613
|
}
|
|
4602
4614
|
}
|
|
4603
4615
|
};
|
|
4604
4616
|
case 'addAddress':
|
|
4605
4617
|
case 'changeAddress':
|
|
4606
4618
|
{
|
|
4607
|
-
var
|
|
4619
|
+
var _context8;
|
|
4608
4620
|
const _ref3 = actionPayload.address?.custom || {},
|
|
4609
4621
|
_ref3$fields = _ref3.fields,
|
|
4610
4622
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
4611
|
-
const customFields = isEmpty__default["default"](fields) ? null : _mapInstanceProperty__default["default"](
|
|
4623
|
+
const customFields = isEmpty__default["default"](fields) ? null : _mapInstanceProperty__default["default"](_context8 = _Object$entries__default["default"](fields)).call(_context8, _ref4 => {
|
|
4612
4624
|
let _ref5 = _slicedToArray(_ref4, 2),
|
|
4613
4625
|
name = _ref5[0],
|
|
4614
4626
|
value = _ref5[1];
|
|
@@ -4633,13 +4645,13 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4633
4645
|
}
|
|
4634
4646
|
case 'setAddressCustomType':
|
|
4635
4647
|
{
|
|
4636
|
-
var
|
|
4648
|
+
var _context9;
|
|
4637
4649
|
const _ref6 = actionPayload || {},
|
|
4638
4650
|
addressId = _ref6.addressId,
|
|
4639
4651
|
_ref6$fields = _ref6.fields,
|
|
4640
4652
|
fields = _ref6$fields === void 0 ? {} : _ref6$fields,
|
|
4641
4653
|
type = _ref6.type;
|
|
4642
|
-
const customFields = isEmpty__default["default"](fields) ? null : _mapInstanceProperty__default["default"](
|
|
4654
|
+
const customFields = isEmpty__default["default"](fields) ? null : _mapInstanceProperty__default["default"](_context9 = _Object$entries__default["default"](fields)).call(_context9, _ref7 => {
|
|
4643
4655
|
let _ref8 = _slicedToArray(_ref7, 2),
|
|
4644
4656
|
name = _ref8[0],
|
|
4645
4657
|
value = _ref8[1];
|
|
@@ -4667,7 +4679,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4667
4679
|
};
|
|
4668
4680
|
const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["default"](actions).call(actions, (previousActions, _ref9) => {
|
|
4669
4681
|
let actionName = _ref9.action,
|
|
4670
|
-
actionPayload = _objectWithoutProperties(_ref9, _excluded$
|
|
4682
|
+
actionPayload = _objectWithoutProperties(_ref9, _excluded$d);
|
|
4671
4683
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4672
4684
|
}, []);
|
|
4673
4685
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
@@ -5071,7 +5083,7 @@ function uniqueObjects(items) {
|
|
|
5071
5083
|
|
|
5072
5084
|
*/
|
|
5073
5085
|
|
|
5074
|
-
const messages$
|
|
5086
|
+
const messages$J = reactIntl.defineMessages({
|
|
5075
5087
|
unique: {
|
|
5076
5088
|
id: 'Validation.unique',
|
|
5077
5089
|
description: 'An error message to show if the field must be unique',
|
|
@@ -5113,7 +5125,7 @@ const messages$I = reactIntl.defineMessages({
|
|
|
5113
5125
|
defaultMessage: 'Invalid ID format. Please enter a valid ID.'
|
|
5114
5126
|
}
|
|
5115
5127
|
});
|
|
5116
|
-
var validationMessages = messages$
|
|
5128
|
+
var validationMessages = messages$J;
|
|
5117
5129
|
|
|
5118
5130
|
function getIndexesOfInvalidValues(values) {
|
|
5119
5131
|
let invalidValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -5369,7 +5381,7 @@ function ReferenceSearch(props) {
|
|
|
5369
5381
|
});
|
|
5370
5382
|
}
|
|
5371
5383
|
|
|
5372
|
-
const messages$
|
|
5384
|
+
const messages$H = reactIntl.defineMessages({
|
|
5373
5385
|
placeholder: {
|
|
5374
5386
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5375
5387
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5396,7 +5408,7 @@ const messages$G = reactIntl.defineMessages({
|
|
|
5396
5408
|
defaultMessage: 'Enter search term'
|
|
5397
5409
|
}
|
|
5398
5410
|
});
|
|
5399
|
-
var messages$
|
|
5411
|
+
var messages$I = messages$H;
|
|
5400
5412
|
|
|
5401
5413
|
function ownKeys$11(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; }
|
|
5402
5414
|
function _objectSpread$11(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$11(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$11(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
@@ -5421,7 +5433,7 @@ function Option$1(props) {
|
|
|
5421
5433
|
fallbackOrder: languages
|
|
5422
5434
|
})
|
|
5423
5435
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
5424
|
-
children: [formatMessage(messages$
|
|
5436
|
+
children: [formatMessage(messages$I.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
5425
5437
|
})]
|
|
5426
5438
|
})
|
|
5427
5439
|
}));
|
|
@@ -5497,10 +5509,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5497
5509
|
onBlur: props.onBlur,
|
|
5498
5510
|
onChange: props.onChange,
|
|
5499
5511
|
value: returnNullIfEmpty(props.value),
|
|
5500
|
-
placeholderLabel: formatMessage(messages$
|
|
5501
|
-
searchPromptLabel: formatMessage(messages$
|
|
5502
|
-
noResultsLabel: formatMessage(messages$
|
|
5503
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5512
|
+
placeholderLabel: formatMessage(messages$I.placeholder),
|
|
5513
|
+
searchPromptLabel: formatMessage(messages$I.searchPrompt),
|
|
5514
|
+
noResultsLabel: formatMessage(messages$I.noResults),
|
|
5515
|
+
referenceIsMissingLabel: formatMessage(messages$I.isMissing),
|
|
5504
5516
|
mapItemToOption: mapItemToOption,
|
|
5505
5517
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5506
5518
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5510,7 +5522,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5510
5522
|
});
|
|
5511
5523
|
}
|
|
5512
5524
|
|
|
5513
|
-
const messages$
|
|
5525
|
+
const messages$F = reactIntl.defineMessages({
|
|
5514
5526
|
placeholder: {
|
|
5515
5527
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5516
5528
|
description: 'Placeholder for search for a category',
|
|
@@ -5542,7 +5554,7 @@ const messages$E = reactIntl.defineMessages({
|
|
|
5542
5554
|
defaultMessage: 'Parent Category'
|
|
5543
5555
|
}
|
|
5544
5556
|
});
|
|
5545
|
-
var messages$
|
|
5557
|
+
var messages$G = messages$F;
|
|
5546
5558
|
|
|
5547
5559
|
function ownKeys$$(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; }
|
|
5548
5560
|
function _objectSpread$$(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$$(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$$(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
@@ -5567,7 +5579,7 @@ function Option(props) {
|
|
|
5567
5579
|
fallbackOrder: languages
|
|
5568
5580
|
})
|
|
5569
5581
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5570
|
-
children: `${formatMessage(messages$
|
|
5582
|
+
children: `${formatMessage(messages$G.parentCategory)}: ${l10n.formatLocalizedString(category.parent, {
|
|
5571
5583
|
key: 'name',
|
|
5572
5584
|
locale: language,
|
|
5573
5585
|
fallbackOrder: languages
|
|
@@ -5579,7 +5591,7 @@ function Option(props) {
|
|
|
5579
5591
|
fallbackOrder: languages
|
|
5580
5592
|
})}`
|
|
5581
5593
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5582
|
-
children: `${formatMessage(messages$
|
|
5594
|
+
children: `${formatMessage(messages$G.externalId)}: ${category.externalId || constants.NO_VALUE_FALLBACK}`
|
|
5583
5595
|
})]
|
|
5584
5596
|
})
|
|
5585
5597
|
}));
|
|
@@ -5627,10 +5639,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5627
5639
|
onBlur: props.onBlur,
|
|
5628
5640
|
onChange: props.onChange,
|
|
5629
5641
|
value: props.value,
|
|
5630
|
-
placeholderLabel: formatMessage(messages$
|
|
5631
|
-
searchPromptLabel: formatMessage(messages$
|
|
5632
|
-
noResultsLabel: formatMessage(messages$
|
|
5633
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5642
|
+
placeholderLabel: formatMessage(messages$G.placeholder),
|
|
5643
|
+
searchPromptLabel: formatMessage(messages$G.searchPrompt),
|
|
5644
|
+
noResultsLabel: formatMessage(messages$G.noResults),
|
|
5645
|
+
referenceIsMissingLabel: formatMessage(messages$G.isMissing),
|
|
5634
5646
|
mapItemToOption: mapItemToOption,
|
|
5635
5647
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5636
5648
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5655,6 +5667,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5655
5667
|
}]));
|
|
5656
5668
|
}
|
|
5657
5669
|
|
|
5670
|
+
const _excluded$c = ["type"];
|
|
5658
5671
|
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; }
|
|
5659
5672
|
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; }
|
|
5660
5673
|
var styles$g = {
|
|
@@ -5682,7 +5695,10 @@ var styles$g = {
|
|
|
5682
5695
|
"save-alt": "button-module__save-alt___6iHMF button-module__save___1-KXp button-module__confirm___-W92x button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
5683
5696
|
"add-button": "button-module__add-button___1f093"
|
|
5684
5697
|
};
|
|
5685
|
-
const Button =
|
|
5698
|
+
const Button = _ref => {
|
|
5699
|
+
let _ref$type = _ref.type,
|
|
5700
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
5701
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
5686
5702
|
const className = props.className,
|
|
5687
5703
|
onClick = props.onClick,
|
|
5688
5704
|
isDisabled = props.isDisabled,
|
|
@@ -5692,7 +5708,7 @@ const Button = props => {
|
|
|
5692
5708
|
const dataProps = filterDataAttributes(props);
|
|
5693
5709
|
return jsxRuntime.jsx("button", _objectSpread$Z(_objectSpread$Z({
|
|
5694
5710
|
onClick: isDisabled ? null : onClick,
|
|
5695
|
-
type:
|
|
5711
|
+
type: type,
|
|
5696
5712
|
className: classnames__default["default"](styles$g.button, isDisabled ? styles$g.disabled : null, className),
|
|
5697
5713
|
disabled: isDisabled,
|
|
5698
5714
|
"aria-label": props['aria-label']
|
|
@@ -5701,12 +5717,9 @@ const Button = props => {
|
|
|
5701
5717
|
}));
|
|
5702
5718
|
};
|
|
5703
5719
|
Button.displayName = 'Button';
|
|
5704
|
-
Button.defaultProps = {
|
|
5705
|
-
type: 'button'
|
|
5706
|
-
};
|
|
5707
5720
|
var Button$1 = Button;
|
|
5708
5721
|
|
|
5709
|
-
var messages$
|
|
5722
|
+
var messages$E = reactIntl.defineMessages({
|
|
5710
5723
|
chooseFile: {
|
|
5711
5724
|
id: 'ButtonFileInput.chooseFile',
|
|
5712
5725
|
description: 'The label text of the field for upload local file',
|
|
@@ -5714,34 +5727,39 @@ var messages$D = reactIntl.defineMessages({
|
|
|
5714
5727
|
}
|
|
5715
5728
|
});
|
|
5716
5729
|
|
|
5730
|
+
const _excluded$b = ["children", "allowMultiple", "acceptTypes"];
|
|
5717
5731
|
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; }
|
|
5718
5732
|
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; }
|
|
5719
5733
|
var styles$f = {
|
|
5720
5734
|
"button": "file-input-module__button___2KypN",
|
|
5721
5735
|
"input": "file-input-module__input___3MP4D"
|
|
5722
5736
|
};
|
|
5723
|
-
const FileInput =
|
|
5724
|
-
children
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5737
|
+
const FileInput = _ref => {
|
|
5738
|
+
let _ref$children = _ref.children,
|
|
5739
|
+
children = _ref$children === void 0 ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$Y({}, messages$E.chooseFile)) : _ref$children,
|
|
5740
|
+
_ref$allowMultiple = _ref.allowMultiple,
|
|
5741
|
+
allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
|
|
5742
|
+
_ref$acceptTypes = _ref.acceptTypes,
|
|
5743
|
+
acceptTypes = _ref$acceptTypes === void 0 ? 'image/png,image/jpeg,image/gif' : _ref$acceptTypes,
|
|
5744
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
5745
|
+
return jsxRuntime.jsx("label", {
|
|
5746
|
+
children: jsxRuntime.jsxs("span", {
|
|
5747
|
+
className: styles$f.button,
|
|
5748
|
+
children: [jsxRuntime.jsx("input", {
|
|
5749
|
+
className: styles$f.input,
|
|
5750
|
+
type: "file",
|
|
5751
|
+
accept: acceptTypes,
|
|
5752
|
+
name: props.name,
|
|
5753
|
+
onChange: props.onChange,
|
|
5754
|
+
multiple: allowMultiple
|
|
5755
|
+
}), children]
|
|
5756
|
+
})
|
|
5757
|
+
});
|
|
5741
5758
|
};
|
|
5759
|
+
FileInput.displayName = 'FileInput';
|
|
5742
5760
|
var FileInput$1 = FileInput;
|
|
5743
5761
|
|
|
5744
|
-
var messages$
|
|
5762
|
+
var messages$D = reactIntl.defineMessages({
|
|
5745
5763
|
countriesBasicSelectPlaceholder: {
|
|
5746
5764
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
5747
5765
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -5762,7 +5780,7 @@ var messages$C = reactIntl.defineMessages({
|
|
|
5762
5780
|
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; }
|
|
5763
5781
|
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; }
|
|
5764
5782
|
const emptyCountryOption = intl => [{
|
|
5765
|
-
label: intl.formatMessage(messages$
|
|
5783
|
+
label: intl.formatMessage(messages$D.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
5766
5784
|
value: undefined,
|
|
5767
5785
|
isDisabled: true
|
|
5768
5786
|
}];
|
|
@@ -5804,7 +5822,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
5804
5822
|
var _context3;
|
|
5805
5823
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
5806
5824
|
}),
|
|
5807
|
-
placeholder: intl.formatMessage(messages$
|
|
5825
|
+
placeholder: intl.formatMessage(messages$D.countriesAsyncSelectPlaceholder),
|
|
5808
5826
|
loadOptions: handleLoadOptions,
|
|
5809
5827
|
onChange: onOptionChange,
|
|
5810
5828
|
isDisabled: props.isDisabled,
|
|
@@ -5824,7 +5842,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
5824
5842
|
value: props.value,
|
|
5825
5843
|
isRequired: props.isRequired,
|
|
5826
5844
|
description: props.description,
|
|
5827
|
-
placeholder: intl.formatMessage(messages$
|
|
5845
|
+
placeholder: intl.formatMessage(messages$D.countriesBasicSelectPlaceholder),
|
|
5828
5846
|
options: props.options,
|
|
5829
5847
|
onChange: props.onChange,
|
|
5830
5848
|
isDisabled: props.isDisabled,
|
|
@@ -5836,22 +5854,31 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
5836
5854
|
|
|
5837
5855
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
5838
5856
|
|
|
5857
|
+
const _excluded$a = ["countriesAsyncLoadingLimit", "isMulti", "isRequired", "hasWarning"];
|
|
5839
5858
|
function ownKeys$W(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; }
|
|
5840
5859
|
function _objectSpread$W(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$W(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$W(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5841
|
-
function CountriesPicker(
|
|
5842
|
-
|
|
5860
|
+
function CountriesPicker(_ref) {
|
|
5861
|
+
let _ref$countriesAsyncLo = _ref.countriesAsyncLoadingLimit,
|
|
5862
|
+
countriesAsyncLoadingLimit = _ref$countriesAsyncLo === void 0 ? COUNTRIES_ASYNC_LOADING_LIMIT : _ref$countriesAsyncLo,
|
|
5863
|
+
_ref$isMulti = _ref.isMulti,
|
|
5864
|
+
isMulti = _ref$isMulti === void 0 ? false : _ref$isMulti,
|
|
5865
|
+
_ref$isRequired = _ref.isRequired,
|
|
5866
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
5867
|
+
_ref$hasWarning = _ref.hasWarning,
|
|
5868
|
+
hasWarning = _ref$hasWarning === void 0 ? false : _ref$hasWarning,
|
|
5869
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
5870
|
+
const CustomCountriesPicker = props.options?.length <= countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
5843
5871
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
5844
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$W({
|
|
5872
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$W({
|
|
5873
|
+
countriesAsyncLoadingLimit: countriesAsyncLoadingLimit,
|
|
5874
|
+
isMulti: isMulti,
|
|
5875
|
+
isRequired: isRequired,
|
|
5876
|
+
hasWarning: hasWarning
|
|
5877
|
+
}, props))
|
|
5845
5878
|
});
|
|
5846
5879
|
}
|
|
5847
|
-
CountriesPicker.defaultProps = {
|
|
5848
|
-
countriesAsyncLoadingLimit: COUNTRIES_ASYNC_LOADING_LIMIT,
|
|
5849
|
-
isMulti: false,
|
|
5850
|
-
isRequired: false,
|
|
5851
|
-
hasWarning: false
|
|
5852
|
-
};
|
|
5853
5880
|
|
|
5854
|
-
var messages$
|
|
5881
|
+
var messages$C = reactIntl.defineMessages({
|
|
5855
5882
|
noCustomerGroupsFound: {
|
|
5856
5883
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
5857
5884
|
description: 'The message to display when no customer groups were found',
|
|
@@ -5941,7 +5968,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
5941
5968
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
5942
5969
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
5943
5970
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
5944
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
5971
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
5945
5972
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
5946
5973
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
5947
5974
|
max: "scale",
|
|
@@ -5952,7 +5979,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
5952
5979
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
5953
5980
|
id: name,
|
|
5954
5981
|
name: name,
|
|
5955
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
5982
|
+
placeholder: placeholder ?? formatMessage(messages$C.placeholder),
|
|
5956
5983
|
loadOptions: loadOptionsDebounced,
|
|
5957
5984
|
defaultOptions: true,
|
|
5958
5985
|
showOptionGroupDivider: true,
|
|
@@ -6087,16 +6114,24 @@ const makeChangeHandler = setValue => event => {
|
|
|
6087
6114
|
// attributes.
|
|
6088
6115
|
const omitUnknownValues = (valuesAsMap, fieldDefinitionsAsMap) => omitBy__default["default"](valuesAsMap, (value, key) => isNil__default["default"](fieldDefinitionsAsMap[key]));
|
|
6089
6116
|
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6117
|
+
var messages$B = reactIntl.defineMessages({
|
|
6118
|
+
booleanSetInputYesLabel: {
|
|
6119
|
+
id: 'CustomBooleanInputSet.booleanSetInputYesLabel',
|
|
6120
|
+
description: 'Custom boolean input set Yes label',
|
|
6121
|
+
defaultMessage: 'YES'
|
|
6122
|
+
},
|
|
6123
|
+
booleanSetInputNoLabel: {
|
|
6124
|
+
id: 'CustomBooleanInputSet.booleanSetInputNoLabel',
|
|
6125
|
+
description: 'Custom boolean input set No label',
|
|
6126
|
+
defaultMessage: 'NO'
|
|
6127
|
+
},
|
|
6128
|
+
booleanSetInputAllLabel: {
|
|
6129
|
+
id: 'CustomBooleanInputSet.booleanSetInputAllLabel',
|
|
6130
|
+
description: 'Custom boolean input set All label',
|
|
6131
|
+
defaultMessage: 'ALL'
|
|
6132
|
+
}
|
|
6133
|
+
});
|
|
6134
|
+
|
|
6100
6135
|
const valueToBooleanSet = value => {
|
|
6101
6136
|
switch (value) {
|
|
6102
6137
|
case 'true':
|
|
@@ -6117,6 +6152,18 @@ const mapToValue = value => {
|
|
|
6117
6152
|
};
|
|
6118
6153
|
function CustomBooleanInputSet(props) {
|
|
6119
6154
|
const value = mapToValue(props.value);
|
|
6155
|
+
const _useIntl = reactIntl.useIntl(),
|
|
6156
|
+
formatMessage = _useIntl.formatMessage;
|
|
6157
|
+
const options = React.useMemo(() => [{
|
|
6158
|
+
value: 'true',
|
|
6159
|
+
label: formatMessage(messages$B.booleanSetInputYesLabel)
|
|
6160
|
+
}, {
|
|
6161
|
+
value: 'false',
|
|
6162
|
+
label: formatMessage(messages$B.booleanSetInputNoLabel)
|
|
6163
|
+
}, {
|
|
6164
|
+
value: 'all',
|
|
6165
|
+
label: formatMessage(messages$B.booleanSetInputAllLabel)
|
|
6166
|
+
}], [formatMessage]);
|
|
6120
6167
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6121
6168
|
const nullifiedIfNeeded = !rawValue ? undefined : valueToBooleanSet(rawValue);
|
|
6122
6169
|
props.setFieldValue(props.name, nullifiedIfNeeded);
|
|
@@ -6125,7 +6172,7 @@ function CustomBooleanInputSet(props) {
|
|
|
6125
6172
|
id: props.name,
|
|
6126
6173
|
name: props.name,
|
|
6127
6174
|
value: value,
|
|
6128
|
-
options: options
|
|
6175
|
+
options: options,
|
|
6129
6176
|
onChange: handleChange,
|
|
6130
6177
|
onBlur: props.onBlur,
|
|
6131
6178
|
isClearable: !props.fieldDefinition.required,
|
|
@@ -6538,7 +6585,8 @@ function CustomLocalizedTextInput(props) {
|
|
|
6538
6585
|
hasError: props.hasError,
|
|
6539
6586
|
isDisabled: props.isDisabled,
|
|
6540
6587
|
isReadOnly: props.isReadOnly,
|
|
6541
|
-
hasWarning: props.hasWarning
|
|
6588
|
+
hasWarning: props.hasWarning,
|
|
6589
|
+
additionalInfo: props.additionalInfo
|
|
6542
6590
|
})
|
|
6543
6591
|
});
|
|
6544
6592
|
}
|
|
@@ -7349,7 +7397,8 @@ function CustomTimeInput(props) {
|
|
|
7349
7397
|
setInternalValue = _useState2[1];
|
|
7350
7398
|
const lastValueSentToFormik = React.useRef();
|
|
7351
7399
|
React.useEffect(() => {
|
|
7352
|
-
if (lastValueSentToFormik.current !== props.value
|
|
7400
|
+
if (lastValueSentToFormik.current !== props.value || !lastValueSentToFormik.current && !props.value // not updating tailored value when the value is empty
|
|
7401
|
+
) {
|
|
7353
7402
|
setInternalValue(formatTime(props.value));
|
|
7354
7403
|
}
|
|
7355
7404
|
}, [props.value, formatTime]);
|
|
@@ -7426,7 +7475,8 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7426
7475
|
hasError: props.hasError,
|
|
7427
7476
|
hasWarning: props.hasWarning,
|
|
7428
7477
|
handleWarningChange: props.handleWarningChange,
|
|
7429
|
-
renderWarnings: props.renderWarnings
|
|
7478
|
+
renderWarnings: props.renderWarnings,
|
|
7479
|
+
additionalInfo: props.additionalInfo
|
|
7430
7480
|
});
|
|
7431
7481
|
});
|
|
7432
7482
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
@@ -7801,17 +7851,21 @@ const useDnDContext = () => {
|
|
|
7801
7851
|
return React.useContext(DnDContext);
|
|
7802
7852
|
};
|
|
7803
7853
|
|
|
7804
|
-
const _excluded$
|
|
7854
|
+
const _excluded$9 = ["renderCustomWarnings", "WrapperComponent"];
|
|
7805
7855
|
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; }
|
|
7806
7856
|
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; }
|
|
7807
|
-
const
|
|
7857
|
+
const existingAttributeTypes = ['text', 'ltext'];
|
|
7858
|
+
const newAttributeTypes = ['text', 'ltext', 'number', 'enum', 'lenum', 'money', 'boolean', 'date', 'datetime', 'reference', 'time']; // Add more types here
|
|
7859
|
+
const setAttributeTypes = ['text', 'ltext', 'number', 'enum', 'lenum', 'money', 'boolean', 'date', 'time', 'datetime', 'reference'];
|
|
7808
7860
|
const getFieldName = (parentName, fieldName) => {
|
|
7809
7861
|
if (!parentName) return fieldName;
|
|
7810
7862
|
return `${parentName}.${fieldName}`;
|
|
7811
7863
|
};
|
|
7812
|
-
const
|
|
7864
|
+
const isAttributeType = function () {
|
|
7813
7865
|
let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7814
|
-
|
|
7866
|
+
let isTailoringAttributeForOtherTypes = arguments.length > 1 ? arguments[1] : undefined;
|
|
7867
|
+
const attributeTypes = isTailoringAttributeForOtherTypes ? newAttributeTypes : existingAttributeTypes;
|
|
7868
|
+
return _includesInstanceProperty__default["default"](attributeTypes).call(attributeTypes, fieldDefinitionType.name) || isTailoringAttributeForOtherTypes && fieldDefinitionType.name === 'set' && _includesInstanceProperty__default["default"](setAttributeTypes).call(setAttributeTypes, fieldDefinitionType?.elementType?.name);
|
|
7815
7869
|
};
|
|
7816
7870
|
const isNested = fieldDefinition => {
|
|
7817
7871
|
const type = fieldDefinition.type;
|
|
@@ -7823,8 +7877,10 @@ const isNested = fieldDefinition => {
|
|
|
7823
7877
|
return typeName === CUSTOM_FIELD_TYPES.nested;
|
|
7824
7878
|
};
|
|
7825
7879
|
const CustomFieldsInternal = _ref => {
|
|
7826
|
-
let
|
|
7827
|
-
|
|
7880
|
+
let _ref$renderCustomWarn = _ref.renderCustomWarnings,
|
|
7881
|
+
renderCustomWarnings = _ref$renderCustomWarn === void 0 ? () => null : _ref$renderCustomWarn,
|
|
7882
|
+
WrapperComponent = _ref.WrapperComponent,
|
|
7883
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
7828
7884
|
const _useFormikContext = formik.useFormikContext(),
|
|
7829
7885
|
errors = _useFormikContext.errors,
|
|
7830
7886
|
touched = _useFormikContext.touched,
|
|
@@ -7832,6 +7888,8 @@ const CustomFieldsInternal = _ref => {
|
|
|
7832
7888
|
handleBlur = _useFormikContext.handleBlur,
|
|
7833
7889
|
status = _useFormikContext.status;
|
|
7834
7890
|
const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
|
|
7891
|
+
const isTailoringAttributeForOtherTypes = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
|
|
7892
|
+
const isTailoringFallbackEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES);
|
|
7835
7893
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7836
7894
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7837
7895
|
const _useDnDContext = useDnDContext(),
|
|
@@ -7845,7 +7903,8 @@ const CustomFieldsInternal = _ref => {
|
|
|
7845
7903
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7846
7904
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7847
7905
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7848
|
-
const isFieldDisabled = props.isDisabled && !(
|
|
7906
|
+
const isFieldDisabled = props.isDisabled && !(isAttributeType(fieldDefinition.type, isTailoringAttributeForOtherTypes) && isTailoringAttributesEnabled);
|
|
7907
|
+
const isSet = fieldDefinition.type.name === 'set';
|
|
7849
7908
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7850
7909
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7851
7910
|
|
|
@@ -7870,7 +7929,8 @@ const CustomFieldsInternal = _ref => {
|
|
|
7870
7929
|
hasError: hasError,
|
|
7871
7930
|
hasWarning: props.renderWarnings && status?.warnings[fieldName],
|
|
7872
7931
|
handleWarningChange: props.handleWarningChange,
|
|
7873
|
-
renderWarnings: props.renderWarnings
|
|
7932
|
+
renderWarnings: props.renderWarnings,
|
|
7933
|
+
additionalInfo: isTailoringFallbackEnabled && props.additionalInfoHandler && !isSet ? props.additionalInfoHandler(fieldDefinition) : undefined
|
|
7874
7934
|
};
|
|
7875
7935
|
const Field = jsxRuntime.jsx(FieldComponent, _objectSpread$J({}, fieldProps));
|
|
7876
7936
|
return jsxRuntime.jsx(formik.FastField, {
|
|
@@ -7894,7 +7954,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7894
7954
|
alignItems: "stretch",
|
|
7895
7955
|
children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
|
|
7896
7956
|
children: Field
|
|
7897
|
-
}) : Field, props.renderWarnings && status?.warnings[fieldName] &&
|
|
7957
|
+
}) : Field, props.renderWarnings && status?.warnings[fieldName] && renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors$1, {
|
|
7898
7958
|
isTouched: isTouched,
|
|
7899
7959
|
errors: fieldErrors
|
|
7900
7960
|
})]
|
|
@@ -7907,9 +7967,6 @@ const CustomFieldsInternal = _ref => {
|
|
|
7907
7967
|
});
|
|
7908
7968
|
};
|
|
7909
7969
|
CustomFieldsInternal.displayName = 'CustomFieldsInternal';
|
|
7910
|
-
CustomFieldsInternal.defaultProps = {
|
|
7911
|
-
renderCustomWarnings: () => null
|
|
7912
|
-
};
|
|
7913
7970
|
var CustomFieldsInternal$1 = CustomFieldsInternal;
|
|
7914
7971
|
|
|
7915
7972
|
function ownKeys$I(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; }
|
|
@@ -7981,14 +8038,14 @@ const attributesMapToNameValuePairs = map => {
|
|
|
7981
8038
|
});
|
|
7982
8039
|
};
|
|
7983
8040
|
|
|
7984
|
-
const _excluded = ["WrapperComponent"];
|
|
8041
|
+
const _excluded$8 = ["WrapperComponent"];
|
|
7985
8042
|
const getAttributeShortName = (fullName, attributesPrefix) => {
|
|
7986
8043
|
if (!attributesPrefix) return fullName;
|
|
7987
8044
|
return fullName.replace(`${attributesPrefix}.`, '');
|
|
7988
8045
|
};
|
|
7989
8046
|
function ProductAttributes(_ref) {
|
|
7990
8047
|
let WrapperComponent = _ref.WrapperComponent,
|
|
7991
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
8048
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
7992
8049
|
const formik$1 = formik.useFormikContext();
|
|
7993
8050
|
const fieldDefinitions = React.useMemo(() => {
|
|
7994
8051
|
var _context;
|
|
@@ -8016,7 +8073,8 @@ function ProductAttributes(_ref) {
|
|
|
8016
8073
|
WrapperComponent: WrapperComponent,
|
|
8017
8074
|
renderWarnings: props.renderWarnings,
|
|
8018
8075
|
renderCustomWarnings: props.renderCustomWarnings,
|
|
8019
|
-
handleWarningChange: props.handleWarningChange
|
|
8076
|
+
handleWarningChange: props.handleWarningChange,
|
|
8077
|
+
additionalInfoHandler: props.additionalInfoHandler
|
|
8020
8078
|
})
|
|
8021
8079
|
})
|
|
8022
8080
|
});
|
|
@@ -8462,9 +8520,37 @@ function ModeSelectInputOption(props) {
|
|
|
8462
8520
|
}));
|
|
8463
8521
|
}
|
|
8464
8522
|
|
|
8523
|
+
const _excluded$7 = ["lowerProductSelectionsLimit", "upperProductSelectionsLimit", "renderSelectInputOptionValuesByField", "optionType", "isMulti", "isRequired", "hasWarning", "hasError", "isClearable", "isReadOnly", "isDisabled", "excludedProductSelectionIds", "title"];
|
|
8465
8524
|
function ownKeys$F(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; }
|
|
8466
8525
|
function _objectSpread$F(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$F(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$F(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
8467
|
-
function ProductSelectionsPicker(
|
|
8526
|
+
function ProductSelectionsPicker(_ref) {
|
|
8527
|
+
let _ref$lowerProductSele = _ref.lowerProductSelectionsLimit,
|
|
8528
|
+
lowerProductSelectionsLimit = _ref$lowerProductSele === void 0 ? LOWER_PRODUCT_SELECTIONS_LIMIT : _ref$lowerProductSele,
|
|
8529
|
+
_ref$upperProductSele = _ref.upperProductSelectionsLimit,
|
|
8530
|
+
upperProductSelectionsLimit = _ref$upperProductSele === void 0 ? UPPER_PRODUCT_SELECTIONS_LIMIT : _ref$upperProductSele,
|
|
8531
|
+
_ref$renderSelectInpu = _ref.renderSelectInputOptionValuesByField,
|
|
8532
|
+
renderSelectInputOptionValuesByField = _ref$renderSelectInpu === void 0 ? 'id' : _ref$renderSelectInpu,
|
|
8533
|
+
_ref$optionType = _ref.optionType,
|
|
8534
|
+
optionType = _ref$optionType === void 0 ? 'double-property' : _ref$optionType,
|
|
8535
|
+
_ref$isMulti = _ref.isMulti,
|
|
8536
|
+
isMulti = _ref$isMulti === void 0 ? false : _ref$isMulti,
|
|
8537
|
+
_ref$isRequired = _ref.isRequired,
|
|
8538
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
8539
|
+
_ref$hasWarning = _ref.hasWarning,
|
|
8540
|
+
hasWarning = _ref$hasWarning === void 0 ? false : _ref$hasWarning,
|
|
8541
|
+
_ref$hasError = _ref.hasError,
|
|
8542
|
+
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
8543
|
+
_ref$isClearable = _ref.isClearable,
|
|
8544
|
+
isClearable = _ref$isClearable === void 0 ? false : _ref$isClearable,
|
|
8545
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
8546
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
8547
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
8548
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
8549
|
+
_ref$excludedProductS = _ref.excludedProductSelectionIds,
|
|
8550
|
+
excludedProductSelectionIds = _ref$excludedProductS === void 0 ? [] : _ref$excludedProductS,
|
|
8551
|
+
_ref$title = _ref.title,
|
|
8552
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
8553
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
8468
8554
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher$1();
|
|
8469
8555
|
const components = React.useMemo(() => {
|
|
8470
8556
|
return {
|
|
@@ -8472,39 +8558,38 @@ function ProductSelectionsPicker(props) {
|
|
|
8472
8558
|
if (optionInnerProps.isDisabled) {
|
|
8473
8559
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
8474
8560
|
}
|
|
8475
|
-
if (
|
|
8561
|
+
if (optionType === TYPE_PROPERTY) {
|
|
8476
8562
|
return jsxRuntime.jsx(ModeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
8477
8563
|
}
|
|
8478
8564
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8479
|
-
optionType:
|
|
8565
|
+
optionType: optionType,
|
|
8480
8566
|
optionInnerProps: optionInnerProps
|
|
8481
8567
|
});
|
|
8482
8568
|
}
|
|
8483
8569
|
};
|
|
8484
|
-
}, [
|
|
8570
|
+
}, [optionType]);
|
|
8485
8571
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner$1, {});
|
|
8486
|
-
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <=
|
|
8572
|
+
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8487
8573
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8488
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({
|
|
8574
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({
|
|
8575
|
+
lowerProductSelectionsLimit: lowerProductSelectionsLimit,
|
|
8576
|
+
upperProductSelectionsLimit: upperProductSelectionsLimit,
|
|
8577
|
+
renderSelectInputOptionValuesByField: renderSelectInputOptionValuesByField,
|
|
8578
|
+
optionType: optionType,
|
|
8579
|
+
isMulti: isMulti,
|
|
8580
|
+
isRequired: isRequired,
|
|
8581
|
+
hasWarning: hasWarning,
|
|
8582
|
+
hasError: hasError,
|
|
8583
|
+
isClearable: isClearable,
|
|
8584
|
+
isReadOnly: isReadOnly,
|
|
8585
|
+
isDisabled: isDisabled,
|
|
8586
|
+
excludedProductSelectionIds: excludedProductSelectionIds,
|
|
8587
|
+
title: title
|
|
8588
|
+
}, props), {}, {
|
|
8489
8589
|
components: components
|
|
8490
8590
|
}))
|
|
8491
8591
|
});
|
|
8492
8592
|
}
|
|
8493
|
-
ProductSelectionsPicker.defaultProps = {
|
|
8494
|
-
lowerProductSelectionsLimit: LOWER_PRODUCT_SELECTIONS_LIMIT,
|
|
8495
|
-
upperProductSelectionsLimit: UPPER_PRODUCT_SELECTIONS_LIMIT,
|
|
8496
|
-
renderSelectInputOptionValuesByField: 'id',
|
|
8497
|
-
optionType: 'double-property',
|
|
8498
|
-
isMulti: false,
|
|
8499
|
-
isRequired: false,
|
|
8500
|
-
hasWarning: false,
|
|
8501
|
-
hasError: false,
|
|
8502
|
-
isClearable: false,
|
|
8503
|
-
isReadOnly: false,
|
|
8504
|
-
isDisabled: false,
|
|
8505
|
-
excludedProductSelectionIds: [],
|
|
8506
|
-
title: '' // FieldLabel requires title to have some value
|
|
8507
|
-
};
|
|
8508
8593
|
|
|
8509
8594
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
8510
8595
|
var styles$b = {
|
|
@@ -8541,19 +8626,21 @@ const ScrollToFieldError = () => {
|
|
|
8541
8626
|
if (firstErrorElement) {
|
|
8542
8627
|
// Get a reference to the label.
|
|
8543
8628
|
const firstElementId = firstErrorElement.getAttribute('id');
|
|
8544
|
-
|
|
8629
|
+
if (firstElementId) {
|
|
8630
|
+
const localizedInputIndex = _indexOfInstanceProperty__default["default"](firstElementId).call(firstElementId, `.${dataLocale}`);
|
|
8545
8631
|
|
|
8546
|
-
|
|
8547
|
-
|
|
8632
|
+
// check if locale is appended then remove it from id
|
|
8633
|
+
const id = localizedInputIndex > -1 ? firstElementId.replace(`.${dataLocale}`, '') : firstElementId;
|
|
8548
8634
|
|
|
8549
|
-
|
|
8635
|
+
// Scroll to the label (if found), otherwise to the input element itself.
|
|
8550
8636
|
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8637
|
+
const elementToScrollTo =
|
|
8638
|
+
// div is used only for custom fields
|
|
8639
|
+
document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
|
|
8640
|
+
elementToScrollTo.scrollIntoView?.({
|
|
8641
|
+
behavior: 'smooth'
|
|
8642
|
+
});
|
|
8643
|
+
}
|
|
8557
8644
|
}
|
|
8558
8645
|
}, [dataLocale, isValid, submitCount]);
|
|
8559
8646
|
return null;
|
|
@@ -8699,6 +8786,7 @@ const getCustomGroupLabelOption = customLabel => [{
|
|
|
8699
8786
|
isDisabled: true
|
|
8700
8787
|
}];
|
|
8701
8788
|
|
|
8789
|
+
const _excluded$6 = ["shouldFetchProductSelections"];
|
|
8702
8790
|
function ownKeys$E(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; }
|
|
8703
8791
|
function _objectSpread$E(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$E(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$E(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
8704
8792
|
const hasErrors$2 = errors => {
|
|
@@ -8729,7 +8817,10 @@ const emptyStoreOption = intl => [{
|
|
|
8729
8817
|
value: undefined,
|
|
8730
8818
|
isDisabled: true
|
|
8731
8819
|
}];
|
|
8732
|
-
const StoresAsyncSelectInput =
|
|
8820
|
+
const StoresAsyncSelectInput = _ref2 => {
|
|
8821
|
+
let _ref2$shouldFetchProd = _ref2.shouldFetchProductSelections,
|
|
8822
|
+
shouldFetchProductSelections = _ref2$shouldFetchProd === void 0 ? false : _ref2$shouldFetchProd,
|
|
8823
|
+
props = _objectWithoutProperties(_ref2, _excluded$6);
|
|
8733
8824
|
const intl = reactIntl.useIntl();
|
|
8734
8825
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
8735
8826
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -8743,7 +8834,7 @@ const StoresAsyncSelectInput = props => {
|
|
|
8743
8834
|
offset: 0,
|
|
8744
8835
|
sort: 'createdAt asc',
|
|
8745
8836
|
excludeExtendedStoresList: true,
|
|
8746
|
-
excludeProductSelections: !
|
|
8837
|
+
excludeProductSelections: !shouldFetchProductSelections,
|
|
8747
8838
|
stores: keysOfStores?.length && keysOfStores,
|
|
8748
8839
|
projectKey: props.projectKey
|
|
8749
8840
|
});
|
|
@@ -8824,18 +8915,19 @@ const StoresAsyncSelectInput = props => {
|
|
|
8824
8915
|
});
|
|
8825
8916
|
};
|
|
8826
8917
|
StoresAsyncSelectInput.displayName = 'StoresAsyncSelectInput';
|
|
8827
|
-
StoresAsyncSelectInput.defaultProps = {
|
|
8828
|
-
shouldFetchProductSelections: false
|
|
8829
|
-
};
|
|
8830
8918
|
var StoresAsyncSelectInput$1 = StoresAsyncSelectInput;
|
|
8831
8919
|
|
|
8920
|
+
const _excluded$5 = ["shouldFetchProductSelections"];
|
|
8832
8921
|
function ownKeys$D(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; }
|
|
8833
8922
|
function _objectSpread$D(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$D(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$D(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
8834
8923
|
const hasErrors$1 = errors => {
|
|
8835
8924
|
var _context;
|
|
8836
8925
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
8837
8926
|
};
|
|
8838
|
-
const StoresBasicSelectInput =
|
|
8927
|
+
const StoresBasicSelectInput = _ref => {
|
|
8928
|
+
let _ref$shouldFetchProdu = _ref.shouldFetchProductSelections,
|
|
8929
|
+
shouldFetchProductSelections = _ref$shouldFetchProdu === void 0 ? false : _ref$shouldFetchProdu,
|
|
8930
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
8839
8931
|
const intl = reactIntl.useIntl();
|
|
8840
8932
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
8841
8933
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -8849,7 +8941,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8849
8941
|
offset: 0,
|
|
8850
8942
|
sort: 'createdAt asc',
|
|
8851
8943
|
excludeExtendedStoresList: true,
|
|
8852
|
-
excludeProductSelections: !
|
|
8944
|
+
excludeProductSelections: !shouldFetchProductSelections,
|
|
8853
8945
|
stores: keysOfStores?.length && keysOfStores,
|
|
8854
8946
|
projectKey: props.projectKey
|
|
8855
8947
|
});
|
|
@@ -8874,7 +8966,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8874
8966
|
const currentStore = _findInstanceProperty__default["default"](listOptions).call(listOptions, store => store.value === value);
|
|
8875
8967
|
|
|
8876
8968
|
// We need complete store info including productSelections
|
|
8877
|
-
if (!
|
|
8969
|
+
if (!shouldFetchProductSelections && !props?.renderLabel) {
|
|
8878
8970
|
props.onChange(event);
|
|
8879
8971
|
} else {
|
|
8880
8972
|
props.onChange({
|
|
@@ -8922,9 +9014,6 @@ const StoresBasicSelectInput = props => {
|
|
|
8922
9014
|
});
|
|
8923
9015
|
};
|
|
8924
9016
|
StoresBasicSelectInput.displayName = 'StoresBasicSelectInput';
|
|
8925
|
-
StoresBasicSelectInput.defaultProps = {
|
|
8926
|
-
shouldFetchProductSelections: false
|
|
8927
|
-
};
|
|
8928
9017
|
var StoresBasicSelectInput$1 = StoresBasicSelectInput;
|
|
8929
9018
|
|
|
8930
9019
|
var TotalNumberOfStores = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "TotalNumberOfStores" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "totalNumberOfStores" }, name: { kind: "Name", value: "stores" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 76, source: { body: "query TotalNumberOfStores {\n totalNumberOfStores: stores {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -8971,6 +9060,7 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8971
9060
|
};
|
|
8972
9061
|
var useStoresByFieldFetcher$1 = useStoresByFieldFetcher;
|
|
8973
9062
|
|
|
9063
|
+
const _excluded$4 = ["shouldFetchProductSelections"];
|
|
8974
9064
|
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; }
|
|
8975
9065
|
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; }
|
|
8976
9066
|
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 } } } };
|
|
@@ -9041,7 +9131,10 @@ const getValueFromOptions = _ref2 => {
|
|
|
9041
9131
|
return selectedOptions[0];
|
|
9042
9132
|
}
|
|
9043
9133
|
};
|
|
9044
|
-
const StoresSearchSelectInput =
|
|
9134
|
+
const StoresSearchSelectInput = _ref3 => {
|
|
9135
|
+
let _ref3$shouldFetchProd = _ref3.shouldFetchProductSelections,
|
|
9136
|
+
shouldFetchProductSelections = _ref3$shouldFetchProd === void 0 ? false : _ref3$shouldFetchProd,
|
|
9137
|
+
props = _objectWithoutProperties(_ref3, _excluded$4);
|
|
9045
9138
|
// hooks
|
|
9046
9139
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
9047
9140
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -9051,7 +9144,7 @@ const StoresSearchSelectInput = props => {
|
|
|
9051
9144
|
projectLanguages = _useApplicationContex.projectLanguages;
|
|
9052
9145
|
const intl = reactIntl.useIntl();
|
|
9053
9146
|
const client$1 = client.useApolloClient();
|
|
9054
|
-
const storesByFieldFetcher = useStoresByFieldFetcher$1(props.value, props.renderSelectInputOptionValuesByField, props.projectKey,
|
|
9147
|
+
const storesByFieldFetcher = useStoresByFieldFetcher$1(props.value, props.renderSelectInputOptionValuesByField, props.projectKey, shouldFetchProductSelections);
|
|
9055
9148
|
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors) || props.hasError;
|
|
9056
9149
|
const handleLoadOptions = searchText => {
|
|
9057
9150
|
const extractMatchedStores = client$1.query({
|
|
@@ -9060,15 +9153,15 @@ const StoresSearchSelectInput = props => {
|
|
|
9060
9153
|
searchText,
|
|
9061
9154
|
dataLocale,
|
|
9062
9155
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9063
|
-
shouldFetchProductSelections
|
|
9156
|
+
shouldFetchProductSelections
|
|
9064
9157
|
}),
|
|
9065
9158
|
context: {
|
|
9066
9159
|
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM,
|
|
9067
9160
|
projectKey: props.projectKey
|
|
9068
9161
|
},
|
|
9069
9162
|
fetchPolicy: 'network-only'
|
|
9070
|
-
}).then(
|
|
9071
|
-
let data =
|
|
9163
|
+
}).then(_ref4 => {
|
|
9164
|
+
let data = _ref4.data;
|
|
9072
9165
|
const result = data.storesByWherePredicate?.results.map(store => mapStoresToOptions({
|
|
9073
9166
|
store,
|
|
9074
9167
|
dataLocale,
|
|
@@ -9085,8 +9178,8 @@ const StoresSearchSelectInput = props => {
|
|
|
9085
9178
|
return extractMatchedStores;
|
|
9086
9179
|
};
|
|
9087
9180
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
9088
|
-
const renderNoOptions =
|
|
9089
|
-
let inputValue =
|
|
9181
|
+
const renderNoOptions = _ref5 => {
|
|
9182
|
+
let inputValue = _ref5.inputValue;
|
|
9090
9183
|
return jsxRuntime.jsxs("div", {
|
|
9091
9184
|
className: styles$9.renderLabelContainer,
|
|
9092
9185
|
children: [jsxRuntime.jsx("div", {
|
|
@@ -9143,17 +9236,26 @@ const StoresSearchSelectInput = props => {
|
|
|
9143
9236
|
});
|
|
9144
9237
|
};
|
|
9145
9238
|
StoresSearchSelectInput.displayName = 'StoresSearchSelectInput';
|
|
9146
|
-
StoresSearchSelectInput.defaultProps = {
|
|
9147
|
-
shouldFetchProductSelections: false
|
|
9148
|
-
};
|
|
9149
9239
|
var StoresSearchSelectInput$1 = StoresSearchSelectInput;
|
|
9150
9240
|
|
|
9241
|
+
const _excluded$3 = ["lowerStoresLimit", "upperStoresLimit", "renderSelectInputOptionValuesByField", "optionType", "shouldFetchProductSelections"];
|
|
9151
9242
|
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; }
|
|
9152
9243
|
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; }
|
|
9153
9244
|
var styles$8 = {
|
|
9154
9245
|
"customOption": "store-select-input-module__customOption___2SC00"
|
|
9155
9246
|
};
|
|
9156
|
-
const StoreSelectInput =
|
|
9247
|
+
const StoreSelectInput = _ref => {
|
|
9248
|
+
let _ref$lowerStoresLimit = _ref.lowerStoresLimit,
|
|
9249
|
+
lowerStoresLimit = _ref$lowerStoresLimit === void 0 ? LOWER_STORES_LIMIT : _ref$lowerStoresLimit,
|
|
9250
|
+
_ref$upperStoresLimit = _ref.upperStoresLimit,
|
|
9251
|
+
upperStoresLimit = _ref$upperStoresLimit === void 0 ? UPPER_STORES_LIMIT : _ref$upperStoresLimit,
|
|
9252
|
+
_ref$renderSelectInpu = _ref.renderSelectInputOptionValuesByField,
|
|
9253
|
+
renderSelectInputOptionValuesByField = _ref$renderSelectInpu === void 0 ? 'id' : _ref$renderSelectInpu,
|
|
9254
|
+
_ref$optionType = _ref.optionType,
|
|
9255
|
+
optionType = _ref$optionType === void 0 ? 'double-property' : _ref$optionType,
|
|
9256
|
+
_ref$shouldFetchProdu = _ref.shouldFetchProductSelections,
|
|
9257
|
+
shouldFetchProductSelections = _ref$shouldFetchProdu === void 0 ? false : _ref$shouldFetchProdu,
|
|
9258
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
9157
9259
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher$1(props.projectKey);
|
|
9158
9260
|
const components = React.useMemo(() => {
|
|
9159
9261
|
return {
|
|
@@ -9162,19 +9264,19 @@ const StoreSelectInput = props => {
|
|
|
9162
9264
|
if (optionInnerProps.isDisabled) {
|
|
9163
9265
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$B({}, optionInnerProps));
|
|
9164
9266
|
}
|
|
9165
|
-
const isSearchSelectInput = totalNumberOfStoresFetcher.total >
|
|
9267
|
+
const isSearchSelectInput = totalNumberOfStoresFetcher.total > upperStoresLimit;
|
|
9166
9268
|
return jsxRuntime.jsx("div", {
|
|
9167
9269
|
className: isSearchSelectInput ? styles$8.customOption : '',
|
|
9168
9270
|
children: jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9169
|
-
optionType:
|
|
9271
|
+
optionType: optionType,
|
|
9170
9272
|
optionInnerProps: optionInnerProps
|
|
9171
9273
|
})
|
|
9172
9274
|
});
|
|
9173
9275
|
}
|
|
9174
9276
|
};
|
|
9175
|
-
}, [
|
|
9277
|
+
}, [optionType, totalNumberOfStoresFetcher.total, upperStoresLimit]);
|
|
9176
9278
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner$1, {});
|
|
9177
|
-
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <=
|
|
9279
|
+
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= lowerStoresLimit ? StoresBasicSelectInput$1 : totalNumberOfStoresFetcher.total <= upperStoresLimit ? StoresAsyncSelectInput$1 : StoresSearchSelectInput$1;
|
|
9178
9280
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$B(_objectSpread$B({
|
|
9179
9281
|
menuIsOpen: props.menuIsOpen,
|
|
9180
9282
|
placeholder: props.placeholder,
|
|
@@ -9203,27 +9305,27 @@ const StoreSelectInput = props => {
|
|
|
9203
9305
|
maxMenuHeight: props.maxMenuHeight,
|
|
9204
9306
|
menuPortalTarget: props.menuPortalTarget,
|
|
9205
9307
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
9206
|
-
renderSelectInputOptionValuesByField:
|
|
9207
|
-
lowerStoresLimit:
|
|
9208
|
-
upperStoresLimit:
|
|
9308
|
+
renderSelectInputOptionValuesByField: renderSelectInputOptionValuesByField,
|
|
9309
|
+
lowerStoresLimit: lowerStoresLimit,
|
|
9310
|
+
upperStoresLimit: upperStoresLimit,
|
|
9209
9311
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9210
|
-
shouldFetchProductSelections:
|
|
9312
|
+
shouldFetchProductSelections: shouldFetchProductSelections,
|
|
9211
9313
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
9212
9314
|
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)));
|
|
9213
9315
|
};
|
|
9214
9316
|
StoreSelectInput.displayName = 'StoreSelectInput';
|
|
9215
|
-
StoreSelectInput.defaultProps = {
|
|
9216
|
-
lowerStoresLimit: LOWER_STORES_LIMIT,
|
|
9217
|
-
upperStoresLimit: UPPER_STORES_LIMIT,
|
|
9218
|
-
renderSelectInputOptionValuesByField: 'id',
|
|
9219
|
-
optionType: 'double-property',
|
|
9220
|
-
shouldFetchProductSelections: false
|
|
9221
|
-
};
|
|
9222
9317
|
var StoreSelectInput$1 = StoreSelectInput;
|
|
9223
9318
|
|
|
9319
|
+
const _excluded$2 = ["lowerStoresLimit", "upperStoresLimit", "mappedValueField"];
|
|
9224
9320
|
function ownKeys$A(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; }
|
|
9225
9321
|
function _objectSpread$A(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$A(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$A(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
9226
|
-
const StoreSelectField =
|
|
9322
|
+
const StoreSelectField = _ref => {
|
|
9323
|
+
let _ref$lowerStoresLimit = _ref.lowerStoresLimit,
|
|
9324
|
+
lowerStoresLimit = _ref$lowerStoresLimit === void 0 ? LOWER_STORES_LIMIT : _ref$lowerStoresLimit,
|
|
9325
|
+
_ref$upperStoresLimit = _ref.upperStoresLimit,
|
|
9326
|
+
upperStoresLimit = _ref$upperStoresLimit === void 0 ? UPPER_STORES_LIMIT : _ref$upperStoresLimit;
|
|
9327
|
+
_ref.mappedValueField;
|
|
9328
|
+
let props = _objectWithoutProperties(_ref, _excluded$2);
|
|
9227
9329
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
9228
9330
|
max: props.horizontalConstraint,
|
|
9229
9331
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -9260,8 +9362,8 @@ const StoreSelectField = props => {
|
|
|
9260
9362
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
9261
9363
|
optionType: props.optionType,
|
|
9262
9364
|
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField,
|
|
9263
|
-
lowerStoresLimit:
|
|
9264
|
-
upperStoresLimit:
|
|
9365
|
+
lowerStoresLimit: lowerStoresLimit,
|
|
9366
|
+
upperStoresLimit: upperStoresLimit,
|
|
9265
9367
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9266
9368
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
9267
9369
|
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)))]
|
|
@@ -9269,11 +9371,6 @@ const StoreSelectField = props => {
|
|
|
9269
9371
|
});
|
|
9270
9372
|
};
|
|
9271
9373
|
StoreSelectField.displayName = 'StoreSelectField';
|
|
9272
|
-
StoreSelectField.defaultProps = {
|
|
9273
|
-
lowerStoresLimit: LOWER_STORES_LIMIT,
|
|
9274
|
-
upperStoresLimit: UPPER_STORES_LIMIT,
|
|
9275
|
-
mappedValueField: 'id'
|
|
9276
|
-
};
|
|
9277
9374
|
var StoreSelectField$1 = StoreSelectField;
|
|
9278
9375
|
|
|
9279
9376
|
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; }
|
|
@@ -9694,7 +9791,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
9694
9791
|
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9695
9792
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function () { return !!t; })(); }
|
|
9696
9793
|
var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, 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" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], 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: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, 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: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, 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: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, 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: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, 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: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, 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: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, 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: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, 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: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9697
|
-
const customizableResources = ['asset', 'address', 'associate-role', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel'];
|
|
9794
|
+
const customizableResources = ['asset', 'address', 'associate-role', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel', 'transaction'];
|
|
9698
9795
|
const emptyTypeDefinitions = {
|
|
9699
9796
|
total: 0,
|
|
9700
9797
|
count: 0,
|
|
@@ -10247,7 +10344,7 @@ const defaultValue = {
|
|
|
10247
10344
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10248
10345
|
var PimIndexerContext$1 = PimIndexerContext;
|
|
10249
10346
|
|
|
10250
|
-
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:
|
|
10347
|
+
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: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: 269, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n productSelections {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10251
10348
|
var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
10252
10349
|
try {
|
|
10253
10350
|
await dispatch(sdk.actions.head({
|
|
@@ -10267,11 +10364,12 @@ var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
|
10267
10364
|
fetchPolicy: 'network-only'
|
|
10268
10365
|
}),
|
|
10269
10366
|
data = _await$apolloClient$q.data;
|
|
10270
|
-
if (data.indicesExist.products.newInProgress || data.indicesExist.productTypes.newInProgress) {
|
|
10367
|
+
if (data.indicesExist.products.newInProgress || data.indicesExist.productTypes.newInProgress || data.indicesExist.productSelections.newInProgress) {
|
|
10271
10368
|
return {
|
|
10272
10369
|
status: 'indexing',
|
|
10273
10370
|
isIndexingProducts: !data.indicesExist.products.searchableIndexExists,
|
|
10274
|
-
isIndexingProductTypes: !data.indicesExist.productTypes.searchableIndexExists
|
|
10371
|
+
isIndexingProductTypes: !data.indicesExist.productTypes.searchableIndexExists,
|
|
10372
|
+
isIndexingProductSelections: !data.indicesExist.productSelections.searchableIndexExists
|
|
10275
10373
|
};
|
|
10276
10374
|
}
|
|
10277
10375
|
return {
|
|
@@ -10305,21 +10403,23 @@ function ownKeys$r(e, r) { var t = _Object$keys__default["default"](e); if (_Obj
|
|
|
10305
10403
|
function _objectSpread$r(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$r(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$r(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
10306
10404
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10307
10405
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function () { return !!t; })(); }
|
|
10308
|
-
var RefreshProductIndices = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "RefreshProductIndices" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "ids" } }, type: { kind: "NonNullType", type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "refreshProducts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "ids" }, value: { kind: "Variable", name: { kind: "Name", value: "ids" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "deletedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "notFoundDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "unchangedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "failedRefreshedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end:
|
|
10309
|
-
var IndexProject = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "IndexProject" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "reIndexAllProducts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "reIndexAllProductTypes" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end:
|
|
10310
|
-
var GetIndexingProgress = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetIndexingProgress" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end:
|
|
10406
|
+
var RefreshProductIndices = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "RefreshProductIndices" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "ids" } }, type: { kind: "NonNullType", type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "refreshProducts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "ids" }, value: { kind: "Variable", name: { kind: "Name", value: "ids" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "deletedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "notFoundDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "unchangedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "failedRefreshedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 1549, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n $shouldIndexProductSelections: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n productSelections: reIndexAllProductSelections\n @include(if: $shouldIndexProductSelections) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $productSelectionsJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n $shouldIncludeProductSelections: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n\n productSelections: getReindexingStatus(id: $productSelectionsJobId)\n @include(if: $shouldIncludeProductSelections) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10407
|
+
var IndexProject = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "IndexProject" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "reIndexAllProducts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "reIndexAllProductTypes" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productSelections" }, name: { kind: "Name", value: "reIndexAllProductSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 1549, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n $shouldIndexProductSelections: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n productSelections: reIndexAllProductSelections\n @include(if: $shouldIndexProductSelections) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $productSelectionsJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n $shouldIncludeProductSelections: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n\n productSelections: getReindexingStatus(id: $productSelectionsJobId)\n @include(if: $shouldIncludeProductSelections) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10408
|
+
var GetIndexingProgress = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetIndexingProgress" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productSelectionsJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productSelections" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productSelectionsJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 1549, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n $shouldIndexProductSelections: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n productSelections: reIndexAllProductSelections\n @include(if: $shouldIndexProductSelections) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $productSelectionsJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n $shouldIncludeProductSelections: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n\n productSelections: getReindexingStatus(id: $productSelectionsJobId)\n @include(if: $shouldIncludeProductSelections) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10311
10409
|
const pimIndexerRequestContext = {
|
|
10312
10410
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
10313
10411
|
};
|
|
10314
|
-
const isIndexingCompleted = (products, productTypes) => products.completed && productTypes.completed;
|
|
10315
|
-
const calculateProgress = (products, productTypes) => (products.percentCompleted + productTypes.percentCompleted) /
|
|
10412
|
+
const isIndexingCompleted = (products, productTypes, productSelections) => products.completed && productTypes.completed && productSelections.completed;
|
|
10413
|
+
const calculateProgress = (products, productTypes, productSelections) => (products.percentCompleted + productTypes.percentCompleted + productSelections.percentCompleted) / 3;
|
|
10316
10414
|
const getIndexingJobIds = _ref => {
|
|
10317
10415
|
let _ref$data = _ref.data,
|
|
10318
10416
|
products = _ref$data.products,
|
|
10319
|
-
productTypes = _ref$data.productTypes
|
|
10417
|
+
productTypes = _ref$data.productTypes,
|
|
10418
|
+
productSelections = _ref$data.productSelections;
|
|
10320
10419
|
return {
|
|
10321
10420
|
productsJobId: products?.indexingJobId || products?.existingIndexingJobId,
|
|
10322
|
-
productTypesJobId: productTypes?.indexingJobId || productTypes?.existingIndexingJobId
|
|
10421
|
+
productTypesJobId: productTypes?.indexingJobId || productTypes?.existingIndexingJobId,
|
|
10422
|
+
productSelectionsJobId: productSelections?.indexingJobId || productSelections?.existingIndexingJobId
|
|
10323
10423
|
};
|
|
10324
10424
|
};
|
|
10325
10425
|
let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -10342,12 +10442,14 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10342
10442
|
const _await$_this$props$fe = await _this.props.fetchPimIndexStatus(_this.props.client, _this.props.projectKey),
|
|
10343
10443
|
status = _await$_this$props$fe.status,
|
|
10344
10444
|
isIndexingProducts = _await$_this$props$fe.isIndexingProducts,
|
|
10345
|
-
isIndexingProductTypes = _await$_this$props$fe.isIndexingProductTypes
|
|
10445
|
+
isIndexingProductTypes = _await$_this$props$fe.isIndexingProductTypes,
|
|
10446
|
+
isIndexingProductSelections = _await$_this$props$fe.isIndexingProductSelections;
|
|
10346
10447
|
const isPimIndexerUnreachable = _includesInstanceProperty__default["default"](_context = ['not-configured', 'unreachable']).call(_context, status);
|
|
10347
10448
|
if (status === 'indexing') {
|
|
10348
10449
|
_this.monitorIndexingProgress({
|
|
10349
10450
|
isIndexingProducts,
|
|
10350
|
-
isIndexingProductTypes
|
|
10451
|
+
isIndexingProductTypes,
|
|
10452
|
+
isIndexingProductSelections
|
|
10351
10453
|
});
|
|
10352
10454
|
} else {
|
|
10353
10455
|
_this.setState({
|
|
@@ -10404,8 +10506,10 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10404
10506
|
variables: {
|
|
10405
10507
|
productsJobId: _this.state.productsJobId || '',
|
|
10406
10508
|
productTypesJobId: _this.state.productTypesJobId || '',
|
|
10509
|
+
productSelectionsJobId: _this.state.productSelectionsJobId || '',
|
|
10407
10510
|
shouldIncludeProducts: !!_this.state.productsJobId,
|
|
10408
|
-
shouldIncludeProductTypes: !!_this.state.productTypesJobId
|
|
10511
|
+
shouldIncludeProductTypes: !!_this.state.productTypesJobId,
|
|
10512
|
+
shouldIncludeProductSelections: !!_this.state.productSelectionsJobId
|
|
10409
10513
|
},
|
|
10410
10514
|
fetchPolicy: 'network-only'
|
|
10411
10515
|
});
|
|
@@ -10415,7 +10519,8 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10415
10519
|
};
|
|
10416
10520
|
return {
|
|
10417
10521
|
products: result.data.products || completedStatus,
|
|
10418
|
-
productTypes: result.data.productTypes || completedStatus
|
|
10522
|
+
productTypes: result.data.productTypes || completedStatus,
|
|
10523
|
+
productSelections: result.data.productSelections || completedStatus
|
|
10419
10524
|
};
|
|
10420
10525
|
};
|
|
10421
10526
|
_this.handleFinishedIndexing = async () => {
|
|
@@ -10454,9 +10559,10 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10454
10559
|
try {
|
|
10455
10560
|
const _await$_this$getIndex = await _this.getIndexingProgress(),
|
|
10456
10561
|
products = _await$_this$getIndex.products,
|
|
10457
|
-
productTypes = _await$_this$getIndex.productTypes
|
|
10458
|
-
|
|
10459
|
-
const
|
|
10562
|
+
productTypes = _await$_this$getIndex.productTypes,
|
|
10563
|
+
productSelections = _await$_this$getIndex.productSelections;
|
|
10564
|
+
const isCompleted = isIndexingCompleted(products, productTypes, productSelections);
|
|
10565
|
+
const indexingProgress = calculateProgress(products, productTypes, productSelections);
|
|
10460
10566
|
_this.setState({
|
|
10461
10567
|
indexingProgress
|
|
10462
10568
|
});
|
|
@@ -10474,14 +10580,16 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10474
10580
|
};
|
|
10475
10581
|
_this.monitorIndexingProgress = async _ref2 => {
|
|
10476
10582
|
let isIndexingProducts = _ref2.isIndexingProducts,
|
|
10477
|
-
isIndexingProductTypes = _ref2.isIndexingProductTypes
|
|
10583
|
+
isIndexingProductTypes = _ref2.isIndexingProductTypes,
|
|
10584
|
+
isIndexingProductSelections = _ref2.isIndexingProductSelections;
|
|
10478
10585
|
if (_this.state.isProjectBeingIndexedByPim) return;
|
|
10479
10586
|
try {
|
|
10480
10587
|
const indexMutationResult = await _this.props.indexProject({
|
|
10481
10588
|
context: pimIndexerRequestContext,
|
|
10482
10589
|
variables: {
|
|
10483
10590
|
shouldIndexProducts: isIndexingProducts,
|
|
10484
|
-
shouldIndexProductTypes: isIndexingProductTypes
|
|
10591
|
+
shouldIndexProductTypes: isIndexingProductTypes,
|
|
10592
|
+
shouldIndexProductSelections: isIndexingProductSelections
|
|
10485
10593
|
}
|
|
10486
10594
|
});
|
|
10487
10595
|
_this.setState(_objectSpread$r(_objectSpread$r({
|
|
@@ -10496,7 +10604,8 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10496
10604
|
};
|
|
10497
10605
|
_this.indexProject = () => _this.monitorIndexingProgress({
|
|
10498
10606
|
isIndexingProductTypes: true,
|
|
10499
|
-
isIndexingProducts: true
|
|
10607
|
+
isIndexingProducts: true,
|
|
10608
|
+
isIndexingProductSelections: true
|
|
10500
10609
|
});
|
|
10501
10610
|
return _this;
|
|
10502
10611
|
}
|
|
@@ -11971,12 +12080,18 @@ var messages$c = reactIntl.defineMessages({
|
|
|
11971
12080
|
}
|
|
11972
12081
|
});
|
|
11973
12082
|
|
|
12083
|
+
const _excluded$1 = ["isRequired", "disabled"];
|
|
11974
12084
|
const valueMapping = {
|
|
11975
12085
|
yes: true,
|
|
11976
12086
|
no: false,
|
|
11977
12087
|
all: [true, false]
|
|
11978
12088
|
};
|
|
11979
|
-
const BooleanField =
|
|
12089
|
+
const BooleanField = _ref => {
|
|
12090
|
+
let _ref$isRequired = _ref.isRequired,
|
|
12091
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
12092
|
+
_ref$disabled = _ref.disabled,
|
|
12093
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
12094
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
11980
12095
|
let selectedValue;
|
|
11981
12096
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray__default["default"](props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
11982
12097
|
const yesLabel = props.intl.formatMessage(messages$c.yes);
|
|
@@ -11994,7 +12109,7 @@ const BooleanField = props => {
|
|
|
11994
12109
|
});
|
|
11995
12110
|
return jsxRuntime.jsx(uiKit.SelectInput, {
|
|
11996
12111
|
name: props.name,
|
|
11997
|
-
isClearable: !
|
|
12112
|
+
isClearable: !isRequired,
|
|
11998
12113
|
isSearchable: false,
|
|
11999
12114
|
value: selectedValue,
|
|
12000
12115
|
onChange: event => {
|
|
@@ -12004,14 +12119,10 @@ const BooleanField = props => {
|
|
|
12004
12119
|
props.onChange(newValue);
|
|
12005
12120
|
},
|
|
12006
12121
|
options,
|
|
12007
|
-
isDisabled:
|
|
12122
|
+
isDisabled: disabled
|
|
12008
12123
|
});
|
|
12009
12124
|
};
|
|
12010
12125
|
BooleanField.displayName = 'BooleanField';
|
|
12011
|
-
BooleanField.defaultProps = {
|
|
12012
|
-
isRequired: false,
|
|
12013
|
-
disabled: false
|
|
12014
|
-
};
|
|
12015
12126
|
var booleanField = reactIntl.injectIntl(BooleanField);
|
|
12016
12127
|
function getBooleanValue(value) {
|
|
12017
12128
|
if (typeof value !== 'boolean') return undefined;
|
|
@@ -12055,16 +12166,19 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
12055
12166
|
}
|
|
12056
12167
|
});
|
|
12057
12168
|
|
|
12169
|
+
const _excluded = ["isChecked"];
|
|
12058
12170
|
function ownKeys$6(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; }
|
|
12059
12171
|
function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
12060
|
-
const MissingValueField =
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12172
|
+
const MissingValueField = _ref => {
|
|
12173
|
+
let _ref$isChecked = _ref.isChecked,
|
|
12174
|
+
isChecked = _ref$isChecked === void 0 ? false : _ref$isChecked,
|
|
12175
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12176
|
+
return jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
12177
|
+
name: "missing-value",
|
|
12178
|
+
isChecked: isChecked,
|
|
12179
|
+
onChange: props.onChange,
|
|
12180
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$9.label))
|
|
12181
|
+
});
|
|
12068
12182
|
};
|
|
12069
12183
|
var MissingValueField$1 = MissingValueField;
|
|
12070
12184
|
|
|
@@ -13338,7 +13452,8 @@ const not = function () {
|
|
|
13338
13452
|
|
|
13339
13453
|
const safelyAddFallback = function (string) {
|
|
13340
13454
|
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.NO_VALUE_FALLBACK;
|
|
13341
|
-
|
|
13455
|
+
if (string === '') return fallback;
|
|
13456
|
+
return string ?? fallback;
|
|
13342
13457
|
};
|
|
13343
13458
|
|
|
13344
13459
|
var messages = reactIntl.defineMessages({
|
|
@@ -13862,7 +13977,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
13862
13977
|
exports.safelyAddFallback = safelyAddFallback;
|
|
13863
13978
|
exports.sanitize = sanitize;
|
|
13864
13979
|
exports.searchCategories = searchCategories;
|
|
13865
|
-
exports.searchInputMessages = messages$
|
|
13980
|
+
exports.searchInputMessages = messages$N;
|
|
13866
13981
|
exports.setDisplayName = setDisplayName$1;
|
|
13867
13982
|
exports.setToArray = setToArray;
|
|
13868
13983
|
exports.shallowEqual = shallowEqual;
|