@crystaldesign/diva-navigator 26.3.0-rc.1 → 26.3.0-rc.11
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/build/esm/index.js +80 -113
- package/build/types/navigator/src/Header/QrCodeScanner/Scanner.d.ts.map +1 -1
- package/build/types/navigator/src/Header/QrCodeScanner/index.d.ts.map +1 -1
- package/build/types/navigator/src/Header/QrCodeScanner/utils.d.ts +7 -20
- package/build/types/navigator/src/Header/QrCodeScanner/utils.d.ts.map +1 -1
- package/build/types/navigator/src/OrgTreeSelect/useOrgTree.d.ts.map +1 -1
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -4,14 +4,14 @@ import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructurin
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useTranslation, useDivaCore, getLogger } from '@crystaldesign/diva-core';
|
|
6
6
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
8
7
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
9
|
-
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
10
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
9
|
import Fuse from 'fuse.js';
|
|
12
10
|
import Switch from 'react-switch';
|
|
13
11
|
import Dropdown from 'react-dropdown';
|
|
14
12
|
import { md5 } from '@crystaldesign/diva-utils';
|
|
13
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
14
|
+
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
15
15
|
import { Alert, Button as Button$1, Stack, Paper, Typography, Divider, TextField, CircularProgress } from '@mui/material';
|
|
16
16
|
import SearchIcon from '@mui/icons-material/Search';
|
|
17
17
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
@@ -503,67 +503,24 @@ var initialState = {
|
|
|
503
503
|
function useOrgTree(onSelect) {
|
|
504
504
|
var _organization$_id;
|
|
505
505
|
var _useDivaCore = useDivaCore(),
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
_useDivaCore$state = _useDivaCore.state,
|
|
507
|
+
organization = _useDivaCore$state.organization,
|
|
508
|
+
organizationTree = _useDivaCore$state.organizationTree,
|
|
509
|
+
initializing = _useDivaCore$state.initializing;
|
|
508
510
|
var _useReducer = useReducer(treeReducer, initialState),
|
|
509
511
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
510
512
|
state = _useReducer2[0],
|
|
511
513
|
dispatch = _useReducer2[1];
|
|
512
514
|
var organizationId = (_organization$_id = organization === null || organization === void 0 ? void 0 : organization._id) !== null && _organization$_id !== void 0 ? _organization$_id : null;
|
|
513
515
|
useEffect(function () {
|
|
514
|
-
|
|
515
|
-
_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
516
|
-
var response;
|
|
517
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
518
|
-
while (1) switch (_context.prev = _context.next) {
|
|
519
|
-
case 0:
|
|
520
|
-
_context.prev = 0;
|
|
521
|
-
_context.next = 3;
|
|
522
|
-
return organizationHandler.getOrganizationTree();
|
|
523
|
-
case 3:
|
|
524
|
-
response = _context.sent;
|
|
525
|
-
if (!cancelled) {
|
|
526
|
-
_context.next = 6;
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
return _context.abrupt("return");
|
|
530
|
-
case 6:
|
|
531
|
-
dispatch({
|
|
532
|
-
type: 'SET_TREE',
|
|
533
|
-
tree: response.tree,
|
|
534
|
-
totalAccessible: response.totalAccessible,
|
|
535
|
-
selectedId: organizationId
|
|
536
|
-
});
|
|
537
|
-
_context.next = 12;
|
|
538
|
-
break;
|
|
539
|
-
case 9:
|
|
540
|
-
_context.prev = 9;
|
|
541
|
-
_context.t0 = _context["catch"](0);
|
|
542
|
-
if (!cancelled) {
|
|
543
|
-
dispatch({
|
|
544
|
-
type: 'SET_TREE',
|
|
545
|
-
tree: [],
|
|
546
|
-
totalAccessible: 0,
|
|
547
|
-
selectedId: null
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
case 12:
|
|
551
|
-
case "end":
|
|
552
|
-
return _context.stop();
|
|
553
|
-
}
|
|
554
|
-
}, _callee, null, [[0, 9]]);
|
|
555
|
-
}))();
|
|
556
|
-
return function () {
|
|
557
|
-
cancelled = true;
|
|
558
|
-
};
|
|
559
|
-
}, []);
|
|
560
|
-
useEffect(function () {
|
|
561
|
-
if (state.selectedId === organizationId) return;
|
|
516
|
+
if (initializing) return;
|
|
562
517
|
dispatch({
|
|
563
|
-
type: '
|
|
564
|
-
|
|
518
|
+
type: 'SET_TREE',
|
|
519
|
+
tree: organizationTree.tree,
|
|
520
|
+
totalAccessible: organizationTree.totalAccessible,
|
|
521
|
+
selectedId: organizationId
|
|
565
522
|
});
|
|
566
|
-
var path = findPathToNode(
|
|
523
|
+
var path = findPathToNode(organizationTree.tree, organizationId);
|
|
567
524
|
if (path) {
|
|
568
525
|
dispatch({
|
|
569
526
|
type: 'SET_EXPANDED',
|
|
@@ -571,7 +528,7 @@ function useOrgTree(onSelect) {
|
|
|
571
528
|
force: 'expand'
|
|
572
529
|
});
|
|
573
530
|
}
|
|
574
|
-
}, [organizationId,
|
|
531
|
+
}, [initializing, organizationId, organizationTree.totalAccessible, organizationTree.tree]);
|
|
575
532
|
var toggleExpand = useCallback(function (nodeId) {
|
|
576
533
|
dispatch({
|
|
577
534
|
type: 'SET_EXPANDED',
|
|
@@ -2158,10 +2115,11 @@ function matchProduct(_x, _x2, _x3) {
|
|
|
2158
2115
|
}
|
|
2159
2116
|
|
|
2160
2117
|
/**
|
|
2161
|
-
*
|
|
2118
|
+
* Checks if the given divaNr is a valid product.
|
|
2162
2119
|
*
|
|
2163
2120
|
* @param divaNr The divaNr to get the product for
|
|
2164
|
-
* @param
|
|
2121
|
+
* @param jwt The jwt to use for the request
|
|
2122
|
+
* @param catalogService The catalog service to use for the request
|
|
2165
2123
|
*/
|
|
2166
2124
|
function _matchProduct() {
|
|
2167
2125
|
_matchProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, shopBaseUrl, apiGetProductByFilter) {
|
|
@@ -2272,49 +2230,58 @@ function _matchProduct() {
|
|
|
2272
2230
|
}));
|
|
2273
2231
|
return _matchProduct.apply(this, arguments);
|
|
2274
2232
|
}
|
|
2275
|
-
function
|
|
2276
|
-
return
|
|
2233
|
+
function checkProductByDivaNr(_x4, _x5, _x6) {
|
|
2234
|
+
return _checkProductByDivaNr.apply(this, arguments);
|
|
2277
2235
|
}
|
|
2278
|
-
function
|
|
2279
|
-
|
|
2280
|
-
var
|
|
2236
|
+
function _checkProductByDivaNr() {
|
|
2237
|
+
_checkProductByDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(divaNr, jwt, catalogService) {
|
|
2238
|
+
var response, data, item;
|
|
2281
2239
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2282
2240
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2283
2241
|
case 0:
|
|
2284
|
-
|
|
2285
|
-
id: 'divaNr',
|
|
2286
|
-
op: 'eq',
|
|
2287
|
-
value: divaNr
|
|
2288
|
-
}, {
|
|
2289
|
-
id: 'baseProduct',
|
|
2290
|
-
op: 'eq',
|
|
2291
|
-
value: false
|
|
2292
|
-
}];
|
|
2242
|
+
_context2.prev = 0;
|
|
2293
2243
|
_context2.next = 3;
|
|
2294
|
-
return
|
|
2244
|
+
return fetch("".concat(catalogService, "/v1/products/").concat(divaNr, "/list"), {
|
|
2245
|
+
headers: {
|
|
2246
|
+
Authorization: "Bearer ".concat(jwt)
|
|
2247
|
+
}
|
|
2248
|
+
});
|
|
2295
2249
|
case 3:
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
_context2.next = 7;
|
|
2250
|
+
response = _context2.sent;
|
|
2251
|
+
if (!response.ok) {
|
|
2252
|
+
_context2.next = 11;
|
|
2300
2253
|
break;
|
|
2301
2254
|
}
|
|
2302
|
-
|
|
2255
|
+
_context2.next = 7;
|
|
2256
|
+
return response.json();
|
|
2303
2257
|
case 7:
|
|
2258
|
+
data = _context2.sent;
|
|
2259
|
+
item = data === null || data === void 0 ? void 0 : data[0];
|
|
2260
|
+
if (!item) {
|
|
2261
|
+
_context2.next = 11;
|
|
2262
|
+
break;
|
|
2263
|
+
}
|
|
2304
2264
|
return _context2.abrupt("return", {
|
|
2305
2265
|
id: item._id,
|
|
2306
2266
|
organizationId: item.organizationId,
|
|
2307
2267
|
organizationIdDisplayText: item.organizationId_displayText
|
|
2308
2268
|
});
|
|
2309
|
-
case
|
|
2269
|
+
case 11:
|
|
2270
|
+
return _context2.abrupt("return", undefined);
|
|
2271
|
+
case 14:
|
|
2272
|
+
_context2.prev = 14;
|
|
2273
|
+
_context2.t0 = _context2["catch"](0);
|
|
2274
|
+
LOG$1.warn('Error getting product by divaNr or id', _context2.t0);
|
|
2275
|
+
return _context2.abrupt("return", undefined);
|
|
2276
|
+
case 18:
|
|
2310
2277
|
case "end":
|
|
2311
2278
|
return _context2.stop();
|
|
2312
2279
|
}
|
|
2313
|
-
}, _callee2);
|
|
2280
|
+
}, _callee2, null, [[0, 14]]);
|
|
2314
2281
|
}));
|
|
2315
|
-
return
|
|
2282
|
+
return _checkProductByDivaNr.apply(this, arguments);
|
|
2316
2283
|
}
|
|
2317
|
-
function checkConfigurationByDivaNr(
|
|
2284
|
+
function checkConfigurationByDivaNr(_x7, _x8, _x9) {
|
|
2318
2285
|
return _checkConfigurationByDivaNr.apply(this, arguments);
|
|
2319
2286
|
}
|
|
2320
2287
|
function _checkConfigurationByDivaNr() {
|
|
@@ -2342,28 +2309,17 @@ function _checkConfigurationByDivaNr() {
|
|
|
2342
2309
|
case 8:
|
|
2343
2310
|
data = _context3.sent;
|
|
2344
2311
|
return _context3.abrupt("return", {
|
|
2345
|
-
isValid: true,
|
|
2346
2312
|
organizationId: data.basket.OrganizationId,
|
|
2347
2313
|
organizationIdDisplayText: data.basket.OrganizationId_displayText,
|
|
2348
2314
|
orderStatus: data.basket.OrderStatus
|
|
2349
2315
|
});
|
|
2350
2316
|
case 10:
|
|
2351
|
-
return _context3.abrupt("return",
|
|
2352
|
-
isValid: false,
|
|
2353
|
-
organizationId: undefined,
|
|
2354
|
-
organizationIdDisplayText: undefined,
|
|
2355
|
-
orderStatus: undefined
|
|
2356
|
-
});
|
|
2317
|
+
return _context3.abrupt("return", undefined);
|
|
2357
2318
|
case 13:
|
|
2358
2319
|
_context3.prev = 13;
|
|
2359
2320
|
_context3.t0 = _context3["catch"](1);
|
|
2360
2321
|
LOG$1.warn('Error checking configuration by divaNr', _context3.t0);
|
|
2361
|
-
return _context3.abrupt("return",
|
|
2362
|
-
isValid: false,
|
|
2363
|
-
organizationId: undefined,
|
|
2364
|
-
organizationIdDisplayText: undefined,
|
|
2365
|
-
orderStatus: undefined
|
|
2366
|
-
});
|
|
2322
|
+
return _context3.abrupt("return", undefined);
|
|
2367
2323
|
case 17:
|
|
2368
2324
|
case "end":
|
|
2369
2325
|
return _context3.stop();
|
|
@@ -2376,7 +2332,7 @@ function _checkConfigurationByDivaNr() {
|
|
|
2376
2332
|
* Resolves a divaNr to a FetchedResult by trying basket first, then product.
|
|
2377
2333
|
* Returns null if neither is found or enabled.
|
|
2378
2334
|
*/
|
|
2379
|
-
function resolveDivaNr(
|
|
2335
|
+
function resolveDivaNr(_x10, _x11) {
|
|
2380
2336
|
return _resolveDivaNr.apply(this, arguments);
|
|
2381
2337
|
}
|
|
2382
2338
|
|
|
@@ -2384,9 +2340,9 @@ function resolveDivaNr(_x9, _x10, _x11) {
|
|
|
2384
2340
|
* Opens the given result in the current organization.
|
|
2385
2341
|
*/
|
|
2386
2342
|
function _resolveDivaNr() {
|
|
2387
|
-
_resolveDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(divaNr, options
|
|
2343
|
+
_resolveDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(divaNr, options) {
|
|
2388
2344
|
var _options$qrCodeScanne, _options$qrCodeScanne2;
|
|
2389
|
-
var basketEnabled,
|
|
2345
|
+
var basketEnabled, basket, productEnabled, product;
|
|
2390
2346
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
2391
2347
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2392
2348
|
case 0:
|
|
@@ -2398,16 +2354,16 @@ function _resolveDivaNr() {
|
|
|
2398
2354
|
_context4.next = 4;
|
|
2399
2355
|
return checkConfigurationByDivaNr(divaNr, options.jwt, options.basketService);
|
|
2400
2356
|
case 4:
|
|
2401
|
-
|
|
2402
|
-
if (!
|
|
2357
|
+
basket = _context4.sent;
|
|
2358
|
+
if (!basket) {
|
|
2403
2359
|
_context4.next = 7;
|
|
2404
2360
|
break;
|
|
2405
2361
|
}
|
|
2406
2362
|
return _context4.abrupt("return", {
|
|
2407
2363
|
type: 'basket',
|
|
2408
|
-
organizationId:
|
|
2409
|
-
organizationIdDisplayText:
|
|
2410
|
-
orderStatus:
|
|
2364
|
+
organizationId: basket.organizationId,
|
|
2365
|
+
organizationIdDisplayText: basket.organizationIdDisplayText,
|
|
2366
|
+
orderStatus: basket.orderStatus,
|
|
2411
2367
|
divaNr: divaNr
|
|
2412
2368
|
});
|
|
2413
2369
|
case 7:
|
|
@@ -2417,7 +2373,7 @@ function _resolveDivaNr() {
|
|
|
2417
2373
|
break;
|
|
2418
2374
|
}
|
|
2419
2375
|
_context4.next = 11;
|
|
2420
|
-
return
|
|
2376
|
+
return checkProductByDivaNr(divaNr, options.jwt, options.catalogService);
|
|
2421
2377
|
case 11:
|
|
2422
2378
|
product = _context4.sent;
|
|
2423
2379
|
if (!product) {
|
|
@@ -2485,6 +2441,7 @@ function openResultInTargetOrg(result, openComponent, closeModal) {
|
|
|
2485
2441
|
|
|
2486
2442
|
var LOG = getLogger('Framework', 'QrCoedScanner');
|
|
2487
2443
|
function Scanner(_ref) {
|
|
2444
|
+
var _organization$type, _organization$type$to;
|
|
2488
2445
|
var onResult = _ref.onResult;
|
|
2489
2446
|
var qrCodeReader = useRef();
|
|
2490
2447
|
var _useDivaCore = useDivaCore(),
|
|
@@ -2508,7 +2465,8 @@ function Scanner(_ref) {
|
|
|
2508
2465
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2509
2466
|
error = _React$useState2[0],
|
|
2510
2467
|
setError = _React$useState2[1];
|
|
2511
|
-
var
|
|
2468
|
+
var organizationType = organization === null || organization === void 0 || (_organization$type = organization.type) === null || _organization$type === void 0 || (_organization$type$to = _organization$type.toUpperCase) === null || _organization$type$to === void 0 ? void 0 : _organization$type$to.call(_organization$type);
|
|
2469
|
+
var isWrapperOrg = !(organization !== null && organization !== void 0 && organization.type) && !(organization !== null && organization !== void 0 && organization.parentType) || organizationType === 'SUPPLIER' || organizationType === 'SUPLIER';
|
|
2512
2470
|
var handleResult = function handleResult(result) {
|
|
2513
2471
|
var isSameOrg = !result.organizationId || result.organizationId === organization._id;
|
|
2514
2472
|
if (isSameOrg) {
|
|
@@ -2528,7 +2486,8 @@ function Scanner(_ref) {
|
|
|
2528
2486
|
options = {
|
|
2529
2487
|
qrCodeScanner: qrCodeScanner,
|
|
2530
2488
|
jwt: jwt,
|
|
2531
|
-
basketService: apiConfig.basketService
|
|
2489
|
+
basketService: apiConfig.basketService,
|
|
2490
|
+
catalogService: apiConfig.catalogService
|
|
2532
2491
|
};
|
|
2533
2492
|
divaNr = matchDivaNr(text);
|
|
2534
2493
|
if (!divaNr) {
|
|
@@ -2537,7 +2496,7 @@ function Scanner(_ref) {
|
|
|
2537
2496
|
}
|
|
2538
2497
|
LOG.debug('Found DivaNr in QR Code: ' + divaNr);
|
|
2539
2498
|
_context.next = 6;
|
|
2540
|
-
return resolveDivaNr(divaNr, options
|
|
2499
|
+
return resolveDivaNr(divaNr, options);
|
|
2541
2500
|
case 6:
|
|
2542
2501
|
result = _context.sent;
|
|
2543
2502
|
if (!result) {
|
|
@@ -2674,12 +2633,14 @@ function OrgActionButtons(_ref) {
|
|
|
2674
2633
|
var result = _ref.result,
|
|
2675
2634
|
organizationId = _ref.organizationId,
|
|
2676
2635
|
isWrapperOrg = _ref.isWrapperOrg,
|
|
2636
|
+
canAccessTargetOrg = _ref.canAccessTargetOrg,
|
|
2677
2637
|
onOpenCurrent = _ref.onOpenCurrent,
|
|
2678
2638
|
onOpenTarget = _ref.onOpenTarget;
|
|
2679
2639
|
var _useTranslation = useTranslation(),
|
|
2680
2640
|
t = _useTranslation.t;
|
|
2681
2641
|
var isSameOrg = !result.organizationId || result.organizationId === organizationId;
|
|
2682
|
-
|
|
2642
|
+
var isProduct = result.type === 'product';
|
|
2643
|
+
if (isSameOrg || isProduct && !isWrapperOrg || !canAccessTargetOrg) {
|
|
2683
2644
|
return /*#__PURE__*/jsx(Button$1, {
|
|
2684
2645
|
variant: "contained",
|
|
2685
2646
|
onClick: onOpenCurrent,
|
|
@@ -2712,18 +2673,20 @@ function OrgActionButtons(_ref) {
|
|
|
2712
2673
|
});
|
|
2713
2674
|
}
|
|
2714
2675
|
function ScannerModalContent() {
|
|
2676
|
+
var _organization$type, _organization$type$to;
|
|
2715
2677
|
var _useTranslation2 = useTranslation(),
|
|
2716
2678
|
t = _useTranslation2.t;
|
|
2717
2679
|
var _useDivaCore = useDivaCore(),
|
|
2718
2680
|
_useDivaCore$actions = _useDivaCore.actions,
|
|
2719
2681
|
closeModal = _useDivaCore$actions.closeModal,
|
|
2720
2682
|
openComponent = _useDivaCore$actions.openComponent,
|
|
2683
|
+
canAccessOrganization = _useDivaCore$actions.canAccessOrganization,
|
|
2721
2684
|
_useDivaCore$state = _useDivaCore.state,
|
|
2722
2685
|
qrCodeScanner = _useDivaCore$state.navigationConfiguration.qrCodeScanner,
|
|
2723
2686
|
jwt = _useDivaCore$state.jwt,
|
|
2724
2687
|
apiConfig = _useDivaCore$state.apiConfig,
|
|
2725
|
-
organization = _useDivaCore$state.organization
|
|
2726
|
-
|
|
2688
|
+
organization = _useDivaCore$state.organization;
|
|
2689
|
+
_useDivaCore.handler.productHandler;
|
|
2727
2690
|
var _React$useState = React.useState(false),
|
|
2728
2691
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2729
2692
|
showScanner = _React$useState2[0],
|
|
@@ -2750,7 +2713,9 @@ function ScannerModalContent() {
|
|
|
2750
2713
|
var hasEnoughDigits = function hasEnoughDigits(value) {
|
|
2751
2714
|
return /^DIVA-\d{4}/i.test(value.trim());
|
|
2752
2715
|
};
|
|
2753
|
-
var
|
|
2716
|
+
var organizationType = organization === null || organization === void 0 || (_organization$type = organization.type) === null || _organization$type === void 0 || (_organization$type$to = _organization$type.toUpperCase) === null || _organization$type$to === void 0 ? void 0 : _organization$type$to.call(_organization$type);
|
|
2717
|
+
var isWrapperOrg = !(organization !== null && organization !== void 0 && organization.type) && !(organization !== null && organization !== void 0 && organization.parentType) || organizationType === 'SUPPLIER' || organizationType === 'SUPLIER';
|
|
2718
|
+
var canAccessTargetOrg = (fetchedResult === null || fetchedResult === void 0 ? void 0 : fetchedResult.organizationId) != null ? canAccessOrganization(fetchedResult.organizationId) : true;
|
|
2754
2719
|
React.useEffect(function () {
|
|
2755
2720
|
var normalized = divaNrInput.trim().toUpperCase();
|
|
2756
2721
|
if (!isValidDivaNr(normalized) || !hasEnoughDigits(normalized)) {
|
|
@@ -2771,8 +2736,9 @@ function ScannerModalContent() {
|
|
|
2771
2736
|
return resolveDivaNr(normalized, {
|
|
2772
2737
|
qrCodeScanner: qrCodeScanner,
|
|
2773
2738
|
jwt: jwt,
|
|
2774
|
-
basketService: apiConfig.basketService
|
|
2775
|
-
|
|
2739
|
+
basketService: apiConfig.basketService,
|
|
2740
|
+
catalogService: apiConfig.catalogService
|
|
2741
|
+
});
|
|
2776
2742
|
case 5:
|
|
2777
2743
|
result = _context.sent;
|
|
2778
2744
|
if (!cancelled) {
|
|
@@ -2878,6 +2844,7 @@ function ScannerModalContent() {
|
|
|
2878
2844
|
result: fetchedResult,
|
|
2879
2845
|
organizationId: organization._id,
|
|
2880
2846
|
isWrapperOrg: isWrapperOrg,
|
|
2847
|
+
canAccessTargetOrg: canAccessTargetOrg,
|
|
2881
2848
|
onOpenCurrent: handleOpenCurrent,
|
|
2882
2849
|
onOpenTarget: handleOpenTarget
|
|
2883
2850
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scanner.d.ts","sourceRoot":"","sources":["../../../../../../src/Header/QrCodeScanner/Scanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,
|
|
1
|
+
{"version":3,"file":"Scanner.d.ts","sourceRoot":"","sources":["../../../../../../src/Header/QrCodeScanner/Scanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EACL,aAAa,EAOd,MAAM,SAAS,CAAC;AAIjB,UAAU,YAAY;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,qBAgHjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Header/QrCodeScanner/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Header/QrCodeScanner/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgL1B,MAAM,CAAC,OAAO,gCAyBb"}
|
|
@@ -49,35 +49,22 @@ export declare function matchProduct(url: string, shopBaseUrl: string, apiGetPro
|
|
|
49
49
|
organizationIdDisplayText?: string;
|
|
50
50
|
} | undefined>;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Checks if the given divaNr is a valid product.
|
|
53
53
|
*
|
|
54
54
|
* @param divaNr The divaNr to get the product for
|
|
55
|
-
* @param
|
|
55
|
+
* @param jwt The jwt to use for the request
|
|
56
|
+
* @param catalogService The catalog service to use for the request
|
|
56
57
|
*/
|
|
57
|
-
export declare function
|
|
58
|
-
id: string;
|
|
59
|
-
op: string;
|
|
60
|
-
value: string | number | boolean;
|
|
61
|
-
}[], limit: number, useFilter?: boolean, hierarchy?: boolean) => Promise<{
|
|
62
|
-
data: any[];
|
|
63
|
-
}>): Promise<{
|
|
58
|
+
export declare function checkProductByDivaNr(divaNr: string, jwt: string, catalogService: string): Promise<{
|
|
64
59
|
id: string;
|
|
65
60
|
organizationId?: string;
|
|
66
61
|
organizationIdDisplayText?: string;
|
|
67
62
|
} | undefined>;
|
|
68
63
|
export declare function checkConfigurationByDivaNr(divaNr: string, jwt: string, basketService: string): Promise<{
|
|
69
|
-
isValid: boolean;
|
|
70
64
|
organizationId: any;
|
|
71
65
|
organizationIdDisplayText: any;
|
|
72
66
|
orderStatus: any;
|
|
73
|
-
}>;
|
|
74
|
-
type ApiGetProductByFilter = (filter: {
|
|
75
|
-
id: string;
|
|
76
|
-
op: string;
|
|
77
|
-
value: string | number | boolean;
|
|
78
|
-
}[], limit: number, useFilter?: boolean, hierarchy?: boolean) => Promise<{
|
|
79
|
-
data: any[];
|
|
80
|
-
}>;
|
|
67
|
+
} | undefined>;
|
|
81
68
|
export interface ResolveDivaNrOptions {
|
|
82
69
|
qrCodeScanner?: boolean | {
|
|
83
70
|
basket?: boolean;
|
|
@@ -85,12 +72,13 @@ export interface ResolveDivaNrOptions {
|
|
|
85
72
|
};
|
|
86
73
|
jwt: string;
|
|
87
74
|
basketService: string;
|
|
75
|
+
catalogService: string;
|
|
88
76
|
}
|
|
89
77
|
/**
|
|
90
78
|
* Resolves a divaNr to a FetchedResult by trying basket first, then product.
|
|
91
79
|
* Returns null if neither is found or enabled.
|
|
92
80
|
*/
|
|
93
|
-
export declare function resolveDivaNr(divaNr: string, options: ResolveDivaNrOptions
|
|
81
|
+
export declare function resolveDivaNr(divaNr: string, options: ResolveDivaNrOptions): Promise<FetchedResult | null>;
|
|
94
82
|
/**
|
|
95
83
|
* Opens the given result in the current organization.
|
|
96
84
|
*/
|
|
@@ -99,5 +87,4 @@ export declare function openResultInCurrentOrg(result: FetchedResult, openCompon
|
|
|
99
87
|
* Opens the given result in the target organization (new tab).
|
|
100
88
|
*/
|
|
101
89
|
export declare function openResultInTargetOrg(result: FetchedResult, openComponent: (data: Action) => void, closeModal: () => void): void;
|
|
102
|
-
export {};
|
|
103
90
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/Header/QrCodeScanner/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,0BAA0B,CAAC;AAI7D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrH;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,yBAAyB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExG;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,sBA0BtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,qBAAqB,EAAE,CACrB,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,E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H,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,GAAG,IAAI,CAQhI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrgTree.d.ts","sourceRoot":"","sources":["../../../../../src/OrgTreeSelect/useOrgTree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"useOrgTree.d.ts","sourceRoot":"","sources":["../../../../../src/OrgTreeSelect/useOrgTree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAyB,MAAM,SAAS,CAAC;AAiD7D,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI;;;;;;;2BAsB9C,MAAM;sBAKvC,WAAW;2BAQT,MAAM;EAoBlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-navigator",
|
|
3
|
-
"version": "26.3.0-rc.
|
|
3
|
+
"version": "26.3.0-rc.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@testing-library/jest-dom": "^6.5.0",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
},
|
|
26
26
|
"module": "build/esm/index.js",
|
|
27
27
|
"types": "./build/types/navigator/src/index.d.ts",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "5ef9c0de13a4ee4294f8faef02121190b96db90a"
|
|
29
29
|
}
|