@commercetools-frontend/experimental-components 3.2.1 → 4.0.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.
|
@@ -2276,7 +2276,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2276
2276
|
})
|
|
2277
2277
|
};
|
|
2278
2278
|
};
|
|
2279
|
-
const createQueryVariables$
|
|
2279
|
+
const createQueryVariables$9 = ownProps => {
|
|
2280
2280
|
var _context;
|
|
2281
2281
|
return _objectSpread$1h(_objectSpread$1h({
|
|
2282
2282
|
limit: ownProps.limit,
|
|
@@ -2292,7 +2292,7 @@ const createQueryVariables$8 = ownProps => {
|
|
|
2292
2292
|
const useStoresListFetcher = props => {
|
|
2293
2293
|
const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
|
|
2294
2294
|
const excludeProductSelections = props.excludeProductSelections || false;
|
|
2295
|
-
const queryVariables = createQueryVariables$
|
|
2295
|
+
const queryVariables = createQueryVariables$9({
|
|
2296
2296
|
limit: props.limit,
|
|
2297
2297
|
offset: props.offset,
|
|
2298
2298
|
sort: _sortInstanceProperty__default["default"](props),
|
|
@@ -2899,8 +2899,8 @@ const convertProductSelectionsFromGraphQl = productSelections => {
|
|
|
2899
2899
|
});
|
|
2900
2900
|
};
|
|
2901
2901
|
|
|
2902
|
-
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, 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: "productSelections" }, arguments: [{ 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" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { 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: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end:
|
|
2903
|
-
const createQueryVariables$
|
|
2902
|
+
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, 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: "productSelections" }, arguments: [{ 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" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { 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: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n type\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2903
|
+
const createQueryVariables$8 = ownProps => ({
|
|
2904
2904
|
limit: ownProps.limit,
|
|
2905
2905
|
offset: ownProps.offset,
|
|
2906
2906
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2912,7 +2912,7 @@ const emptyProductSelections = {
|
|
|
2912
2912
|
results: []
|
|
2913
2913
|
};
|
|
2914
2914
|
const useProductSelectionsFetcher = props => {
|
|
2915
|
-
const queryVariables = createQueryVariables$
|
|
2915
|
+
const queryVariables = createQueryVariables$8(props);
|
|
2916
2916
|
const _useQuery = hooks.useQuery(FetchProductSelections, {
|
|
2917
2917
|
context: {
|
|
2918
2918
|
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
@@ -7931,6 +7931,11 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7931
7931
|
id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
|
|
7932
7932
|
description: 'Placeholder of the search select field for product selections',
|
|
7933
7933
|
defaultMessage: 'Search for product selections by entering exact key'
|
|
7934
|
+
},
|
|
7935
|
+
asyncSelectDropdownTypeAheadPrompt: {
|
|
7936
|
+
id: 'ProductSelectionPicker.asyncSelectDropdownTypeAheadPrompt',
|
|
7937
|
+
description: 'Message shown telling the user to start typing to load more product selections',
|
|
7938
|
+
defaultMessage: 'Start typing above to load more'
|
|
7934
7939
|
}
|
|
7935
7940
|
});
|
|
7936
7941
|
|
|
@@ -7963,6 +7968,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7963
7968
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7964
7969
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
7965
7970
|
const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7971
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
7972
|
+
var _context;
|
|
7973
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7974
|
+
});
|
|
7966
7975
|
const onOptionClick = event => {
|
|
7967
7976
|
const productSelectionId = event.target.value;
|
|
7968
7977
|
const currentProductSelection = _findInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
|
|
@@ -7977,12 +7986,18 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7977
7986
|
isRequired: props.isRequired,
|
|
7978
7987
|
description: props.description,
|
|
7979
7988
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
|
|
7980
|
-
options: mapProductSelectionsToOptions$1(
|
|
7989
|
+
options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
|
|
7981
7990
|
components: props.components,
|
|
7982
7991
|
onChange: onOptionClick,
|
|
7992
|
+
onBlur: props.onBlur,
|
|
7983
7993
|
isDisabled: props.isDisabled,
|
|
7984
7994
|
isReadOnly: props.isReadOnly,
|
|
7985
7995
|
hasWarning: props.hasWarning,
|
|
7996
|
+
hasError: props.hasError,
|
|
7997
|
+
isClearable: props.isClearable,
|
|
7998
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7999
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8000
|
+
maxMenuHeight: props.maxMenuHeight,
|
|
7986
8001
|
isSearchable: true
|
|
7987
8002
|
});
|
|
7988
8003
|
}
|
|
@@ -7990,6 +8005,28 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7990
8005
|
const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
|
|
7991
8006
|
const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
|
|
7992
8007
|
|
|
8008
|
+
const getValueFromOptions$3 = _ref => {
|
|
8009
|
+
let currentlySelectedProductSelections = _ref.currentlySelectedProductSelections,
|
|
8010
|
+
allProductSelectionOptions = _ref.allProductSelectionOptions,
|
|
8011
|
+
isMulti = _ref.isMulti;
|
|
8012
|
+
// return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
|
|
8013
|
+
if (!currentlySelectedProductSelections) {
|
|
8014
|
+
return undefined;
|
|
8015
|
+
}
|
|
8016
|
+
|
|
8017
|
+
// handle async-select-field value transformation
|
|
8018
|
+
if (isMulti) {
|
|
8019
|
+
return _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value));
|
|
8020
|
+
}
|
|
8021
|
+
|
|
8022
|
+
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
8023
|
+
return _findInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value);
|
|
8024
|
+
};
|
|
8025
|
+
const emptyStoreOption$1 = intl => [{
|
|
8026
|
+
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
8027
|
+
value: undefined,
|
|
8028
|
+
isDisabled: true
|
|
8029
|
+
}];
|
|
7993
8030
|
function ProductSelectionsAsyncSelectDropdown(props) {
|
|
7994
8031
|
var _productSelectionsFet3;
|
|
7995
8032
|
const intl = reactIntl.useIntl();
|
|
@@ -8007,6 +8044,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8007
8044
|
var _productSelectionsFet, _productSelectionsFet2;
|
|
8008
8045
|
return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
8009
8046
|
}, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
|
|
8047
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
8048
|
+
var _context;
|
|
8049
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
8050
|
+
});
|
|
8010
8051
|
const onOptionClick = event => {
|
|
8011
8052
|
var _event$target$value;
|
|
8012
8053
|
const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
|
|
@@ -8014,7 +8055,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8014
8055
|
props.onChange(currentProductSelection);
|
|
8015
8056
|
};
|
|
8016
8057
|
const allProductSelectionOptions = React.useMemo(() => {
|
|
8017
|
-
return _mapInstanceProperty__default["default"](
|
|
8058
|
+
return _mapInstanceProperty__default["default"](filteredProductSelections).call(filteredProductSelections, productSelection => {
|
|
8018
8059
|
const localizedName = l10n.formatLocalizedString(productSelection, {
|
|
8019
8060
|
key: 'name',
|
|
8020
8061
|
locale: dataLocale,
|
|
@@ -8027,17 +8068,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8027
8068
|
key: productSelection.key
|
|
8028
8069
|
};
|
|
8029
8070
|
});
|
|
8030
|
-
}, [dataLocale, projectLanguages,
|
|
8071
|
+
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
8031
8072
|
const getDefaultOptions = () => {
|
|
8032
|
-
return
|
|
8073
|
+
return [{
|
|
8074
|
+
options: _sliceInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
|
|
8075
|
+
}, {
|
|
8076
|
+
options: emptyStoreOption$1(intl)
|
|
8077
|
+
}];
|
|
8033
8078
|
};
|
|
8034
8079
|
const handleLoadOptions = async searchTerm => {
|
|
8035
8080
|
const productSelectionOptions = allProductSelectionOptions;
|
|
8036
8081
|
const filteredOptions = _filterInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, productSelection => {
|
|
8037
|
-
var
|
|
8038
|
-
return _includesInstanceProperty__default["default"](
|
|
8082
|
+
var _context2, _context3;
|
|
8083
|
+
return _includesInstanceProperty__default["default"](_context2 = productSelection.label.toLowerCase()).call(_context2, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty__default["default"](_context3 = productSelection.key.toLowerCase()).call(_context3, searchTerm.toLowerCase());
|
|
8039
8084
|
});
|
|
8040
|
-
|
|
8085
|
+
const finalOptions = searchTerm ? _sliceInstanceProperty__default["default"](filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
|
|
8086
|
+
return [{
|
|
8087
|
+
options: finalOptions
|
|
8088
|
+
}, {
|
|
8089
|
+
options: emptyStoreOption$1(intl)
|
|
8090
|
+
}];
|
|
8041
8091
|
};
|
|
8042
8092
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8043
8093
|
return jsxRuntime.jsx(uiKit.AsyncSelectField, {
|
|
@@ -8048,22 +8098,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8048
8098
|
isRequired: props.isRequired,
|
|
8049
8099
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
|
|
8050
8100
|
loadOptions: handleLoadOptions,
|
|
8101
|
+
value: getValueFromOptions$3({
|
|
8102
|
+
currentlySelectedProductSelections: props.value,
|
|
8103
|
+
allProductSelectionOptions,
|
|
8104
|
+
isMulti: props.isMulti
|
|
8105
|
+
}),
|
|
8051
8106
|
onChange: onOptionClick,
|
|
8107
|
+
onBlur: props.onBlur,
|
|
8052
8108
|
isDisabled: props.isDisabled,
|
|
8109
|
+
showOptionGroupDivider: true,
|
|
8053
8110
|
isReadOnly: props.isReadOnly,
|
|
8054
8111
|
components: props.components,
|
|
8055
8112
|
defaultOptions: getDefaultOptions(),
|
|
8056
|
-
hasWarning: props.hasWarning
|
|
8113
|
+
hasWarning: props.hasWarning,
|
|
8114
|
+
hasError: props.hasError,
|
|
8115
|
+
isClearable: props.isClearable,
|
|
8116
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
8117
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8118
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8057
8119
|
});
|
|
8058
8120
|
}
|
|
8059
8121
|
|
|
8122
|
+
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], 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: "version" }, 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: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8123
|
+
const createQueryVariables$7 = (productSelections, predicateField) => {
|
|
8124
|
+
var _context;
|
|
8125
|
+
return {
|
|
8126
|
+
where: _concatInstanceProperty__default["default"](_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty__default["default"](productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
|
|
8127
|
+
limit: 500
|
|
8128
|
+
};
|
|
8129
|
+
};
|
|
8130
|
+
const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
|
|
8131
|
+
var _productSelectionsQue, _productSelectionsQue2;
|
|
8132
|
+
const productSelectionList = _Array$isArray__default["default"](productSelections) ? productSelections : [productSelections];
|
|
8133
|
+
const productSelectionsQuery = react.useQuery(ProductSelectionsPickerFetcher$1, {
|
|
8134
|
+
context: {
|
|
8135
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
8136
|
+
},
|
|
8137
|
+
variables: createQueryVariables$7(productSelectionList, predicateField),
|
|
8138
|
+
skip: productSelectionList.length === 0
|
|
8139
|
+
});
|
|
8140
|
+
return {
|
|
8141
|
+
productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
|
|
8142
|
+
isLoading: productSelectionsQuery.loading
|
|
8143
|
+
};
|
|
8144
|
+
};
|
|
8145
|
+
|
|
8060
8146
|
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], 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: "version" }, 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: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8061
|
-
const mapProductSelectionsToOptions = memoize__default["default"](
|
|
8062
|
-
let
|
|
8063
|
-
|
|
8064
|
-
|
|
8147
|
+
const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
8148
|
+
let _ref$productSelection = _ref.productSelections,
|
|
8149
|
+
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
8150
|
+
dataLocale = _ref.dataLocale,
|
|
8151
|
+
projectLanguages = _ref.projectLanguages,
|
|
8152
|
+
renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField;
|
|
8065
8153
|
return _mapInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => ({
|
|
8066
|
-
value: productSelection.id,
|
|
8154
|
+
value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
|
|
8067
8155
|
label: l10n.formatLocalizedString(productSelection, {
|
|
8068
8156
|
key: 'name',
|
|
8069
8157
|
locale: dataLocale,
|
|
@@ -8072,9 +8160,22 @@ const mapProductSelectionsToOptions = memoize__default["default"](function () {
|
|
|
8072
8160
|
key: productSelection.key
|
|
8073
8161
|
}));
|
|
8074
8162
|
});
|
|
8075
|
-
const
|
|
8163
|
+
const getValueFromOptions$2 = _ref2 => {
|
|
8164
|
+
let isMulti = _ref2.isMulti,
|
|
8165
|
+
currentlySelectedProductSelections = _ref2.currentlySelectedProductSelections,
|
|
8166
|
+
productSelectionFieldOptions = _ref2.productSelectionFieldOptions;
|
|
8167
|
+
if (!currentlySelectedProductSelections) {
|
|
8168
|
+
return undefined;
|
|
8169
|
+
}
|
|
8170
|
+
if (isMulti) {
|
|
8171
|
+
return productSelectionFieldOptions;
|
|
8172
|
+
}
|
|
8173
|
+
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
8174
|
+
return productSelectionFieldOptions[0];
|
|
8175
|
+
};
|
|
8176
|
+
const createQueryVariables$6 = _ref3 => {
|
|
8076
8177
|
var _context;
|
|
8077
|
-
let searchText =
|
|
8178
|
+
let searchText = _ref3.searchText;
|
|
8078
8179
|
const sanitizedSearchText = sanitize(_trimInstanceProperty__default["default"](searchText).call(searchText, searchText));
|
|
8079
8180
|
const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
|
|
8080
8181
|
const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
|
|
@@ -8084,6 +8185,7 @@ const createQueryVariables$6 = _ref => {
|
|
|
8084
8185
|
};
|
|
8085
8186
|
};
|
|
8086
8187
|
function ProductSelectionsSearchSelectDropdown(props) {
|
|
8188
|
+
var _context3;
|
|
8087
8189
|
const intl = reactIntl.useIntl();
|
|
8088
8190
|
const _useState = React.useState([]),
|
|
8089
8191
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -8096,6 +8198,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8096
8198
|
})),
|
|
8097
8199
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8098
8200
|
dataLocale = _useApplicationContex.dataLocale;
|
|
8201
|
+
const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
|
|
8099
8202
|
const handleLoadOptions = async searchText => {
|
|
8100
8203
|
var _data$productSelectio, _data$productSelectio2;
|
|
8101
8204
|
const _await$client$query = await client$1.query({
|
|
@@ -8111,8 +8214,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8111
8214
|
data = _await$client$query.data;
|
|
8112
8215
|
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 ? void 0 : (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
8113
8216
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
8114
|
-
|
|
8115
|
-
|
|
8217
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
8218
|
+
var _context2;
|
|
8219
|
+
return !_includesInstanceProperty__default["default"](_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
|
|
8220
|
+
});
|
|
8221
|
+
setProductSelectionResults(filteredProductSelections);
|
|
8222
|
+
return mapProductSelectionsToOptions({
|
|
8223
|
+
productSelections: filteredProductSelections,
|
|
8224
|
+
dataLocale,
|
|
8225
|
+
projectLanguages,
|
|
8226
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8227
|
+
});
|
|
8116
8228
|
};
|
|
8117
8229
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8118
8230
|
const onOptionClick = event => {
|
|
@@ -8121,33 +8233,56 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8121
8233
|
const currentProductSelection = _findInstanceProperty__default["default"](productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8122
8234
|
props.onChange(currentProductSelection);
|
|
8123
8235
|
};
|
|
8236
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8124
8237
|
return jsxRuntime.jsx(uiKit.SearchSelectField, {
|
|
8125
8238
|
id: props.id,
|
|
8126
8239
|
name: props.name,
|
|
8127
8240
|
title: props.title,
|
|
8241
|
+
value: getValueFromOptions$2({
|
|
8242
|
+
currentlySelectedProductSelections: props.value,
|
|
8243
|
+
productSelectionFieldOptions: mapProductSelectionsToOptions({
|
|
8244
|
+
productSelections: _mapInstanceProperty__default["default"](_context3 = productSelectionsByFieldFetcher.productSelections).call(_context3, convertProductSelectionFromGraphQl),
|
|
8245
|
+
dataLocale,
|
|
8246
|
+
projectLanguages,
|
|
8247
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8248
|
+
}),
|
|
8249
|
+
isMulti: props.isMulti
|
|
8250
|
+
}),
|
|
8128
8251
|
description: props.description,
|
|
8129
8252
|
isRequired: props.isRequired,
|
|
8130
8253
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
|
|
8131
8254
|
loadOptions: loadOptionsDebounced,
|
|
8132
8255
|
onChange: onOptionClick,
|
|
8256
|
+
onBlur: props.onBlur,
|
|
8133
8257
|
components: props.components,
|
|
8134
|
-
isDisabled: props.isDisabled,
|
|
8258
|
+
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8135
8259
|
isReadOnly: props.isReadOnly,
|
|
8136
|
-
hasWarning: props.hasWarning
|
|
8260
|
+
hasWarning: props.hasWarning,
|
|
8261
|
+
isClearable: props.isClearable,
|
|
8262
|
+
hasError: props.hasError,
|
|
8263
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
8264
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8265
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8137
8266
|
});
|
|
8138
8267
|
}
|
|
8139
8268
|
|
|
8140
8269
|
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8141
8270
|
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8142
|
-
const components = {
|
|
8143
|
-
// eslint-disable-next-line react/display-name
|
|
8144
|
-
Option: optionInnerProps => jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8145
|
-
optionType: "double-property",
|
|
8146
|
-
optionInnerProps: optionInnerProps
|
|
8147
|
-
})
|
|
8148
|
-
};
|
|
8149
8271
|
function ProductSelectionsPicker(props) {
|
|
8150
8272
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8273
|
+
const components = React.useMemo(() => {
|
|
8274
|
+
return {
|
|
8275
|
+
Option: optionInnerProps => {
|
|
8276
|
+
if (optionInnerProps.isDisabled) {
|
|
8277
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$N({}, optionInnerProps));
|
|
8278
|
+
}
|
|
8279
|
+
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8280
|
+
optionType: props.optionType,
|
|
8281
|
+
optionInnerProps: optionInnerProps
|
|
8282
|
+
});
|
|
8283
|
+
}
|
|
8284
|
+
};
|
|
8285
|
+
}, [props.optionType]);
|
|
8151
8286
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8152
8287
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8153
8288
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
@@ -8163,7 +8298,13 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8163
8298
|
optionType: 'double-property',
|
|
8164
8299
|
isMulti: false,
|
|
8165
8300
|
isRequired: false,
|
|
8166
|
-
hasWarning: false
|
|
8301
|
+
hasWarning: false,
|
|
8302
|
+
hasError: false,
|
|
8303
|
+
isClearable: false,
|
|
8304
|
+
isReadOnly: false,
|
|
8305
|
+
isDisabled: false,
|
|
8306
|
+
excludedProductSelectionIds: [],
|
|
8307
|
+
title: '' // FieldLabel requires title to have some value
|
|
8167
8308
|
};
|
|
8168
8309
|
|
|
8169
8310
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
@@ -9790,11 +9931,9 @@ const mergeOverwritten = (inherited, explicit) => {
|
|
|
9790
9931
|
};
|
|
9791
9932
|
};
|
|
9792
9933
|
const mergeAssociates = businessUnit => {
|
|
9793
|
-
var _context2;
|
|
9794
|
-
const _businessUnit$associa = businessUnit.associates,
|
|
9795
|
-
|
|
9796
|
-
_businessUnit$inherit = businessUnit.inheritedAssociates,
|
|
9797
|
-
inheritedAssociates = _businessUnit$inherit === void 0 ? [] : _businessUnit$inherit;
|
|
9934
|
+
var _businessUnit$associa, _businessUnit$inherit, _context2;
|
|
9935
|
+
const associates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$associa = businessUnit.associates) === null || _businessUnit$associa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$associa).call(_businessUnit$associa, associate => associate === null || associate === void 0 ? void 0 : associate.customer);
|
|
9936
|
+
const inheritedAssociates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$inherit = businessUnit.inheritedAssociates) === null || _businessUnit$inherit === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$inherit).call(_businessUnit$inherit, inheritedAssociate => inheritedAssociate === null || inheritedAssociate === void 0 ? void 0 : inheritedAssociate.customer);
|
|
9798
9937
|
const overwrittenOnExplicit = intersectionBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
9799
9938
|
const overwrittenOnInherited = intersectionBy__default["default"](inheritedAssociates, associates, 'customer.id') || [];
|
|
9800
9939
|
const onlyExplicit = differenceBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
@@ -9895,10 +10034,10 @@ var messages$r = reactIntl.defineMessages({
|
|
|
9895
10034
|
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9896
10035
|
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9897
10036
|
const BusinessUnitAssociatesListView = props => {
|
|
9898
|
-
var _props$values, _props$values$associa;
|
|
10037
|
+
var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
|
|
9899
10038
|
const intl = reactIntl.useIntl();
|
|
9900
10039
|
const businessUnitsAssociateRolesFeatureEnabled = applicationShell.useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
9901
|
-
const totalAssociates = (_props$values = _valuesInstanceProperty__default["default"](props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length;
|
|
10040
|
+
const totalAssociates = ((_props$values = _valuesInstanceProperty__default["default"](props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length) + (((_props$values2 = _valuesInstanceProperty__default["default"](props)) === null || _props$values2 === void 0 ? void 0 : (_props$values2$inheri = _props$values2.inheritedAssociates) === null || _props$values2$inheri === void 0 ? void 0 : _props$values2$inheri.length) || 0);
|
|
9902
10041
|
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
9903
10042
|
const _usePaginationState = uiKit.usePaginationState({
|
|
9904
10043
|
perPage: 20
|
|
@@ -9913,8 +10052,8 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
9913
10052
|
searchValue = _useState2[0],
|
|
9914
10053
|
setSearchValue = _useState2[1];
|
|
9915
10054
|
const associates = React.useMemo(() => {
|
|
9916
|
-
var _props$
|
|
9917
|
-
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty__default["default"](props)) : (_props$
|
|
10055
|
+
var _props$values3, _context, _context2;
|
|
10056
|
+
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty__default["default"](props)) : (_props$values3 = _valuesInstanceProperty__default["default"](props)) === null || _props$values3 === void 0 ? void 0 : _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _props$values3.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
|
|
9918
10057
|
id: associate.customer.id
|
|
9919
10058
|
}));
|
|
9920
10059
|
}, [_valuesInstanceProperty__default["default"](props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
@@ -10038,7 +10177,7 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
10038
10177
|
};
|
|
10039
10178
|
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
10040
10179
|
|
|
10041
|
-
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end:
|
|
10180
|
+
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "inheritedAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 831, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n inheritedAssociates {\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10042
10181
|
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
10043
10182
|
let id = _ref.id,
|
|
10044
10183
|
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
@@ -12614,6 +12753,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
12614
12753
|
return jsxRuntime.jsx("div", {
|
|
12615
12754
|
className: styles$4.container,
|
|
12616
12755
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
12756
|
+
menuHorizontalConstraint: 5,
|
|
12617
12757
|
options: props.options,
|
|
12618
12758
|
value: {
|
|
12619
12759
|
text: searchText,
|