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