@crystaldesign/diva-archive 26.4.0-beta.21 → 26.4.0-beta.23
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 +218 -136
- package/package.json +3 -3
package/build/esm/index.js
CHANGED
|
@@ -348,7 +348,7 @@ function getAction(_ref2) {
|
|
|
348
348
|
case 'pdf':
|
|
349
349
|
return openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t, action, reportHandler);
|
|
350
350
|
case 'planner':
|
|
351
|
-
return openPlannerAction(openComponent, updateBreadcrumbs);
|
|
351
|
+
return openPlannerAction(openComponent, updateBreadcrumbs, openModal, organization, canAccessOrganization, t);
|
|
352
352
|
case 'sendToIwoFurn':
|
|
353
353
|
return sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openModal, t);
|
|
354
354
|
case 'order':
|
|
@@ -536,8 +536,8 @@ function openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t,
|
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
function openPlannerAction(openComponent, updateBreadcrumbs) {
|
|
540
|
-
|
|
539
|
+
function openPlannerAction(openComponent, updateBreadcrumbs, openModal, organization, canAccessOrganization, t) {
|
|
540
|
+
var openInCurrentOrg = function openInCurrentOrg(item) {
|
|
541
541
|
updateBreadcrumbs({
|
|
542
542
|
type: 'replace',
|
|
543
543
|
groupId: 'ARCHIVE',
|
|
@@ -576,6 +576,88 @@ function openPlannerAction(openComponent, updateBreadcrumbs) {
|
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
|
+
var openInTargetOrg = function openInTargetOrg(item) {
|
|
580
|
+
var url = window.location.origin + '/planner?lang=de' + '&organizationId=' + item.OrganizationId + '&divaNr=' + item.DivaNr + '&assignNewDivaNr=' + (item.OrderStatus === 'SEND' ? 'true' : 'false');
|
|
581
|
+
openComponent({
|
|
582
|
+
url: url
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
return /*#__PURE__*/function () {
|
|
586
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
|
|
587
|
+
var _organization$type2, _organization$type2$t, modalTitle, hasAccessToTargetOrg, organizationType, isWrapperLikeOrganization;
|
|
588
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
589
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
590
|
+
case 0:
|
|
591
|
+
if (!(item.OrganizationId && item.OrganizationId !== organization._id)) {
|
|
592
|
+
_context2.next = 10;
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
modalTitle = t('action.archive.edit.cannotopen');
|
|
596
|
+
hasAccessToTargetOrg = canAccessOrganization(item.OrganizationId);
|
|
597
|
+
if (hasAccessToTargetOrg) {
|
|
598
|
+
_context2.next = 5;
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
return _context2.abrupt("return", openInCurrentOrg(item));
|
|
602
|
+
case 5:
|
|
603
|
+
organizationType = organization === null || organization === void 0 || (_organization$type2 = organization.type) === null || _organization$type2 === void 0 || (_organization$type2$t = _organization$type2.toUpperCase) === null || _organization$type2$t === void 0 ? void 0 : _organization$type2$t.call(_organization$type2);
|
|
604
|
+
isWrapperLikeOrganization = !(organization !== null && organization !== void 0 && organization.type) && !(organization !== null && organization !== void 0 && organization.parentType) || organizationType === 'SUPPLIER' || organizationType === 'SUPLIER';
|
|
605
|
+
if (!isWrapperLikeOrganization) {
|
|
606
|
+
_context2.next = 9;
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
return _context2.abrupt("return", openModal({
|
|
610
|
+
title: modalTitle,
|
|
611
|
+
text: t('action.archive.edit.otherorganizationdetail', {
|
|
612
|
+
suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
|
|
613
|
+
}),
|
|
614
|
+
reject: true,
|
|
615
|
+
accept: true,
|
|
616
|
+
callback: function callback(accept) {
|
|
617
|
+
if (accept) {
|
|
618
|
+
openInTargetOrg(item);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
622
|
+
case 9:
|
|
623
|
+
return _context2.abrupt("return", openModal({
|
|
624
|
+
title: modalTitle,
|
|
625
|
+
rejectByIcon: true,
|
|
626
|
+
text: t('action.archive.edit.otherorganizationdetail', {
|
|
627
|
+
suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
|
|
628
|
+
}),
|
|
629
|
+
actions: [{
|
|
630
|
+
text: t('action.archive.edit.openincurrentorg'),
|
|
631
|
+
id: 'currentOrg',
|
|
632
|
+
variant: 'outlined',
|
|
633
|
+
closeable: true
|
|
634
|
+
}, {
|
|
635
|
+
text: t('action.archive.edit.openintargetorg', {
|
|
636
|
+
suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
|
|
637
|
+
}),
|
|
638
|
+
id: 'targetOrg',
|
|
639
|
+
variant: 'contained'
|
|
640
|
+
}],
|
|
641
|
+
callback: function callback(result) {
|
|
642
|
+
if (result === 'currentOrg') {
|
|
643
|
+
openInCurrentOrg(item);
|
|
644
|
+
} else if (result === 'targetOrg') {
|
|
645
|
+
openInTargetOrg(item);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}));
|
|
649
|
+
case 10:
|
|
650
|
+
return _context2.abrupt("return", openInCurrentOrg(item));
|
|
651
|
+
case 11:
|
|
652
|
+
case "end":
|
|
653
|
+
return _context2.stop();
|
|
654
|
+
}
|
|
655
|
+
}, _callee2);
|
|
656
|
+
}));
|
|
657
|
+
return function (_x2) {
|
|
658
|
+
return _ref4.apply(this, arguments);
|
|
659
|
+
};
|
|
660
|
+
}();
|
|
579
661
|
}
|
|
580
662
|
function openEmailAction(sendEmail, t, action, organization, user) {
|
|
581
663
|
return function (item) {
|
|
@@ -591,15 +673,15 @@ function openEmailAction(sendEmail, t, action, organization, user) {
|
|
|
591
673
|
}
|
|
592
674
|
function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openModal, t) {
|
|
593
675
|
return /*#__PURE__*/function () {
|
|
594
|
-
var
|
|
676
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(item) {
|
|
595
677
|
var result;
|
|
596
|
-
return _regeneratorRuntime.wrap(function
|
|
597
|
-
while (1) switch (
|
|
678
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
679
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
598
680
|
case 0:
|
|
599
|
-
|
|
681
|
+
_context3.next = 2;
|
|
600
682
|
return sendToIwofurn(apiConfig, jwt, item.DivaNr, Number(item.DocumentVersion), toggleLoading);
|
|
601
683
|
case 2:
|
|
602
|
-
result =
|
|
684
|
+
result = _context3.sent;
|
|
603
685
|
if (result === true) {
|
|
604
686
|
openModal({
|
|
605
687
|
accept: true,
|
|
@@ -618,34 +700,34 @@ function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openM
|
|
|
618
700
|
}
|
|
619
701
|
case 4:
|
|
620
702
|
case "end":
|
|
621
|
-
return
|
|
703
|
+
return _context3.stop();
|
|
622
704
|
}
|
|
623
|
-
},
|
|
705
|
+
}, _callee3);
|
|
624
706
|
}));
|
|
625
|
-
return function (
|
|
626
|
-
return
|
|
707
|
+
return function (_x3) {
|
|
708
|
+
return _ref5.apply(this, arguments);
|
|
627
709
|
};
|
|
628
710
|
}();
|
|
629
711
|
}
|
|
630
|
-
function placeOrderAction(
|
|
631
|
-
var apiConfig =
|
|
632
|
-
jwt =
|
|
633
|
-
organization =
|
|
634
|
-
sendEmail =
|
|
635
|
-
openModal =
|
|
636
|
-
t =
|
|
637
|
-
action =
|
|
638
|
-
setReloadPage =
|
|
712
|
+
function placeOrderAction(_ref6) {
|
|
713
|
+
var apiConfig = _ref6.apiConfig,
|
|
714
|
+
jwt = _ref6.jwt,
|
|
715
|
+
organization = _ref6.organization,
|
|
716
|
+
sendEmail = _ref6.sendEmail,
|
|
717
|
+
openModal = _ref6.openModal,
|
|
718
|
+
t = _ref6.t,
|
|
719
|
+
action = _ref6.action,
|
|
720
|
+
setReloadPage = _ref6.setReloadPage;
|
|
639
721
|
return /*#__PURE__*/function () {
|
|
640
|
-
var
|
|
641
|
-
return _regeneratorRuntime.wrap(function
|
|
642
|
-
while (1) switch (
|
|
722
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(item, id, updateOne) {
|
|
723
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
724
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
643
725
|
case 0:
|
|
644
726
|
if (jwt) {
|
|
645
|
-
|
|
727
|
+
_context5.next = 2;
|
|
646
728
|
break;
|
|
647
729
|
}
|
|
648
|
-
return
|
|
730
|
+
return _context5.abrupt("return");
|
|
649
731
|
case 2:
|
|
650
732
|
triggerSendEmail({
|
|
651
733
|
sendEmail: sendEmail,
|
|
@@ -654,12 +736,12 @@ function placeOrderAction(_ref5) {
|
|
|
654
736
|
action: action,
|
|
655
737
|
item: item,
|
|
656
738
|
callback: function () {
|
|
657
|
-
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
658
|
-
return _regeneratorRuntime.wrap(function
|
|
659
|
-
while (1) switch (
|
|
739
|
+
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(success) {
|
|
740
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
741
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
660
742
|
case 0:
|
|
661
743
|
if (!(success == 'SUCCESS')) {
|
|
662
|
-
|
|
744
|
+
_context4.next = 7;
|
|
663
745
|
break;
|
|
664
746
|
}
|
|
665
747
|
openModal({
|
|
@@ -669,13 +751,13 @@ function placeOrderAction(_ref5) {
|
|
|
669
751
|
return setReloadPage(1);
|
|
670
752
|
}
|
|
671
753
|
});
|
|
672
|
-
|
|
754
|
+
_context4.next = 4;
|
|
673
755
|
return setOrdered(apiConfig, item.OrganizationId, jwt, item.DivaNr, parseInt(item.DocumentVersion));
|
|
674
756
|
case 4:
|
|
675
757
|
updateOne(_objectSpread$2(_objectSpread$2({}, item), {}, {
|
|
676
758
|
OrderStatus: 'SEND'
|
|
677
759
|
}));
|
|
678
|
-
|
|
760
|
+
_context4.next = 8;
|
|
679
761
|
break;
|
|
680
762
|
case 7:
|
|
681
763
|
openModal({
|
|
@@ -685,11 +767,11 @@ function placeOrderAction(_ref5) {
|
|
|
685
767
|
});
|
|
686
768
|
case 8:
|
|
687
769
|
case "end":
|
|
688
|
-
return
|
|
770
|
+
return _context4.stop();
|
|
689
771
|
}
|
|
690
|
-
},
|
|
772
|
+
}, _callee4);
|
|
691
773
|
}));
|
|
692
|
-
function callback(
|
|
774
|
+
function callback(_x7) {
|
|
693
775
|
return _callback.apply(this, arguments);
|
|
694
776
|
}
|
|
695
777
|
return callback;
|
|
@@ -697,56 +779,56 @@ function placeOrderAction(_ref5) {
|
|
|
697
779
|
});
|
|
698
780
|
case 3:
|
|
699
781
|
case "end":
|
|
700
|
-
return
|
|
782
|
+
return _context5.stop();
|
|
701
783
|
}
|
|
702
|
-
},
|
|
784
|
+
}, _callee5);
|
|
703
785
|
}));
|
|
704
|
-
return function (
|
|
705
|
-
return
|
|
786
|
+
return function (_x4, _x5, _x6) {
|
|
787
|
+
return _ref7.apply(this, arguments);
|
|
706
788
|
};
|
|
707
789
|
}();
|
|
708
790
|
}
|
|
709
|
-
function setArchivedAction(
|
|
710
|
-
var apiConfig =
|
|
711
|
-
jwt =
|
|
712
|
-
openModal =
|
|
713
|
-
t =
|
|
714
|
-
trashed =
|
|
791
|
+
function setArchivedAction(_ref8) {
|
|
792
|
+
var apiConfig = _ref8.apiConfig,
|
|
793
|
+
jwt = _ref8.jwt,
|
|
794
|
+
openModal = _ref8.openModal,
|
|
795
|
+
t = _ref8.t,
|
|
796
|
+
trashed = _ref8.trashed;
|
|
715
797
|
return /*#__PURE__*/function () {
|
|
716
|
-
var
|
|
717
|
-
return _regeneratorRuntime.wrap(function
|
|
718
|
-
while (1) switch (
|
|
798
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(item, id, updateOne, deleteOne) {
|
|
799
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
800
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
719
801
|
case 0:
|
|
720
802
|
if (jwt) {
|
|
721
|
-
|
|
803
|
+
_context7.next = 2;
|
|
722
804
|
break;
|
|
723
805
|
}
|
|
724
|
-
return
|
|
806
|
+
return _context7.abrupt("return");
|
|
725
807
|
case 2:
|
|
726
808
|
openModal({
|
|
727
809
|
accept: true,
|
|
728
810
|
reject: true,
|
|
729
811
|
title: t(trashed ? 'order.restore' : 'order.delete'),
|
|
730
812
|
callback: function () {
|
|
731
|
-
var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
732
|
-
return _regeneratorRuntime.wrap(function
|
|
733
|
-
while (1) switch (
|
|
813
|
+
var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(accepted) {
|
|
814
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
815
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
734
816
|
case 0:
|
|
735
817
|
if (!accepted) {
|
|
736
|
-
|
|
818
|
+
_context6.next = 4;
|
|
737
819
|
break;
|
|
738
820
|
}
|
|
739
|
-
|
|
821
|
+
_context6.next = 3;
|
|
740
822
|
return setArchived(apiConfig, jwt, item.DivaNr, !trashed);
|
|
741
823
|
case 3:
|
|
742
824
|
deleteOne();
|
|
743
825
|
case 4:
|
|
744
826
|
case "end":
|
|
745
|
-
return
|
|
827
|
+
return _context6.stop();
|
|
746
828
|
}
|
|
747
|
-
},
|
|
829
|
+
}, _callee6);
|
|
748
830
|
}));
|
|
749
|
-
function callback(
|
|
831
|
+
function callback(_x12) {
|
|
750
832
|
return _callback2.apply(this, arguments);
|
|
751
833
|
}
|
|
752
834
|
return callback;
|
|
@@ -754,31 +836,31 @@ function setArchivedAction(_ref7) {
|
|
|
754
836
|
});
|
|
755
837
|
case 3:
|
|
756
838
|
case "end":
|
|
757
|
-
return
|
|
839
|
+
return _context7.stop();
|
|
758
840
|
}
|
|
759
|
-
},
|
|
841
|
+
}, _callee7);
|
|
760
842
|
}));
|
|
761
|
-
return function (
|
|
762
|
-
return
|
|
843
|
+
return function (_x8, _x9, _x10, _x11) {
|
|
844
|
+
return _ref9.apply(this, arguments);
|
|
763
845
|
};
|
|
764
846
|
}();
|
|
765
847
|
}
|
|
766
|
-
function deleteAction(
|
|
767
|
-
var apiConfig =
|
|
768
|
-
jwt =
|
|
769
|
-
openModal =
|
|
770
|
-
t =
|
|
771
|
-
trashed =
|
|
848
|
+
function deleteAction(_ref10) {
|
|
849
|
+
var apiConfig = _ref10.apiConfig,
|
|
850
|
+
jwt = _ref10.jwt,
|
|
851
|
+
openModal = _ref10.openModal,
|
|
852
|
+
t = _ref10.t,
|
|
853
|
+
trashed = _ref10.trashed;
|
|
772
854
|
return /*#__PURE__*/function () {
|
|
773
|
-
var
|
|
774
|
-
return _regeneratorRuntime.wrap(function
|
|
775
|
-
while (1) switch (
|
|
855
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(item, id, updateOne, deleteOne) {
|
|
856
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
857
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
776
858
|
case 0:
|
|
777
859
|
if (jwt) {
|
|
778
|
-
|
|
860
|
+
_context9.next = 2;
|
|
779
861
|
break;
|
|
780
862
|
}
|
|
781
|
-
return
|
|
863
|
+
return _context9.abrupt("return");
|
|
782
864
|
case 2:
|
|
783
865
|
openModal({
|
|
784
866
|
accept: true,
|
|
@@ -787,25 +869,25 @@ function deleteAction(_ref9) {
|
|
|
787
869
|
divaNr: item.DivaNr
|
|
788
870
|
}),
|
|
789
871
|
callback: function () {
|
|
790
|
-
var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
791
|
-
return _regeneratorRuntime.wrap(function
|
|
792
|
-
while (1) switch (
|
|
872
|
+
var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(accepted) {
|
|
873
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
874
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
793
875
|
case 0:
|
|
794
876
|
if (!accepted) {
|
|
795
|
-
|
|
877
|
+
_context8.next = 4;
|
|
796
878
|
break;
|
|
797
879
|
}
|
|
798
|
-
|
|
880
|
+
_context8.next = 3;
|
|
799
881
|
return deleteBasket(apiConfig, jwt, item.DivaNr, !trashed);
|
|
800
882
|
case 3:
|
|
801
883
|
deleteOne();
|
|
802
884
|
case 4:
|
|
803
885
|
case "end":
|
|
804
|
-
return
|
|
886
|
+
return _context8.stop();
|
|
805
887
|
}
|
|
806
|
-
},
|
|
888
|
+
}, _callee8);
|
|
807
889
|
}));
|
|
808
|
-
function callback(
|
|
890
|
+
function callback(_x17) {
|
|
809
891
|
return _callback3.apply(this, arguments);
|
|
810
892
|
}
|
|
811
893
|
return callback;
|
|
@@ -813,23 +895,23 @@ function deleteAction(_ref9) {
|
|
|
813
895
|
});
|
|
814
896
|
case 3:
|
|
815
897
|
case "end":
|
|
816
|
-
return
|
|
898
|
+
return _context9.stop();
|
|
817
899
|
}
|
|
818
|
-
},
|
|
900
|
+
}, _callee9);
|
|
819
901
|
}));
|
|
820
|
-
return function (
|
|
821
|
-
return
|
|
902
|
+
return function (_x13, _x14, _x15, _x16) {
|
|
903
|
+
return _ref11.apply(this, arguments);
|
|
822
904
|
};
|
|
823
905
|
}();
|
|
824
906
|
}
|
|
825
|
-
function triggerSendEmail(
|
|
826
|
-
var sendEmail =
|
|
827
|
-
|
|
828
|
-
var action =
|
|
829
|
-
|
|
830
|
-
var user =
|
|
831
|
-
item =
|
|
832
|
-
callback =
|
|
907
|
+
function triggerSendEmail(_ref12) {
|
|
908
|
+
var sendEmail = _ref12.sendEmail;
|
|
909
|
+
_ref12.t;
|
|
910
|
+
var action = _ref12.action;
|
|
911
|
+
_ref12.organization;
|
|
912
|
+
var user = _ref12.user,
|
|
913
|
+
item = _ref12.item,
|
|
914
|
+
callback = _ref12.callback;
|
|
833
915
|
var to;
|
|
834
916
|
try {
|
|
835
917
|
var _action$to;
|
|
@@ -883,17 +965,17 @@ function getMailAddress(string, required) {
|
|
|
883
965
|
}
|
|
884
966
|
throw new Error('Required mail address is missing');
|
|
885
967
|
}
|
|
886
|
-
function sendToIwofurn(
|
|
968
|
+
function sendToIwofurn(_x18, _x19, _x20, _x21, _x22) {
|
|
887
969
|
return _sendToIwofurn.apply(this, arguments);
|
|
888
970
|
}
|
|
889
971
|
function _sendToIwofurn() {
|
|
890
|
-
_sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
972
|
+
_sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(apiConfig, jwt, divaNr, version, toggleLoading) {
|
|
891
973
|
var result;
|
|
892
|
-
return _regeneratorRuntime.wrap(function
|
|
893
|
-
while (1) switch (
|
|
974
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
975
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
894
976
|
case 0:
|
|
895
977
|
toggleLoading('iwofurn');
|
|
896
|
-
|
|
978
|
+
_context10.next = 3;
|
|
897
979
|
return fetch("".concat(apiConfig.basketService, "/iwofurn/send?divaNr=").concat(divaNr, "&version=").concat(version), {
|
|
898
980
|
method: 'POST',
|
|
899
981
|
body: undefined,
|
|
@@ -905,38 +987,38 @@ function _sendToIwofurn() {
|
|
|
905
987
|
return r.json();
|
|
906
988
|
});
|
|
907
989
|
case 3:
|
|
908
|
-
result =
|
|
990
|
+
result = _context10.sent;
|
|
909
991
|
toggleLoading('iwofurn');
|
|
910
992
|
if (!(result.result !== 'Success')) {
|
|
911
|
-
|
|
993
|
+
_context10.next = 7;
|
|
912
994
|
break;
|
|
913
995
|
}
|
|
914
|
-
return
|
|
996
|
+
return _context10.abrupt("return", result.error);
|
|
915
997
|
case 7:
|
|
916
|
-
return
|
|
998
|
+
return _context10.abrupt("return", true);
|
|
917
999
|
case 8:
|
|
918
1000
|
case "end":
|
|
919
|
-
return
|
|
1001
|
+
return _context10.stop();
|
|
920
1002
|
}
|
|
921
|
-
},
|
|
1003
|
+
}, _callee10);
|
|
922
1004
|
}));
|
|
923
1005
|
return _sendToIwofurn.apply(this, arguments);
|
|
924
1006
|
}
|
|
925
|
-
function setOrdered(
|
|
1007
|
+
function setOrdered(_x23, _x24, _x25, _x26, _x27) {
|
|
926
1008
|
return _setOrdered.apply(this, arguments);
|
|
927
1009
|
}
|
|
928
1010
|
function _setOrdered() {
|
|
929
|
-
_setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1011
|
+
_setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(apiConfig, organizationId, jwt, divaNr, documentVersion) {
|
|
930
1012
|
var body;
|
|
931
|
-
return _regeneratorRuntime.wrap(function
|
|
932
|
-
while (1) switch (
|
|
1013
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1014
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
933
1015
|
case 0:
|
|
934
|
-
|
|
1016
|
+
_context11.prev = 0;
|
|
935
1017
|
body = {
|
|
936
1018
|
divaNr: divaNr,
|
|
937
1019
|
version: documentVersion
|
|
938
1020
|
};
|
|
939
|
-
|
|
1021
|
+
_context11.next = 4;
|
|
940
1022
|
return fetch("".concat(apiConfig.basketService, "/orders?organizationId=").concat(organizationId), {
|
|
941
1023
|
method: 'POST',
|
|
942
1024
|
headers: {
|
|
@@ -948,33 +1030,33 @@ function _setOrdered() {
|
|
|
948
1030
|
return r.json();
|
|
949
1031
|
});
|
|
950
1032
|
case 4:
|
|
951
|
-
|
|
1033
|
+
_context11.next = 10;
|
|
952
1034
|
break;
|
|
953
1035
|
case 6:
|
|
954
|
-
|
|
955
|
-
|
|
1036
|
+
_context11.prev = 6;
|
|
1037
|
+
_context11.t0 = _context11["catch"](0);
|
|
956
1038
|
LOG.error(new DivaError('Could not set OrderStatus', {
|
|
957
|
-
cause:
|
|
1039
|
+
cause: _context11.t0
|
|
958
1040
|
}));
|
|
959
1041
|
throw new Error('DivaNr not found');
|
|
960
1042
|
case 10:
|
|
961
1043
|
case "end":
|
|
962
|
-
return
|
|
1044
|
+
return _context11.stop();
|
|
963
1045
|
}
|
|
964
|
-
},
|
|
1046
|
+
}, _callee11, null, [[0, 6]]);
|
|
965
1047
|
}));
|
|
966
1048
|
return _setOrdered.apply(this, arguments);
|
|
967
1049
|
}
|
|
968
|
-
function setArchived(
|
|
1050
|
+
function setArchived(_x28, _x29, _x30, _x31) {
|
|
969
1051
|
return _setArchived.apply(this, arguments);
|
|
970
1052
|
}
|
|
971
1053
|
function _setArchived() {
|
|
972
|
-
_setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1054
|
+
_setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(apiConfig, jwt, divaNr, archived) {
|
|
973
1055
|
var result;
|
|
974
|
-
return _regeneratorRuntime.wrap(function
|
|
975
|
-
while (1) switch (
|
|
1056
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
1057
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
976
1058
|
case 0:
|
|
977
|
-
|
|
1059
|
+
_context12.next = 2;
|
|
978
1060
|
return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr + (archived ? '/archive' : '/restore'), {
|
|
979
1061
|
method: archived ? 'DELETE' : 'PATCH',
|
|
980
1062
|
headers: {
|
|
@@ -985,32 +1067,32 @@ function _setArchived() {
|
|
|
985
1067
|
return r.json();
|
|
986
1068
|
});
|
|
987
1069
|
case 2:
|
|
988
|
-
result =
|
|
1070
|
+
result = _context12.sent;
|
|
989
1071
|
if (!result) {
|
|
990
|
-
|
|
1072
|
+
_context12.next = 5;
|
|
991
1073
|
break;
|
|
992
1074
|
}
|
|
993
|
-
return
|
|
1075
|
+
return _context12.abrupt("return", result);
|
|
994
1076
|
case 5:
|
|
995
1077
|
throw new Error('DivaNr not found.');
|
|
996
1078
|
case 6:
|
|
997
1079
|
case "end":
|
|
998
|
-
return
|
|
1080
|
+
return _context12.stop();
|
|
999
1081
|
}
|
|
1000
|
-
},
|
|
1082
|
+
}, _callee12);
|
|
1001
1083
|
}));
|
|
1002
1084
|
return _setArchived.apply(this, arguments);
|
|
1003
1085
|
}
|
|
1004
|
-
function deleteBasket(
|
|
1086
|
+
function deleteBasket(_x32, _x33, _x34, _x35) {
|
|
1005
1087
|
return _deleteBasket.apply(this, arguments);
|
|
1006
1088
|
}
|
|
1007
1089
|
function _deleteBasket() {
|
|
1008
|
-
_deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1090
|
+
_deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(apiConfig, jwt, divaNr, archived) {
|
|
1009
1091
|
var result;
|
|
1010
|
-
return _regeneratorRuntime.wrap(function
|
|
1011
|
-
while (1) switch (
|
|
1092
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1093
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1012
1094
|
case 0:
|
|
1013
|
-
|
|
1095
|
+
_context13.next = 2;
|
|
1014
1096
|
return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr, {
|
|
1015
1097
|
method: 'DELETE',
|
|
1016
1098
|
headers: {
|
|
@@ -1021,19 +1103,19 @@ function _deleteBasket() {
|
|
|
1021
1103
|
return r.json();
|
|
1022
1104
|
});
|
|
1023
1105
|
case 2:
|
|
1024
|
-
result =
|
|
1106
|
+
result = _context13.sent;
|
|
1025
1107
|
if (!result) {
|
|
1026
|
-
|
|
1108
|
+
_context13.next = 5;
|
|
1027
1109
|
break;
|
|
1028
1110
|
}
|
|
1029
|
-
return
|
|
1111
|
+
return _context13.abrupt("return", result);
|
|
1030
1112
|
case 5:
|
|
1031
1113
|
throw new Error('DivaNr not found.');
|
|
1032
1114
|
case 6:
|
|
1033
1115
|
case "end":
|
|
1034
|
-
return
|
|
1116
|
+
return _context13.stop();
|
|
1035
1117
|
}
|
|
1036
|
-
},
|
|
1118
|
+
}, _callee13);
|
|
1037
1119
|
}));
|
|
1038
1120
|
return _deleteBasket.apply(this, arguments);
|
|
1039
1121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-archive",
|
|
3
|
-
"version": "26.4.0-beta.
|
|
3
|
+
"version": "26.4.0-beta.23",
|
|
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.4.0-beta.
|
|
18
|
+
"@crystaldesign/grid": "26.4.0-beta.23",
|
|
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": "f8d8fe39ce430da6fa842b3bc573922543834424"
|
|
24
24
|
}
|