@commercetools-frontend/application-shell 20.10.4 → 20.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{application-entry-point-4b134bcb.cjs.dev.js → application-entry-point-18770bfb.cjs.dev.js} +55 -55
- package/dist/{application-entry-point-b7c5325e.esm.js → application-entry-point-3f374457.esm.js} +3 -3
- package/dist/{application-entry-point-83ea80e3.cjs.prod.js → application-entry-point-ffe525a6.cjs.prod.js} +52 -52
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +15 -41
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +15 -41
- package/dist/commercetools-frontend-application-shell.esm.js +2 -2
- package/dist/declarations/src/components/locale-switcher/locale-switcher.d.ts +0 -5
- package/dist/declarations/src/components/navbar/use-navbar-state-manager.d.ts +13 -13
- package/dist/declarations/src/components/quick-access/butler-command/butler-command.d.ts +0 -11
- package/dist/declarations/src/types/generated/ctp.d.ts +3619 -3336
- package/dist/declarations/src/types/generated/mc.d.ts +189 -195
- package/dist/declarations/src/types/generated/proxy.d.ts +28 -28
- package/dist/declarations/src/types/generated/settings.d.ts +1425 -2504
- package/dist/declarations/src/version.d.ts +1 -1
- package/dist/{index-8605a9e1.cjs.prod.js → index-76c4413b.cjs.prod.js} +230 -217
- package/dist/{index-82a5ea23.cjs.dev.js → index-e6679632.cjs.dev.js} +338 -326
- package/dist/{index-577c7a43.esm.js → index-f9fabc3f.esm.js} +57 -45
- package/dist/{project-expired-4a4db9c8.cjs.dev.js → project-expired-76545cc5.cjs.dev.js} +7 -7
- package/dist/{project-expired-5603cf9b.cjs.prod.js → project-expired-add920ff.cjs.prod.js} +7 -7
- package/dist/{project-expired-55c51196.esm.js → project-expired-ca9b4abf.esm.js} +3 -3
- package/dist/{project-not-found-efa7e5a7.esm.js → project-not-found-705141ee.esm.js} +3 -3
- package/dist/{project-not-found-33567915.cjs.dev.js → project-not-found-9b444972.cjs.dev.js} +7 -7
- package/dist/{project-not-found-f325728d.cjs.prod.js → project-not-found-ecbab238.cjs.prod.js} +7 -7
- package/dist/{project-not-initialized-d396896e.cjs.dev.js → project-not-initialized-43c3480b.cjs.dev.js} +7 -7
- package/dist/{project-not-initialized-68192fda.cjs.prod.js → project-not-initialized-aa2e0406.cjs.prod.js} +7 -7
- package/dist/{project-not-initialized-36c1617d.esm.js → project-not-initialized-c75f1950.esm.js} +3 -3
- package/dist/{project-suspended-69502d1e.esm.js → project-suspended-c851af31.esm.js} +3 -3
- package/dist/{project-suspended-61a15b65.cjs.dev.js → project-suspended-d476386a.cjs.dev.js} +7 -7
- package/dist/{project-suspended-e43ce7c2.cjs.prod.js → project-suspended-d70929a8.cjs.prod.js} +7 -7
- package/dist/{quick-access-2e6398f7.cjs.prod.js → quick-access-0a46f8a1.cjs.prod.js} +87 -87
- package/dist/{quick-access-1f9e885b.esm.js → quick-access-11f02492.esm.js} +9 -15
- package/dist/{quick-access-57979158.cjs.dev.js → quick-access-3c16727c.cjs.dev.js} +104 -110
- package/dist/{service-page-project-switcher-013404f5.esm.js → service-page-project-switcher-087d711d.esm.js} +1 -1
- package/dist/{service-page-project-switcher-8efe2817.cjs.prod.js → service-page-project-switcher-6ec976d5.cjs.prod.js} +2 -2
- package/dist/{service-page-project-switcher-ef90ae95.cjs.dev.js → service-page-project-switcher-e22f7891.cjs.dev.js} +2 -2
- package/package.json +15 -17
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +25 -29
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +19 -23
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +1 -1
|
@@ -24,7 +24,7 @@ var debounce = require('debounce-async');
|
|
|
24
24
|
var constants = require('@commercetools-frontend/constants');
|
|
25
25
|
var permissions$1 = require('@commercetools-frontend/permissions');
|
|
26
26
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
27
|
-
var applicationEntryPoint = require('./application-entry-point-
|
|
27
|
+
var applicationEntryPoint = require('./application-entry-point-ffe525a6.cjs.prod.js');
|
|
28
28
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
29
29
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
30
30
|
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -43,7 +43,7 @@ var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
|
|
|
43
43
|
var icons = require('@commercetools-uikit/icons');
|
|
44
44
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
45
45
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
46
|
-
var dist_commercetoolsFrontendApplicationShell = require('./index-
|
|
46
|
+
var dist_commercetoolsFrontendApplicationShell = require('./index-76c4413b.cjs.prod.js');
|
|
47
47
|
var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
48
48
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
49
49
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -162,13 +162,13 @@ var ButlerCommand = function ButlerCommand(props) {
|
|
|
162
162
|
return jsxRuntime.jsxs("div", {
|
|
163
163
|
"data-testid": "quick-access-result(".concat(props.command.id, ")"),
|
|
164
164
|
"aria-current": props.isSelected === true ? 'true' : 'false',
|
|
165
|
-
css: /*#__PURE__*/react.css("display:flex;padding:0 ", designSystem.customProperties.spacingM, ";height:36px;font-size:16px;font-weight:200;line-height:36px;cursor:default;", props.isSelected === true ? _concatInstanceProperty__default[
|
|
165
|
+
css: /*#__PURE__*/react.css("display:flex;padding:0 ", designSystem.customProperties.spacingM, ";height:36px;font-size:16px;font-weight:200;line-height:36px;cursor:default;", props.isSelected === true ? _concatInstanceProperty__default["default"](_context = "\n background: ".concat(designSystem.customProperties.colorAccent, ";\n color: ")).call(_context, designSystem.customProperties.colorSurface, ";\n ") : '', ";" + ("" ), "" ),
|
|
166
166
|
onMouseEnter: props.onMouseEnter,
|
|
167
167
|
onClick: props.onClick,
|
|
168
168
|
children: [jsxRuntime.jsx("div", {
|
|
169
169
|
css: _ref2,
|
|
170
170
|
children: props.command.text
|
|
171
|
-
}), (_Array$isArray__default[
|
|
171
|
+
}), (_Array$isArray__default["default"](props.command.subCommands) && props.command.subCommands.length > 0 || typeof props.command.subCommands === 'function') && jsxRuntime.jsx("div", {
|
|
172
172
|
css: _ref$1,
|
|
173
173
|
children: jsxRuntime.jsx(icons.AngleThinRightIcon, {
|
|
174
174
|
size: "medium",
|
|
@@ -178,8 +178,8 @@ var ButlerCommand = function ButlerCommand(props) {
|
|
|
178
178
|
}, props.command.id);
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
ButlerCommand.displayName = 'ButlerCommand';
|
|
182
181
|
ButlerCommand.propTypes = {};
|
|
182
|
+
ButlerCommand.displayName = 'ButlerCommand';
|
|
183
183
|
|
|
184
184
|
var messages = reactIntl.defineMessages({
|
|
185
185
|
inputPlacehoder: {
|
|
@@ -432,9 +432,9 @@ var messages = reactIntl.defineMessages({
|
|
|
432
432
|
|
|
433
433
|
var _templateObject$3, _templateObject2$2;
|
|
434
434
|
|
|
435
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
435
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
436
436
|
|
|
437
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context15; _forEachInstanceProperty__default[
|
|
437
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context15; _forEachInstanceProperty__default["default"](_context15 = ownKeys(Object(source), true)).call(_context15, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context16; _forEachInstanceProperty__default["default"](_context16 = ownKeys(Object(source))).call(_context16, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
438
438
|
|
|
439
439
|
var isSelectAllCombo = function isSelectAllCombo(event) {
|
|
440
440
|
return event.key === 'a' && event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey;
|
|
@@ -447,10 +447,10 @@ var isCloseCombo = function isCloseCombo(event) {
|
|
|
447
447
|
var getPlatform = function getPlatform() {
|
|
448
448
|
var _context, _context2, _context3, _context4;
|
|
449
449
|
|
|
450
|
-
if (_includesInstanceProperty__default[
|
|
451
|
-
if (_includesInstanceProperty__default[
|
|
452
|
-
if (_includesInstanceProperty__default[
|
|
453
|
-
if (_includesInstanceProperty__default[
|
|
450
|
+
if (_includesInstanceProperty__default["default"](_context = navigator.appVersion).call(_context, 'Win')) return 'windows';
|
|
451
|
+
if (_includesInstanceProperty__default["default"](_context2 = navigator.appVersion).call(_context2, 'Mac')) return 'macos';
|
|
452
|
+
if (_includesInstanceProperty__default["default"](_context3 = navigator.appVersion).call(_context3, 'X11')) return 'unix';
|
|
453
|
+
if (_includesInstanceProperty__default["default"](_context4 = navigator.appVersion).call(_context4, 'Linux')) return 'linux';
|
|
454
454
|
return null;
|
|
455
455
|
};
|
|
456
456
|
|
|
@@ -524,7 +524,7 @@ var reducer = function reducer() {
|
|
|
524
524
|
|
|
525
525
|
case 'setNextCommands':
|
|
526
526
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
527
|
-
stack: _concatInstanceProperty__default[
|
|
527
|
+
stack: _concatInstanceProperty__default["default"](_context5 = []).call(_context5, _toConsumableArray(state.stack), [{
|
|
528
528
|
searchText: state.searchText,
|
|
529
529
|
results: state.results,
|
|
530
530
|
selectedResult: state.selectedResult
|
|
@@ -541,7 +541,7 @@ var reducer = function reducer() {
|
|
|
541
541
|
selectedResult: 0,
|
|
542
542
|
enableHistory: false,
|
|
543
543
|
// omit last item
|
|
544
|
-
stack: _sliceInstanceProperty__default[
|
|
544
|
+
stack: _sliceInstanceProperty__default["default"](_context6 = state.stack).call(_context6, 0, -1)
|
|
545
545
|
});
|
|
546
546
|
|
|
547
547
|
case 'searchText':
|
|
@@ -660,7 +660,7 @@ var Butler = function Butler(props) {
|
|
|
660
660
|
// top of the history (with the most recent results), or appends a new entry
|
|
661
661
|
// when it didn't exist before.
|
|
662
662
|
|
|
663
|
-
onHistoryEntriesChangeFromParent(_concatInstanceProperty__default[
|
|
663
|
+
onHistoryEntriesChangeFromParent(_concatInstanceProperty__default["default"](_context7 = []).call(_context7, _toConsumableArray(_filterInstanceProperty__default["default"](_context8 = props.historyEntries).call(_context8, function (command) {
|
|
664
664
|
return command.searchText !== entry.searchText;
|
|
665
665
|
})), [entry]));
|
|
666
666
|
dispatch({
|
|
@@ -724,13 +724,13 @@ var Butler = function Butler(props) {
|
|
|
724
724
|
shouldSelectFieldText.current = true;
|
|
725
725
|
var selectedIndex = state.searchText.length === 0 ? // When going back the first step
|
|
726
726
|
-1 : // When going back more than one step
|
|
727
|
-
_findIndexInstanceProperty__default[
|
|
727
|
+
_findIndexInstanceProperty__default["default"](_context9 = props.historyEntries).call(_context9, function (command) {
|
|
728
728
|
return command.searchText === state.searchText;
|
|
729
729
|
}); // Pick the previous command from the history
|
|
730
730
|
|
|
731
731
|
var prevCommand = selectedIndex === -1 ? // previous command on top of the history when going back on
|
|
732
732
|
// first step
|
|
733
|
-
last__default[
|
|
733
|
+
last__default["default"](props.historyEntries) : // previous command is deeper down
|
|
734
734
|
// When the history does not exist (negative index), then
|
|
735
735
|
// this implicitly returns undefined
|
|
736
736
|
props.historyEntries[selectedIndex - 1]; // Skip when no previous entry exists in the history
|
|
@@ -766,9 +766,9 @@ var Butler = function Butler(props) {
|
|
|
766
766
|
unsetHasNetworkError(); // NOTE: since we need to fetch the "next command", which is an async operation,
|
|
767
767
|
// we use a IIFE to process that and eventually update the state.
|
|
768
768
|
|
|
769
|
-
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
769
|
+
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
770
770
|
var nextCommands;
|
|
771
|
-
return _regeneratorRuntime__default[
|
|
771
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context10) {
|
|
772
772
|
while (1) {
|
|
773
773
|
switch (_context10.prev = _context10.next) {
|
|
774
774
|
case 0:
|
|
@@ -818,7 +818,7 @@ var Butler = function Butler(props) {
|
|
|
818
818
|
|
|
819
819
|
if (event.key === 'ArrowLeft') {
|
|
820
820
|
// go left in stack
|
|
821
|
-
var _prevCommand = last__default[
|
|
821
|
+
var _prevCommand = last__default["default"](state.stack); // do nothing when we can't go left anymore
|
|
822
822
|
|
|
823
823
|
|
|
824
824
|
if (!_prevCommand) return; // prevent cursor from jumping a char to the left in text input
|
|
@@ -857,7 +857,7 @@ var Butler = function Butler(props) {
|
|
|
857
857
|
var handleChange = react$1.useCallback(function (event) {
|
|
858
858
|
var searchText = event.target.value;
|
|
859
859
|
|
|
860
|
-
if (_trimInstanceProperty__default[
|
|
860
|
+
if (_trimInstanceProperty__default["default"](searchText).call(searchText).length === 0) {
|
|
861
861
|
dispatch({
|
|
862
862
|
type: 'reset'
|
|
863
863
|
});
|
|
@@ -871,7 +871,7 @@ var Butler = function Butler(props) {
|
|
|
871
871
|
// are more than three characters. So no false loading
|
|
872
872
|
// indication is given.
|
|
873
873
|
|
|
874
|
-
if (_trimInstanceProperty__default[
|
|
874
|
+
if (_trimInstanceProperty__default["default"](searchText).call(searchText).length > 3) {
|
|
875
875
|
setIsLoading();
|
|
876
876
|
}
|
|
877
877
|
|
|
@@ -880,7 +880,7 @@ var Butler = function Butler(props) {
|
|
|
880
880
|
|
|
881
881
|
unsetHasNetworkError();
|
|
882
882
|
unsetIsLoading();
|
|
883
|
-
var fuse = new Fuse__default[
|
|
883
|
+
var fuse = new Fuse__default["default"](asyncResults, {
|
|
884
884
|
keys: [{
|
|
885
885
|
name: 'text',
|
|
886
886
|
weight: 0.6
|
|
@@ -892,7 +892,7 @@ var Butler = function Butler(props) {
|
|
|
892
892
|
includeScore: true
|
|
893
893
|
});
|
|
894
894
|
|
|
895
|
-
var searchResults = _sliceInstanceProperty__default[
|
|
895
|
+
var searchResults = _sliceInstanceProperty__default["default"](_context11 = _filterInstanceProperty__default["default"](_context12 = fuse.search(searchText) // Filter out results with a matching score over 0.75
|
|
896
896
|
).call(_context12, function (result) {
|
|
897
897
|
return result.score ? result.score < 0.75 : false;
|
|
898
898
|
}) // Keep a maximal of 9 results
|
|
@@ -900,7 +900,7 @@ var Butler = function Butler(props) {
|
|
|
900
900
|
|
|
901
901
|
dispatch({
|
|
902
902
|
type: 'setSearchTextResults',
|
|
903
|
-
payload: _mapInstanceProperty__default[
|
|
903
|
+
payload: _mapInstanceProperty__default["default"](searchResults).call(searchResults, function (result) {
|
|
904
904
|
return result.item;
|
|
905
905
|
})
|
|
906
906
|
});
|
|
@@ -980,7 +980,7 @@ var Butler = function Butler(props) {
|
|
|
980
980
|
"data-testid": "quick-access-search-input"
|
|
981
981
|
}), state.isLoading && jsxRuntime.jsx("div", {
|
|
982
982
|
css: /*#__PURE__*/react.css("align-self:center;margin-top:", designSystem.customProperties.spacingS, ";margin-right:", designSystem.customProperties.spacingS, ";" + ("" ), "" ),
|
|
983
|
-
children: jsxRuntime.jsx(LoadingSpinner__default[
|
|
983
|
+
children: jsxRuntime.jsx(LoadingSpinner__default["default"], {})
|
|
984
984
|
})]
|
|
985
985
|
}), function () {
|
|
986
986
|
var _context13, _context14;
|
|
@@ -989,11 +989,11 @@ var Butler = function Butler(props) {
|
|
|
989
989
|
css: /*#__PURE__*/react.css("overflow:hidden;white-space:nowrap;cursor:default;background:", designSystem.customProperties.colorError, ";text-align:center;text-transform:uppercase;color:", designSystem.customProperties.colorSurface, ";font-size:", designSystem.customProperties.fontSizeSmall, ";padding:", designSystem.customProperties.spacingXs, ";" + ("" ), "" ),
|
|
990
990
|
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.offline))
|
|
991
991
|
});
|
|
992
|
-
if (state.results.length === 0 && _trimInstanceProperty__default[
|
|
992
|
+
if (state.results.length === 0 && _trimInstanceProperty__default["default"](_context13 = state.searchText).call(_context13).length > 0) return jsxRuntime.jsx("div", {
|
|
993
993
|
css: /*#__PURE__*/react.css("overflow:hidden;white-space:nowrap;cursor:default;background:", designSystem.customProperties.colorNeutral, ";color:", designSystem.customProperties.colorSolid, ";text-align:center;text-transform:uppercase;font-size:", designSystem.customProperties.fontSizeSmall, ";padding:", designSystem.customProperties.spacingXs, ";" + ("" ), "" ),
|
|
994
994
|
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.noResults))
|
|
995
995
|
});
|
|
996
|
-
return _mapInstanceProperty__default[
|
|
996
|
+
return _mapInstanceProperty__default["default"](_context14 = state.results).call(_context14, function (command, index) {
|
|
997
997
|
return jsxRuntime.jsx(ButlerCommand, {
|
|
998
998
|
command: command,
|
|
999
999
|
isSelected: state.selectedResult === index,
|
|
@@ -1063,7 +1063,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1063
1063
|
applicationContext = _ref.applicationContext,
|
|
1064
1064
|
featureToggles = _ref.featureToggles,
|
|
1065
1065
|
changeProjectDataLocale = _ref.changeProjectDataLocale;
|
|
1066
|
-
return _filterInstanceProperty__default[
|
|
1066
|
+
return _filterInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = [applicationContext.project && applicationContext.permissions && featureToggles.canViewDashboard && permissions$1.hasSomePermissions([permissions.ViewOrders], applicationContext.permissions) && {
|
|
1067
1067
|
id: 'go/dashboard',
|
|
1068
1068
|
text: intl.formatMessage(messages.openDashboard),
|
|
1069
1069
|
keywords: ['Go to Dashboard'],
|
|
@@ -1079,7 +1079,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1079
1079
|
type: actionTypes.go,
|
|
1080
1080
|
to: "/".concat(applicationContext.project.key, "/products/pim-search")
|
|
1081
1081
|
},
|
|
1082
|
-
subCommands: _filterInstanceProperty__default[
|
|
1082
|
+
subCommands: _filterInstanceProperty__default["default"](_context3 = [permissions$1.hasSomePermissions([permissions.ViewProducts], applicationContext.permissions) && {
|
|
1083
1083
|
id: 'go/products/list',
|
|
1084
1084
|
text: intl.formatMessage(messages.openProductList),
|
|
1085
1085
|
action: {
|
|
@@ -1116,7 +1116,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1116
1116
|
type: actionTypes.go,
|
|
1117
1117
|
to: "/".concat(applicationContext.project.key, "/categories")
|
|
1118
1118
|
},
|
|
1119
|
-
subCommands: _filterInstanceProperty__default[
|
|
1119
|
+
subCommands: _filterInstanceProperty__default["default"](_context4 = [permissions$1.hasSomePermissions([permissions.ViewCategories], applicationContext.permissions) && {
|
|
1120
1120
|
id: 'go/categories/list',
|
|
1121
1121
|
text: intl.formatMessage(messages.openCategoriesList),
|
|
1122
1122
|
action: {
|
|
@@ -1146,7 +1146,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1146
1146
|
type: actionTypes.go,
|
|
1147
1147
|
to: "/".concat(applicationContext.project.key, "/customers")
|
|
1148
1148
|
},
|
|
1149
|
-
subCommands: _filterInstanceProperty__default[
|
|
1149
|
+
subCommands: _filterInstanceProperty__default["default"](_context5 = [permissions$1.hasSomePermissions([permissions.ViewCustomers], applicationContext.permissions) && {
|
|
1150
1150
|
id: 'go/customers/list',
|
|
1151
1151
|
text: intl.formatMessage(messages.openCustomersList),
|
|
1152
1152
|
action: {
|
|
@@ -1183,7 +1183,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1183
1183
|
type: actionTypes.go,
|
|
1184
1184
|
to: "/".concat(applicationContext.project.key, "/orders")
|
|
1185
1185
|
},
|
|
1186
|
-
subCommands: _filterInstanceProperty__default[
|
|
1186
|
+
subCommands: _filterInstanceProperty__default["default"](_context6 = [permissions$1.hasSomePermissions([permissions.ViewOrders], applicationContext.permissions) && {
|
|
1187
1187
|
id: 'go/orders/list',
|
|
1188
1188
|
text: intl.formatMessage(messages.openOrdersList),
|
|
1189
1189
|
action: {
|
|
@@ -1206,7 +1206,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1206
1206
|
type: actionTypes.go,
|
|
1207
1207
|
to: "/".concat(applicationContext.project.key, "/discounts")
|
|
1208
1208
|
},
|
|
1209
|
-
subCommands: _filterInstanceProperty__default[
|
|
1209
|
+
subCommands: _filterInstanceProperty__default["default"](_context7 = [permissions$1.hasSomePermissions([permissions.ViewProductDiscounts], applicationContext.permissions) && {
|
|
1210
1210
|
id: 'go/discounts/products/list',
|
|
1211
1211
|
text: intl.formatMessage(messages.openProductDiscountsList),
|
|
1212
1212
|
action: {
|
|
@@ -1234,7 +1234,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1234
1234
|
type: actionTypes.go,
|
|
1235
1235
|
to: "/".concat(applicationContext.project.key, "/discounts/new")
|
|
1236
1236
|
},
|
|
1237
|
-
subCommands: _filterInstanceProperty__default[
|
|
1237
|
+
subCommands: _filterInstanceProperty__default["default"](_context8 = [permissions$1.hasSomePermissions([permissions.ManageProductDiscounts], applicationContext.permissions) && {
|
|
1238
1238
|
id: 'go/discounts/product/add',
|
|
1239
1239
|
text: intl.formatMessage(messages.openAddProductDiscount),
|
|
1240
1240
|
action: {
|
|
@@ -1265,14 +1265,14 @@ var createCommands = function createCommands(_ref) {
|
|
|
1265
1265
|
type: actionTypes.go,
|
|
1266
1266
|
to: "/".concat(applicationContext.project.key, "/settings/project")
|
|
1267
1267
|
},
|
|
1268
|
-
subCommands: _filterInstanceProperty__default[
|
|
1268
|
+
subCommands: _filterInstanceProperty__default["default"](_context9 = [permissions$1.hasSomePermissions([permissions.ViewProjectSettings, permissions.ManageProjectSettings], applicationContext.permissions) && {
|
|
1269
1269
|
id: 'go/settings/project',
|
|
1270
1270
|
text: intl.formatMessage(messages.openProjectSettings),
|
|
1271
1271
|
action: {
|
|
1272
1272
|
type: actionTypes.go,
|
|
1273
1273
|
to: "/".concat(applicationContext.project.key, "/settings/project")
|
|
1274
1274
|
},
|
|
1275
|
-
subCommands: _filterInstanceProperty__default[
|
|
1275
|
+
subCommands: _filterInstanceProperty__default["default"](_context10 = [{
|
|
1276
1276
|
id: 'go/settings/project/international',
|
|
1277
1277
|
text: intl.formatMessage(messages.openProjectSettingsInternationalTab),
|
|
1278
1278
|
action: {
|
|
@@ -1322,7 +1322,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1322
1322
|
type: actionTypes.go,
|
|
1323
1323
|
to: "/".concat(applicationContext.project.key, "/settings/developer")
|
|
1324
1324
|
},
|
|
1325
|
-
subCommands: _filterInstanceProperty__default[
|
|
1325
|
+
subCommands: _filterInstanceProperty__default["default"](_context11 = [permissions$1.hasSomePermissions([permissions.ViewDeveloperSettings], applicationContext.permissions) && {
|
|
1326
1326
|
id: 'go/settings/developer/api-clients/list',
|
|
1327
1327
|
text: intl.formatMessage(messages.openApiClientsList),
|
|
1328
1328
|
action: {
|
|
@@ -1357,7 +1357,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1357
1357
|
subCommands: function subCommands() {
|
|
1358
1358
|
var _context12, _context13;
|
|
1359
1359
|
|
|
1360
|
-
return _Promise__default[
|
|
1360
|
+
return _Promise__default["default"].resolve(_filterInstanceProperty__default["default"](_context12 = _mapInstanceProperty__default["default"](_context13 = applicationContext.project ? applicationContext.project.languages : []).call(_context13, function (language) {
|
|
1361
1361
|
return changeProjectDataLocale && {
|
|
1362
1362
|
id: "action/set-resource-language/".concat(language),
|
|
1363
1363
|
text: commonTags.oneLineTrim(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", "\n ", "\n "])), language, language === applicationContext.dataLocale ? ' (active)' : ''),
|
|
@@ -1421,7 +1421,7 @@ var createCommands = function createCommands(_ref) {
|
|
|
1421
1421
|
type: actionTypes.go,
|
|
1422
1422
|
to: "/account/organizations"
|
|
1423
1423
|
}
|
|
1424
|
-
}]).call(_context2, _toConsumableArray(applicationContext.user ? _mapInstanceProperty__default[
|
|
1424
|
+
}]).call(_context2, _toConsumableArray(applicationContext.user ? _mapInstanceProperty__default["default"](_context14 = applicationContext.user.projects.results).call(_context14, function (userProject) {
|
|
1425
1425
|
return {
|
|
1426
1426
|
id: "go/project(".concat(userProject.key, ")"),
|
|
1427
1427
|
text: intl.formatMessage(messages.useProject, {
|
|
@@ -1443,26 +1443,26 @@ var sanitize = function sanitize(param) {
|
|
|
1443
1443
|
.replace(/"/g, '\\"');
|
|
1444
1444
|
};
|
|
1445
1445
|
var flattenCommands = /*#__PURE__*/function () {
|
|
1446
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1446
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(results, execQuery) {
|
|
1447
1447
|
var flatten, _flatten;
|
|
1448
1448
|
|
|
1449
|
-
return _regeneratorRuntime__default[
|
|
1449
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context6) {
|
|
1450
1450
|
while (1) {
|
|
1451
1451
|
switch (_context6.prev = _context6.next) {
|
|
1452
1452
|
case 0:
|
|
1453
1453
|
_flatten = function _flatten3() {
|
|
1454
|
-
_flatten = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1455
|
-
return _regeneratorRuntime__default[
|
|
1454
|
+
_flatten = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(commands) {
|
|
1455
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context5) {
|
|
1456
1456
|
while (1) {
|
|
1457
1457
|
switch (_context5.prev = _context5.next) {
|
|
1458
1458
|
case 0:
|
|
1459
|
-
return _context5.abrupt("return", _reduceInstanceProperty__default[
|
|
1460
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1459
|
+
return _context5.abrupt("return", _reduceInstanceProperty__default["default"](commands).call(commands, /*#__PURE__*/function () {
|
|
1460
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(prevPromise, command) {
|
|
1461
1461
|
var _context3;
|
|
1462
1462
|
|
|
1463
1463
|
var prevResults, _context2, _context, subCommands, _flattenSubCommands, flattenSubCommands;
|
|
1464
1464
|
|
|
1465
|
-
return _regeneratorRuntime__default[
|
|
1465
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context4) {
|
|
1466
1466
|
while (1) {
|
|
1467
1467
|
switch (_context4.prev = _context4.next) {
|
|
1468
1468
|
case 0:
|
|
@@ -1492,7 +1492,7 @@ var flattenCommands = /*#__PURE__*/function () {
|
|
|
1492
1492
|
|
|
1493
1493
|
case 10:
|
|
1494
1494
|
_flattenSubCommands = _context4.sent;
|
|
1495
|
-
return _context4.abrupt("return", _concatInstanceProperty__default[
|
|
1495
|
+
return _context4.abrupt("return", _concatInstanceProperty__default["default"](_context = []).call(_context, _toConsumableArray(prevResults), [command], _toConsumableArray(_flattenSubCommands)));
|
|
1496
1496
|
|
|
1497
1497
|
case 12:
|
|
1498
1498
|
_context4.next = 14;
|
|
@@ -1500,10 +1500,10 @@ var flattenCommands = /*#__PURE__*/function () {
|
|
|
1500
1500
|
|
|
1501
1501
|
case 14:
|
|
1502
1502
|
flattenSubCommands = _context4.sent;
|
|
1503
|
-
return _context4.abrupt("return", _concatInstanceProperty__default[
|
|
1503
|
+
return _context4.abrupt("return", _concatInstanceProperty__default["default"](_context2 = []).call(_context2, _toConsumableArray(prevResults), [command], _toConsumableArray(flattenSubCommands)));
|
|
1504
1504
|
|
|
1505
1505
|
case 16:
|
|
1506
|
-
return _context4.abrupt("return", _concatInstanceProperty__default[
|
|
1506
|
+
return _context4.abrupt("return", _concatInstanceProperty__default["default"](_context3 = []).call(_context3, _toConsumableArray(prevResults), [command]));
|
|
1507
1507
|
|
|
1508
1508
|
case 17:
|
|
1509
1509
|
case "end":
|
|
@@ -1516,7 +1516,7 @@ var flattenCommands = /*#__PURE__*/function () {
|
|
|
1516
1516
|
return function (_x4, _x5) {
|
|
1517
1517
|
return _ref2.apply(this, arguments);
|
|
1518
1518
|
};
|
|
1519
|
-
}(), _Promise__default[
|
|
1519
|
+
}(), _Promise__default["default"].resolve([])));
|
|
1520
1520
|
|
|
1521
1521
|
case 1:
|
|
1522
1522
|
case "end":
|
|
@@ -1552,7 +1552,7 @@ var flattenCommands = /*#__PURE__*/function () {
|
|
|
1552
1552
|
}(); // Once ui-kit exposes its fallback mechanism, we can use the same one here
|
|
1553
1553
|
|
|
1554
1554
|
var translate = function translate(nameAllLocales, projectDataLocale) {
|
|
1555
|
-
var matchedTranslation = _findInstanceProperty__default[
|
|
1555
|
+
var matchedTranslation = _findInstanceProperty__default["default"](nameAllLocales).call(nameAllLocales, function (translation) {
|
|
1556
1556
|
return translation.locale === projectDataLocale && translation.value;
|
|
1557
1557
|
});
|
|
1558
1558
|
|
|
@@ -1574,28 +1574,28 @@ var createProductVariantSubCommands = function createProductVariantSubCommands(_
|
|
|
1574
1574
|
var canViewProducts = permissions$1.hasSomePermissions([permissions.ViewProducts], applicationContext.permissions);
|
|
1575
1575
|
if (!canViewProducts || !applicationContext.project) return [];
|
|
1576
1576
|
return [{
|
|
1577
|
-
id: _concatInstanceProperty__default[
|
|
1577
|
+
id: _concatInstanceProperty__default["default"](_context = "go/product(".concat(productId, ")/variant(")).call(_context, variantId, ")/attributes"),
|
|
1578
1578
|
text: intl.formatMessage(messages.showProductVariantAttributes),
|
|
1579
1579
|
action: {
|
|
1580
1580
|
type: actionTypes.go,
|
|
1581
1581
|
to: commonTags.oneLineTrim(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n /", "\n /products\n /", "\n /variants\n /", "\n /attributes\n "])), applicationContext.project.key, productId, variantId)
|
|
1582
1582
|
}
|
|
1583
1583
|
}, {
|
|
1584
|
-
id: _concatInstanceProperty__default[
|
|
1584
|
+
id: _concatInstanceProperty__default["default"](_context2 = "go/product(".concat(productId, ")/variant")).call(_context2, variantId, "/images"),
|
|
1585
1585
|
text: intl.formatMessage(messages.showProductVariantImages),
|
|
1586
1586
|
action: {
|
|
1587
1587
|
type: actionTypes.go,
|
|
1588
1588
|
to: commonTags.oneLineTrim(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n /", "\n /products\n /", "\n /variants\n /", "\n /images\n "])), applicationContext.project.key, productId, variantId)
|
|
1589
1589
|
}
|
|
1590
1590
|
}, {
|
|
1591
|
-
id: _concatInstanceProperty__default[
|
|
1591
|
+
id: _concatInstanceProperty__default["default"](_context3 = "go/product(".concat(productId, ")/variant(")).call(_context3, variantId, ")/prices"),
|
|
1592
1592
|
text: intl.formatMessage(messages.showProductVariantPrices),
|
|
1593
1593
|
action: {
|
|
1594
1594
|
type: actionTypes.go,
|
|
1595
1595
|
to: commonTags.oneLineTrim(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /", "\n /products\n /", "\n /variants\n /", "\n /prices\n "])), applicationContext.project.key, productId, variantId)
|
|
1596
1596
|
}
|
|
1597
1597
|
}, {
|
|
1598
|
-
id: _concatInstanceProperty__default[
|
|
1598
|
+
id: _concatInstanceProperty__default["default"](_context4 = "go/product(".concat(productId, ")/variant(")).call(_context4, variantId, ")/inventory"),
|
|
1599
1599
|
text: intl.formatMessage(messages.showProductVariantInventory),
|
|
1600
1600
|
action: {
|
|
1601
1601
|
type: actionTypes.go,
|
|
@@ -1617,10 +1617,10 @@ var formatVariantMessage = function formatVariantMessage(variant, intl) {
|
|
|
1617
1617
|
};
|
|
1618
1618
|
|
|
1619
1619
|
var createProductVariantListSubCommands = /*#__PURE__*/function () {
|
|
1620
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1620
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(_ref2) {
|
|
1621
1621
|
var intl, applicationContext, productId, execQuery, canViewProducts, data, _context5, projectKey;
|
|
1622
1622
|
|
|
1623
|
-
return _regeneratorRuntime__default[
|
|
1623
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context7) {
|
|
1624
1624
|
while (1) {
|
|
1625
1625
|
switch (_context7.prev = _context7.next) {
|
|
1626
1626
|
case 0:
|
|
@@ -1651,11 +1651,11 @@ var createProductVariantListSubCommands = /*#__PURE__*/function () {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
|
|
1653
1653
|
projectKey = applicationContext.project.key;
|
|
1654
|
-
return _context7.abrupt("return", _mapInstanceProperty__default[
|
|
1654
|
+
return _context7.abrupt("return", _mapInstanceProperty__default["default"](_context5 = data.product.masterData.staged.allVariants).call(_context5, function (variant) {
|
|
1655
1655
|
var _context6;
|
|
1656
1656
|
|
|
1657
1657
|
return {
|
|
1658
|
-
id: _concatInstanceProperty__default[
|
|
1658
|
+
id: _concatInstanceProperty__default["default"](_context6 = "go/product(".concat(productId, ")/variant(")).call(_context6, variant.id, ")"),
|
|
1659
1659
|
text: formatVariantMessage(variant, intl),
|
|
1660
1660
|
subCommands: createProductVariantSubCommands({
|
|
1661
1661
|
intl: intl,
|
|
@@ -1727,7 +1727,7 @@ var createProductTabsSubCommands = function createProductTabsSubCommands(_ref4)
|
|
|
1727
1727
|
var STORAGE_KEY = 'quickAccessHistoryEntries';
|
|
1728
1728
|
var saveHistoryEntries = function saveHistoryEntries(historyEntries) {
|
|
1729
1729
|
try {
|
|
1730
|
-
window.sessionStorage.setItem(STORAGE_KEY, _JSON$stringify__default[
|
|
1730
|
+
window.sessionStorage.setItem(STORAGE_KEY, _JSON$stringify__default["default"](historyEntries));
|
|
1731
1731
|
return true;
|
|
1732
1732
|
} catch (error) {
|
|
1733
1733
|
return false;
|
|
@@ -1826,10 +1826,10 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1826
1826
|
var onPimIndexerStateChangeFromParent = props.onPimIndexerStateChange;
|
|
1827
1827
|
var dispatchFetchProductIds = sdk.useAsyncDispatch();
|
|
1828
1828
|
var fetchPimSearchProductIds = react$1.useCallback( /*#__PURE__*/function () {
|
|
1829
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1829
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(searchText) {
|
|
1830
1830
|
var _context, result;
|
|
1831
1831
|
|
|
1832
|
-
return _regeneratorRuntime__default[
|
|
1832
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context2) {
|
|
1833
1833
|
while (1) {
|
|
1834
1834
|
switch (_context2.prev = _context2.next) {
|
|
1835
1835
|
case 0:
|
|
@@ -1843,7 +1843,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1843
1843
|
|
|
1844
1844
|
case 3:
|
|
1845
1845
|
result = _context2.sent;
|
|
1846
|
-
return _context2.abrupt("return", result && result.hits ? _mapInstanceProperty__default[
|
|
1846
|
+
return _context2.abrupt("return", result && result.hits ? _mapInstanceProperty__default["default"](_context = result.hits).call(_context, function (hit) {
|
|
1847
1847
|
return hit.id;
|
|
1848
1848
|
}) : []);
|
|
1849
1849
|
|
|
@@ -1863,8 +1863,8 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1863
1863
|
};
|
|
1864
1864
|
}(), [applicationContext.dataLocale, applicationContext.project, dispatchFetchProductIds]);
|
|
1865
1865
|
var dispatchFetchPimIndexerStatus = sdk.useAsyncDispatch();
|
|
1866
|
-
var fetchPimIndexerStatus = react$1.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1867
|
-
return _regeneratorRuntime__default[
|
|
1866
|
+
var fetchPimIndexerStatus = react$1.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2() {
|
|
1867
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context3) {
|
|
1868
1868
|
while (1) {
|
|
1869
1869
|
switch (_context3.prev = _context3.next) {
|
|
1870
1870
|
case 0:
|
|
@@ -1895,9 +1895,9 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
}, _callee2, null, [[1, 6]]);
|
|
1897
1897
|
})), [applicationContext.dataLocale, applicationContext.project, dispatchFetchPimIndexerStatus]);
|
|
1898
|
-
var getProjectIndexStatus = react$1.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1898
|
+
var getProjectIndexStatus = react$1.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3() {
|
|
1899
1899
|
var canViewProducts;
|
|
1900
|
-
return _regeneratorRuntime__default[
|
|
1900
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context4) {
|
|
1901
1901
|
while (1) {
|
|
1902
1902
|
switch (_context4.prev = _context4.next) {
|
|
1903
1903
|
case 0:
|
|
@@ -1952,8 +1952,8 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1952
1952
|
});
|
|
1953
1953
|
}, [apolloClient]);
|
|
1954
1954
|
var getNextCommands = react$1.useCallback( /*#__PURE__*/function () {
|
|
1955
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1956
|
-
return _regeneratorRuntime__default[
|
|
1955
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(command) {
|
|
1956
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context5) {
|
|
1957
1957
|
while (1) {
|
|
1958
1958
|
switch (_context5.prev = _context5.next) {
|
|
1959
1959
|
case 0:
|
|
@@ -1965,7 +1965,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1965
1965
|
return _context5.abrupt("return", []);
|
|
1966
1966
|
|
|
1967
1967
|
case 2:
|
|
1968
|
-
if (!_Array$isArray__default[
|
|
1968
|
+
if (!_Array$isArray__default["default"](command.subCommands)) {
|
|
1969
1969
|
_context5.next = 4;
|
|
1970
1970
|
break;
|
|
1971
1971
|
}
|
|
@@ -1992,10 +1992,10 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
1992
1992
|
};
|
|
1993
1993
|
}(), [execQuery]);
|
|
1994
1994
|
var getProjectCommands = react$1.useCallback( /*#__PURE__*/function () {
|
|
1995
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
1995
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(searchText) {
|
|
1996
1996
|
var idsOfProductsMatchingSearchText, canViewProducts, data, commands, _context6, productId, variantId, variantKey, _context7, _productId, _variantId, _context8, _productId2, _context9, _context11, _productId3;
|
|
1997
1997
|
|
|
1998
|
-
return _regeneratorRuntime__default[
|
|
1998
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context12) {
|
|
1999
1999
|
while (1) {
|
|
2000
2000
|
switch (_context12.prev = _context12.next) {
|
|
2001
2001
|
case 0:
|
|
@@ -2023,8 +2023,8 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2023
2023
|
searchText: sanitize(searchText),
|
|
2024
2024
|
// Pass conditional arguments to disable some of the queries
|
|
2025
2025
|
canViewProducts: canViewProducts,
|
|
2026
|
-
productsWhereClause: "id in (".concat(_mapInstanceProperty__default[
|
|
2027
|
-
return _JSON$stringify__default[
|
|
2026
|
+
productsWhereClause: "id in (".concat(_mapInstanceProperty__default["default"](idsOfProductsMatchingSearchText).call(idsOfProductsMatchingSearchText, function (id) {
|
|
2027
|
+
return _JSON$stringify__default["default"](id);
|
|
2028
2028
|
}).join(', '), ")"),
|
|
2029
2029
|
includeProductsByIds: Boolean(canViewProducts && idsOfProductsMatchingSearchText.length > 0)
|
|
2030
2030
|
}, {
|
|
@@ -2040,7 +2040,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2040
2040
|
variantId = data.productByVariantKey.masterData.staged.variant.id;
|
|
2041
2041
|
variantKey = data.productByVariantKey.masterData.staged.variant.key;
|
|
2042
2042
|
commands.push({
|
|
2043
|
-
id: _concatInstanceProperty__default[
|
|
2043
|
+
id: _concatInstanceProperty__default["default"](_context6 = "go/product-variant-by-key/product(".concat(productId, "/variant(")).call(_context6, variantId, ")"),
|
|
2044
2044
|
text: intl.formatMessage(messages.showProductVariant, {
|
|
2045
2045
|
variantName: translate(data.productByVariantKey.masterData.staged.nameAllLocales, applicationContext.dataLocale)
|
|
2046
2046
|
}),
|
|
@@ -2062,7 +2062,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2062
2062
|
_productId = data.productByVariantSku.id;
|
|
2063
2063
|
_variantId = data.productByVariantSku.masterData.staged.variant.id;
|
|
2064
2064
|
commands.push({
|
|
2065
|
-
id: _concatInstanceProperty__default[
|
|
2065
|
+
id: _concatInstanceProperty__default["default"](_context7 = "go/product-variant-by-sku/product(".concat(_productId, ")/variant(")).call(_context7, _variantId, ")"),
|
|
2066
2066
|
text: intl.formatMessage(messages.showProductVariant, {
|
|
2067
2067
|
variantName: data.productByVariantSku.masterData.staged.variant.sku
|
|
2068
2068
|
}),
|
|
@@ -2089,7 +2089,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2089
2089
|
keywords: [_productId2],
|
|
2090
2090
|
action: {
|
|
2091
2091
|
type: actionTypes.go,
|
|
2092
|
-
to: _concatInstanceProperty__default[
|
|
2092
|
+
to: _concatInstanceProperty__default["default"](_context8 = "/".concat(applicationContext.project.key, "/products/")).call(_context8, _productId2)
|
|
2093
2093
|
},
|
|
2094
2094
|
subCommands: createProductTabsSubCommands({
|
|
2095
2095
|
intl: intl,
|
|
@@ -2100,7 +2100,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2100
2100
|
}
|
|
2101
2101
|
|
|
2102
2102
|
if (data && data.productsByIds && data.productsByIds.results) {
|
|
2103
|
-
_forEachInstanceProperty__default[
|
|
2103
|
+
_forEachInstanceProperty__default["default"](_context9 = data.productsByIds.results).call(_context9, function (product) {
|
|
2104
2104
|
if (product.masterData.staged && applicationContext.project && applicationContext.dataLocale) {
|
|
2105
2105
|
var _context10;
|
|
2106
2106
|
|
|
@@ -2112,7 +2112,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2112
2112
|
keywords: [product.id],
|
|
2113
2113
|
action: {
|
|
2114
2114
|
type: actionTypes.go,
|
|
2115
|
-
to: _concatInstanceProperty__default[
|
|
2115
|
+
to: _concatInstanceProperty__default["default"](_context10 = "/".concat(applicationContext.project.key, "/products/")).call(_context10, product.id)
|
|
2116
2116
|
},
|
|
2117
2117
|
subCommands: createProductTabsSubCommands({
|
|
2118
2118
|
intl: intl,
|
|
@@ -2133,7 +2133,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2133
2133
|
}),
|
|
2134
2134
|
action: {
|
|
2135
2135
|
type: actionTypes.go,
|
|
2136
|
-
to: _concatInstanceProperty__default[
|
|
2136
|
+
to: _concatInstanceProperty__default["default"](_context11 = "/".concat(applicationContext.project.key, "/products/")).call(_context11, _productId3)
|
|
2137
2137
|
},
|
|
2138
2138
|
subCommands: createProductTabsSubCommands({
|
|
2139
2139
|
intl: intl,
|
|
@@ -2157,14 +2157,14 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2157
2157
|
return _ref5.apply(this, arguments);
|
|
2158
2158
|
};
|
|
2159
2159
|
}(), [applicationContext, execQuery, fetchPimSearchProductIds, intl, props.pimIndexerState]);
|
|
2160
|
-
var debouncedGetProjectCommands = debounce__default[
|
|
2160
|
+
var debouncedGetProjectCommands = debounce__default["default"](getProjectCommands, 200, {
|
|
2161
2161
|
cancelObj: 'canceled'
|
|
2162
2162
|
});
|
|
2163
2163
|
var search = react$1.useCallback( /*#__PURE__*/function () {
|
|
2164
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default[
|
|
2164
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(searchText) {
|
|
2165
2165
|
var generalCommands, _context13, projectCommands, allCommands;
|
|
2166
2166
|
|
|
2167
|
-
return _regeneratorRuntime__default[
|
|
2167
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context14) {
|
|
2168
2168
|
while (1) {
|
|
2169
2169
|
switch (_context14.prev = _context14.next) {
|
|
2170
2170
|
case 0:
|
|
@@ -2187,7 +2187,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2187
2187
|
return _context14.abrupt("return", generalCommands);
|
|
2188
2188
|
|
|
2189
2189
|
case 3:
|
|
2190
|
-
if (!(_trimInstanceProperty__default[
|
|
2190
|
+
if (!(_trimInstanceProperty__default["default"](searchText).call(searchText).length < 3)) {
|
|
2191
2191
|
_context14.next = 5;
|
|
2192
2192
|
break;
|
|
2193
2193
|
}
|
|
@@ -2201,7 +2201,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2201
2201
|
|
|
2202
2202
|
case 8:
|
|
2203
2203
|
projectCommands = _context14.sent;
|
|
2204
|
-
allCommands = _concatInstanceProperty__default[
|
|
2204
|
+
allCommands = _concatInstanceProperty__default["default"](_context13 = []).call(_context13, _toConsumableArray(generalCommands), _toConsumableArray(projectCommands));
|
|
2205
2205
|
_context14.next = 12;
|
|
2206
2206
|
return flattenCommands(allCommands, execQuery);
|
|
2207
2207
|
|
|
@@ -2246,7 +2246,7 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2246
2246
|
// and always open other pages in a new window
|
|
2247
2247
|
|
|
2248
2248
|
|
|
2249
|
-
if (meta.openInNewTab || !_startsWithInstanceProperty__default[
|
|
2249
|
+
if (meta.openInNewTab || !_startsWithInstanceProperty__default["default"](_context15 = command.action.to).call(_context15, '/')) {
|
|
2250
2250
|
// eslint-disable-next-line no-restricted-globals
|
|
2251
2251
|
open(command.action.to, '_blank');
|
|
2252
2252
|
} else if (applicationContext.environment.useFullRedirectsForLinks) {
|
|
@@ -2268,4 +2268,4 @@ var QuickAccess = function QuickAccess(props) {
|
|
|
2268
2268
|
QuickAccess.propTypes = {};
|
|
2269
2269
|
QuickAccess.displayName = 'QuickAccess';
|
|
2270
2270
|
|
|
2271
|
-
exports[
|
|
2271
|
+
exports["default"] = QuickAccess;
|