@crystaldesign/diva-archive 26.2.0-beta.29 → 26.2.0-beta.30
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
CHANGED
|
@@ -222,9 +222,7 @@ function useActions(_ref) {
|
|
|
222
222
|
openModal = _useDivaCore$actions.openModal,
|
|
223
223
|
userHasPermission = _useDivaCore$actions.userHasPermission,
|
|
224
224
|
openSnackBar = _useDivaCore$actions.openSnackBar,
|
|
225
|
-
|
|
226
|
-
reportHandler = _useDivaCore$handler.reportHandler,
|
|
227
|
-
organizationHandler = _useDivaCore$handler.organizationHandler;
|
|
225
|
+
reportHandler = _useDivaCore.handler.reportHandler;
|
|
228
226
|
var _useTranslation = useTranslation(),
|
|
229
227
|
t = _useTranslation.t;
|
|
230
228
|
if (trashed) {
|
|
@@ -295,8 +293,7 @@ function useActions(_ref) {
|
|
|
295
293
|
apiConfig: apiConfig,
|
|
296
294
|
jwt: jwt,
|
|
297
295
|
reportHandler: reportHandler,
|
|
298
|
-
user: user
|
|
299
|
-
organizationHandler: organizationHandler
|
|
296
|
+
user: user
|
|
300
297
|
})
|
|
301
298
|
};
|
|
302
299
|
});
|
|
@@ -330,11 +327,10 @@ function getAction(_ref2) {
|
|
|
330
327
|
apiConfig = _ref2.apiConfig,
|
|
331
328
|
jwt = _ref2.jwt,
|
|
332
329
|
reportHandler = _ref2.reportHandler,
|
|
333
|
-
user = _ref2.user
|
|
334
|
-
organizationHandler = _ref2.organizationHandler;
|
|
330
|
+
user = _ref2.user;
|
|
335
331
|
switch (action.type) {
|
|
336
332
|
case 'basket':
|
|
337
|
-
return openBasketAction(openComponent
|
|
333
|
+
return openBasketAction(openComponent);
|
|
338
334
|
case 'pdf':
|
|
339
335
|
return openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t, action, reportHandler);
|
|
340
336
|
case 'planner':
|
|
@@ -358,90 +354,26 @@ function getAction(_ref2) {
|
|
|
358
354
|
throw Error("".concat(action.type, " is not a valid action type"));
|
|
359
355
|
}
|
|
360
356
|
}
|
|
361
|
-
function openBasketAction(openComponent
|
|
362
|
-
return
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
while (1) switch (_context.prev = _context.next) {
|
|
367
|
-
case 0:
|
|
368
|
-
if (!(item.OrganizationId !== organization._id)) {
|
|
369
|
-
_context.next = 14;
|
|
370
|
-
break;
|
|
371
|
-
}
|
|
372
|
-
if (!item.OrganizationId) {
|
|
373
|
-
_context.next = 14;
|
|
374
|
-
break;
|
|
375
|
-
}
|
|
376
|
-
_context.next = 4;
|
|
377
|
-
return organizationHandler.getOrganizationDataById(item.OrganizationId);
|
|
378
|
-
case 4:
|
|
379
|
-
targetOrganizationData = _context.sent;
|
|
380
|
-
if (!(targetOrganizationData == 'FORBIDDEN')) {
|
|
381
|
-
_context.next = 10;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
errorText = t('errorcodes._source.labels.error.CORE_0003');
|
|
385
|
-
divaError = new DivaError(errorText, {
|
|
386
|
-
code: 'CORE_0003'
|
|
387
|
-
});
|
|
388
|
-
LOG.error(divaError);
|
|
389
|
-
return _context.abrupt("return", openModal({
|
|
390
|
-
title: t('action.archive.openproduct.error'),
|
|
391
|
-
text: t('action.archive.openproduct.errortext'),
|
|
392
|
-
accept: true
|
|
393
|
-
}));
|
|
394
|
-
case 10:
|
|
395
|
-
modaltext = t('action.archive.edit.otherorganizationdetail');
|
|
396
|
-
modaltitle = t('action.archive.edit.cannotopen', {
|
|
397
|
-
suborganization: (_targetOrganizationDa = targetOrganizationData) === null || _targetOrganizationDa === void 0 ? void 0 : _targetOrganizationDa.displayName
|
|
398
|
-
});
|
|
399
|
-
if (!targetOrganizationData) {
|
|
400
|
-
modaltitle = t('action.archive.edit.cannotopenunknown');
|
|
401
|
-
}
|
|
402
|
-
return _context.abrupt("return", openModal({
|
|
403
|
-
title: modaltitle,
|
|
404
|
-
text: modaltext,
|
|
405
|
-
reject: true,
|
|
406
|
-
accept: true,
|
|
407
|
-
callback: function callback(accept) {
|
|
408
|
-
if (accept) {
|
|
409
|
-
var url = window.location.origin + '/seller?lang=de' + '&organizationId=' + item.OrganizationId + '&module=Basket&divaNr=' + item.DivaNr + "&check=1";
|
|
410
|
-
openComponent({
|
|
411
|
-
url: url,
|
|
412
|
-
openInNewTab: true
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}));
|
|
417
|
-
case 14:
|
|
418
|
-
params = {
|
|
419
|
-
module: 'Basket',
|
|
420
|
-
divaNr: item.DivaNrVersion
|
|
421
|
-
};
|
|
422
|
-
if (item.OrderStatus === 'SEND') {
|
|
423
|
-
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
424
|
-
assignNewDivaNr: 'true'
|
|
425
|
-
});
|
|
426
|
-
} else {
|
|
427
|
-
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
428
|
-
check: '1'
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
return _context.abrupt("return", openComponent({
|
|
432
|
-
type: 'SELLER',
|
|
433
|
-
parameters: params
|
|
434
|
-
}));
|
|
435
|
-
case 17:
|
|
436
|
-
case "end":
|
|
437
|
-
return _context.stop();
|
|
438
|
-
}
|
|
439
|
-
}, _callee);
|
|
440
|
-
}));
|
|
441
|
-
return function (_x) {
|
|
442
|
-
return _ref3.apply(this, arguments);
|
|
357
|
+
function openBasketAction(openComponent) {
|
|
358
|
+
return function (item) {
|
|
359
|
+
var params = {
|
|
360
|
+
module: 'Basket',
|
|
361
|
+
divaNr: item.DivaNrVersion
|
|
443
362
|
};
|
|
444
|
-
|
|
363
|
+
if (item.OrderStatus === 'SEND') {
|
|
364
|
+
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
365
|
+
assignNewDivaNr: 'true'
|
|
366
|
+
});
|
|
367
|
+
} else {
|
|
368
|
+
params = _objectSpread$2(_objectSpread$2({}, params), {}, {
|
|
369
|
+
check: '1'
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
openComponent({
|
|
373
|
+
type: 'SELLER',
|
|
374
|
+
parameters: params
|
|
375
|
+
});
|
|
376
|
+
};
|
|
445
377
|
}
|
|
446
378
|
function openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t, action, reportHandler) {
|
|
447
379
|
return function (item) {
|
|
@@ -554,15 +486,15 @@ function openEmailAction(sendEmail, t, action, organization, user) {
|
|
|
554
486
|
}
|
|
555
487
|
function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openModal, t) {
|
|
556
488
|
return /*#__PURE__*/function () {
|
|
557
|
-
var
|
|
489
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(item) {
|
|
558
490
|
var result;
|
|
559
|
-
return _regeneratorRuntime.wrap(function
|
|
560
|
-
while (1) switch (
|
|
491
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
492
|
+
while (1) switch (_context.prev = _context.next) {
|
|
561
493
|
case 0:
|
|
562
|
-
|
|
494
|
+
_context.next = 2;
|
|
563
495
|
return sendToIwofurn(apiConfig, jwt, item.DivaNr, Number(item.DocumentVersion), toggleLoading);
|
|
564
496
|
case 2:
|
|
565
|
-
result =
|
|
497
|
+
result = _context.sent;
|
|
566
498
|
if (result === true) {
|
|
567
499
|
openModal({
|
|
568
500
|
accept: true,
|
|
@@ -581,34 +513,34 @@ function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openM
|
|
|
581
513
|
}
|
|
582
514
|
case 4:
|
|
583
515
|
case "end":
|
|
584
|
-
return
|
|
516
|
+
return _context.stop();
|
|
585
517
|
}
|
|
586
|
-
},
|
|
518
|
+
}, _callee);
|
|
587
519
|
}));
|
|
588
|
-
return function (
|
|
589
|
-
return
|
|
520
|
+
return function (_x) {
|
|
521
|
+
return _ref3.apply(this, arguments);
|
|
590
522
|
};
|
|
591
523
|
}();
|
|
592
524
|
}
|
|
593
|
-
function placeOrderAction(
|
|
594
|
-
var apiConfig =
|
|
595
|
-
jwt =
|
|
596
|
-
organization =
|
|
597
|
-
sendEmail =
|
|
598
|
-
openModal =
|
|
599
|
-
t =
|
|
600
|
-
action =
|
|
601
|
-
setReloadPage =
|
|
525
|
+
function placeOrderAction(_ref4) {
|
|
526
|
+
var apiConfig = _ref4.apiConfig,
|
|
527
|
+
jwt = _ref4.jwt,
|
|
528
|
+
organization = _ref4.organization,
|
|
529
|
+
sendEmail = _ref4.sendEmail,
|
|
530
|
+
openModal = _ref4.openModal,
|
|
531
|
+
t = _ref4.t,
|
|
532
|
+
action = _ref4.action,
|
|
533
|
+
setReloadPage = _ref4.setReloadPage;
|
|
602
534
|
return /*#__PURE__*/function () {
|
|
603
|
-
var
|
|
604
|
-
return _regeneratorRuntime.wrap(function
|
|
605
|
-
while (1) switch (
|
|
535
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(item, id, updateOne) {
|
|
536
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
537
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
606
538
|
case 0:
|
|
607
539
|
if (jwt) {
|
|
608
|
-
|
|
540
|
+
_context3.next = 2;
|
|
609
541
|
break;
|
|
610
542
|
}
|
|
611
|
-
return
|
|
543
|
+
return _context3.abrupt("return");
|
|
612
544
|
case 2:
|
|
613
545
|
// Add sendOrdersEmail to the 'to' field, with a comma if action.to already has content
|
|
614
546
|
if (organization.settings.sendOrdersEmail) {
|
|
@@ -621,12 +553,12 @@ function placeOrderAction(_ref5) {
|
|
|
621
553
|
action: action,
|
|
622
554
|
item: item,
|
|
623
555
|
callback: function () {
|
|
624
|
-
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
625
|
-
return _regeneratorRuntime.wrap(function
|
|
626
|
-
while (1) switch (
|
|
556
|
+
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(success) {
|
|
557
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
558
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
627
559
|
case 0:
|
|
628
560
|
if (!(success == 'SUCCESS')) {
|
|
629
|
-
|
|
561
|
+
_context2.next = 7;
|
|
630
562
|
break;
|
|
631
563
|
}
|
|
632
564
|
openModal({
|
|
@@ -636,13 +568,13 @@ function placeOrderAction(_ref5) {
|
|
|
636
568
|
return setReloadPage(1);
|
|
637
569
|
}
|
|
638
570
|
});
|
|
639
|
-
|
|
571
|
+
_context2.next = 4;
|
|
640
572
|
return setOrdered(apiConfig, organization._id, jwt, item.DivaNr, parseInt(item.DocumentVersion));
|
|
641
573
|
case 4:
|
|
642
574
|
updateOne(_objectSpread$2(_objectSpread$2({}, item), {}, {
|
|
643
575
|
OrderStatus: 'SEND'
|
|
644
576
|
}));
|
|
645
|
-
|
|
577
|
+
_context2.next = 8;
|
|
646
578
|
break;
|
|
647
579
|
case 7:
|
|
648
580
|
openModal({
|
|
@@ -652,11 +584,11 @@ function placeOrderAction(_ref5) {
|
|
|
652
584
|
});
|
|
653
585
|
case 8:
|
|
654
586
|
case "end":
|
|
655
|
-
return
|
|
587
|
+
return _context2.stop();
|
|
656
588
|
}
|
|
657
|
-
},
|
|
589
|
+
}, _callee2);
|
|
658
590
|
}));
|
|
659
|
-
function callback(
|
|
591
|
+
function callback(_x5) {
|
|
660
592
|
return _callback.apply(this, arguments);
|
|
661
593
|
}
|
|
662
594
|
return callback;
|
|
@@ -664,56 +596,56 @@ function placeOrderAction(_ref5) {
|
|
|
664
596
|
});
|
|
665
597
|
case 4:
|
|
666
598
|
case "end":
|
|
667
|
-
return
|
|
599
|
+
return _context3.stop();
|
|
668
600
|
}
|
|
669
|
-
},
|
|
601
|
+
}, _callee3);
|
|
670
602
|
}));
|
|
671
|
-
return function (_x3, _x4
|
|
672
|
-
return
|
|
603
|
+
return function (_x2, _x3, _x4) {
|
|
604
|
+
return _ref5.apply(this, arguments);
|
|
673
605
|
};
|
|
674
606
|
}();
|
|
675
607
|
}
|
|
676
|
-
function setArchivedAction(
|
|
677
|
-
var apiConfig =
|
|
678
|
-
jwt =
|
|
679
|
-
openModal =
|
|
680
|
-
t =
|
|
681
|
-
trashed =
|
|
608
|
+
function setArchivedAction(_ref6) {
|
|
609
|
+
var apiConfig = _ref6.apiConfig,
|
|
610
|
+
jwt = _ref6.jwt,
|
|
611
|
+
openModal = _ref6.openModal,
|
|
612
|
+
t = _ref6.t,
|
|
613
|
+
trashed = _ref6.trashed;
|
|
682
614
|
return /*#__PURE__*/function () {
|
|
683
|
-
var
|
|
684
|
-
return _regeneratorRuntime.wrap(function
|
|
685
|
-
while (1) switch (
|
|
615
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(item, id, updateOne, deleteOne) {
|
|
616
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
617
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
686
618
|
case 0:
|
|
687
619
|
if (jwt) {
|
|
688
|
-
|
|
620
|
+
_context5.next = 2;
|
|
689
621
|
break;
|
|
690
622
|
}
|
|
691
|
-
return
|
|
623
|
+
return _context5.abrupt("return");
|
|
692
624
|
case 2:
|
|
693
625
|
openModal({
|
|
694
626
|
accept: true,
|
|
695
627
|
reject: true,
|
|
696
628
|
title: t(trashed ? 'order.restore' : 'order.delete'),
|
|
697
629
|
callback: function () {
|
|
698
|
-
var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
699
|
-
return _regeneratorRuntime.wrap(function
|
|
700
|
-
while (1) switch (
|
|
630
|
+
var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(accepted) {
|
|
631
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
632
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
701
633
|
case 0:
|
|
702
634
|
if (!accepted) {
|
|
703
|
-
|
|
635
|
+
_context4.next = 4;
|
|
704
636
|
break;
|
|
705
637
|
}
|
|
706
|
-
|
|
638
|
+
_context4.next = 3;
|
|
707
639
|
return setArchived(apiConfig, jwt, item.DivaNr, !trashed);
|
|
708
640
|
case 3:
|
|
709
641
|
deleteOne();
|
|
710
642
|
case 4:
|
|
711
643
|
case "end":
|
|
712
|
-
return
|
|
644
|
+
return _context4.stop();
|
|
713
645
|
}
|
|
714
|
-
},
|
|
646
|
+
}, _callee4);
|
|
715
647
|
}));
|
|
716
|
-
function callback(
|
|
648
|
+
function callback(_x10) {
|
|
717
649
|
return _callback2.apply(this, arguments);
|
|
718
650
|
}
|
|
719
651
|
return callback;
|
|
@@ -721,31 +653,31 @@ function setArchivedAction(_ref7) {
|
|
|
721
653
|
});
|
|
722
654
|
case 3:
|
|
723
655
|
case "end":
|
|
724
|
-
return
|
|
656
|
+
return _context5.stop();
|
|
725
657
|
}
|
|
726
|
-
},
|
|
658
|
+
}, _callee5);
|
|
727
659
|
}));
|
|
728
|
-
return function (_x7, _x8, _x9
|
|
729
|
-
return
|
|
660
|
+
return function (_x6, _x7, _x8, _x9) {
|
|
661
|
+
return _ref7.apply(this, arguments);
|
|
730
662
|
};
|
|
731
663
|
}();
|
|
732
664
|
}
|
|
733
|
-
function deleteAction(
|
|
734
|
-
var apiConfig =
|
|
735
|
-
jwt =
|
|
736
|
-
openModal =
|
|
737
|
-
t =
|
|
738
|
-
trashed =
|
|
665
|
+
function deleteAction(_ref8) {
|
|
666
|
+
var apiConfig = _ref8.apiConfig,
|
|
667
|
+
jwt = _ref8.jwt,
|
|
668
|
+
openModal = _ref8.openModal,
|
|
669
|
+
t = _ref8.t,
|
|
670
|
+
trashed = _ref8.trashed;
|
|
739
671
|
return /*#__PURE__*/function () {
|
|
740
|
-
var
|
|
741
|
-
return _regeneratorRuntime.wrap(function
|
|
742
|
-
while (1) switch (
|
|
672
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(item, id, updateOne, deleteOne) {
|
|
673
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
674
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
743
675
|
case 0:
|
|
744
676
|
if (jwt) {
|
|
745
|
-
|
|
677
|
+
_context7.next = 2;
|
|
746
678
|
break;
|
|
747
679
|
}
|
|
748
|
-
return
|
|
680
|
+
return _context7.abrupt("return");
|
|
749
681
|
case 2:
|
|
750
682
|
openModal({
|
|
751
683
|
accept: true,
|
|
@@ -754,25 +686,25 @@ function deleteAction(_ref9) {
|
|
|
754
686
|
divaNr: item.DivaNr
|
|
755
687
|
}),
|
|
756
688
|
callback: function () {
|
|
757
|
-
var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
758
|
-
return _regeneratorRuntime.wrap(function
|
|
759
|
-
while (1) switch (
|
|
689
|
+
var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(accepted) {
|
|
690
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
691
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
760
692
|
case 0:
|
|
761
693
|
if (!accepted) {
|
|
762
|
-
|
|
694
|
+
_context6.next = 4;
|
|
763
695
|
break;
|
|
764
696
|
}
|
|
765
|
-
|
|
697
|
+
_context6.next = 3;
|
|
766
698
|
return deleteBasket(apiConfig, jwt, item.DivaNr, !trashed);
|
|
767
699
|
case 3:
|
|
768
700
|
deleteOne();
|
|
769
701
|
case 4:
|
|
770
702
|
case "end":
|
|
771
|
-
return
|
|
703
|
+
return _context6.stop();
|
|
772
704
|
}
|
|
773
|
-
},
|
|
705
|
+
}, _callee6);
|
|
774
706
|
}));
|
|
775
|
-
function callback(
|
|
707
|
+
function callback(_x15) {
|
|
776
708
|
return _callback3.apply(this, arguments);
|
|
777
709
|
}
|
|
778
710
|
return callback;
|
|
@@ -780,23 +712,23 @@ function deleteAction(_ref9) {
|
|
|
780
712
|
});
|
|
781
713
|
case 3:
|
|
782
714
|
case "end":
|
|
783
|
-
return
|
|
715
|
+
return _context7.stop();
|
|
784
716
|
}
|
|
785
|
-
},
|
|
717
|
+
}, _callee7);
|
|
786
718
|
}));
|
|
787
|
-
return function (_x12, _x13, _x14
|
|
788
|
-
return
|
|
719
|
+
return function (_x11, _x12, _x13, _x14) {
|
|
720
|
+
return _ref9.apply(this, arguments);
|
|
789
721
|
};
|
|
790
722
|
}();
|
|
791
723
|
}
|
|
792
|
-
function triggerSendEmail(
|
|
793
|
-
var sendEmail =
|
|
794
|
-
|
|
795
|
-
var action =
|
|
796
|
-
organization =
|
|
797
|
-
user =
|
|
798
|
-
item =
|
|
799
|
-
callback =
|
|
724
|
+
function triggerSendEmail(_ref10) {
|
|
725
|
+
var sendEmail = _ref10.sendEmail;
|
|
726
|
+
_ref10.t;
|
|
727
|
+
var action = _ref10.action,
|
|
728
|
+
organization = _ref10.organization,
|
|
729
|
+
user = _ref10.user,
|
|
730
|
+
item = _ref10.item,
|
|
731
|
+
callback = _ref10.callback;
|
|
800
732
|
var to;
|
|
801
733
|
try {
|
|
802
734
|
var _action$to;
|
|
@@ -852,17 +784,17 @@ function getMailAddress(string, required) {
|
|
|
852
784
|
}
|
|
853
785
|
throw new Error('Required mail address is missing');
|
|
854
786
|
}
|
|
855
|
-
function sendToIwofurn(_x17, _x18, _x19, _x20
|
|
787
|
+
function sendToIwofurn(_x16, _x17, _x18, _x19, _x20) {
|
|
856
788
|
return _sendToIwofurn.apply(this, arguments);
|
|
857
789
|
}
|
|
858
790
|
function _sendToIwofurn() {
|
|
859
|
-
_sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
791
|
+
_sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(apiConfig, jwt, divaNr, version, toggleLoading) {
|
|
860
792
|
var result;
|
|
861
|
-
return _regeneratorRuntime.wrap(function
|
|
862
|
-
while (1) switch (
|
|
793
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
794
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
863
795
|
case 0:
|
|
864
796
|
toggleLoading('iwofurn');
|
|
865
|
-
|
|
797
|
+
_context8.next = 3;
|
|
866
798
|
return fetch("".concat(apiConfig.basketService, "/iwofurn/send?divaNr=").concat(divaNr, "&version=").concat(version), {
|
|
867
799
|
method: 'POST',
|
|
868
800
|
body: undefined,
|
|
@@ -874,38 +806,38 @@ function _sendToIwofurn() {
|
|
|
874
806
|
return r.json();
|
|
875
807
|
});
|
|
876
808
|
case 3:
|
|
877
|
-
result =
|
|
809
|
+
result = _context8.sent;
|
|
878
810
|
toggleLoading('iwofurn');
|
|
879
811
|
if (!(result.result !== 'Success')) {
|
|
880
|
-
|
|
812
|
+
_context8.next = 7;
|
|
881
813
|
break;
|
|
882
814
|
}
|
|
883
|
-
return
|
|
815
|
+
return _context8.abrupt("return", result.error);
|
|
884
816
|
case 7:
|
|
885
|
-
return
|
|
817
|
+
return _context8.abrupt("return", true);
|
|
886
818
|
case 8:
|
|
887
819
|
case "end":
|
|
888
|
-
return
|
|
820
|
+
return _context8.stop();
|
|
889
821
|
}
|
|
890
|
-
},
|
|
822
|
+
}, _callee8);
|
|
891
823
|
}));
|
|
892
824
|
return _sendToIwofurn.apply(this, arguments);
|
|
893
825
|
}
|
|
894
|
-
function setOrdered(_x22, _x23, _x24, _x25
|
|
826
|
+
function setOrdered(_x21, _x22, _x23, _x24, _x25) {
|
|
895
827
|
return _setOrdered.apply(this, arguments);
|
|
896
828
|
}
|
|
897
829
|
function _setOrdered() {
|
|
898
|
-
_setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
830
|
+
_setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(apiConfig, organizationId, jwt, divaNr, documentVersion) {
|
|
899
831
|
var body;
|
|
900
|
-
return _regeneratorRuntime.wrap(function
|
|
901
|
-
while (1) switch (
|
|
832
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
833
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
902
834
|
case 0:
|
|
903
|
-
|
|
835
|
+
_context9.prev = 0;
|
|
904
836
|
body = {
|
|
905
837
|
divaNr: divaNr,
|
|
906
838
|
version: documentVersion
|
|
907
839
|
};
|
|
908
|
-
|
|
840
|
+
_context9.next = 4;
|
|
909
841
|
return fetch("".concat(apiConfig.basketService, "/orders?organizationId=").concat(organizationId), {
|
|
910
842
|
method: 'POST',
|
|
911
843
|
headers: {
|
|
@@ -917,33 +849,33 @@ function _setOrdered() {
|
|
|
917
849
|
return r.json();
|
|
918
850
|
});
|
|
919
851
|
case 4:
|
|
920
|
-
|
|
852
|
+
_context9.next = 10;
|
|
921
853
|
break;
|
|
922
854
|
case 6:
|
|
923
|
-
|
|
924
|
-
|
|
855
|
+
_context9.prev = 6;
|
|
856
|
+
_context9.t0 = _context9["catch"](0);
|
|
925
857
|
LOG.error(new DivaError('Could not set OrderStatus', {
|
|
926
|
-
cause:
|
|
858
|
+
cause: _context9.t0
|
|
927
859
|
}));
|
|
928
860
|
throw new Error('DivaNr not found');
|
|
929
861
|
case 10:
|
|
930
862
|
case "end":
|
|
931
|
-
return
|
|
863
|
+
return _context9.stop();
|
|
932
864
|
}
|
|
933
|
-
},
|
|
865
|
+
}, _callee9, null, [[0, 6]]);
|
|
934
866
|
}));
|
|
935
867
|
return _setOrdered.apply(this, arguments);
|
|
936
868
|
}
|
|
937
|
-
function setArchived(_x27, _x28, _x29
|
|
869
|
+
function setArchived(_x26, _x27, _x28, _x29) {
|
|
938
870
|
return _setArchived.apply(this, arguments);
|
|
939
871
|
}
|
|
940
872
|
function _setArchived() {
|
|
941
|
-
_setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
873
|
+
_setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(apiConfig, jwt, divaNr, archived) {
|
|
942
874
|
var result;
|
|
943
|
-
return _regeneratorRuntime.wrap(function
|
|
944
|
-
while (1) switch (
|
|
875
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
876
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
945
877
|
case 0:
|
|
946
|
-
|
|
878
|
+
_context10.next = 2;
|
|
947
879
|
return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr + (archived ? '/archive' : '/restore'), {
|
|
948
880
|
method: archived ? 'DELETE' : 'PATCH',
|
|
949
881
|
headers: {
|
|
@@ -954,32 +886,32 @@ function _setArchived() {
|
|
|
954
886
|
return r.json();
|
|
955
887
|
});
|
|
956
888
|
case 2:
|
|
957
|
-
result =
|
|
889
|
+
result = _context10.sent;
|
|
958
890
|
if (!result) {
|
|
959
|
-
|
|
891
|
+
_context10.next = 5;
|
|
960
892
|
break;
|
|
961
893
|
}
|
|
962
|
-
return
|
|
894
|
+
return _context10.abrupt("return", result);
|
|
963
895
|
case 5:
|
|
964
896
|
throw new Error('DivaNr not found.');
|
|
965
897
|
case 6:
|
|
966
898
|
case "end":
|
|
967
|
-
return
|
|
899
|
+
return _context10.stop();
|
|
968
900
|
}
|
|
969
|
-
},
|
|
901
|
+
}, _callee10);
|
|
970
902
|
}));
|
|
971
903
|
return _setArchived.apply(this, arguments);
|
|
972
904
|
}
|
|
973
|
-
function deleteBasket(_x31, _x32, _x33
|
|
905
|
+
function deleteBasket(_x30, _x31, _x32, _x33) {
|
|
974
906
|
return _deleteBasket.apply(this, arguments);
|
|
975
907
|
}
|
|
976
908
|
function _deleteBasket() {
|
|
977
|
-
_deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
909
|
+
_deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(apiConfig, jwt, divaNr, archived) {
|
|
978
910
|
var result;
|
|
979
|
-
return _regeneratorRuntime.wrap(function
|
|
980
|
-
while (1) switch (
|
|
911
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
912
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
981
913
|
case 0:
|
|
982
|
-
|
|
914
|
+
_context11.next = 2;
|
|
983
915
|
return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr, {
|
|
984
916
|
method: 'DELETE',
|
|
985
917
|
headers: {
|
|
@@ -990,19 +922,19 @@ function _deleteBasket() {
|
|
|
990
922
|
return r.json();
|
|
991
923
|
});
|
|
992
924
|
case 2:
|
|
993
|
-
result =
|
|
925
|
+
result = _context11.sent;
|
|
994
926
|
if (!result) {
|
|
995
|
-
|
|
927
|
+
_context11.next = 5;
|
|
996
928
|
break;
|
|
997
929
|
}
|
|
998
|
-
return
|
|
930
|
+
return _context11.abrupt("return", result);
|
|
999
931
|
case 5:
|
|
1000
932
|
throw new Error('DivaNr not found.');
|
|
1001
933
|
case 6:
|
|
1002
934
|
case "end":
|
|
1003
|
-
return
|
|
935
|
+
return _context11.stop();
|
|
1004
936
|
}
|
|
1005
|
-
},
|
|
937
|
+
}, _callee11);
|
|
1006
938
|
}));
|
|
1007
939
|
return _deleteBasket.apply(this, arguments);
|
|
1008
940
|
}
|
|
@@ -1403,7 +1335,7 @@ var Archive = function Archive(_ref2) {
|
|
|
1403
1335
|
break;
|
|
1404
1336
|
}
|
|
1405
1337
|
}
|
|
1406
|
-
var hideOnlyOrgs = ((_ref3 = childOrganizations !== null && childOrganizations !== void 0 ? childOrganizations : []) === null || _ref3 === void 0 ? void 0 : _ref3.length)
|
|
1338
|
+
var hideOnlyOrgs = ((_ref3 = childOrganizations !== null && childOrganizations !== void 0 ? childOrganizations : []) === null || _ref3 === void 0 ? void 0 : _ref3.length) === 0 && !hasParentWithCrossOrg;
|
|
1407
1339
|
var _useState3 = useState(config.defaultHirarchy ? 'allOrgs' : !hideOnlyOrgs ? 'onlyOrg' : 'allOrgs'),
|
|
1408
1340
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1409
1341
|
activeTab = _useState4[0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IACzE,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AACD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,KAAK,IAAI,CAAC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,MAAM,CAAC;SACnB;KACF,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,GAAG,CAAC;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActions.d.ts","sourceRoot":"","sources":["../../../../src/useActions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useActions.d.ts","sourceRoot":"","sources":["../../../../src/useActions.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiB,WAAW,EAAE,aAAa,EAA0B,MAAM,SAAS,CAAC;AAI5F,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC7D;AAID,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,KAAK,iEA6EtF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-archive",
|
|
3
|
-
"version": "26.2.0-beta.
|
|
3
|
+
"version": "26.2.0-beta.30",
|
|
4
4
|
"license": "COMMERCIAL",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@testing-library/jest-dom": "^6.5.0",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"react-dom": "^18.3.1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@crystaldesign/grid": "26.2.0-beta.
|
|
18
|
+
"@crystaldesign/grid": "26.2.0-beta.30",
|
|
19
19
|
"flat": "^5.0.2"
|
|
20
20
|
},
|
|
21
21
|
"module": "build/esm/index.js",
|
|
22
22
|
"types": "./build/types/archive/src/index.d.ts",
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "a316fda1fce1b951ec9a6b07bf99715b042f270b"
|
|
24
24
|
}
|