@commercetools-frontend/experimental-components 6.3.2 → 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 +345 -236
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +345 -236
- package/dist/commercetools-frontend-experimental-components.esm.js +345 -236
- package/dist/styles.css +38 -37
- package/package.json +23 -21
|
@@ -265,6 +265,7 @@ const INTERVALS_IN_SECONDS = {
|
|
|
265
265
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
266
266
|
const PRODUCT_TAILORING_FOR_ATTRIBUTES = 'productTailoringForAttributes';
|
|
267
267
|
const PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT = 'productTailoringForAttributesTypesOtherThanText';
|
|
268
|
+
const PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES = 'productTailoringForAttributesFallbackValues';
|
|
268
269
|
|
|
269
270
|
// TODO: apply a more robust solution to overlaying issues
|
|
270
271
|
const Z_INDEX_DROPDOWN = 30000;
|
|
@@ -282,7 +283,7 @@ var pickerMessages$1 = reactIntl.defineMessages({
|
|
|
282
283
|
}
|
|
283
284
|
});
|
|
284
285
|
|
|
285
|
-
var messages$
|
|
286
|
+
var messages$R = reactIntl.defineMessages({
|
|
286
287
|
noChannelsFound: {
|
|
287
288
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
288
289
|
description: 'The message to display when no channels were found',
|
|
@@ -366,7 +367,7 @@ const ChannelPickerInput = _ref => {
|
|
|
366
367
|
return inputValue.length === 0 && data.channels.total > 60 ? [...channels, getBottomOption()] : channels;
|
|
367
368
|
}).catch(error => {
|
|
368
369
|
setLoadingError(error);
|
|
369
|
-
onError(error);
|
|
370
|
+
onError && onError(error);
|
|
370
371
|
}), [loadOptions, convertChannelToOption, onError]);
|
|
371
372
|
const loadOptionsDebounced = useDebouncedPromiseCallback$1(handleLoadOptions, 300);
|
|
372
373
|
const _useHandlers = useHandlers$1(onChange),
|
|
@@ -379,10 +380,10 @@ const ChannelPickerInput = _ref => {
|
|
|
379
380
|
}, [handleInternalInputChange]);
|
|
380
381
|
const isCurrentOptionLoadingFailed = Boolean(currentOption?.error);
|
|
381
382
|
React.useEffect(() => {
|
|
382
|
-
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
383
|
+
if (isCurrentOptionLoadingFailed && onError) onError(currentOption.error);
|
|
383
384
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
384
385
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
385
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
386
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$R.noChannelsFound), [loadingError, formatMessage]);
|
|
386
387
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
387
388
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
388
389
|
max: "scale",
|
|
@@ -393,7 +394,7 @@ const ChannelPickerInput = _ref => {
|
|
|
393
394
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
394
395
|
id: name,
|
|
395
396
|
name: name,
|
|
396
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
397
|
+
placeholder: placeholder ?? formatMessage(messages$R.placeholder),
|
|
397
398
|
loadOptions: loadOptionsDebounced,
|
|
398
399
|
defaultOptions: true,
|
|
399
400
|
showOptionGroupDivider: true,
|
|
@@ -449,7 +450,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
449
450
|
FormattedDateTime.displayName = 'FormattedDateTime';
|
|
450
451
|
var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
451
452
|
|
|
452
|
-
var messages$
|
|
453
|
+
var messages$Q = reactIntl.defineMessages({
|
|
453
454
|
noProductTypesFound: {
|
|
454
455
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
455
456
|
description: 'The message to display when no product types were found',
|
|
@@ -538,7 +539,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
538
539
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
539
540
|
id: name,
|
|
540
541
|
name: name,
|
|
541
|
-
placeholder: formatMessage(messages$
|
|
542
|
+
placeholder: formatMessage(messages$Q.placeholder),
|
|
542
543
|
loadOptions: loadOptionsDebounced,
|
|
543
544
|
defaultOptions: [],
|
|
544
545
|
isClearable: isClearable,
|
|
@@ -551,7 +552,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
551
552
|
onInputChange: handleInputChange,
|
|
552
553
|
onBlur: onBlur,
|
|
553
554
|
value: currentOption.data,
|
|
554
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
555
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$Q.noProductTypesFound),
|
|
555
556
|
hasError: hasError || isLoadingFailed,
|
|
556
557
|
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
557
558
|
menuPortalTarget: document.body,
|
|
@@ -567,7 +568,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
567
568
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
568
569
|
var ProductTypePickerInput$1 = ProductTypePickerInput;
|
|
569
570
|
|
|
570
|
-
var messages$
|
|
571
|
+
var messages$P = reactIntl.defineMessages({
|
|
571
572
|
noStatesFound: {
|
|
572
573
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
573
574
|
description: 'The message to display when no states were found',
|
|
@@ -651,7 +652,7 @@ const StatePickerInput = _ref => {
|
|
|
651
652
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
652
653
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
653
654
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
654
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
655
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$P.noStatesFound), [loadingError, formatMessage]);
|
|
655
656
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
656
657
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
657
658
|
max: "scale",
|
|
@@ -663,7 +664,7 @@ const StatePickerInput = _ref => {
|
|
|
663
664
|
id: name,
|
|
664
665
|
name: name,
|
|
665
666
|
horizontalConstraint: "scale",
|
|
666
|
-
placeholder: formatMessage(messages$
|
|
667
|
+
placeholder: formatMessage(messages$P.placeholder),
|
|
667
668
|
loadOptions: loadOptionsDebounced,
|
|
668
669
|
defaultOptions: true,
|
|
669
670
|
showOptionGroupDivider: true,
|
|
@@ -720,7 +721,7 @@ const CustomFieldTooltip = _ref => {
|
|
|
720
721
|
};
|
|
721
722
|
var CustomFieldTooltip$1 = CustomFieldTooltip;
|
|
722
723
|
|
|
723
|
-
var messages$
|
|
724
|
+
var messages$O = reactIntl.defineMessages({
|
|
724
725
|
bottomOption: {
|
|
725
726
|
id: 'Products.Pickers.bottomOption',
|
|
726
727
|
description: 'The message to display at the end of the options menu',
|
|
@@ -732,7 +733,7 @@ function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Ob
|
|
|
732
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; }
|
|
733
734
|
const getBottomOption = formatMessage => ({
|
|
734
735
|
options: [{
|
|
735
|
-
label: formatMessage ? formatMessage(messages$
|
|
736
|
+
label: formatMessage ? formatMessage(messages$O.bottomOption) : messages$O.bottomOption,
|
|
736
737
|
isBottomOption: true,
|
|
737
738
|
isDisabled: true
|
|
738
739
|
}]
|
|
@@ -779,7 +780,7 @@ const useHandlers = onChange => {
|
|
|
779
780
|
};
|
|
780
781
|
var useHandlers$1 = useHandlers;
|
|
781
782
|
|
|
782
|
-
const _excluded$
|
|
783
|
+
const _excluded$e = ["extraWhere"];
|
|
783
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; }
|
|
784
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; }
|
|
785
786
|
const constructPrefixSearchPredicate$1 = function () {
|
|
@@ -822,7 +823,7 @@ const useLoadOptions = _ref => {
|
|
|
822
823
|
}
|
|
823
824
|
const _ref2 = variables ?? {},
|
|
824
825
|
extraWhere = _ref2.extraWhere,
|
|
825
|
-
restVariables = _objectWithoutProperties(_ref2, _excluded$
|
|
826
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$e);
|
|
826
827
|
if (typeof extraWhere === 'string') {
|
|
827
828
|
where = where ? `(${where}) and ${variables.extraWhere}` : variables.extraWhere;
|
|
828
829
|
}
|
|
@@ -841,7 +842,7 @@ const useLoadOptions = _ref => {
|
|
|
841
842
|
};
|
|
842
843
|
var useLoadOptions$1 = useLoadOptions;
|
|
843
844
|
|
|
844
|
-
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 } } } };
|
|
845
846
|
const useExecuteGraphQLRequest = () => {
|
|
846
847
|
const apolloClient = react.useApolloClient();
|
|
847
848
|
return React.useCallback((query, variables, context, fetchPolicy) => {
|
|
@@ -1255,7 +1256,7 @@ ThrottledField.defaultProps = {
|
|
|
1255
1256
|
};
|
|
1256
1257
|
var ThrottledField$1 = ThrottledField;
|
|
1257
1258
|
|
|
1258
|
-
var messages$
|
|
1259
|
+
var messages$N = reactIntl.defineMessages({
|
|
1259
1260
|
buttonLabel: {
|
|
1260
1261
|
id: 'SearchInput.buttonLabel',
|
|
1261
1262
|
description: 'Label for "Search" button.',
|
|
@@ -1360,7 +1361,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
1360
1361
|
"data-testid": this.props.testId || 'search-input',
|
|
1361
1362
|
value: this.state.text,
|
|
1362
1363
|
label: this.props.label,
|
|
1363
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
1364
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$N.placeholder),
|
|
1364
1365
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
1365
1366
|
onChange: this.handleInputChange,
|
|
1366
1367
|
onEnter: this.handleEnter,
|
|
@@ -2029,7 +2030,7 @@ const usePersistedReminder = function () {
|
|
|
2029
2030
|
};
|
|
2030
2031
|
var usePersistedReminder$1 = usePersistedReminder;
|
|
2031
2032
|
|
|
2032
|
-
var messages$
|
|
2033
|
+
var messages$M = reactIntl.defineMessages({
|
|
2033
2034
|
profileUpdated: {
|
|
2034
2035
|
id: 'NotificationText.profileUpdated',
|
|
2035
2036
|
description: 'Label for the notification header',
|
|
@@ -2066,9 +2067,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2066
2067
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2067
2068
|
as: "p",
|
|
2068
2069
|
isBold: true,
|
|
2069
|
-
intlMessage: messages$
|
|
2070
|
+
intlMessage: messages$M.profileUpdated
|
|
2070
2071
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2071
|
-
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$
|
|
2072
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.addMoreInformation), {}, {
|
|
2072
2073
|
values: {
|
|
2073
2074
|
newline: getNewLine
|
|
2074
2075
|
}
|
|
@@ -2077,7 +2078,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2077
2078
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2078
2079
|
scale: "xs",
|
|
2079
2080
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2080
|
-
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$
|
|
2081
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$M.informationAndProfileLink), {}, {
|
|
2081
2082
|
values: {
|
|
2082
2083
|
newline: getNewLine,
|
|
2083
2084
|
link: getLinkToProfile
|
|
@@ -2202,7 +2203,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2202
2203
|
};
|
|
2203
2204
|
var useEventCallback$1 = useEventCallback;
|
|
2204
2205
|
|
|
2205
|
-
var messages$
|
|
2206
|
+
var messages$L = reactIntl.defineMessages({
|
|
2206
2207
|
fallbackHint: {
|
|
2207
2208
|
id: 'KeyFallback.fallbackHint',
|
|
2208
2209
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2226,7 +2227,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2226
2227
|
return values => {
|
|
2227
2228
|
if (!values.resource) return null;
|
|
2228
2229
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2229
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2230
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2230
2231
|
key: values.resource.key
|
|
2231
2232
|
});
|
|
2232
2233
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -3883,7 +3884,7 @@ function formatMoney$2(moneyValue, intl, options) {
|
|
|
3883
3884
|
}, options));
|
|
3884
3885
|
}
|
|
3885
3886
|
|
|
3886
|
-
var messages$
|
|
3887
|
+
var messages$K = reactIntl.defineMessages({
|
|
3887
3888
|
booleanYes: {
|
|
3888
3889
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
3889
3890
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -3965,7 +3966,7 @@ const formatDateTime = _ref7 => {
|
|
|
3965
3966
|
const formatBoolean = _ref8 => {
|
|
3966
3967
|
let value = _ref8.value,
|
|
3967
3968
|
intl = _ref8.intl;
|
|
3968
|
-
return value ? intl.formatMessage(messages$
|
|
3969
|
+
return value ? intl.formatMessage(messages$K.booleanYes) : intl.formatMessage(messages$K.booleanNo);
|
|
3969
3970
|
};
|
|
3970
3971
|
const formatNilType = _ref9 => {
|
|
3971
3972
|
let value = _ref9.value,
|
|
@@ -4124,9 +4125,9 @@ const getPrefixSearchBounds = input => {
|
|
|
4124
4125
|
};
|
|
4125
4126
|
var getPrefixSearchBounds$1 = getPrefixSearchBounds;
|
|
4126
4127
|
|
|
4127
|
-
const _excluded$
|
|
4128
|
+
const _excluded$d = ["action"];
|
|
4128
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; }
|
|
4129
|
-
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; }
|
|
4130
4131
|
|
|
4131
4132
|
/**
|
|
4132
4133
|
* Checks if a value is a LocalizedString
|
|
@@ -4263,6 +4264,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4263
4264
|
const formatMoney = valueType => money => {
|
|
4264
4265
|
switch (valueType) {
|
|
4265
4266
|
case 'fixed':
|
|
4267
|
+
case 'fixedCart':
|
|
4266
4268
|
return {
|
|
4267
4269
|
[money.type]: _objectSpread$15({
|
|
4268
4270
|
centAmount: money.centAmount,
|
|
@@ -4294,6 +4296,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4294
4296
|
absolute: ['money'],
|
|
4295
4297
|
absoluteCart: ['money', 'applicationMode'],
|
|
4296
4298
|
fixed: ['money'],
|
|
4299
|
+
fixedCart: ['money', 'applicationMode'],
|
|
4297
4300
|
giftLineItem: ['product', 'variantId', 'distributionChannel', 'supplyChannel', 'ResourceIdentifierInput']
|
|
4298
4301
|
};
|
|
4299
4302
|
const filteredValue = pick__default["default"](actionPayload.value, possibleTypeKeys[valueType]);
|
|
@@ -4317,7 +4320,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4317
4320
|
* as its dynamic content can not be typed in SDL for the mutation.
|
|
4318
4321
|
*/
|
|
4319
4322
|
const convertAction = (actionName, actionPayload) => {
|
|
4320
|
-
var _context3, _context4, _context5;
|
|
4323
|
+
var _context3, _context4, _context5, _context6, _context7;
|
|
4321
4324
|
const getNameFromPayload = payload => {
|
|
4322
4325
|
// changeName for `Organizations`
|
|
4323
4326
|
if (typeof payload.name === 'string') return payload;
|
|
@@ -4598,18 +4601,26 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4598
4601
|
return {
|
|
4599
4602
|
[actionName]: {
|
|
4600
4603
|
target: {
|
|
4601
|
-
[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
|
+
})
|
|
4602
4613
|
}
|
|
4603
4614
|
}
|
|
4604
4615
|
};
|
|
4605
4616
|
case 'addAddress':
|
|
4606
4617
|
case 'changeAddress':
|
|
4607
4618
|
{
|
|
4608
|
-
var
|
|
4619
|
+
var _context8;
|
|
4609
4620
|
const _ref3 = actionPayload.address?.custom || {},
|
|
4610
4621
|
_ref3$fields = _ref3.fields,
|
|
4611
4622
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
4612
|
-
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 => {
|
|
4613
4624
|
let _ref5 = _slicedToArray(_ref4, 2),
|
|
4614
4625
|
name = _ref5[0],
|
|
4615
4626
|
value = _ref5[1];
|
|
@@ -4634,13 +4645,13 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4634
4645
|
}
|
|
4635
4646
|
case 'setAddressCustomType':
|
|
4636
4647
|
{
|
|
4637
|
-
var
|
|
4648
|
+
var _context9;
|
|
4638
4649
|
const _ref6 = actionPayload || {},
|
|
4639
4650
|
addressId = _ref6.addressId,
|
|
4640
4651
|
_ref6$fields = _ref6.fields,
|
|
4641
4652
|
fields = _ref6$fields === void 0 ? {} : _ref6$fields,
|
|
4642
4653
|
type = _ref6.type;
|
|
4643
|
-
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 => {
|
|
4644
4655
|
let _ref8 = _slicedToArray(_ref7, 2),
|
|
4645
4656
|
name = _ref8[0],
|
|
4646
4657
|
value = _ref8[1];
|
|
@@ -4668,7 +4679,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4668
4679
|
};
|
|
4669
4680
|
const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["default"](actions).call(actions, (previousActions, _ref9) => {
|
|
4670
4681
|
let actionName = _ref9.action,
|
|
4671
|
-
actionPayload = _objectWithoutProperties(_ref9, _excluded$
|
|
4682
|
+
actionPayload = _objectWithoutProperties(_ref9, _excluded$d);
|
|
4672
4683
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4673
4684
|
}, []);
|
|
4674
4685
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
@@ -5072,7 +5083,7 @@ function uniqueObjects(items) {
|
|
|
5072
5083
|
|
|
5073
5084
|
*/
|
|
5074
5085
|
|
|
5075
|
-
const messages$
|
|
5086
|
+
const messages$J = reactIntl.defineMessages({
|
|
5076
5087
|
unique: {
|
|
5077
5088
|
id: 'Validation.unique',
|
|
5078
5089
|
description: 'An error message to show if the field must be unique',
|
|
@@ -5114,7 +5125,7 @@ const messages$I = reactIntl.defineMessages({
|
|
|
5114
5125
|
defaultMessage: 'Invalid ID format. Please enter a valid ID.'
|
|
5115
5126
|
}
|
|
5116
5127
|
});
|
|
5117
|
-
var validationMessages = messages$
|
|
5128
|
+
var validationMessages = messages$J;
|
|
5118
5129
|
|
|
5119
5130
|
function getIndexesOfInvalidValues(values) {
|
|
5120
5131
|
let invalidValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -5370,7 +5381,7 @@ function ReferenceSearch(props) {
|
|
|
5370
5381
|
});
|
|
5371
5382
|
}
|
|
5372
5383
|
|
|
5373
|
-
const messages$
|
|
5384
|
+
const messages$H = reactIntl.defineMessages({
|
|
5374
5385
|
placeholder: {
|
|
5375
5386
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5376
5387
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5397,7 +5408,7 @@ const messages$G = reactIntl.defineMessages({
|
|
|
5397
5408
|
defaultMessage: 'Enter search term'
|
|
5398
5409
|
}
|
|
5399
5410
|
});
|
|
5400
|
-
var messages$
|
|
5411
|
+
var messages$I = messages$H;
|
|
5401
5412
|
|
|
5402
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; }
|
|
5403
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; }
|
|
@@ -5422,7 +5433,7 @@ function Option$1(props) {
|
|
|
5422
5433
|
fallbackOrder: languages
|
|
5423
5434
|
})
|
|
5424
5435
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
5425
|
-
children: [formatMessage(messages$
|
|
5436
|
+
children: [formatMessage(messages$I.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
5426
5437
|
})]
|
|
5427
5438
|
})
|
|
5428
5439
|
}));
|
|
@@ -5498,10 +5509,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5498
5509
|
onBlur: props.onBlur,
|
|
5499
5510
|
onChange: props.onChange,
|
|
5500
5511
|
value: returnNullIfEmpty(props.value),
|
|
5501
|
-
placeholderLabel: formatMessage(messages$
|
|
5502
|
-
searchPromptLabel: formatMessage(messages$
|
|
5503
|
-
noResultsLabel: formatMessage(messages$
|
|
5504
|
-
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),
|
|
5505
5516
|
mapItemToOption: mapItemToOption,
|
|
5506
5517
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5507
5518
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5511,7 +5522,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5511
5522
|
});
|
|
5512
5523
|
}
|
|
5513
5524
|
|
|
5514
|
-
const messages$
|
|
5525
|
+
const messages$F = reactIntl.defineMessages({
|
|
5515
5526
|
placeholder: {
|
|
5516
5527
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5517
5528
|
description: 'Placeholder for search for a category',
|
|
@@ -5543,7 +5554,7 @@ const messages$E = reactIntl.defineMessages({
|
|
|
5543
5554
|
defaultMessage: 'Parent Category'
|
|
5544
5555
|
}
|
|
5545
5556
|
});
|
|
5546
|
-
var messages$
|
|
5557
|
+
var messages$G = messages$F;
|
|
5547
5558
|
|
|
5548
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; }
|
|
5549
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; }
|
|
@@ -5568,7 +5579,7 @@ function Option(props) {
|
|
|
5568
5579
|
fallbackOrder: languages
|
|
5569
5580
|
})
|
|
5570
5581
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5571
|
-
children: `${formatMessage(messages$
|
|
5582
|
+
children: `${formatMessage(messages$G.parentCategory)}: ${l10n.formatLocalizedString(category.parent, {
|
|
5572
5583
|
key: 'name',
|
|
5573
5584
|
locale: language,
|
|
5574
5585
|
fallbackOrder: languages
|
|
@@ -5580,7 +5591,7 @@ function Option(props) {
|
|
|
5580
5591
|
fallbackOrder: languages
|
|
5581
5592
|
})}`
|
|
5582
5593
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5583
|
-
children: `${formatMessage(messages$
|
|
5594
|
+
children: `${formatMessage(messages$G.externalId)}: ${category.externalId || constants.NO_VALUE_FALLBACK}`
|
|
5584
5595
|
})]
|
|
5585
5596
|
})
|
|
5586
5597
|
}));
|
|
@@ -5628,10 +5639,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5628
5639
|
onBlur: props.onBlur,
|
|
5629
5640
|
onChange: props.onChange,
|
|
5630
5641
|
value: props.value,
|
|
5631
|
-
placeholderLabel: formatMessage(messages$
|
|
5632
|
-
searchPromptLabel: formatMessage(messages$
|
|
5633
|
-
noResultsLabel: formatMessage(messages$
|
|
5634
|
-
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),
|
|
5635
5646
|
mapItemToOption: mapItemToOption,
|
|
5636
5647
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5637
5648
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5656,6 +5667,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5656
5667
|
}]));
|
|
5657
5668
|
}
|
|
5658
5669
|
|
|
5670
|
+
const _excluded$c = ["type"];
|
|
5659
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; }
|
|
5660
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; }
|
|
5661
5673
|
var styles$g = {
|
|
@@ -5683,7 +5695,10 @@ var styles$g = {
|
|
|
5683
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",
|
|
5684
5696
|
"add-button": "button-module__add-button___1f093"
|
|
5685
5697
|
};
|
|
5686
|
-
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);
|
|
5687
5702
|
const className = props.className,
|
|
5688
5703
|
onClick = props.onClick,
|
|
5689
5704
|
isDisabled = props.isDisabled,
|
|
@@ -5693,7 +5708,7 @@ const Button = props => {
|
|
|
5693
5708
|
const dataProps = filterDataAttributes(props);
|
|
5694
5709
|
return jsxRuntime.jsx("button", _objectSpread$Z(_objectSpread$Z({
|
|
5695
5710
|
onClick: isDisabled ? null : onClick,
|
|
5696
|
-
type:
|
|
5711
|
+
type: type,
|
|
5697
5712
|
className: classnames__default["default"](styles$g.button, isDisabled ? styles$g.disabled : null, className),
|
|
5698
5713
|
disabled: isDisabled,
|
|
5699
5714
|
"aria-label": props['aria-label']
|
|
@@ -5702,12 +5717,9 @@ const Button = props => {
|
|
|
5702
5717
|
}));
|
|
5703
5718
|
};
|
|
5704
5719
|
Button.displayName = 'Button';
|
|
5705
|
-
Button.defaultProps = {
|
|
5706
|
-
type: 'button'
|
|
5707
|
-
};
|
|
5708
5720
|
var Button$1 = Button;
|
|
5709
5721
|
|
|
5710
|
-
var messages$
|
|
5722
|
+
var messages$E = reactIntl.defineMessages({
|
|
5711
5723
|
chooseFile: {
|
|
5712
5724
|
id: 'ButtonFileInput.chooseFile',
|
|
5713
5725
|
description: 'The label text of the field for upload local file',
|
|
@@ -5715,34 +5727,39 @@ var messages$D = reactIntl.defineMessages({
|
|
|
5715
5727
|
}
|
|
5716
5728
|
});
|
|
5717
5729
|
|
|
5730
|
+
const _excluded$b = ["children", "allowMultiple", "acceptTypes"];
|
|
5718
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; }
|
|
5719
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; }
|
|
5720
5733
|
var styles$f = {
|
|
5721
5734
|
"button": "file-input-module__button___2KypN",
|
|
5722
5735
|
"input": "file-input-module__input___3MP4D"
|
|
5723
5736
|
};
|
|
5724
|
-
const FileInput =
|
|
5725
|
-
children
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
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
|
+
});
|
|
5742
5758
|
};
|
|
5759
|
+
FileInput.displayName = 'FileInput';
|
|
5743
5760
|
var FileInput$1 = FileInput;
|
|
5744
5761
|
|
|
5745
|
-
var messages$
|
|
5762
|
+
var messages$D = reactIntl.defineMessages({
|
|
5746
5763
|
countriesBasicSelectPlaceholder: {
|
|
5747
5764
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
5748
5765
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -5763,7 +5780,7 @@ var messages$C = reactIntl.defineMessages({
|
|
|
5763
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; }
|
|
5764
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; }
|
|
5765
5782
|
const emptyCountryOption = intl => [{
|
|
5766
|
-
label: intl.formatMessage(messages$
|
|
5783
|
+
label: intl.formatMessage(messages$D.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
5767
5784
|
value: undefined,
|
|
5768
5785
|
isDisabled: true
|
|
5769
5786
|
}];
|
|
@@ -5805,7 +5822,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
5805
5822
|
var _context3;
|
|
5806
5823
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
5807
5824
|
}),
|
|
5808
|
-
placeholder: intl.formatMessage(messages$
|
|
5825
|
+
placeholder: intl.formatMessage(messages$D.countriesAsyncSelectPlaceholder),
|
|
5809
5826
|
loadOptions: handleLoadOptions,
|
|
5810
5827
|
onChange: onOptionChange,
|
|
5811
5828
|
isDisabled: props.isDisabled,
|
|
@@ -5825,7 +5842,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
5825
5842
|
value: props.value,
|
|
5826
5843
|
isRequired: props.isRequired,
|
|
5827
5844
|
description: props.description,
|
|
5828
|
-
placeholder: intl.formatMessage(messages$
|
|
5845
|
+
placeholder: intl.formatMessage(messages$D.countriesBasicSelectPlaceholder),
|
|
5829
5846
|
options: props.options,
|
|
5830
5847
|
onChange: props.onChange,
|
|
5831
5848
|
isDisabled: props.isDisabled,
|
|
@@ -5837,22 +5854,31 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
5837
5854
|
|
|
5838
5855
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
5839
5856
|
|
|
5857
|
+
const _excluded$a = ["countriesAsyncLoadingLimit", "isMulti", "isRequired", "hasWarning"];
|
|
5840
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; }
|
|
5841
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; }
|
|
5842
|
-
function CountriesPicker(
|
|
5843
|
-
|
|
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;
|
|
5844
5871
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
5845
|
-
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))
|
|
5846
5878
|
});
|
|
5847
5879
|
}
|
|
5848
|
-
CountriesPicker.defaultProps = {
|
|
5849
|
-
countriesAsyncLoadingLimit: COUNTRIES_ASYNC_LOADING_LIMIT,
|
|
5850
|
-
isMulti: false,
|
|
5851
|
-
isRequired: false,
|
|
5852
|
-
hasWarning: false
|
|
5853
|
-
};
|
|
5854
5880
|
|
|
5855
|
-
var messages$
|
|
5881
|
+
var messages$C = reactIntl.defineMessages({
|
|
5856
5882
|
noCustomerGroupsFound: {
|
|
5857
5883
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
5858
5884
|
description: 'The message to display when no customer groups were found',
|
|
@@ -5942,7 +5968,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
5942
5968
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
5943
5969
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
5944
5970
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
5945
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
5971
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
5946
5972
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
5947
5973
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
5948
5974
|
max: "scale",
|
|
@@ -5953,7 +5979,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
5953
5979
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
5954
5980
|
id: name,
|
|
5955
5981
|
name: name,
|
|
5956
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
5982
|
+
placeholder: placeholder ?? formatMessage(messages$C.placeholder),
|
|
5957
5983
|
loadOptions: loadOptionsDebounced,
|
|
5958
5984
|
defaultOptions: true,
|
|
5959
5985
|
showOptionGroupDivider: true,
|
|
@@ -6088,16 +6114,24 @@ const makeChangeHandler = setValue => event => {
|
|
|
6088
6114
|
// attributes.
|
|
6089
6115
|
const omitUnknownValues = (valuesAsMap, fieldDefinitionsAsMap) => omitBy__default["default"](valuesAsMap, (value, key) => isNil__default["default"](fieldDefinitionsAsMap[key]));
|
|
6090
6116
|
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
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
|
+
|
|
6101
6135
|
const valueToBooleanSet = value => {
|
|
6102
6136
|
switch (value) {
|
|
6103
6137
|
case 'true':
|
|
@@ -6118,6 +6152,18 @@ const mapToValue = value => {
|
|
|
6118
6152
|
};
|
|
6119
6153
|
function CustomBooleanInputSet(props) {
|
|
6120
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]);
|
|
6121
6167
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6122
6168
|
const nullifiedIfNeeded = !rawValue ? undefined : valueToBooleanSet(rawValue);
|
|
6123
6169
|
props.setFieldValue(props.name, nullifiedIfNeeded);
|
|
@@ -6126,7 +6172,7 @@ function CustomBooleanInputSet(props) {
|
|
|
6126
6172
|
id: props.name,
|
|
6127
6173
|
name: props.name,
|
|
6128
6174
|
value: value,
|
|
6129
|
-
options: options
|
|
6175
|
+
options: options,
|
|
6130
6176
|
onChange: handleChange,
|
|
6131
6177
|
onBlur: props.onBlur,
|
|
6132
6178
|
isClearable: !props.fieldDefinition.required,
|
|
@@ -6539,7 +6585,8 @@ function CustomLocalizedTextInput(props) {
|
|
|
6539
6585
|
hasError: props.hasError,
|
|
6540
6586
|
isDisabled: props.isDisabled,
|
|
6541
6587
|
isReadOnly: props.isReadOnly,
|
|
6542
|
-
hasWarning: props.hasWarning
|
|
6588
|
+
hasWarning: props.hasWarning,
|
|
6589
|
+
additionalInfo: props.additionalInfo
|
|
6543
6590
|
})
|
|
6544
6591
|
});
|
|
6545
6592
|
}
|
|
@@ -7350,7 +7397,8 @@ function CustomTimeInput(props) {
|
|
|
7350
7397
|
setInternalValue = _useState2[1];
|
|
7351
7398
|
const lastValueSentToFormik = React.useRef();
|
|
7352
7399
|
React.useEffect(() => {
|
|
7353
|
-
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
|
+
) {
|
|
7354
7402
|
setInternalValue(formatTime(props.value));
|
|
7355
7403
|
}
|
|
7356
7404
|
}, [props.value, formatTime]);
|
|
@@ -7427,7 +7475,8 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7427
7475
|
hasError: props.hasError,
|
|
7428
7476
|
hasWarning: props.hasWarning,
|
|
7429
7477
|
handleWarningChange: props.handleWarningChange,
|
|
7430
|
-
renderWarnings: props.renderWarnings
|
|
7478
|
+
renderWarnings: props.renderWarnings,
|
|
7479
|
+
additionalInfo: props.additionalInfo
|
|
7431
7480
|
});
|
|
7432
7481
|
});
|
|
7433
7482
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
@@ -7802,22 +7851,22 @@ const useDnDContext = () => {
|
|
|
7802
7851
|
return React.useContext(DnDContext);
|
|
7803
7852
|
};
|
|
7804
7853
|
|
|
7805
|
-
const _excluded$
|
|
7854
|
+
const _excluded$9 = ["renderCustomWarnings", "WrapperComponent"];
|
|
7806
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; }
|
|
7807
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; }
|
|
7808
7857
|
const existingAttributeTypes = ['text', 'ltext'];
|
|
7809
|
-
const newAttributeTypes = ['text', 'ltext', 'number']; // Add more types here
|
|
7810
|
-
|
|
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'];
|
|
7811
7860
|
const getFieldName = (parentName, fieldName) => {
|
|
7812
7861
|
if (!parentName) return fieldName;
|
|
7813
7862
|
return `${parentName}.${fieldName}`;
|
|
7814
7863
|
};
|
|
7815
|
-
function
|
|
7864
|
+
const isAttributeType = function () {
|
|
7816
7865
|
let fieldDefinitionType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7817
7866
|
let isTailoringAttributeForOtherTypes = arguments.length > 1 ? arguments[1] : undefined;
|
|
7818
7867
|
const attributeTypes = isTailoringAttributeForOtherTypes ? newAttributeTypes : existingAttributeTypes;
|
|
7819
|
-
return _includesInstanceProperty__default["default"](attributeTypes).call(attributeTypes, fieldDefinitionType.name);
|
|
7820
|
-
}
|
|
7868
|
+
return _includesInstanceProperty__default["default"](attributeTypes).call(attributeTypes, fieldDefinitionType.name) || isTailoringAttributeForOtherTypes && fieldDefinitionType.name === 'set' && _includesInstanceProperty__default["default"](setAttributeTypes).call(setAttributeTypes, fieldDefinitionType?.elementType?.name);
|
|
7869
|
+
};
|
|
7821
7870
|
const isNested = fieldDefinition => {
|
|
7822
7871
|
const type = fieldDefinition.type;
|
|
7823
7872
|
const typeName = type.name.toLowerCase();
|
|
@@ -7828,8 +7877,10 @@ const isNested = fieldDefinition => {
|
|
|
7828
7877
|
return typeName === CUSTOM_FIELD_TYPES.nested;
|
|
7829
7878
|
};
|
|
7830
7879
|
const CustomFieldsInternal = _ref => {
|
|
7831
|
-
let
|
|
7832
|
-
|
|
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);
|
|
7833
7884
|
const _useFormikContext = formik.useFormikContext(),
|
|
7834
7885
|
errors = _useFormikContext.errors,
|
|
7835
7886
|
touched = _useFormikContext.touched,
|
|
@@ -7838,6 +7889,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7838
7889
|
status = _useFormikContext.status;
|
|
7839
7890
|
const isTailoringAttributesEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES);
|
|
7840
7891
|
const isTailoringAttributeForOtherTypes = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_TYPES_OTHER_THAN_TEXT);
|
|
7892
|
+
const isTailoringFallbackEnabled = applicationShell.useFeatureToggle(PRODUCT_TAILORING_FOR_ATTRIBUTES_FALLBACK_VALUES);
|
|
7841
7893
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7842
7894
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7843
7895
|
const _useDnDContext = useDnDContext(),
|
|
@@ -7852,6 +7904,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7852
7904
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7853
7905
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7854
7906
|
const isFieldDisabled = props.isDisabled && !(isAttributeType(fieldDefinition.type, isTailoringAttributeForOtherTypes) && isTailoringAttributesEnabled);
|
|
7907
|
+
const isSet = fieldDefinition.type.name === 'set';
|
|
7855
7908
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7856
7909
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7857
7910
|
|
|
@@ -7876,7 +7929,8 @@ const CustomFieldsInternal = _ref => {
|
|
|
7876
7929
|
hasError: hasError,
|
|
7877
7930
|
hasWarning: props.renderWarnings && status?.warnings[fieldName],
|
|
7878
7931
|
handleWarningChange: props.handleWarningChange,
|
|
7879
|
-
renderWarnings: props.renderWarnings
|
|
7932
|
+
renderWarnings: props.renderWarnings,
|
|
7933
|
+
additionalInfo: isTailoringFallbackEnabled && props.additionalInfoHandler && !isSet ? props.additionalInfoHandler(fieldDefinition) : undefined
|
|
7880
7934
|
};
|
|
7881
7935
|
const Field = jsxRuntime.jsx(FieldComponent, _objectSpread$J({}, fieldProps));
|
|
7882
7936
|
return jsxRuntime.jsx(formik.FastField, {
|
|
@@ -7900,7 +7954,7 @@ const CustomFieldsInternal = _ref => {
|
|
|
7900
7954
|
alignItems: "stretch",
|
|
7901
7955
|
children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
|
|
7902
7956
|
children: Field
|
|
7903
|
-
}) : Field, props.renderWarnings && status?.warnings[fieldName] &&
|
|
7957
|
+
}) : Field, props.renderWarnings && status?.warnings[fieldName] && renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors$1, {
|
|
7904
7958
|
isTouched: isTouched,
|
|
7905
7959
|
errors: fieldErrors
|
|
7906
7960
|
})]
|
|
@@ -7913,9 +7967,6 @@ const CustomFieldsInternal = _ref => {
|
|
|
7913
7967
|
});
|
|
7914
7968
|
};
|
|
7915
7969
|
CustomFieldsInternal.displayName = 'CustomFieldsInternal';
|
|
7916
|
-
CustomFieldsInternal.defaultProps = {
|
|
7917
|
-
renderCustomWarnings: () => null
|
|
7918
|
-
};
|
|
7919
7970
|
var CustomFieldsInternal$1 = CustomFieldsInternal;
|
|
7920
7971
|
|
|
7921
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; }
|
|
@@ -7987,14 +8038,14 @@ const attributesMapToNameValuePairs = map => {
|
|
|
7987
8038
|
});
|
|
7988
8039
|
};
|
|
7989
8040
|
|
|
7990
|
-
const _excluded = ["WrapperComponent"];
|
|
8041
|
+
const _excluded$8 = ["WrapperComponent"];
|
|
7991
8042
|
const getAttributeShortName = (fullName, attributesPrefix) => {
|
|
7992
8043
|
if (!attributesPrefix) return fullName;
|
|
7993
8044
|
return fullName.replace(`${attributesPrefix}.`, '');
|
|
7994
8045
|
};
|
|
7995
8046
|
function ProductAttributes(_ref) {
|
|
7996
8047
|
let WrapperComponent = _ref.WrapperComponent,
|
|
7997
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
8048
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
7998
8049
|
const formik$1 = formik.useFormikContext();
|
|
7999
8050
|
const fieldDefinitions = React.useMemo(() => {
|
|
8000
8051
|
var _context;
|
|
@@ -8022,7 +8073,8 @@ function ProductAttributes(_ref) {
|
|
|
8022
8073
|
WrapperComponent: WrapperComponent,
|
|
8023
8074
|
renderWarnings: props.renderWarnings,
|
|
8024
8075
|
renderCustomWarnings: props.renderCustomWarnings,
|
|
8025
|
-
handleWarningChange: props.handleWarningChange
|
|
8076
|
+
handleWarningChange: props.handleWarningChange,
|
|
8077
|
+
additionalInfoHandler: props.additionalInfoHandler
|
|
8026
8078
|
})
|
|
8027
8079
|
})
|
|
8028
8080
|
});
|
|
@@ -8468,9 +8520,37 @@ function ModeSelectInputOption(props) {
|
|
|
8468
8520
|
}));
|
|
8469
8521
|
}
|
|
8470
8522
|
|
|
8523
|
+
const _excluded$7 = ["lowerProductSelectionsLimit", "upperProductSelectionsLimit", "renderSelectInputOptionValuesByField", "optionType", "isMulti", "isRequired", "hasWarning", "hasError", "isClearable", "isReadOnly", "isDisabled", "excludedProductSelectionIds", "title"];
|
|
8471
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; }
|
|
8472
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; }
|
|
8473
|
-
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);
|
|
8474
8554
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher$1();
|
|
8475
8555
|
const components = React.useMemo(() => {
|
|
8476
8556
|
return {
|
|
@@ -8478,39 +8558,38 @@ function ProductSelectionsPicker(props) {
|
|
|
8478
8558
|
if (optionInnerProps.isDisabled) {
|
|
8479
8559
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
8480
8560
|
}
|
|
8481
|
-
if (
|
|
8561
|
+
if (optionType === TYPE_PROPERTY) {
|
|
8482
8562
|
return jsxRuntime.jsx(ModeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
8483
8563
|
}
|
|
8484
8564
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8485
|
-
optionType:
|
|
8565
|
+
optionType: optionType,
|
|
8486
8566
|
optionInnerProps: optionInnerProps
|
|
8487
8567
|
});
|
|
8488
8568
|
}
|
|
8489
8569
|
};
|
|
8490
|
-
}, [
|
|
8570
|
+
}, [optionType]);
|
|
8491
8571
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner$1, {});
|
|
8492
|
-
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <=
|
|
8572
|
+
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8493
8573
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8494
|
-
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), {}, {
|
|
8495
8589
|
components: components
|
|
8496
8590
|
}))
|
|
8497
8591
|
});
|
|
8498
8592
|
}
|
|
8499
|
-
ProductSelectionsPicker.defaultProps = {
|
|
8500
|
-
lowerProductSelectionsLimit: LOWER_PRODUCT_SELECTIONS_LIMIT,
|
|
8501
|
-
upperProductSelectionsLimit: UPPER_PRODUCT_SELECTIONS_LIMIT,
|
|
8502
|
-
renderSelectInputOptionValuesByField: 'id',
|
|
8503
|
-
optionType: 'double-property',
|
|
8504
|
-
isMulti: false,
|
|
8505
|
-
isRequired: false,
|
|
8506
|
-
hasWarning: false,
|
|
8507
|
-
hasError: false,
|
|
8508
|
-
isClearable: false,
|
|
8509
|
-
isReadOnly: false,
|
|
8510
|
-
isDisabled: false,
|
|
8511
|
-
excludedProductSelectionIds: [],
|
|
8512
|
-
title: '' // FieldLabel requires title to have some value
|
|
8513
|
-
};
|
|
8514
8593
|
|
|
8515
8594
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
8516
8595
|
var styles$b = {
|
|
@@ -8547,19 +8626,21 @@ const ScrollToFieldError = () => {
|
|
|
8547
8626
|
if (firstErrorElement) {
|
|
8548
8627
|
// Get a reference to the label.
|
|
8549
8628
|
const firstElementId = firstErrorElement.getAttribute('id');
|
|
8550
|
-
|
|
8629
|
+
if (firstElementId) {
|
|
8630
|
+
const localizedInputIndex = _indexOfInstanceProperty__default["default"](firstElementId).call(firstElementId, `.${dataLocale}`);
|
|
8551
8631
|
|
|
8552
|
-
|
|
8553
|
-
|
|
8632
|
+
// check if locale is appended then remove it from id
|
|
8633
|
+
const id = localizedInputIndex > -1 ? firstElementId.replace(`.${dataLocale}`, '') : firstElementId;
|
|
8554
8634
|
|
|
8555
|
-
|
|
8635
|
+
// Scroll to the label (if found), otherwise to the input element itself.
|
|
8556
8636
|
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
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
|
+
}
|
|
8563
8644
|
}
|
|
8564
8645
|
}, [dataLocale, isValid, submitCount]);
|
|
8565
8646
|
return null;
|
|
@@ -8705,6 +8786,7 @@ const getCustomGroupLabelOption = customLabel => [{
|
|
|
8705
8786
|
isDisabled: true
|
|
8706
8787
|
}];
|
|
8707
8788
|
|
|
8789
|
+
const _excluded$6 = ["shouldFetchProductSelections"];
|
|
8708
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; }
|
|
8709
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; }
|
|
8710
8792
|
const hasErrors$2 = errors => {
|
|
@@ -8735,7 +8817,10 @@ const emptyStoreOption = intl => [{
|
|
|
8735
8817
|
value: undefined,
|
|
8736
8818
|
isDisabled: true
|
|
8737
8819
|
}];
|
|
8738
|
-
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);
|
|
8739
8824
|
const intl = reactIntl.useIntl();
|
|
8740
8825
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
8741
8826
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -8749,7 +8834,7 @@ const StoresAsyncSelectInput = props => {
|
|
|
8749
8834
|
offset: 0,
|
|
8750
8835
|
sort: 'createdAt asc',
|
|
8751
8836
|
excludeExtendedStoresList: true,
|
|
8752
|
-
excludeProductSelections: !
|
|
8837
|
+
excludeProductSelections: !shouldFetchProductSelections,
|
|
8753
8838
|
stores: keysOfStores?.length && keysOfStores,
|
|
8754
8839
|
projectKey: props.projectKey
|
|
8755
8840
|
});
|
|
@@ -8830,18 +8915,19 @@ const StoresAsyncSelectInput = props => {
|
|
|
8830
8915
|
});
|
|
8831
8916
|
};
|
|
8832
8917
|
StoresAsyncSelectInput.displayName = 'StoresAsyncSelectInput';
|
|
8833
|
-
StoresAsyncSelectInput.defaultProps = {
|
|
8834
|
-
shouldFetchProductSelections: false
|
|
8835
|
-
};
|
|
8836
8918
|
var StoresAsyncSelectInput$1 = StoresAsyncSelectInput;
|
|
8837
8919
|
|
|
8920
|
+
const _excluded$5 = ["shouldFetchProductSelections"];
|
|
8838
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; }
|
|
8839
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; }
|
|
8840
8923
|
const hasErrors$1 = errors => {
|
|
8841
8924
|
var _context;
|
|
8842
8925
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
8843
8926
|
};
|
|
8844
|
-
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);
|
|
8845
8931
|
const intl = reactIntl.useIntl();
|
|
8846
8932
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
8847
8933
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -8855,7 +8941,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8855
8941
|
offset: 0,
|
|
8856
8942
|
sort: 'createdAt asc',
|
|
8857
8943
|
excludeExtendedStoresList: true,
|
|
8858
|
-
excludeProductSelections: !
|
|
8944
|
+
excludeProductSelections: !shouldFetchProductSelections,
|
|
8859
8945
|
stores: keysOfStores?.length && keysOfStores,
|
|
8860
8946
|
projectKey: props.projectKey
|
|
8861
8947
|
});
|
|
@@ -8880,7 +8966,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8880
8966
|
const currentStore = _findInstanceProperty__default["default"](listOptions).call(listOptions, store => store.value === value);
|
|
8881
8967
|
|
|
8882
8968
|
// We need complete store info including productSelections
|
|
8883
|
-
if (!
|
|
8969
|
+
if (!shouldFetchProductSelections && !props?.renderLabel) {
|
|
8884
8970
|
props.onChange(event);
|
|
8885
8971
|
} else {
|
|
8886
8972
|
props.onChange({
|
|
@@ -8928,9 +9014,6 @@ const StoresBasicSelectInput = props => {
|
|
|
8928
9014
|
});
|
|
8929
9015
|
};
|
|
8930
9016
|
StoresBasicSelectInput.displayName = 'StoresBasicSelectInput';
|
|
8931
|
-
StoresBasicSelectInput.defaultProps = {
|
|
8932
|
-
shouldFetchProductSelections: false
|
|
8933
|
-
};
|
|
8934
9017
|
var StoresBasicSelectInput$1 = StoresBasicSelectInput;
|
|
8935
9018
|
|
|
8936
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 } } } };
|
|
@@ -8977,6 +9060,7 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8977
9060
|
};
|
|
8978
9061
|
var useStoresByFieldFetcher$1 = useStoresByFieldFetcher;
|
|
8979
9062
|
|
|
9063
|
+
const _excluded$4 = ["shouldFetchProductSelections"];
|
|
8980
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; }
|
|
8981
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; }
|
|
8982
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 } } } };
|
|
@@ -9047,7 +9131,10 @@ const getValueFromOptions = _ref2 => {
|
|
|
9047
9131
|
return selectedOptions[0];
|
|
9048
9132
|
}
|
|
9049
9133
|
};
|
|
9050
|
-
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);
|
|
9051
9138
|
// hooks
|
|
9052
9139
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
9053
9140
|
dataLocale: applicationContext.dataLocale,
|
|
@@ -9057,7 +9144,7 @@ const StoresSearchSelectInput = props => {
|
|
|
9057
9144
|
projectLanguages = _useApplicationContex.projectLanguages;
|
|
9058
9145
|
const intl = reactIntl.useIntl();
|
|
9059
9146
|
const client$1 = client.useApolloClient();
|
|
9060
|
-
const storesByFieldFetcher = useStoresByFieldFetcher$1(props.value, props.renderSelectInputOptionValuesByField, props.projectKey,
|
|
9147
|
+
const storesByFieldFetcher = useStoresByFieldFetcher$1(props.value, props.renderSelectInputOptionValuesByField, props.projectKey, shouldFetchProductSelections);
|
|
9061
9148
|
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors) || props.hasError;
|
|
9062
9149
|
const handleLoadOptions = searchText => {
|
|
9063
9150
|
const extractMatchedStores = client$1.query({
|
|
@@ -9066,15 +9153,15 @@ const StoresSearchSelectInput = props => {
|
|
|
9066
9153
|
searchText,
|
|
9067
9154
|
dataLocale,
|
|
9068
9155
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9069
|
-
shouldFetchProductSelections
|
|
9156
|
+
shouldFetchProductSelections
|
|
9070
9157
|
}),
|
|
9071
9158
|
context: {
|
|
9072
9159
|
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM,
|
|
9073
9160
|
projectKey: props.projectKey
|
|
9074
9161
|
},
|
|
9075
9162
|
fetchPolicy: 'network-only'
|
|
9076
|
-
}).then(
|
|
9077
|
-
let data =
|
|
9163
|
+
}).then(_ref4 => {
|
|
9164
|
+
let data = _ref4.data;
|
|
9078
9165
|
const result = data.storesByWherePredicate?.results.map(store => mapStoresToOptions({
|
|
9079
9166
|
store,
|
|
9080
9167
|
dataLocale,
|
|
@@ -9091,8 +9178,8 @@ const StoresSearchSelectInput = props => {
|
|
|
9091
9178
|
return extractMatchedStores;
|
|
9092
9179
|
};
|
|
9093
9180
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
9094
|
-
const renderNoOptions =
|
|
9095
|
-
let inputValue =
|
|
9181
|
+
const renderNoOptions = _ref5 => {
|
|
9182
|
+
let inputValue = _ref5.inputValue;
|
|
9096
9183
|
return jsxRuntime.jsxs("div", {
|
|
9097
9184
|
className: styles$9.renderLabelContainer,
|
|
9098
9185
|
children: [jsxRuntime.jsx("div", {
|
|
@@ -9149,17 +9236,26 @@ const StoresSearchSelectInput = props => {
|
|
|
9149
9236
|
});
|
|
9150
9237
|
};
|
|
9151
9238
|
StoresSearchSelectInput.displayName = 'StoresSearchSelectInput';
|
|
9152
|
-
StoresSearchSelectInput.defaultProps = {
|
|
9153
|
-
shouldFetchProductSelections: false
|
|
9154
|
-
};
|
|
9155
9239
|
var StoresSearchSelectInput$1 = StoresSearchSelectInput;
|
|
9156
9240
|
|
|
9241
|
+
const _excluded$3 = ["lowerStoresLimit", "upperStoresLimit", "renderSelectInputOptionValuesByField", "optionType", "shouldFetchProductSelections"];
|
|
9157
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; }
|
|
9158
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; }
|
|
9159
9244
|
var styles$8 = {
|
|
9160
9245
|
"customOption": "store-select-input-module__customOption___2SC00"
|
|
9161
9246
|
};
|
|
9162
|
-
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);
|
|
9163
9259
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher$1(props.projectKey);
|
|
9164
9260
|
const components = React.useMemo(() => {
|
|
9165
9261
|
return {
|
|
@@ -9168,19 +9264,19 @@ const StoreSelectInput = props => {
|
|
|
9168
9264
|
if (optionInnerProps.isDisabled) {
|
|
9169
9265
|
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$B({}, optionInnerProps));
|
|
9170
9266
|
}
|
|
9171
|
-
const isSearchSelectInput = totalNumberOfStoresFetcher.total >
|
|
9267
|
+
const isSearchSelectInput = totalNumberOfStoresFetcher.total > upperStoresLimit;
|
|
9172
9268
|
return jsxRuntime.jsx("div", {
|
|
9173
9269
|
className: isSearchSelectInput ? styles$8.customOption : '',
|
|
9174
9270
|
children: jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
9175
|
-
optionType:
|
|
9271
|
+
optionType: optionType,
|
|
9176
9272
|
optionInnerProps: optionInnerProps
|
|
9177
9273
|
})
|
|
9178
9274
|
});
|
|
9179
9275
|
}
|
|
9180
9276
|
};
|
|
9181
|
-
}, [
|
|
9277
|
+
}, [optionType, totalNumberOfStoresFetcher.total, upperStoresLimit]);
|
|
9182
9278
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner$1, {});
|
|
9183
|
-
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <=
|
|
9279
|
+
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= lowerStoresLimit ? StoresBasicSelectInput$1 : totalNumberOfStoresFetcher.total <= upperStoresLimit ? StoresAsyncSelectInput$1 : StoresSearchSelectInput$1;
|
|
9184
9280
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$B(_objectSpread$B({
|
|
9185
9281
|
menuIsOpen: props.menuIsOpen,
|
|
9186
9282
|
placeholder: props.placeholder,
|
|
@@ -9209,27 +9305,27 @@ const StoreSelectInput = props => {
|
|
|
9209
9305
|
maxMenuHeight: props.maxMenuHeight,
|
|
9210
9306
|
menuPortalTarget: props.menuPortalTarget,
|
|
9211
9307
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
9212
|
-
renderSelectInputOptionValuesByField:
|
|
9213
|
-
lowerStoresLimit:
|
|
9214
|
-
upperStoresLimit:
|
|
9308
|
+
renderSelectInputOptionValuesByField: renderSelectInputOptionValuesByField,
|
|
9309
|
+
lowerStoresLimit: lowerStoresLimit,
|
|
9310
|
+
upperStoresLimit: upperStoresLimit,
|
|
9215
9311
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9216
|
-
shouldFetchProductSelections:
|
|
9312
|
+
shouldFetchProductSelections: shouldFetchProductSelections,
|
|
9217
9313
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
9218
9314
|
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)));
|
|
9219
9315
|
};
|
|
9220
9316
|
StoreSelectInput.displayName = 'StoreSelectInput';
|
|
9221
|
-
StoreSelectInput.defaultProps = {
|
|
9222
|
-
lowerStoresLimit: LOWER_STORES_LIMIT,
|
|
9223
|
-
upperStoresLimit: UPPER_STORES_LIMIT,
|
|
9224
|
-
renderSelectInputOptionValuesByField: 'id',
|
|
9225
|
-
optionType: 'double-property',
|
|
9226
|
-
shouldFetchProductSelections: false
|
|
9227
|
-
};
|
|
9228
9317
|
var StoreSelectInput$1 = StoreSelectInput;
|
|
9229
9318
|
|
|
9319
|
+
const _excluded$2 = ["lowerStoresLimit", "upperStoresLimit", "mappedValueField"];
|
|
9230
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; }
|
|
9231
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; }
|
|
9232
|
-
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);
|
|
9233
9329
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
9234
9330
|
max: props.horizontalConstraint,
|
|
9235
9331
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -9266,8 +9362,8 @@ const StoreSelectField = props => {
|
|
|
9266
9362
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
9267
9363
|
optionType: props.optionType,
|
|
9268
9364
|
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField,
|
|
9269
|
-
lowerStoresLimit:
|
|
9270
|
-
upperStoresLimit:
|
|
9365
|
+
lowerStoresLimit: lowerStoresLimit,
|
|
9366
|
+
upperStoresLimit: upperStoresLimit,
|
|
9271
9367
|
allAccessibleStoreKeysThroughDataFencePermissions: props.allAccessibleStoreKeysThroughDataFencePermissions,
|
|
9272
9368
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
9273
9369
|
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)))]
|
|
@@ -9275,11 +9371,6 @@ const StoreSelectField = props => {
|
|
|
9275
9371
|
});
|
|
9276
9372
|
};
|
|
9277
9373
|
StoreSelectField.displayName = 'StoreSelectField';
|
|
9278
|
-
StoreSelectField.defaultProps = {
|
|
9279
|
-
lowerStoresLimit: LOWER_STORES_LIMIT,
|
|
9280
|
-
upperStoresLimit: UPPER_STORES_LIMIT,
|
|
9281
|
-
mappedValueField: 'id'
|
|
9282
|
-
};
|
|
9283
9374
|
var StoreSelectField$1 = StoreSelectField;
|
|
9284
9375
|
|
|
9285
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; }
|
|
@@ -9700,7 +9791,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
9700
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)); }
|
|
9701
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; })(); }
|
|
9702
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 } } } };
|
|
9703
|
-
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'];
|
|
9704
9795
|
const emptyTypeDefinitions = {
|
|
9705
9796
|
total: 0,
|
|
9706
9797
|
count: 0,
|
|
@@ -10253,7 +10344,7 @@ const defaultValue = {
|
|
|
10253
10344
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10254
10345
|
var PimIndexerContext$1 = PimIndexerContext;
|
|
10255
10346
|
|
|
10256
|
-
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 } } } };
|
|
10257
10348
|
var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
10258
10349
|
try {
|
|
10259
10350
|
await dispatch(sdk.actions.head({
|
|
@@ -10273,11 +10364,12 @@ var fetchPimIndexStatus = (apolloClient, projectKey) => async dispatch => {
|
|
|
10273
10364
|
fetchPolicy: 'network-only'
|
|
10274
10365
|
}),
|
|
10275
10366
|
data = _await$apolloClient$q.data;
|
|
10276
|
-
if (data.indicesExist.products.newInProgress || data.indicesExist.productTypes.newInProgress) {
|
|
10367
|
+
if (data.indicesExist.products.newInProgress || data.indicesExist.productTypes.newInProgress || data.indicesExist.productSelections.newInProgress) {
|
|
10277
10368
|
return {
|
|
10278
10369
|
status: 'indexing',
|
|
10279
10370
|
isIndexingProducts: !data.indicesExist.products.searchableIndexExists,
|
|
10280
|
-
isIndexingProductTypes: !data.indicesExist.productTypes.searchableIndexExists
|
|
10371
|
+
isIndexingProductTypes: !data.indicesExist.productTypes.searchableIndexExists,
|
|
10372
|
+
isIndexingProductSelections: !data.indicesExist.productSelections.searchableIndexExists
|
|
10281
10373
|
};
|
|
10282
10374
|
}
|
|
10283
10375
|
return {
|
|
@@ -10311,21 +10403,23 @@ function ownKeys$r(e, r) { var t = _Object$keys__default["default"](e); if (_Obj
|
|
|
10311
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; }
|
|
10312
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)); }
|
|
10313
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; })(); }
|
|
10314
|
-
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:
|
|
10315
|
-
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:
|
|
10316
|
-
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 } } } };
|
|
10317
10409
|
const pimIndexerRequestContext = {
|
|
10318
10410
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
10319
10411
|
};
|
|
10320
|
-
const isIndexingCompleted = (products, productTypes) => products.completed && productTypes.completed;
|
|
10321
|
-
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;
|
|
10322
10414
|
const getIndexingJobIds = _ref => {
|
|
10323
10415
|
let _ref$data = _ref.data,
|
|
10324
10416
|
products = _ref$data.products,
|
|
10325
|
-
productTypes = _ref$data.productTypes
|
|
10417
|
+
productTypes = _ref$data.productTypes,
|
|
10418
|
+
productSelections = _ref$data.productSelections;
|
|
10326
10419
|
return {
|
|
10327
10420
|
productsJobId: products?.indexingJobId || products?.existingIndexingJobId,
|
|
10328
|
-
productTypesJobId: productTypes?.indexingJobId || productTypes?.existingIndexingJobId
|
|
10421
|
+
productTypesJobId: productTypes?.indexingJobId || productTypes?.existingIndexingJobId,
|
|
10422
|
+
productSelectionsJobId: productSelections?.indexingJobId || productSelections?.existingIndexingJobId
|
|
10329
10423
|
};
|
|
10330
10424
|
};
|
|
10331
10425
|
let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -10348,12 +10442,14 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10348
10442
|
const _await$_this$props$fe = await _this.props.fetchPimIndexStatus(_this.props.client, _this.props.projectKey),
|
|
10349
10443
|
status = _await$_this$props$fe.status,
|
|
10350
10444
|
isIndexingProducts = _await$_this$props$fe.isIndexingProducts,
|
|
10351
|
-
isIndexingProductTypes = _await$_this$props$fe.isIndexingProductTypes
|
|
10445
|
+
isIndexingProductTypes = _await$_this$props$fe.isIndexingProductTypes,
|
|
10446
|
+
isIndexingProductSelections = _await$_this$props$fe.isIndexingProductSelections;
|
|
10352
10447
|
const isPimIndexerUnreachable = _includesInstanceProperty__default["default"](_context = ['not-configured', 'unreachable']).call(_context, status);
|
|
10353
10448
|
if (status === 'indexing') {
|
|
10354
10449
|
_this.monitorIndexingProgress({
|
|
10355
10450
|
isIndexingProducts,
|
|
10356
|
-
isIndexingProductTypes
|
|
10451
|
+
isIndexingProductTypes,
|
|
10452
|
+
isIndexingProductSelections
|
|
10357
10453
|
});
|
|
10358
10454
|
} else {
|
|
10359
10455
|
_this.setState({
|
|
@@ -10410,8 +10506,10 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10410
10506
|
variables: {
|
|
10411
10507
|
productsJobId: _this.state.productsJobId || '',
|
|
10412
10508
|
productTypesJobId: _this.state.productTypesJobId || '',
|
|
10509
|
+
productSelectionsJobId: _this.state.productSelectionsJobId || '',
|
|
10413
10510
|
shouldIncludeProducts: !!_this.state.productsJobId,
|
|
10414
|
-
shouldIncludeProductTypes: !!_this.state.productTypesJobId
|
|
10511
|
+
shouldIncludeProductTypes: !!_this.state.productTypesJobId,
|
|
10512
|
+
shouldIncludeProductSelections: !!_this.state.productSelectionsJobId
|
|
10415
10513
|
},
|
|
10416
10514
|
fetchPolicy: 'network-only'
|
|
10417
10515
|
});
|
|
@@ -10421,7 +10519,8 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10421
10519
|
};
|
|
10422
10520
|
return {
|
|
10423
10521
|
products: result.data.products || completedStatus,
|
|
10424
|
-
productTypes: result.data.productTypes || completedStatus
|
|
10522
|
+
productTypes: result.data.productTypes || completedStatus,
|
|
10523
|
+
productSelections: result.data.productSelections || completedStatus
|
|
10425
10524
|
};
|
|
10426
10525
|
};
|
|
10427
10526
|
_this.handleFinishedIndexing = async () => {
|
|
@@ -10460,9 +10559,10 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10460
10559
|
try {
|
|
10461
10560
|
const _await$_this$getIndex = await _this.getIndexingProgress(),
|
|
10462
10561
|
products = _await$_this$getIndex.products,
|
|
10463
|
-
productTypes = _await$_this$getIndex.productTypes
|
|
10464
|
-
|
|
10465
|
-
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);
|
|
10466
10566
|
_this.setState({
|
|
10467
10567
|
indexingProgress
|
|
10468
10568
|
});
|
|
@@ -10480,14 +10580,16 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10480
10580
|
};
|
|
10481
10581
|
_this.monitorIndexingProgress = async _ref2 => {
|
|
10482
10582
|
let isIndexingProducts = _ref2.isIndexingProducts,
|
|
10483
|
-
isIndexingProductTypes = _ref2.isIndexingProductTypes
|
|
10583
|
+
isIndexingProductTypes = _ref2.isIndexingProductTypes,
|
|
10584
|
+
isIndexingProductSelections = _ref2.isIndexingProductSelections;
|
|
10484
10585
|
if (_this.state.isProjectBeingIndexedByPim) return;
|
|
10485
10586
|
try {
|
|
10486
10587
|
const indexMutationResult = await _this.props.indexProject({
|
|
10487
10588
|
context: pimIndexerRequestContext,
|
|
10488
10589
|
variables: {
|
|
10489
10590
|
shouldIndexProducts: isIndexingProducts,
|
|
10490
|
-
shouldIndexProductTypes: isIndexingProductTypes
|
|
10591
|
+
shouldIndexProductTypes: isIndexingProductTypes,
|
|
10592
|
+
shouldIndexProductSelections: isIndexingProductSelections
|
|
10491
10593
|
}
|
|
10492
10594
|
});
|
|
10493
10595
|
_this.setState(_objectSpread$r(_objectSpread$r({
|
|
@@ -10502,7 +10604,8 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10502
10604
|
};
|
|
10503
10605
|
_this.indexProject = () => _this.monitorIndexingProgress({
|
|
10504
10606
|
isIndexingProductTypes: true,
|
|
10505
|
-
isIndexingProducts: true
|
|
10607
|
+
isIndexingProducts: true,
|
|
10608
|
+
isIndexingProductSelections: true
|
|
10506
10609
|
});
|
|
10507
10610
|
return _this;
|
|
10508
10611
|
}
|
|
@@ -11977,12 +12080,18 @@ var messages$c = reactIntl.defineMessages({
|
|
|
11977
12080
|
}
|
|
11978
12081
|
});
|
|
11979
12082
|
|
|
12083
|
+
const _excluded$1 = ["isRequired", "disabled"];
|
|
11980
12084
|
const valueMapping = {
|
|
11981
12085
|
yes: true,
|
|
11982
12086
|
no: false,
|
|
11983
12087
|
all: [true, false]
|
|
11984
12088
|
};
|
|
11985
|
-
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);
|
|
11986
12095
|
let selectedValue;
|
|
11987
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]);
|
|
11988
12097
|
const yesLabel = props.intl.formatMessage(messages$c.yes);
|
|
@@ -12000,7 +12109,7 @@ const BooleanField = props => {
|
|
|
12000
12109
|
});
|
|
12001
12110
|
return jsxRuntime.jsx(uiKit.SelectInput, {
|
|
12002
12111
|
name: props.name,
|
|
12003
|
-
isClearable: !
|
|
12112
|
+
isClearable: !isRequired,
|
|
12004
12113
|
isSearchable: false,
|
|
12005
12114
|
value: selectedValue,
|
|
12006
12115
|
onChange: event => {
|
|
@@ -12010,14 +12119,10 @@ const BooleanField = props => {
|
|
|
12010
12119
|
props.onChange(newValue);
|
|
12011
12120
|
},
|
|
12012
12121
|
options,
|
|
12013
|
-
isDisabled:
|
|
12122
|
+
isDisabled: disabled
|
|
12014
12123
|
});
|
|
12015
12124
|
};
|
|
12016
12125
|
BooleanField.displayName = 'BooleanField';
|
|
12017
|
-
BooleanField.defaultProps = {
|
|
12018
|
-
isRequired: false,
|
|
12019
|
-
disabled: false
|
|
12020
|
-
};
|
|
12021
12126
|
var booleanField = reactIntl.injectIntl(BooleanField);
|
|
12022
12127
|
function getBooleanValue(value) {
|
|
12023
12128
|
if (typeof value !== 'boolean') return undefined;
|
|
@@ -12061,16 +12166,19 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
12061
12166
|
}
|
|
12062
12167
|
});
|
|
12063
12168
|
|
|
12169
|
+
const _excluded = ["isChecked"];
|
|
12064
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; }
|
|
12065
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; }
|
|
12066
|
-
const MissingValueField =
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
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
|
+
});
|
|
12074
12182
|
};
|
|
12075
12183
|
var MissingValueField$1 = MissingValueField;
|
|
12076
12184
|
|
|
@@ -13344,7 +13452,8 @@ const not = function () {
|
|
|
13344
13452
|
|
|
13345
13453
|
const safelyAddFallback = function (string) {
|
|
13346
13454
|
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.NO_VALUE_FALLBACK;
|
|
13347
|
-
|
|
13455
|
+
if (string === '') return fallback;
|
|
13456
|
+
return string ?? fallback;
|
|
13348
13457
|
};
|
|
13349
13458
|
|
|
13350
13459
|
var messages = reactIntl.defineMessages({
|
|
@@ -13868,7 +13977,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
13868
13977
|
exports.safelyAddFallback = safelyAddFallback;
|
|
13869
13978
|
exports.sanitize = sanitize;
|
|
13870
13979
|
exports.searchCategories = searchCategories;
|
|
13871
|
-
exports.searchInputMessages = messages$
|
|
13980
|
+
exports.searchInputMessages = messages$N;
|
|
13872
13981
|
exports.setDisplayName = setDisplayName$1;
|
|
13873
13982
|
exports.setToArray = setToArray;
|
|
13874
13983
|
exports.shallowEqual = shallowEqual;
|