@crystaldesign/web-planner-logic 24.12.0-beta.9 → 24.12.0-rc.1
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/cjs/{DivaBoxPlanner-7b508f32.js → DivaBoxPlanner-ed867881.js} +2 -2
- package/build/cjs/{DivaStandardPlanner-c73e6e57.js → DivaStandardPlanner-31757726.js} +9 -8
- package/build/cjs/{DoorPlanner-ffa7af62.js → DoorPlanner-4eb75da2.js} +3 -3
- package/build/cjs/{Host3DSignalR-d3830717.js → Host3DSignalR-6b8cace7.js} +20 -38
- package/build/cjs/{LiviqueWWSHandler-85a1dc89.js → LiviqueWWSHandler-977c3952.js} +2 -2
- package/build/cjs/{PfisterWWSHandler-b47dba23.js → PfisterWWSHandler-ca73bf2c.js} +2 -2
- package/build/cjs/{PlannerHandler2D-9d9d1af9.js → PlannerHandler2D-fee08c06.js} +37 -32
- package/build/cjs/{SeriousBasketHandler-28f031fa.js → SeriousBasketHandler-712a57c0.js} +2 -2
- package/build/cjs/{ShelfPlanner-4b697826.js → ShelfPlanner-8db07a13.js} +1 -1
- package/build/cjs/{StandardWWSHandler-ab0c107b.js → StandardWWSHandler-435c1ce1.js} +2 -2
- package/build/cjs/{index-bceec53b.js → index-2758bcda.js} +801 -1451
- package/build/cjs/index.js +1 -2
- package/build/esm/{DivaBoxPlanner-81bbe89c.js → DivaBoxPlanner-0f855505.js} +2 -2
- package/build/esm/{DivaStandardPlanner-c3f7e518.js → DivaStandardPlanner-7d18b2c2.js} +9 -8
- package/build/esm/{DoorPlanner-f4b338c4.js → DoorPlanner-62fe0f1e.js} +3 -3
- package/build/esm/{Host3DSignalR-45bb9e24.js → Host3DSignalR-42b4d1d2.js} +20 -19
- package/build/esm/{LiviqueWWSHandler-d401b8c4.js → LiviqueWWSHandler-049eb5fd.js} +2 -2
- package/build/esm/{PfisterWWSHandler-ebfad71d.js → PfisterWWSHandler-3ab3de4e.js} +2 -2
- package/build/esm/{PlannerHandler2D-fb755d99.js → PlannerHandler2D-0feebd6f.js} +37 -32
- package/build/esm/{SeriousBasketHandler-53ff90b8.js → SeriousBasketHandler-53dd21ff.js} +2 -2
- package/build/esm/{ShelfPlanner-569fe7f0.js → ShelfPlanner-268c974f.js} +1 -1
- package/build/esm/{StandardWWSHandler-b903e37c.js → StandardWWSHandler-385a2299.js} +2 -2
- package/build/esm/{index-3bbc6483.js → index-1effd2df.js} +803 -1451
- package/build/esm/index.js +1 -1
- package/build/types/web-planner-logic/src/index.d.ts +1 -2
- package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -2
- package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts +1 -2
- package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts +2 -2
- package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -3
- package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Configuration.d.ts +0 -1
- package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/OptionTypes/CatalogOptionDataTypes.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Products/index.d.ts +6 -1
- package/build/types/web-planner-logic/src/interface/Products/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +1 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +6 -6
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +50 -57
- package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -3
- package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +1 -3
- package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -3
- package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -3
- package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
- package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +1 -2
- package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +3 -4
- package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +56 -61
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +0 -2
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +12 -13
- package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +3 -44
- package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +5 -5
- package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +3 -6
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +3 -2
- package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts +2 -0
- package/build/types/web-planner-logic/src/model/Options/ArticleOptionData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts +2 -0
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/mocFunctions/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/scripts/create_renderorder.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/scripts/getOrigProductId.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/scripts/productHandlerMoc.d.ts.map +1 -1
- package/package.json +16 -17
- package/build/cjs/ProductBasketHandler-22cb7ee4.js +0 -62
- package/build/esm/ProductBasketHandler-68443648.js +0 -55
- package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts +0 -14
- package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts.map +0 -1
- package/build/types/web-planner-logic/src/logic/Product/Product.d.ts +0 -71
- package/build/types/web-planner-logic/src/logic/Product/Product.d.ts.map +0 -1
|
@@ -8,7 +8,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
9
9
|
import axios$1 from 'axios';
|
|
10
10
|
import DivaUtils, { DivaError, md5, nanoid } from '@crystaldesign/diva-utils';
|
|
11
|
-
import { PriceObjectData, VariantItemData, JsonConfigPriceData, OrderLineData, CompactOrderLineData, GroupsData, Favorites,
|
|
11
|
+
import { PriceObjectData, VariantItemData, JsonConfigPriceData, OrderLineData, CompactOrderLineData, GroupsData, Favorites, Favorite, ConfigVariantData, OrderSetData, BasketData } from '@crystaldesign/basket-model';
|
|
12
12
|
import BasketHandler from '@crystaldesign/basket-handler';
|
|
13
13
|
import { io } from 'socket.io-client';
|
|
14
14
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
@@ -414,7 +414,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
414
414
|
mediaServiceApiKey: data.divaMediaServiceApiKey,
|
|
415
415
|
language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
|
|
416
416
|
abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
|
|
417
|
-
checkForProductsInStock: data.checkForProductsInStock,
|
|
418
417
|
checkForProductsPrice: data.checkForProductsPrice,
|
|
419
418
|
doDisablePlanner2D: data.doDisablePlanner2D,
|
|
420
419
|
diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
|
|
@@ -486,29 +485,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
486
485
|
var _this$apiConfig$host, _this$apiConfig10;
|
|
487
486
|
return (_this$apiConfig$host = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
|
|
488
487
|
}
|
|
489
|
-
}, {
|
|
490
|
-
key: "doCheckForProductsInStock",
|
|
491
|
-
value: function doCheckForProductsInStock() {
|
|
492
|
-
var _this$divaWebConfigDa4;
|
|
493
|
-
return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsInStock;
|
|
494
|
-
}
|
|
495
488
|
}, {
|
|
496
489
|
key: "doCheckForProductsPrice",
|
|
497
490
|
value: function doCheckForProductsPrice() {
|
|
498
|
-
var _this$
|
|
499
|
-
return
|
|
491
|
+
var _this$divaWebConfigDa4;
|
|
492
|
+
return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsPrice;
|
|
500
493
|
}
|
|
501
494
|
}, {
|
|
502
495
|
key: "getReportConfigIdentifier",
|
|
503
496
|
value: function getReportConfigIdentifier() {
|
|
504
|
-
var _this$
|
|
505
|
-
return (_this$
|
|
497
|
+
var _this$divaWebConfigDa5;
|
|
498
|
+
return (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfigIdentifier;
|
|
506
499
|
}
|
|
507
500
|
}, {
|
|
508
501
|
key: "getPrintOptions",
|
|
509
502
|
value: function getPrintOptions() {
|
|
510
|
-
var _this$
|
|
511
|
-
var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$
|
|
503
|
+
var _this$divaWebConfigDa6;
|
|
504
|
+
var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfig;
|
|
512
505
|
return {
|
|
513
506
|
Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
|
|
514
507
|
PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
|
|
@@ -528,8 +521,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
528
521
|
}, {
|
|
529
522
|
key: "get3DRenderGroup",
|
|
530
523
|
value: function get3DRenderGroup() {
|
|
531
|
-
var _this$
|
|
532
|
-
return (_this$
|
|
524
|
+
var _this$divaWebConfigDa7, _this$divaWebConfigDa8;
|
|
525
|
+
return (_this$divaWebConfigDa7 = (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dRenderGroup) !== null && _this$divaWebConfigDa7 !== void 0 ? _this$divaWebConfigDa7 : '';
|
|
533
526
|
}
|
|
534
527
|
}, {
|
|
535
528
|
key: "getServerId",
|
|
@@ -566,86 +559,86 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
566
559
|
}, {
|
|
567
560
|
key: "getDiva3dStaticBGImage",
|
|
568
561
|
value: function getDiva3dStaticBGImage() {
|
|
569
|
-
var _this$
|
|
570
|
-
return (_this$
|
|
562
|
+
var _this$divaWebConfigDa9;
|
|
563
|
+
return (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage;
|
|
571
564
|
}
|
|
572
565
|
}, {
|
|
573
566
|
key: "getDiva3dStaticBGImage_DefaultRoomList",
|
|
574
567
|
value: function getDiva3dStaticBGImage_DefaultRoomList() {
|
|
575
|
-
var _this$
|
|
576
|
-
return ((_this$
|
|
568
|
+
var _this$divaWebConfigDa10, _this$divaWebConfigDa11;
|
|
569
|
+
return ((_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList;
|
|
577
570
|
}
|
|
578
571
|
}, {
|
|
579
572
|
key: "getDiva3DAllowDefaultCatRoomList",
|
|
580
573
|
value: function getDiva3DAllowDefaultCatRoomList() {
|
|
581
|
-
var _this$
|
|
582
|
-
return (_this$
|
|
574
|
+
var _this$divaWebConfigDa12;
|
|
575
|
+
return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3DAllowDefaultCatRoomList;
|
|
583
576
|
}
|
|
584
577
|
}, {
|
|
585
578
|
key: "doAllowSetPlanner",
|
|
586
579
|
value: function doAllowSetPlanner() {
|
|
587
|
-
var _this$
|
|
588
|
-
return (_this$
|
|
580
|
+
var _this$divaWebConfigDa13;
|
|
581
|
+
return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.doAllowSetPlanner;
|
|
589
582
|
}
|
|
590
583
|
}, {
|
|
591
584
|
key: "getHidePlanner",
|
|
592
585
|
value: function getHidePlanner() {
|
|
593
|
-
var _this$
|
|
594
|
-
return !!((_this$
|
|
586
|
+
var _this$divaWebConfigDa14;
|
|
587
|
+
return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.hidePlanner);
|
|
595
588
|
}
|
|
596
589
|
}, {
|
|
597
590
|
key: "getDoShowAR",
|
|
598
591
|
value: function getDoShowAR() {
|
|
599
|
-
var _this$
|
|
600
|
-
return (_this$
|
|
592
|
+
var _this$divaWebConfigDa15;
|
|
593
|
+
return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableAR;
|
|
601
594
|
}
|
|
602
595
|
}, {
|
|
603
596
|
key: "forceShowRTV",
|
|
604
597
|
value: function forceShowRTV() {
|
|
605
|
-
var _this$
|
|
606
|
-
return (_this$
|
|
598
|
+
var _this$divaWebConfigDa16;
|
|
599
|
+
return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.forceRTV;
|
|
607
600
|
}
|
|
608
601
|
}, {
|
|
609
602
|
key: "getDoShowRTV",
|
|
610
603
|
value: function getDoShowRTV() {
|
|
611
|
-
var _this$
|
|
612
|
-
return (_this$
|
|
604
|
+
var _this$divaWebConfigDa17;
|
|
605
|
+
return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.enableRTV;
|
|
613
606
|
}
|
|
614
607
|
}, {
|
|
615
608
|
key: "getEnableRTVUnityKombi",
|
|
616
609
|
value: function getEnableRTVUnityKombi() {
|
|
617
|
-
var _this$
|
|
618
|
-
return !!((_this$
|
|
610
|
+
var _this$divaWebConfigDa18;
|
|
611
|
+
return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.viewConfig.enableRtvUnityKombi);
|
|
619
612
|
}
|
|
620
613
|
}, {
|
|
621
614
|
key: "getDoDisablePlanner2D",
|
|
622
615
|
value: function getDoDisablePlanner2D() {
|
|
623
|
-
var _this$
|
|
624
|
-
return !!((_this$
|
|
616
|
+
var _this$divaWebConfigDa19;
|
|
617
|
+
return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.doDisablePlanner2D);
|
|
625
618
|
}
|
|
626
619
|
}, {
|
|
627
620
|
key: "getRoomListInProduct",
|
|
628
621
|
value: function getRoomListInProduct() {
|
|
629
|
-
var _this$
|
|
630
|
-
return !!((_this$
|
|
622
|
+
var _this$divaWebConfigDa20;
|
|
623
|
+
return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && (_this$divaWebConfigDa20 = _this$divaWebConfigDa20.viewConfig) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.roomListInProduct);
|
|
631
624
|
}
|
|
632
625
|
}, {
|
|
633
626
|
key: "getPlannerType",
|
|
634
627
|
value: function getPlannerType() {
|
|
635
|
-
var _this$
|
|
636
|
-
return (_this$
|
|
628
|
+
var _this$divaWebConfigDa21;
|
|
629
|
+
return (_this$divaWebConfigDa21 = this.divaWebConfigData) === null || _this$divaWebConfigDa21 === void 0 || (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) === null || _this$divaWebConfigDa21 === void 0 ? void 0 : _this$divaWebConfigDa21.plannerType;
|
|
637
630
|
}
|
|
638
631
|
}, {
|
|
639
632
|
key: "getLoadSupplierColors",
|
|
640
633
|
value: function getLoadSupplierColors() {
|
|
641
|
-
var _this$
|
|
642
|
-
return !!((_this$
|
|
634
|
+
var _this$divaWebConfigDa22;
|
|
635
|
+
return !!((_this$divaWebConfigDa22 = this.divaWebConfigData) !== null && _this$divaWebConfigDa22 !== void 0 && _this$divaWebConfigDa22.loadSupplierColors);
|
|
643
636
|
}
|
|
644
637
|
}, {
|
|
645
638
|
key: "showSelectionModeZero",
|
|
646
639
|
value: function showSelectionModeZero() {
|
|
647
|
-
var _this$
|
|
648
|
-
return !!((_this$
|
|
640
|
+
var _this$divaWebConfigDa23;
|
|
641
|
+
return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.showSelectionModeZero);
|
|
649
642
|
}
|
|
650
643
|
}, {
|
|
651
644
|
key: "ruleDescSeperator",
|
|
@@ -665,8 +658,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
665
658
|
}, {
|
|
666
659
|
key: "getDoCheckVariantData",
|
|
667
660
|
value: function getDoCheckVariantData() {
|
|
668
|
-
var _this$
|
|
669
|
-
return (_this$
|
|
661
|
+
var _this$divaWebConfigDa24;
|
|
662
|
+
return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.doCheckVariantData;
|
|
670
663
|
}
|
|
671
664
|
}, {
|
|
672
665
|
key: "setI18n",
|
|
@@ -746,7 +739,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
746
739
|
}, {
|
|
747
740
|
key: "getBasketDataUrlCacheKey",
|
|
748
741
|
value: function getBasketDataUrlCacheKey(divaNr) {
|
|
749
|
-
//
|
|
742
|
+
//this is only used for testing logic to stiff match the query hash so moched calls are used
|
|
750
743
|
var qs;
|
|
751
744
|
if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
|
|
752
745
|
var splittedDivaNr = divaNr.split('_');
|
|
@@ -759,50 +752,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
759
752
|
}, {
|
|
760
753
|
key: "getViewConfig",
|
|
761
754
|
value: function getViewConfig() {
|
|
762
|
-
var _this$
|
|
763
|
-
return (_this$
|
|
755
|
+
var _this$divaWebConfigDa25;
|
|
756
|
+
return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.viewConfig;
|
|
764
757
|
}
|
|
765
758
|
}, {
|
|
766
759
|
key: "getEmailConfig",
|
|
767
760
|
value: function getEmailConfig() {
|
|
768
|
-
var _this$
|
|
769
|
-
return (_this$
|
|
761
|
+
var _this$divaWebConfigDa26;
|
|
762
|
+
return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.emailConfig;
|
|
770
763
|
}
|
|
771
764
|
}, {
|
|
772
765
|
key: "getABTestCases",
|
|
773
766
|
value: function getABTestCases() {
|
|
774
|
-
var _this$
|
|
775
|
-
return (_this$
|
|
767
|
+
var _this$divaWebConfigDa27, _this$divaWebConfigDa28;
|
|
768
|
+
return (_this$divaWebConfigDa27 = (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.abTestCases) !== null && _this$divaWebConfigDa27 !== void 0 ? _this$divaWebConfigDa27 : [];
|
|
776
769
|
}
|
|
777
770
|
}, {
|
|
778
771
|
key: "getBarrierConfig",
|
|
779
772
|
value: function getBarrierConfig() {
|
|
780
|
-
var _this$
|
|
781
|
-
return (_this$
|
|
773
|
+
var _this$divaWebConfigDa29;
|
|
774
|
+
return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.barrierConfig;
|
|
782
775
|
}
|
|
783
776
|
}, {
|
|
784
777
|
key: "getTemplateConfig",
|
|
785
778
|
value: function getTemplateConfig() {
|
|
786
|
-
var _this$
|
|
787
|
-
return (_this$
|
|
779
|
+
var _this$divaWebConfigDa30;
|
|
780
|
+
return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.templateConfig;
|
|
788
781
|
}
|
|
789
782
|
}, {
|
|
790
783
|
key: "showDivaNr",
|
|
791
784
|
value: function showDivaNr() {
|
|
792
|
-
var _this$
|
|
793
|
-
return (_this$
|
|
785
|
+
var _this$divaWebConfigDa31;
|
|
786
|
+
return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.showDivaNr;
|
|
794
787
|
}
|
|
795
788
|
}, {
|
|
796
789
|
key: "onErrorHandling",
|
|
797
790
|
value: function onErrorHandling() {
|
|
798
|
-
var _this$
|
|
799
|
-
return (_this$
|
|
791
|
+
var _this$divaWebConfigDa32;
|
|
792
|
+
return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.onErrorHandling;
|
|
800
793
|
}
|
|
801
794
|
}, {
|
|
802
795
|
key: "diva3DRenderingDefault",
|
|
803
796
|
value: function diva3DRenderingDefault() {
|
|
804
|
-
var _this$
|
|
805
|
-
return (_this$
|
|
797
|
+
var _this$divaWebConfigDa33;
|
|
798
|
+
return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.diva3DRenderingDefault;
|
|
806
799
|
}
|
|
807
800
|
}, {
|
|
808
801
|
key: "getJwt",
|
|
@@ -817,8 +810,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
817
810
|
}, {
|
|
818
811
|
key: "getUseMask",
|
|
819
812
|
value: function getUseMask() {
|
|
820
|
-
var _this$
|
|
821
|
-
return (_this$
|
|
813
|
+
var _this$divaWebConfigDa34;
|
|
814
|
+
return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.useMask;
|
|
822
815
|
}
|
|
823
816
|
}, {
|
|
824
817
|
key: "apiUrl",
|
|
@@ -878,22 +871,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
878
871
|
}, {
|
|
879
872
|
key: "getBasketDataUrl",
|
|
880
873
|
value: function getBasketDataUrl(divaNr) {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
DivaNrAndDoc = _divaNr$split2[0],
|
|
886
|
-
variantId = _divaNr$split2[1];
|
|
887
|
-
var _DivaNrAndDoc$split = DivaNrAndDoc.split('-'),
|
|
888
|
-
_DivaNrAndDoc$split2 = _slicedToArray(_DivaNrAndDoc$split, 3),
|
|
889
|
-
_onlyDivaNr = _DivaNrAndDoc$split2[1],
|
|
890
|
-
_version = _DivaNrAndDoc$split2[2];
|
|
891
|
-
return '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + '&variantId=' + Number(variantId) + '&dontRepairBasket=true';
|
|
892
|
-
}
|
|
893
|
-
var _divaNr$split3 = divaNr.split('-'),
|
|
894
|
-
_divaNr$split4 = _slicedToArray(_divaNr$split3, 3),
|
|
895
|
-
onlyDivaNr = _divaNr$split4[1],
|
|
896
|
-
version = _divaNr$split4[2];
|
|
874
|
+
var _divaNr$split = divaNr.split('-'),
|
|
875
|
+
_divaNr$split2 = _slicedToArray(_divaNr$split, 3),
|
|
876
|
+
onlyDivaNr = _divaNr$split2[1],
|
|
877
|
+
version = _divaNr$split2[2];
|
|
897
878
|
return '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '') + '&dontRepairBasket=true';
|
|
898
879
|
}
|
|
899
880
|
}, {
|
|
@@ -1023,9 +1004,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
1023
1004
|
return '/baskets/uniqueDivaNr';
|
|
1024
1005
|
}
|
|
1025
1006
|
}, {
|
|
1026
|
-
key: "
|
|
1027
|
-
value: function
|
|
1028
|
-
return '/
|
|
1007
|
+
key: "checkMatchingProducts",
|
|
1008
|
+
value: function checkMatchingProducts() {
|
|
1009
|
+
return '/v1/products/matching';
|
|
1029
1010
|
}
|
|
1030
1011
|
}, {
|
|
1031
1012
|
key: "getAccountList",
|
|
@@ -1350,14 +1331,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
|
|
|
1350
1331
|
}, {
|
|
1351
1332
|
key: "dontLoadAdditionalModelInfos",
|
|
1352
1333
|
get: function get() {
|
|
1353
|
-
var _this$
|
|
1354
|
-
return (_this$
|
|
1334
|
+
var _this$divaWebConfigDa35;
|
|
1335
|
+
return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.dontLoadAdditionalModelInfos;
|
|
1355
1336
|
}
|
|
1356
1337
|
}, {
|
|
1357
1338
|
key: "dontLoadCatalogEditorLiteMask",
|
|
1358
1339
|
get: function get() {
|
|
1359
|
-
var _this$
|
|
1360
|
-
return (_this$
|
|
1340
|
+
var _this$divaWebConfigDa36;
|
|
1341
|
+
return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadCatalogEditorLiteMask;
|
|
1361
1342
|
}
|
|
1362
1343
|
}, {
|
|
1363
1344
|
key: "OrganizationId",
|
|
@@ -1616,6 +1597,16 @@ var ArticleOptionData = /*#__PURE__*/function () {
|
|
|
1616
1597
|
get: function get() {
|
|
1617
1598
|
return this.opt.catalogOPT.contentItemId;
|
|
1618
1599
|
}
|
|
1600
|
+
}, {
|
|
1601
|
+
key: "showSearchbar",
|
|
1602
|
+
get: function get() {
|
|
1603
|
+
return this.opt.catalogOPT.showSearchbar;
|
|
1604
|
+
}
|
|
1605
|
+
}, {
|
|
1606
|
+
key: "showFilter",
|
|
1607
|
+
get: function get() {
|
|
1608
|
+
return this.opt.catalogOPT.showFilter;
|
|
1609
|
+
}
|
|
1619
1610
|
}, {
|
|
1620
1611
|
key: "pdfUrl",
|
|
1621
1612
|
get: function get() {
|
|
@@ -17849,6 +17840,12 @@ var OptionCatalogData = /*#__PURE__*/function () {
|
|
|
17849
17840
|
case 'INFO_URL':
|
|
17850
17841
|
this.opt.url = prop.Value;
|
|
17851
17842
|
break;
|
|
17843
|
+
case 'SHOW_SEARCHBAR':
|
|
17844
|
+
this.opt.showSearchbar = prop.Value;
|
|
17845
|
+
break;
|
|
17846
|
+
case 'SHOW_FILTER':
|
|
17847
|
+
this.opt.showFilter = prop.Value;
|
|
17848
|
+
break;
|
|
17852
17849
|
case 'INFO_PDF':
|
|
17853
17850
|
this.opt.pdfUrl = prop.Value;
|
|
17854
17851
|
break;
|
|
@@ -18049,6 +18046,16 @@ var OptionCatalogData = /*#__PURE__*/function () {
|
|
|
18049
18046
|
get: function get() {
|
|
18050
18047
|
return this.opt.url;
|
|
18051
18048
|
}
|
|
18049
|
+
}, {
|
|
18050
|
+
key: "showSearchbar",
|
|
18051
|
+
get: function get() {
|
|
18052
|
+
return this.opt.showSearchbar;
|
|
18053
|
+
}
|
|
18054
|
+
}, {
|
|
18055
|
+
key: "showFilter",
|
|
18056
|
+
get: function get() {
|
|
18057
|
+
return this.opt.showFilter;
|
|
18058
|
+
}
|
|
18052
18059
|
}, {
|
|
18053
18060
|
key: "pdfUrl",
|
|
18054
18061
|
get: function get() {
|
|
@@ -18510,6 +18517,8 @@ var DivaCatalogData = /*#__PURE__*/function () {
|
|
|
18510
18517
|
//Warnings
|
|
18511
18518
|
else if (item.Codex == 'HIDECONSTRUCTIONWARNING') {
|
|
18512
18519
|
_this.catalogData.doCheckConstructionWarnings = item.Value == '0';
|
|
18520
|
+
} else if (item.Codex == 'FORCECONSTRUCTIONWARNINGARTICLES') {
|
|
18521
|
+
_this.catalogData.forceConstructionWarningForArticles = item.Value.split(';');
|
|
18513
18522
|
} else if (item.Codex == 'HIDECOMPLETENESSWARNING') {
|
|
18514
18523
|
_this.catalogData.hideCompletenessWarning = item.Value == '1';
|
|
18515
18524
|
}
|
|
@@ -19330,6 +19339,11 @@ var DivaCatalogData = /*#__PURE__*/function () {
|
|
|
19330
19339
|
get: function get() {
|
|
19331
19340
|
return this.catalogData.doCheckConstructionWarnings;
|
|
19332
19341
|
}
|
|
19342
|
+
}, {
|
|
19343
|
+
key: "forceConstructionWarningForArticles",
|
|
19344
|
+
get: function get() {
|
|
19345
|
+
return this.catalogData.forceConstructionWarningForArticles;
|
|
19346
|
+
}
|
|
19333
19347
|
}, {
|
|
19334
19348
|
key: "doHideCompletenessWarning",
|
|
19335
19349
|
get: function get() {
|
|
@@ -20474,7 +20488,7 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
20474
20488
|
ruleDesc_locales: initParams.RuleDesc_locales,
|
|
20475
20489
|
toDeleteAfterInit: false,
|
|
20476
20490
|
doUpdatePlannerSize: false,
|
|
20477
|
-
shelfPlanData: initParams.
|
|
20491
|
+
shelfPlanData: initParams.ShelfPlandata ? DivaUtils.DecodeBasketJson(initParams.ShelfPlandata) : undefined,
|
|
20478
20492
|
typeNr: articleData.typeNr,
|
|
20479
20493
|
initDecisions: initParams.initDecisions,
|
|
20480
20494
|
previousPartlistArticles: initParams.PreviousPartlistArticles,
|
|
@@ -21791,6 +21805,18 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
21791
21805
|
get: function get() {
|
|
21792
21806
|
return md5(this.CatalogData.catalogGuid + '_' + this.articleCodex + '_' + JSON.stringify(this.VariantValuesWithoutOPTandOPV).replace(/"/g, '@'));
|
|
21793
21807
|
}
|
|
21808
|
+
}, {
|
|
21809
|
+
key: "articleProductHash",
|
|
21810
|
+
get: function get() {
|
|
21811
|
+
var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
|
|
21812
|
+
for (var key in this.articleOptionStates) {
|
|
21813
|
+
var myArtOption = this.articleOptionStates[key];
|
|
21814
|
+
if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
|
|
21815
|
+
hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
|
|
21816
|
+
}
|
|
21817
|
+
}
|
|
21818
|
+
return md5(hash);
|
|
21819
|
+
}
|
|
21794
21820
|
}, {
|
|
21795
21821
|
key: "VariantValuesWithoutOPTandOPV",
|
|
21796
21822
|
get: function get() {
|
|
@@ -22863,6 +22889,8 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
22863
22889
|
optionImgForPrint: optionImgForPrint,
|
|
22864
22890
|
optionsForPrint: optionsForPrint
|
|
22865
22891
|
});
|
|
22892
|
+
} else {
|
|
22893
|
+
LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
|
|
22866
22894
|
}
|
|
22867
22895
|
}
|
|
22868
22896
|
return partlistArticlesToLoad;
|
|
@@ -23559,7 +23587,7 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
23559
23587
|
break;
|
|
23560
23588
|
}
|
|
23561
23589
|
_context.next = 4;
|
|
23562
|
-
return import('./ShelfPlanner-
|
|
23590
|
+
return import('./ShelfPlanner-268c974f.js');
|
|
23563
23591
|
case 4:
|
|
23564
23592
|
_yield$import = _context.sent;
|
|
23565
23593
|
ShelfPlanner = _yield$import["default"];
|
|
@@ -24331,12 +24359,12 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
24331
24359
|
}
|
|
24332
24360
|
var myOptItem = {
|
|
24333
24361
|
BasketID: this.basketId,
|
|
24334
|
-
|
|
24362
|
+
OPT: OP.substring(3),
|
|
24335
24363
|
OPTName: myArtOption.optionOrigName,
|
|
24336
24364
|
OPTName_locales: myArtOption.optionName_locales,
|
|
24337
24365
|
OptionOCD: myArtOption.optionOcd,
|
|
24338
24366
|
OCD: myArtOption.ocd,
|
|
24339
|
-
|
|
24367
|
+
OPV: myArtOption.val.codex.substring(3),
|
|
24340
24368
|
vOPV: !this.CatalogData.dontUseVCodexInBasket ? myArtOption.vCodex : undefined,
|
|
24341
24369
|
OPVName: DivaUtils.stripTags(myArtOption.name),
|
|
24342
24370
|
OPVName_locales: DivaUtils.stripTagsFromDict((_myArtOption$valName_ = myArtOption.valName_locales) !== null && _myArtOption$valName_ !== void 0 ? _myArtOption$valName_ : {}),
|
|
@@ -24372,7 +24400,7 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
24372
24400
|
}
|
|
24373
24401
|
}, {
|
|
24374
24402
|
key: "getConfigPriceData",
|
|
24375
|
-
value: function getConfigPriceData(
|
|
24403
|
+
value: function getConfigPriceData(VariantBasketDatas) {
|
|
24376
24404
|
var myPriceData = new JsonConfigPriceData();
|
|
24377
24405
|
myPriceData.BasePrices = [];
|
|
24378
24406
|
if (this.price != 0) {
|
|
@@ -24398,12 +24426,12 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
24398
24426
|
} else {
|
|
24399
24427
|
if (checkPrice.IsPercentage) {
|
|
24400
24428
|
//Check if variantBasketdata is set as addPercentage
|
|
24401
|
-
//TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird
|
|
24402
|
-
for (var _i10 = 0; _i10 <
|
|
24429
|
+
//TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketDatas nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
|
|
24430
|
+
for (var _i10 = 0; _i10 < VariantBasketDatas.length; _i10++) {
|
|
24403
24431
|
var priceOPT = checkPrice.OPT.startsWith('OPT') ? checkPrice.OPT.substring(3) : checkPrice;
|
|
24404
|
-
if (
|
|
24432
|
+
if (VariantBasketDatas[_i10].OPT == priceOPT) {
|
|
24405
24433
|
if (!isNaN(checkPrice.Price)) {
|
|
24406
|
-
|
|
24434
|
+
VariantBasketDatas[_i10].AddPercentage = checkPrice.Price * 100;
|
|
24407
24435
|
}
|
|
24408
24436
|
}
|
|
24409
24437
|
}
|
|
@@ -24419,18 +24447,18 @@ var DivaArticle = /*#__PURE__*/function () {
|
|
|
24419
24447
|
var maxPrice = 0,
|
|
24420
24448
|
maxPriceOPT = '';
|
|
24421
24449
|
if (!myPriceData.BasePrice && !this.CatalogData.ignoreMaxPriceAsBP) {
|
|
24422
|
-
for (var _i11 = 0; _i11 <
|
|
24423
|
-
var variant =
|
|
24450
|
+
for (var _i11 = 0; _i11 < VariantBasketDatas.length; _i11++) {
|
|
24451
|
+
var variant = VariantBasketDatas[_i11];
|
|
24424
24452
|
if (variant.AddPrice && (!variant.AddPrice || variant.AddPrice > maxPrice)) {
|
|
24425
24453
|
maxPrice = variant.AddPrice;
|
|
24426
24454
|
maxPriceOPT = variant.OPT;
|
|
24427
24455
|
}
|
|
24428
24456
|
}
|
|
24429
24457
|
}
|
|
24430
|
-
for (var _i12 = 0; _i12 <
|
|
24458
|
+
for (var _i12 = 0; _i12 < VariantBasketDatas.length; _i12++) {
|
|
24431
24459
|
//WCTODO Prio 2 bei Maßauswahl
|
|
24432
24460
|
var CalcPrice = void 0,
|
|
24433
|
-
_variant =
|
|
24461
|
+
_variant = VariantBasketDatas[_i12],
|
|
24434
24462
|
isPercentage = false;
|
|
24435
24463
|
if (_variant.AddPercentage) {
|
|
24436
24464
|
isPercentage = true;
|
|
@@ -25045,7 +25073,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
|
|
|
25045
25073
|
}
|
|
25046
25074
|
}
|
|
25047
25075
|
}
|
|
25048
|
-
if (value == undefined) {
|
|
25076
|
+
if (value == undefined && myArtOPS.isFreeText && !variantValues[_key + '_val']) {
|
|
25049
25077
|
val = myArtOPS.option.freetextDefaultValue;
|
|
25050
25078
|
if (val) {
|
|
25051
25079
|
value = val;
|
|
@@ -26920,7 +26948,9 @@ var DivaSet = /*#__PURE__*/function () {
|
|
|
26920
26948
|
_defineProperty(this, "_supplierColors", void 0);
|
|
26921
26949
|
/**Favorits state */
|
|
26922
26950
|
_defineProperty(this, "_handlelingCurrentFavorites", false);
|
|
26923
|
-
_defineProperty(this, "_favorites",
|
|
26951
|
+
_defineProperty(this, "_favorites", {
|
|
26952
|
+
VariantValues: {}
|
|
26953
|
+
});
|
|
26924
26954
|
//disabledVariants holds the state for explicitly variants that the user did not like so they got unselected in der summary
|
|
26925
26955
|
_defineProperty(this, "_disabledVariants", []);
|
|
26926
26956
|
//for viewSummarylist to not always calc all the different valid variants we cache them and reset them when favoritesselection is changes
|
|
@@ -28089,7 +28119,7 @@ var DivaSet = /*#__PURE__*/function () {
|
|
|
28089
28119
|
break;
|
|
28090
28120
|
}
|
|
28091
28121
|
_context4.next = 3;
|
|
28092
|
-
return import('./DoorPlanner-
|
|
28122
|
+
return import('./DoorPlanner-62fe0f1e.js');
|
|
28093
28123
|
case 3:
|
|
28094
28124
|
_yield$import = _context4.sent;
|
|
28095
28125
|
DoorPlanner = _yield$import["default"];
|
|
@@ -28133,8 +28163,6 @@ var DivaSet = /*#__PURE__*/function () {
|
|
|
28133
28163
|
set: function set(favorites) {
|
|
28134
28164
|
this._favorites = favorites;
|
|
28135
28165
|
}
|
|
28136
|
-
|
|
28137
|
-
//private disabledVariants: number[] = [];
|
|
28138
28166
|
}, {
|
|
28139
28167
|
key: "disabledVariants",
|
|
28140
28168
|
get: function get() {
|
|
@@ -28143,7 +28171,6 @@ var DivaSet = /*#__PURE__*/function () {
|
|
|
28143
28171
|
set: function set(val) {
|
|
28144
28172
|
this._disabledVariants = val;
|
|
28145
28173
|
}
|
|
28146
|
-
//private allVariantsCache FavoritesVariants[]
|
|
28147
28174
|
}, {
|
|
28148
28175
|
key: "allVariantsCache",
|
|
28149
28176
|
get: function get() {
|
|
@@ -28266,558 +28293,6 @@ var DivaSet = /*#__PURE__*/function () {
|
|
|
28266
28293
|
}]);
|
|
28267
28294
|
}();
|
|
28268
28295
|
|
|
28269
|
-
//Diese Klasse verwaltet Productlogiken
|
|
28270
|
-
var Product = /*#__PURE__*/function () {
|
|
28271
|
-
function Product(id, divaNr, articles, price, image, shortDescription, childProducts, dockingPointInfos, affiliate, retailerArticleNr, minQuantity, increments) {
|
|
28272
|
-
_classCallCheck(this, Product);
|
|
28273
|
-
_defineProperty(this, "id", void 0);
|
|
28274
|
-
_defineProperty(this, "productPrice", void 0);
|
|
28275
|
-
_defineProperty(this, "_divaNr", void 0);
|
|
28276
|
-
_defineProperty(this, "shortDescriptionData", void 0);
|
|
28277
|
-
_defineProperty(this, "imageData", void 0);
|
|
28278
|
-
_defineProperty(this, "articles", void 0);
|
|
28279
|
-
_defineProperty(this, "families", []);
|
|
28280
|
-
_defineProperty(this, "childProductsData", void 0);
|
|
28281
|
-
_defineProperty(this, "childProductsGroupedData", void 0);
|
|
28282
|
-
_defineProperty(this, "dockingPointInfos", void 0);
|
|
28283
|
-
_defineProperty(this, "_affiliate", void 0);
|
|
28284
|
-
_defineProperty(this, "_retailerArticleNr", void 0);
|
|
28285
|
-
_defineProperty(this, "_minQuantity", void 0);
|
|
28286
|
-
_defineProperty(this, "_increments", void 0);
|
|
28287
|
-
_defineProperty(this, "_curTargetArticles", void 0);
|
|
28288
|
-
this.id = id;
|
|
28289
|
-
this._divaNr = divaNr;
|
|
28290
|
-
this.articles = articles;
|
|
28291
|
-
this.productPrice = price;
|
|
28292
|
-
this.childProductsData = childProducts;
|
|
28293
|
-
this.shortDescriptionData = shortDescription;
|
|
28294
|
-
this.imageData = image;
|
|
28295
|
-
this.dockingPointInfos = dockingPointInfos;
|
|
28296
|
-
this._affiliate = affiliate;
|
|
28297
|
-
this._retailerArticleNr = retailerArticleNr;
|
|
28298
|
-
this._minQuantity = minQuantity === 1 ? undefined : minQuantity;
|
|
28299
|
-
this._increments = increments === 1 ? undefined : increments;
|
|
28300
|
-
this._curTargetArticles = [];
|
|
28301
|
-
if (this.childProductsData) {
|
|
28302
|
-
this.childProductsGroupedData = {};
|
|
28303
|
-
for (var i = 0; i < this.childProductsData.length; i++) {
|
|
28304
|
-
if (!this.childProductsGroupedData[this.childProductsData[i]]) this.childProductsGroupedData[this.childProductsData[i]] = 0;
|
|
28305
|
-
this.childProductsGroupedData[this.childProductsData[i]]++;
|
|
28306
|
-
}
|
|
28307
|
-
}
|
|
28308
|
-
}
|
|
28309
|
-
return _createClass(Product, [{
|
|
28310
|
-
key: "initFamilies",
|
|
28311
|
-
value: function initFamilies(families) {
|
|
28312
|
-
for (var i = 0; i < families.length; i++) {
|
|
28313
|
-
var _families$i$childProd;
|
|
28314
|
-
if ((_families$i$childProd = families[i].childProducts) !== null && _families$i$childProd !== void 0 && _families$i$childProd.includes(this.id)) this.families.push();
|
|
28315
|
-
}
|
|
28316
|
-
this.families = families;
|
|
28317
|
-
}
|
|
28318
|
-
}, {
|
|
28319
|
-
key: "price",
|
|
28320
|
-
get: function get() {
|
|
28321
|
-
return this.productPrice;
|
|
28322
|
-
}
|
|
28323
|
-
}, {
|
|
28324
|
-
key: "productId",
|
|
28325
|
-
get: function get() {
|
|
28326
|
-
return this.id;
|
|
28327
|
-
}
|
|
28328
|
-
}, {
|
|
28329
|
-
key: "divaNr",
|
|
28330
|
-
get: function get() {
|
|
28331
|
-
return this._divaNr;
|
|
28332
|
-
}
|
|
28333
|
-
}, {
|
|
28334
|
-
key: "isFamily",
|
|
28335
|
-
get: function get() {
|
|
28336
|
-
return this.childProducts !== undefined;
|
|
28337
|
-
}
|
|
28338
|
-
}, {
|
|
28339
|
-
key: "variantValues",
|
|
28340
|
-
get: function get() {
|
|
28341
|
-
return this.articles[0].variantValues;
|
|
28342
|
-
}
|
|
28343
|
-
}, {
|
|
28344
|
-
key: "childProducts",
|
|
28345
|
-
get: function get() {
|
|
28346
|
-
return this.childProductsData;
|
|
28347
|
-
}
|
|
28348
|
-
}, {
|
|
28349
|
-
key: "childProductsGrouped",
|
|
28350
|
-
get: function get() {
|
|
28351
|
-
return this.childProductsGroupedData;
|
|
28352
|
-
}
|
|
28353
|
-
}, {
|
|
28354
|
-
key: "shortDescription",
|
|
28355
|
-
get: function get() {
|
|
28356
|
-
return this.shortDescriptionData;
|
|
28357
|
-
}
|
|
28358
|
-
}, {
|
|
28359
|
-
key: "image",
|
|
28360
|
-
get: function get() {
|
|
28361
|
-
return this.imageData;
|
|
28362
|
-
}
|
|
28363
|
-
}, {
|
|
28364
|
-
key: "affiliate",
|
|
28365
|
-
get: function get() {
|
|
28366
|
-
return this._affiliate;
|
|
28367
|
-
}
|
|
28368
|
-
}, {
|
|
28369
|
-
key: "retailerArticleNr",
|
|
28370
|
-
get: function get() {
|
|
28371
|
-
return this._retailerArticleNr;
|
|
28372
|
-
}
|
|
28373
|
-
}, {
|
|
28374
|
-
key: "increments",
|
|
28375
|
-
get: function get() {
|
|
28376
|
-
// return 2;
|
|
28377
|
-
return this._increments;
|
|
28378
|
-
}
|
|
28379
|
-
}, {
|
|
28380
|
-
key: "minQuantity",
|
|
28381
|
-
get: function get() {
|
|
28382
|
-
// return 3;
|
|
28383
|
-
return this._minQuantity;
|
|
28384
|
-
}
|
|
28385
|
-
}, {
|
|
28386
|
-
key: "curTargetArticles",
|
|
28387
|
-
get: function get() {
|
|
28388
|
-
return this._curTargetArticles;
|
|
28389
|
-
},
|
|
28390
|
-
set: function set(targentArticles) {
|
|
28391
|
-
this._curTargetArticles = targentArticles;
|
|
28392
|
-
}
|
|
28393
|
-
}, {
|
|
28394
|
-
key: "DockingPointInfos",
|
|
28395
|
-
get: function get() {
|
|
28396
|
-
return this.dockingPointInfos;
|
|
28397
|
-
}
|
|
28398
|
-
}, {
|
|
28399
|
-
key: "CatalogCodexes",
|
|
28400
|
-
get: function get() {
|
|
28401
|
-
var catalogCodexes = [];
|
|
28402
|
-
for (var i = 0; i < this.articles.length; i++) {
|
|
28403
|
-
catalogCodexes.push(this.articles[i].catalogCodex);
|
|
28404
|
-
}
|
|
28405
|
-
return catalogCodexes;
|
|
28406
|
-
}
|
|
28407
|
-
}, {
|
|
28408
|
-
key: "findOPVCodexInVariantValues",
|
|
28409
|
-
value: function findOPVCodexInVariantValues(opt, opv) {
|
|
28410
|
-
return this.articles.find(function (article) {
|
|
28411
|
-
return article.variantValues.find(function (variant) {
|
|
28412
|
-
return variant.OPT === opt && variant.OPV === opv;
|
|
28413
|
-
});
|
|
28414
|
-
});
|
|
28415
|
-
}
|
|
28416
|
-
}]);
|
|
28417
|
-
}();
|
|
28418
|
-
|
|
28419
|
-
var DivaProductHandler = /*#__PURE__*/function () {
|
|
28420
|
-
function DivaProductHandler() {
|
|
28421
|
-
_classCallCheck(this, DivaProductHandler);
|
|
28422
|
-
_defineProperty(this, "singleProducts", {});
|
|
28423
|
-
_defineProperty(this, "familyProducts", {});
|
|
28424
|
-
_defineProperty(this, "singleProductsGrouped", {});
|
|
28425
|
-
// key is CatalogCodex and ArticleCodex
|
|
28426
|
-
//the number is the qunaitity of the current loaded product
|
|
28427
|
-
_defineProperty(this, "currentFamilies", {});
|
|
28428
|
-
_defineProperty(this, "currentSingleProducts", {});
|
|
28429
|
-
}
|
|
28430
|
-
return _createClass(DivaProductHandler, [{
|
|
28431
|
-
key: "addProducts",
|
|
28432
|
-
value: function addProducts(variants, families) {
|
|
28433
|
-
var newProducts = [];
|
|
28434
|
-
var newFamilies = [];
|
|
28435
|
-
for (var i = 0; i < variants.length; i++) {
|
|
28436
|
-
var _variant$discountedPr;
|
|
28437
|
-
var article = variants[i].articles[0];
|
|
28438
|
-
var variant = variants[i];
|
|
28439
|
-
var codex = article.catalogCodex + '_' + article.articleCodex;
|
|
28440
|
-
if (!this.singleProductsGrouped[codex]) this.singleProductsGrouped[codex] = {};
|
|
28441
|
-
this.singleProductsGrouped[codex][variants[i]._id] = new Product(variant._id, variant.divaNr, variant.articles, (_variant$discountedPr = variant.discountedPrice) !== null && _variant$discountedPr !== void 0 ? _variant$discountedPr : variant.addedPrice, variant.image, variant.shortDescription, undefined, variant.dockingPointInfos, variant.affiliate, variant.retailerArticleNr, variant.minQuantity, variant.increments);
|
|
28442
|
-
this.singleProducts[variant._id] = this.singleProductsGrouped[codex][variant._id];
|
|
28443
|
-
newProducts.push(this.singleProductsGrouped[codex][variant._id]);
|
|
28444
|
-
}
|
|
28445
|
-
if (families !== null && families !== void 0 && families.length) for (var _i = 0; _i < families.length; _i++) {
|
|
28446
|
-
var _family$discountedPri;
|
|
28447
|
-
var family = families[_i];
|
|
28448
|
-
this.familyProducts[family._id] = new Product(family._id, family.divaNr, family.articles, (_family$discountedPri = family.discountedPrice) !== null && _family$discountedPri !== void 0 ? _family$discountedPri : family.addedPrice, family.image, family.shortDescription, family.childProducts, family.dockingPointInfos, family.affiliate, family.retailerArticleNr, family.minQuantity, family.increments);
|
|
28449
|
-
newFamilies.push(this.familyProducts[family._id]);
|
|
28450
|
-
}
|
|
28451
|
-
for (var _i2 = 0; _i2 < newProducts.length; _i2++) {
|
|
28452
|
-
newProducts[_i2].initFamilies(newFamilies);
|
|
28453
|
-
}
|
|
28454
|
-
}
|
|
28455
|
-
}, {
|
|
28456
|
-
key: "loadProductsOfSets",
|
|
28457
|
-
value: function () {
|
|
28458
|
-
var _loadProductsOfSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(orderSets, involvedSetIds) {
|
|
28459
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
28460
|
-
while (1) switch (_context.prev = _context.next) {
|
|
28461
|
-
case 0:
|
|
28462
|
-
case "end":
|
|
28463
|
-
return _context.stop();
|
|
28464
|
-
}
|
|
28465
|
-
}, _callee);
|
|
28466
|
-
}));
|
|
28467
|
-
function loadProductsOfSets(_x, _x2) {
|
|
28468
|
-
return _loadProductsOfSets.apply(this, arguments);
|
|
28469
|
-
}
|
|
28470
|
-
return loadProductsOfSets;
|
|
28471
|
-
}()
|
|
28472
|
-
}, {
|
|
28473
|
-
key: "updateProducts",
|
|
28474
|
-
value: function () {
|
|
28475
|
-
var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(set, from, productId) {
|
|
28476
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
28477
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
28478
|
-
case 0:
|
|
28479
|
-
case "end":
|
|
28480
|
-
return _context2.stop();
|
|
28481
|
-
}
|
|
28482
|
-
}, _callee2);
|
|
28483
|
-
}));
|
|
28484
|
-
function updateProducts(_x3, _x4, _x5) {
|
|
28485
|
-
return _updateProducts.apply(this, arguments);
|
|
28486
|
-
}
|
|
28487
|
-
return updateProducts;
|
|
28488
|
-
}()
|
|
28489
|
-
}, {
|
|
28490
|
-
key: "updateArticleProducts",
|
|
28491
|
-
value: function updateArticleProducts(set) {
|
|
28492
|
-
var articles = set.getDivaArticles();
|
|
28493
|
-
var targetArticles = Object.keys(articles);
|
|
28494
|
-
for (var i = 0; i < targetArticles.length; i++) {
|
|
28495
|
-
var article = articles[targetArticles[i]];
|
|
28496
|
-
var productVariants = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
|
|
28497
|
-
for (var key in productVariants) {
|
|
28498
|
-
var product = productVariants[key];
|
|
28499
|
-
product.curTargetArticles = [];
|
|
28500
|
-
}
|
|
28501
|
-
}
|
|
28502
|
-
for (var _i3 = 0; _i3 < targetArticles.length; _i3++) {
|
|
28503
|
-
var _article = articles[targetArticles[_i3]];
|
|
28504
|
-
if (!_article) continue;
|
|
28505
|
-
var _productVariants = this.singleProductsGrouped[_article.catalogCodex + '_' + _article.articleCodex];
|
|
28506
|
-
var newProduct = undefined;
|
|
28507
|
-
var _loop = function _loop() {
|
|
28508
|
-
var product = _productVariants[_key];
|
|
28509
|
-
var productVariantValues = _article.VariantValuesWithoutOPTandOPVInObject;
|
|
28510
|
-
var notFound = false;
|
|
28511
|
-
var _loop2 = function _loop2(j) {
|
|
28512
|
-
if (!productVariantValues.find(function (item) {
|
|
28513
|
-
return item.OPT == product.variantValues[j].OPT && item.OPV == product.variantValues[j].OPV;
|
|
28514
|
-
})) {
|
|
28515
|
-
//only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
|
|
28516
|
-
if (productVariantValues.find(function (item) {
|
|
28517
|
-
return item.OPT == product.variantValues[j].OPT;
|
|
28518
|
-
})) {
|
|
28519
|
-
notFound = true;
|
|
28520
|
-
return 1; // break
|
|
28521
|
-
}
|
|
28522
|
-
}
|
|
28523
|
-
};
|
|
28524
|
-
for (var j = 0; j < product.variantValues.length; j++) {
|
|
28525
|
-
if (_loop2(j)) break;
|
|
28526
|
-
}
|
|
28527
|
-
if (!notFound) {
|
|
28528
|
-
newProduct = product;
|
|
28529
|
-
newProduct.curTargetArticles.push(_article.basketId);
|
|
28530
|
-
return 1; // break
|
|
28531
|
-
}
|
|
28532
|
-
};
|
|
28533
|
-
for (var _key in _productVariants) {
|
|
28534
|
-
if (_loop()) break;
|
|
28535
|
-
}
|
|
28536
|
-
_article.curProduct = newProduct;
|
|
28537
|
-
}
|
|
28538
|
-
}
|
|
28539
|
-
}, {
|
|
28540
|
-
key: "updateFamilyProducts",
|
|
28541
|
-
value: function updateFamilyProducts() {
|
|
28542
|
-
this.currentFamilies = {};
|
|
28543
|
-
var familiesToCheck = this.getFamiliesToCheck();
|
|
28544
|
-
var biggestFamily;
|
|
28545
|
-
do {
|
|
28546
|
-
biggestFamily = this.findBiggestFamily(familiesToCheck);
|
|
28547
|
-
if (biggestFamily) {
|
|
28548
|
-
if (!this.currentFamilies[biggestFamily.productId]) this.currentFamilies[biggestFamily.productId] = 0;
|
|
28549
|
-
this.currentFamilies[biggestFamily.productId]++;
|
|
28550
|
-
}
|
|
28551
|
-
} while (biggestFamily);
|
|
28552
|
-
}
|
|
28553
|
-
}, {
|
|
28554
|
-
key: "getFamiliesToCheck",
|
|
28555
|
-
value: function getFamiliesToCheck() {
|
|
28556
|
-
var familiesToCheck = {};
|
|
28557
|
-
for (var key in this.familyProducts) {
|
|
28558
|
-
var familiy = this.familyProducts[key];
|
|
28559
|
-
if (!familiy.childProducts) continue;
|
|
28560
|
-
for (var i = 0; i < familiy.childProducts.length; i++) {
|
|
28561
|
-
if (this.currentSingleProducts[familiy.childProducts[i]]) {
|
|
28562
|
-
familiesToCheck[familiy.productId] = familiy;
|
|
28563
|
-
break;
|
|
28564
|
-
}
|
|
28565
|
-
}
|
|
28566
|
-
}
|
|
28567
|
-
return familiesToCheck;
|
|
28568
|
-
}
|
|
28569
|
-
}, {
|
|
28570
|
-
key: "findBiggestFamily",
|
|
28571
|
-
value: function findBiggestFamily(familiesToCheck) {
|
|
28572
|
-
var matchingFamilies = [];
|
|
28573
|
-
var biggestFamily = false;
|
|
28574
|
-
for (var iKey in familiesToCheck) {
|
|
28575
|
-
var family = familiesToCheck[iKey];
|
|
28576
|
-
var notFit = false;
|
|
28577
|
-
for (var jKey in family.childProductsGrouped) {
|
|
28578
|
-
//if product does not currently exist or the quantity is to small
|
|
28579
|
-
if (!this.currentSingleProducts[jKey] || this.currentSingleProducts[jKey] < family.childProductsGrouped[jKey]) {
|
|
28580
|
-
notFit = true;
|
|
28581
|
-
break;
|
|
28582
|
-
}
|
|
28583
|
-
}
|
|
28584
|
-
if (!notFit) matchingFamilies.push(family);
|
|
28585
|
-
}
|
|
28586
|
-
|
|
28587
|
-
//from all the matching families find the bigges one
|
|
28588
|
-
for (var i = 0; i < matchingFamilies.length; i++) {
|
|
28589
|
-
if (!biggestFamily || biggestFamily.childProducts.length > matchingFamilies[i].childProducts.length) {
|
|
28590
|
-
biggestFamily = matchingFamilies[i];
|
|
28591
|
-
}
|
|
28592
|
-
}
|
|
28593
|
-
if (biggestFamily) {
|
|
28594
|
-
//we found a final bigges familiy. Now subtract the familiy products quantity in the dictionary products for the next run
|
|
28595
|
-
for (var key in biggestFamily.childProductsGrouped) {
|
|
28596
|
-
biggestFamily.childProductsGrouped;
|
|
28597
|
-
this.currentSingleProducts[key] = this.currentSingleProducts[key] - biggestFamily.childProductsGrouped[key];
|
|
28598
|
-
}
|
|
28599
|
-
}
|
|
28600
|
-
return biggestFamily;
|
|
28601
|
-
}
|
|
28602
|
-
}, {
|
|
28603
|
-
key: "checkQuantitySteps",
|
|
28604
|
-
value: function () {
|
|
28605
|
-
var _checkQuantitySteps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(set, from, productId) {
|
|
28606
|
-
var articles, somethingChanged, key, product, currentQuantity, deltaQuantity, whatToDo, article;
|
|
28607
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
28608
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
28609
|
-
case 0:
|
|
28610
|
-
articles = set.getDivaArticles();
|
|
28611
|
-
somethingChanged = false;
|
|
28612
|
-
_context3.t0 = _regeneratorRuntime.keys(this.currentSingleProducts);
|
|
28613
|
-
case 3:
|
|
28614
|
-
if ((_context3.t1 = _context3.t0()).done) {
|
|
28615
|
-
_context3.next = 38;
|
|
28616
|
-
break;
|
|
28617
|
-
}
|
|
28618
|
-
key = _context3.t1.value;
|
|
28619
|
-
product = this.singleProducts[key];
|
|
28620
|
-
currentQuantity = this.currentSingleProducts[key];
|
|
28621
|
-
deltaQuantity = 0;
|
|
28622
|
-
whatToDo = undefined;
|
|
28623
|
-
if (product.minQuantity !== undefined) {
|
|
28624
|
-
if (product.minQuantity > currentQuantity || product.increments !== undefined && product.increments > currentQuantity) {
|
|
28625
|
-
if (from == 'onDelete') {
|
|
28626
|
-
whatToDo = 'deleteArticle';
|
|
28627
|
-
deltaQuantity = currentQuantity;
|
|
28628
|
-
} else {
|
|
28629
|
-
whatToDo = 'increaseQunatity';
|
|
28630
|
-
deltaQuantity = product.minQuantity - currentQuantity;
|
|
28631
|
-
}
|
|
28632
|
-
somethingChanged = 'byMinQuantity';
|
|
28633
|
-
}
|
|
28634
|
-
}
|
|
28635
|
-
if (!(product.increments && whatToDo !== 'deleteArticle')) {
|
|
28636
|
-
_context3.next = 22;
|
|
28637
|
-
break;
|
|
28638
|
-
}
|
|
28639
|
-
case 11:
|
|
28640
|
-
if (!((currentQuantity + deltaQuantity) % product.increments !== 0 || from == 'onDelete' && productId == key)) {
|
|
28641
|
-
_context3.next = 22;
|
|
28642
|
-
break;
|
|
28643
|
-
}
|
|
28644
|
-
deltaQuantity++;
|
|
28645
|
-
somethingChanged = 'byImcrement';
|
|
28646
|
-
if (!(whatToDo !== 'increaseQunatity')) {
|
|
28647
|
-
_context3.next = 20;
|
|
28648
|
-
break;
|
|
28649
|
-
}
|
|
28650
|
-
if (!((currentQuantity - deltaQuantity) % product.increments === 0 && from != 'onAdd')) {
|
|
28651
|
-
_context3.next = 19;
|
|
28652
|
-
break;
|
|
28653
|
-
}
|
|
28654
|
-
if (!(product.minQuantity === undefined || product.minQuantity <= currentQuantity - deltaQuantity || currentQuantity - deltaQuantity === 0)) {
|
|
28655
|
-
_context3.next = 19;
|
|
28656
|
-
break;
|
|
28657
|
-
}
|
|
28658
|
-
whatToDo = 'decreaseQunatity';
|
|
28659
|
-
return _context3.abrupt("break", 22);
|
|
28660
|
-
case 19:
|
|
28661
|
-
if ((currentQuantity + deltaQuantity) % product.increments === 0 && from != 'onDelete') {
|
|
28662
|
-
whatToDo = 'increaseQunatity';
|
|
28663
|
-
}
|
|
28664
|
-
case 20:
|
|
28665
|
-
_context3.next = 11;
|
|
28666
|
-
break;
|
|
28667
|
-
case 22:
|
|
28668
|
-
if (!(whatToDo !== undefined)) {
|
|
28669
|
-
_context3.next = 36;
|
|
28670
|
-
break;
|
|
28671
|
-
}
|
|
28672
|
-
case 23:
|
|
28673
|
-
if (!(deltaQuantity !== 0)) {
|
|
28674
|
-
_context3.next = 36;
|
|
28675
|
-
break;
|
|
28676
|
-
}
|
|
28677
|
-
article = articles[product.curTargetArticles[0]]; //attention!! If an article has a quantity bigger than 1 this wont work!
|
|
28678
|
-
if (!(whatToDo === 'increaseQunatity')) {
|
|
28679
|
-
_context3.next = 30;
|
|
28680
|
-
break;
|
|
28681
|
-
}
|
|
28682
|
-
_context3.next = 28;
|
|
28683
|
-
return setHandlerInstance.addPlannerElement(set, article.articleCodex, {
|
|
28684
|
-
variantValues: article.VariantValues
|
|
28685
|
-
}, 'initializingProduct');
|
|
28686
|
-
case 28:
|
|
28687
|
-
_context3.next = 33;
|
|
28688
|
-
break;
|
|
28689
|
-
case 30:
|
|
28690
|
-
_context3.next = 32;
|
|
28691
|
-
return setHandlerInstance.deleteElementFromSet(set, article, false, undefined, true);
|
|
28692
|
-
case 32:
|
|
28693
|
-
product.curTargetArticles.splice(0, 1);
|
|
28694
|
-
case 33:
|
|
28695
|
-
deltaQuantity--;
|
|
28696
|
-
_context3.next = 23;
|
|
28697
|
-
break;
|
|
28698
|
-
case 36:
|
|
28699
|
-
_context3.next = 3;
|
|
28700
|
-
break;
|
|
28701
|
-
case 38:
|
|
28702
|
-
return _context3.abrupt("return", somethingChanged);
|
|
28703
|
-
case 39:
|
|
28704
|
-
case "end":
|
|
28705
|
-
return _context3.stop();
|
|
28706
|
-
}
|
|
28707
|
-
}, _callee3, this);
|
|
28708
|
-
}));
|
|
28709
|
-
function checkQuantitySteps(_x6, _x7, _x8) {
|
|
28710
|
-
return _checkQuantitySteps.apply(this, arguments);
|
|
28711
|
-
}
|
|
28712
|
-
return checkQuantitySteps;
|
|
28713
|
-
}()
|
|
28714
|
-
/**
|
|
28715
|
-
* this functions controlls if the list of configItems is available or not
|
|
28716
|
-
* @param configItems
|
|
28717
|
-
* @param variantsInfo
|
|
28718
|
-
* @param articles
|
|
28719
|
-
* @param targetArticles
|
|
28720
|
-
* @returns
|
|
28721
|
-
*/
|
|
28722
|
-
}, {
|
|
28723
|
-
key: "checkProductInStock",
|
|
28724
|
-
value: function checkProductInStock(configItems, variantsInfo, articles, targetArticles) {
|
|
28725
|
-
var productsKey = articles[targetArticles[0]].catalogCodex + '_' + articles[targetArticles[0]].articleCodex;
|
|
28726
|
-
var products = this.singleProductsGrouped[productsKey];
|
|
28727
|
-
var indexesToDelete = [];
|
|
28728
|
-
for (var i = 0; i < variantsInfo.length; i++) {
|
|
28729
|
-
var variantInStock = false;
|
|
28730
|
-
var variantInfo = variantsInfo[i];
|
|
28731
|
-
for (var key in products) {
|
|
28732
|
-
//***GUF***DEBUG HERE
|
|
28733
|
-
var productVariantValues = products[key].variantValues;
|
|
28734
|
-
var notFound = false;
|
|
28735
|
-
var _loop3 = function _loop3() {
|
|
28736
|
-
var variant = variantInfo.variants[j];
|
|
28737
|
-
if (!productVariantValues.find(function (item) {
|
|
28738
|
-
return variant.OPT === item.OPT && variant.OPV === item.OPV;
|
|
28739
|
-
})) {
|
|
28740
|
-
//only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
|
|
28741
|
-
if (productVariantValues.find(function (item) {
|
|
28742
|
-
return variant.OPT === item.OPT;
|
|
28743
|
-
})) {
|
|
28744
|
-
notFound = true;
|
|
28745
|
-
return 1; // break
|
|
28746
|
-
}
|
|
28747
|
-
}
|
|
28748
|
-
};
|
|
28749
|
-
for (var j = 0; j < variantInfo.variants.length; j++) {
|
|
28750
|
-
if (_loop3()) break;
|
|
28751
|
-
}
|
|
28752
|
-
if (!notFound) {
|
|
28753
|
-
variantInStock = true;
|
|
28754
|
-
break;
|
|
28755
|
-
}
|
|
28756
|
-
}
|
|
28757
|
-
if (!variantInStock) {
|
|
28758
|
-
if (configItems[i]) {
|
|
28759
|
-
indexesToDelete.push(i);
|
|
28760
|
-
}
|
|
28761
|
-
}
|
|
28762
|
-
}
|
|
28763
|
-
for (var _i4 = indexesToDelete.length - 1; _i4 >= 0; _i4--) {
|
|
28764
|
-
configItems.splice(indexesToDelete[_i4], 1);
|
|
28765
|
-
}
|
|
28766
|
-
return configItems;
|
|
28767
|
-
}
|
|
28768
|
-
}, {
|
|
28769
|
-
key: "getPrice",
|
|
28770
|
-
value: function getPrice() {
|
|
28771
|
-
var price = 0;
|
|
28772
|
-
for (var key in this.currentSingleProducts) {
|
|
28773
|
-
price += this.singleProducts[key].price * this.currentSingleProducts[key];
|
|
28774
|
-
}
|
|
28775
|
-
for (var _key2 in this.currentFamilies) {
|
|
28776
|
-
price += this.singleProducts[_key2].price * this.currentFamilies[_key2];
|
|
28777
|
-
}
|
|
28778
|
-
return price;
|
|
28779
|
-
}
|
|
28780
|
-
}, {
|
|
28781
|
-
key: "getCurrentProducts",
|
|
28782
|
-
value: function getCurrentProducts() {
|
|
28783
|
-
var products = this.currentSingleProducts;
|
|
28784
|
-
for (var key in this.currentFamilies) {
|
|
28785
|
-
products[key] = this.currentFamilies[key];
|
|
28786
|
-
}
|
|
28787
|
-
return products;
|
|
28788
|
-
}
|
|
28789
|
-
}, {
|
|
28790
|
-
key: "getProductById",
|
|
28791
|
-
value: function getProductById(productId) {
|
|
28792
|
-
var product;
|
|
28793
|
-
product = this.singleProducts[productId];
|
|
28794
|
-
if (!product) this.familyProducts[productId];
|
|
28795
|
-
return product;
|
|
28796
|
-
}
|
|
28797
|
-
}, {
|
|
28798
|
-
key: "getBestMatch",
|
|
28799
|
-
value: function getBestMatch(articles) {
|
|
28800
|
-
var OPTION_CODEX = 'KOPFTEIL';
|
|
28801
|
-
if (!articles) return;
|
|
28802
|
-
for (var key in articles) {
|
|
28803
|
-
var _article$VariantValue;
|
|
28804
|
-
var article = articles[key];
|
|
28805
|
-
var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
|
|
28806
|
-
var products = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
|
|
28807
|
-
if (!products || !opv) continue;
|
|
28808
|
-
for (var pId in products) {
|
|
28809
|
-
var _products$pId$affilia;
|
|
28810
|
-
if ((_products$pId$affilia = products[pId].affiliate) !== null && _products$pId$affilia !== void 0 && _products$pId$affilia.length) if (products[pId].findOPVCodexInVariantValues(OPTION_CODEX, opv)) {
|
|
28811
|
-
return products[pId];
|
|
28812
|
-
}
|
|
28813
|
-
}
|
|
28814
|
-
}
|
|
28815
|
-
return undefined;
|
|
28816
|
-
}
|
|
28817
|
-
}]);
|
|
28818
|
-
}();
|
|
28819
|
-
var productHandlerInstance = new DivaProductHandler();
|
|
28820
|
-
|
|
28821
28296
|
var SummaryHandler = /*#__PURE__*/function () {
|
|
28822
28297
|
function SummaryHandler() {
|
|
28823
28298
|
_classCallCheck(this, SummaryHandler);
|
|
@@ -29155,30 +28630,16 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29155
28630
|
}, {
|
|
29156
28631
|
key: "getSummaryItems",
|
|
29157
28632
|
value: function () {
|
|
29158
|
-
var _getSummaryItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, doConfigure
|
|
28633
|
+
var _getSummaryItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, doConfigure) {
|
|
29159
28634
|
var ret, _key5, set, items, type;
|
|
29160
28635
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29161
28636
|
while (1) switch (_context.prev = _context.next) {
|
|
29162
28637
|
case 0:
|
|
29163
28638
|
ret = [];
|
|
29164
|
-
if (!doAllowSetPlanner) {
|
|
29165
|
-
_context.next = 5;
|
|
29166
|
-
break;
|
|
29167
|
-
}
|
|
29168
|
-
ret = [{
|
|
29169
|
-
items: this.getArticlesForSummary(sets),
|
|
29170
|
-
type: 'SUMMARY_ARTICLES',
|
|
29171
|
-
name: 'ARTICLELIST',
|
|
29172
|
-
price: setHandlerInstance.getTotalPrice(sets),
|
|
29173
|
-
quantity: 1
|
|
29174
|
-
}];
|
|
29175
|
-
_context.next = 29;
|
|
29176
|
-
break;
|
|
29177
|
-
case 5:
|
|
29178
28639
|
_context.t0 = _regeneratorRuntime.keys(sets);
|
|
29179
|
-
case
|
|
28640
|
+
case 2:
|
|
29180
28641
|
if ((_context.t1 = _context.t0()).done) {
|
|
29181
|
-
_context.next =
|
|
28642
|
+
_context.next = 25;
|
|
29182
28643
|
break;
|
|
29183
28644
|
}
|
|
29184
28645
|
_key5 = _context.t1.value;
|
|
@@ -29186,9 +28647,9 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29186
28647
|
items = void 0;
|
|
29187
28648
|
type = this.getSummaryType(set);
|
|
29188
28649
|
_context.t2 = type;
|
|
29189
|
-
_context.next = _context.t2 === 'SUMMARY_PARTLIST' ?
|
|
28650
|
+
_context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 10 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 13 : _context.t2 === 'VARIANTS' ? 15 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 21 : 23;
|
|
29190
28651
|
break;
|
|
29191
|
-
case
|
|
28652
|
+
case 10:
|
|
29192
28653
|
items = this.buildSummaryItemsOfPartlist(set);
|
|
29193
28654
|
ret.push({
|
|
29194
28655
|
items: items,
|
|
@@ -29197,33 +28658,33 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29197
28658
|
price: set.getSetPrice(),
|
|
29198
28659
|
quantity: 1
|
|
29199
28660
|
});
|
|
29200
|
-
return _context.abrupt("break",
|
|
29201
|
-
case
|
|
28661
|
+
return _context.abrupt("break", 23);
|
|
28662
|
+
case 13:
|
|
29202
28663
|
ret = ret.concat(this.getOptionTreeSummary(set));
|
|
29203
|
-
return _context.abrupt("break",
|
|
29204
|
-
case
|
|
28664
|
+
return _context.abrupt("break", 23);
|
|
28665
|
+
case 15:
|
|
29205
28666
|
_context.t3 = ret;
|
|
29206
|
-
_context.next =
|
|
28667
|
+
_context.next = 18;
|
|
29207
28668
|
return this.getVariantsSummary(doConfigure, set);
|
|
29208
|
-
case
|
|
28669
|
+
case 18:
|
|
29209
28670
|
_context.t4 = _context.sent;
|
|
29210
28671
|
_context.t3.push.call(_context.t3, _context.t4);
|
|
29211
|
-
return _context.abrupt("break",
|
|
29212
|
-
case
|
|
28672
|
+
return _context.abrupt("break", 23);
|
|
28673
|
+
case 21:
|
|
29213
28674
|
ret.push(this.buildSummaryItemsOfPartlistWithSpecialOptions(set));
|
|
29214
|
-
return _context.abrupt("break",
|
|
29215
|
-
case
|
|
29216
|
-
_context.next =
|
|
28675
|
+
return _context.abrupt("break", 23);
|
|
28676
|
+
case 23:
|
|
28677
|
+
_context.next = 2;
|
|
29217
28678
|
break;
|
|
29218
|
-
case
|
|
28679
|
+
case 25:
|
|
29219
28680
|
return _context.abrupt("return", ret);
|
|
29220
|
-
case
|
|
28681
|
+
case 26:
|
|
29221
28682
|
case "end":
|
|
29222
28683
|
return _context.stop();
|
|
29223
28684
|
}
|
|
29224
28685
|
}, _callee, this);
|
|
29225
28686
|
}));
|
|
29226
|
-
function getSummaryItems(_x, _x2
|
|
28687
|
+
function getSummaryItems(_x, _x2) {
|
|
29227
28688
|
return _getSummaryItems.apply(this, arguments);
|
|
29228
28689
|
}
|
|
29229
28690
|
return getSummaryItems;
|
|
@@ -29327,69 +28788,15 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29327
28788
|
}
|
|
29328
28789
|
return ret;
|
|
29329
28790
|
}
|
|
29330
|
-
}, {
|
|
29331
|
-
key: "getArticlesForSummary",
|
|
29332
|
-
value: function getArticlesForSummary(sets) {
|
|
29333
|
-
var ret = {};
|
|
29334
|
-
for (var setId in sets) {
|
|
29335
|
-
var set = sets[setId];
|
|
29336
|
-
var articles = set.getDivaArticles();
|
|
29337
|
-
for (var basketId in articles) {
|
|
29338
|
-
var article = articles[basketId];
|
|
29339
|
-
if (!article.curProduct) {
|
|
29340
|
-
var _key9 = article.catalogCodex + '_' + article.articleCodex + '_' + article.articleVariantDesc();
|
|
29341
|
-
if (ret[_key9]) {
|
|
29342
|
-
var _ret$_key9$targetArti;
|
|
29343
|
-
ret[_key9].quantity = ret[_key9].quantity + article.quantity;
|
|
29344
|
-
ret[_key9].targetBasketIds.push(article.basketId);
|
|
29345
|
-
(_ret$_key9$targetArti = ret[_key9].targetArticlePosNrs) === null || _ret$_key9$targetArti === void 0 || _ret$_key9$targetArti.push(article.posNr);
|
|
29346
|
-
} else {
|
|
29347
|
-
ret[_key9] = {
|
|
29348
|
-
setId: setId,
|
|
29349
|
-
title: article.name,
|
|
29350
|
-
title_locales: article.name_locales,
|
|
29351
|
-
description: article.actSizeText,
|
|
29352
|
-
isDefined: true,
|
|
29353
|
-
price: article.price,
|
|
29354
|
-
quantity: article.quantity,
|
|
29355
|
-
codex: article.articleCodex,
|
|
29356
|
-
targetBasketIds: [article.basketId],
|
|
29357
|
-
posNr: Object.keys(ret).length,
|
|
29358
|
-
image: article.imageUrl,
|
|
29359
|
-
targetArticlePosNrs: [article.posNr]
|
|
29360
|
-
};
|
|
29361
|
-
}
|
|
29362
|
-
}
|
|
29363
|
-
}
|
|
29364
|
-
}
|
|
29365
|
-
var curProducts = productHandlerInstance.getCurrentProducts();
|
|
29366
|
-
for (var _key10 in curProducts) {
|
|
29367
|
-
var product = productHandlerInstance.getProductById(_key10);
|
|
29368
|
-
ret[_key10] = {
|
|
29369
|
-
setId: 'PRODUCTS',
|
|
29370
|
-
title: product.shortDescription,
|
|
29371
|
-
description: '',
|
|
29372
|
-
isDefined: true,
|
|
29373
|
-
price: product.price,
|
|
29374
|
-
quantity: curProducts[_key10],
|
|
29375
|
-
codex: product.productId,
|
|
29376
|
-
targetBasketIds: [],
|
|
29377
|
-
posNr: Object.keys(ret).length,
|
|
29378
|
-
image: product.image,
|
|
29379
|
-
targetArticlePosNrs: []
|
|
29380
|
-
};
|
|
29381
|
-
}
|
|
29382
|
-
return ret;
|
|
29383
|
-
}
|
|
29384
28791
|
}, {
|
|
29385
28792
|
key: "getSummaryItemsOfAllSets",
|
|
29386
28793
|
value: function getSummaryItemsOfAllSets(sets, set) {
|
|
29387
28794
|
var summaryItemsOfAllSets = {};
|
|
29388
|
-
for (var
|
|
29389
|
-
var _set = sets[
|
|
28795
|
+
for (var _key9 in sets) {
|
|
28796
|
+
var _set = sets[_key9];
|
|
29390
28797
|
var articlePosNrs = this.getArticlesPosNr(_set.getDivaArticles(true));
|
|
29391
28798
|
var summaryItems = this.buildSummaryItems(articlePosNrs, _set);
|
|
29392
|
-
summaryItemsOfAllSets[
|
|
28799
|
+
summaryItemsOfAllSets[_key9] = {
|
|
29393
28800
|
setName: _set.CatalogData.catalogName,
|
|
29394
28801
|
setPrice: _set.getSetPrice(),
|
|
29395
28802
|
summaryItems: summaryItems
|
|
@@ -29403,10 +28810,10 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29403
28810
|
var groupedArticles = setHandlerInstance.getDockedGroupedArticles(set);
|
|
29404
28811
|
var retGroups = {};
|
|
29405
28812
|
var articlesCodexesOnIndex = {};
|
|
29406
|
-
for (var
|
|
29407
|
-
var basketId = groupedArticles[
|
|
28813
|
+
for (var _key10 in groupedArticles) {
|
|
28814
|
+
var basketId = groupedArticles[_key10][Object.keys(groupedArticles[_key10])[0]].basketId;
|
|
29408
28815
|
retGroups[basketId] = {
|
|
29409
|
-
articles: groupedArticles[
|
|
28816
|
+
articles: groupedArticles[_key10],
|
|
29410
28817
|
quantity: 1
|
|
29411
28818
|
};
|
|
29412
28819
|
}
|
|
@@ -29421,12 +28828,12 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29421
28828
|
articlesCodexesOnIndex[articleCodex].push(i);
|
|
29422
28829
|
}
|
|
29423
28830
|
}
|
|
29424
|
-
for (var
|
|
29425
|
-
if (articlesCodexesOnIndex[
|
|
28831
|
+
for (var _key11 in articlesCodexesOnIndex) {
|
|
28832
|
+
if (articlesCodexesOnIndex[_key11].length > 1) {
|
|
29426
28833
|
//group the single groups by the aricleCodex
|
|
29427
28834
|
var articles = [];
|
|
29428
|
-
for (var _i4 = 0; _i4 < articlesCodexesOnIndex[
|
|
29429
|
-
var _group = groupedArticles[articlesCodexesOnIndex[
|
|
28835
|
+
for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key11].length; _i4++) {
|
|
28836
|
+
var _group = groupedArticles[articlesCodexesOnIndex[_key11][_i4]];
|
|
29430
28837
|
articles.push({
|
|
29431
28838
|
article: _group[Object.keys(_group)[0]]
|
|
29432
28839
|
});
|
|
@@ -29482,12 +28889,12 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29482
28889
|
}
|
|
29483
28890
|
|
|
29484
28891
|
//old logic TODO: Delete in 2024
|
|
29485
|
-
if (Object.keys(tabGroups).length === 0) for (var
|
|
29486
|
-
var _ops = article.articleOptionStates[
|
|
28892
|
+
if (Object.keys(tabGroups).length === 0) for (var _key12 in article.articleOptionStates) {
|
|
28893
|
+
var _ops = article.articleOptionStates[_key12];
|
|
29487
28894
|
if (!_ops.isInvisible && (_ops.selectionmode != 0 || (_ops.visibleCount > 1 || _ops.isFreeText) && article.set.api.showSelectionModeZero()) && _ops.isDoShow && _ops.valCodex != 'OPVNR') {
|
|
29488
28895
|
var tabGroup = _ops.option.addOptionToTabgroupInPartlistSummary;
|
|
29489
28896
|
if (tabGroup) tabGroups.push({
|
|
29490
|
-
optionCodex:
|
|
28897
|
+
optionCodex: _key12,
|
|
29491
28898
|
tabGroup: tabGroup
|
|
29492
28899
|
});
|
|
29493
28900
|
}
|
|
@@ -29522,8 +28929,8 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29522
28929
|
}
|
|
29523
28930
|
|
|
29524
28931
|
//old logic TODO: Delete in 2024
|
|
29525
|
-
for (var
|
|
29526
|
-
var _optionState = article.articleOptionStates[
|
|
28932
|
+
for (var _key13 in article.articleOptionStates) {
|
|
28933
|
+
var _optionState = article.articleOptionStates[_key13];
|
|
29527
28934
|
if (_optionState.option.addOptionToTabgroupInPartlistSummary == tabGroup && !_optionState.isInvisible && _optionState.isDoShow && _optionState.visibleCount > 0 && _optionState.valCodex != 'OPVNR') {
|
|
29528
28935
|
opss.push(_optionState);
|
|
29529
28936
|
}
|
|
@@ -29687,7 +29094,7 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29687
29094
|
}
|
|
29688
29095
|
}, _callee3);
|
|
29689
29096
|
}));
|
|
29690
|
-
function getVariantsSummary(
|
|
29097
|
+
function getVariantsSummary(_x3, _x4) {
|
|
29691
29098
|
return _getVariantsSummary.apply(this, arguments);
|
|
29692
29099
|
}
|
|
29693
29100
|
return getVariantsSummary;
|
|
@@ -29715,8 +29122,8 @@ var SummaryHandler = /*#__PURE__*/function () {
|
|
|
29715
29122
|
key: "getArticlesPrice",
|
|
29716
29123
|
value: function getArticlesPrice(articles) {
|
|
29717
29124
|
var price = 0;
|
|
29718
|
-
for (var
|
|
29719
|
-
price = price + articles[
|
|
29125
|
+
for (var _key14 in articles) {
|
|
29126
|
+
price = price + articles[_key14].price * articles[_key14].quantity;
|
|
29720
29127
|
}
|
|
29721
29128
|
return price;
|
|
29722
29129
|
}
|
|
@@ -29736,10 +29143,11 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
29736
29143
|
return _createClass(DivaFavoritesHandler, [{
|
|
29737
29144
|
key: "initSet",
|
|
29738
29145
|
value: function initSet(set, orderSet) {
|
|
29739
|
-
var _orderSet$
|
|
29146
|
+
var _orderSet$TinyVariant;
|
|
29740
29147
|
set.favorites = orderSet !== null && orderSet !== void 0 && orderSet.Favorites ? orderSet.Favorites : new Favorites();
|
|
29741
|
-
if ((_orderSet$
|
|
29742
|
-
|
|
29148
|
+
if ((_orderSet$TinyVariant = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant !== void 0 && _orderSet$TinyVariant.length) {
|
|
29149
|
+
var _orderSet$TinyVariant2;
|
|
29150
|
+
set.oldConfigVariants = _toConsumableArray((_orderSet$TinyVariant2 = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant2 !== void 0 ? _orderSet$TinyVariant2 : []);
|
|
29743
29151
|
}
|
|
29744
29152
|
set.disabledVariants = [];
|
|
29745
29153
|
}
|
|
@@ -29756,33 +29164,35 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
29756
29164
|
key: "getVariantsForSummary",
|
|
29757
29165
|
value: function () {
|
|
29758
29166
|
var _getVariantsForSummary = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(set) {
|
|
29759
|
-
var _set$allVariantsCache;
|
|
29167
|
+
var _set$actions, _set$allVariantsCache, _set$actions2;
|
|
29760
29168
|
var variants;
|
|
29761
29169
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29762
29170
|
while (1) switch (_context.prev = _context.next) {
|
|
29763
29171
|
case 0:
|
|
29764
29172
|
this.isCalcForSummary = true;
|
|
29173
|
+
(_set$actions = set.actions) === null || _set$actions === void 0 || _set$actions.toggleLoading('calcfavorites', false, true);
|
|
29765
29174
|
if (!((_set$allVariantsCache = set.allVariantsCache) !== null && _set$allVariantsCache !== void 0)) {
|
|
29766
|
-
_context.next =
|
|
29175
|
+
_context.next = 6;
|
|
29767
29176
|
break;
|
|
29768
29177
|
}
|
|
29769
29178
|
_context.t0 = _set$allVariantsCache;
|
|
29770
|
-
_context.next =
|
|
29179
|
+
_context.next = 9;
|
|
29771
29180
|
break;
|
|
29772
|
-
case
|
|
29773
|
-
_context.next =
|
|
29181
|
+
case 6:
|
|
29182
|
+
_context.next = 8;
|
|
29774
29183
|
return this.getAllValidVariants(set);
|
|
29775
|
-
case 7:
|
|
29776
|
-
_context.t0 = _context.sent;
|
|
29777
29184
|
case 8:
|
|
29185
|
+
_context.t0 = _context.sent;
|
|
29186
|
+
case 9:
|
|
29778
29187
|
variants = _context.t0;
|
|
29188
|
+
(_set$actions2 = set.actions) === null || _set$actions2 === void 0 || _set$actions2.toggleLoading('calcfavorites', false, false);
|
|
29779
29189
|
this.isCalcForSummary = false;
|
|
29780
29190
|
return _context.abrupt("return", {
|
|
29781
29191
|
disabled: set.disabledVariants,
|
|
29782
29192
|
variants: variants,
|
|
29783
29193
|
singleOptions: this.repairFavorites(set).singleOptions
|
|
29784
29194
|
});
|
|
29785
|
-
case
|
|
29195
|
+
case 13:
|
|
29786
29196
|
case "end":
|
|
29787
29197
|
return _context.stop();
|
|
29788
29198
|
}
|
|
@@ -29959,8 +29369,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
29959
29369
|
if (!((_set$oldConfigVariant = set.oldConfigVariants) !== null && _set$oldConfigVariant !== void 0 && _set$oldConfigVariant.length)) return 0;
|
|
29960
29370
|
var highestId = 0;
|
|
29961
29371
|
for (var i = 0; i < set.oldConfigVariants.length; i++) {
|
|
29962
|
-
|
|
29963
|
-
|
|
29372
|
+
var variant = set.oldConfigVariants[i];
|
|
29373
|
+
if (variant.VariantID && highestId < variant.VariantID) {
|
|
29374
|
+
highestId = variant.VariantID;
|
|
29964
29375
|
}
|
|
29965
29376
|
}
|
|
29966
29377
|
return highestId + 1;
|
|
@@ -29973,15 +29384,17 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
29973
29384
|
for (var i = 0; i < set.oldConfigVariants.length; i++) {
|
|
29974
29385
|
var oldConfigVariant = set.oldConfigVariants[i];
|
|
29975
29386
|
var tryNext = false;
|
|
29976
|
-
|
|
29387
|
+
var _loop2 = function _loop2(basketId) {
|
|
29977
29388
|
var articleNew = variant.targetArticles[basketId];
|
|
29978
|
-
var articleOld = oldConfigVariant.
|
|
29389
|
+
var articleOld = oldConfigVariant.OrderSets[0].OrderLines.find(function (ol) {
|
|
29390
|
+
return ol.BasketID == basketId;
|
|
29391
|
+
});
|
|
29979
29392
|
if (!articleOld) {
|
|
29980
29393
|
tryNext = true;
|
|
29981
|
-
continue
|
|
29394
|
+
return 1; // continue
|
|
29982
29395
|
}
|
|
29983
|
-
var
|
|
29984
|
-
var option = articleOld.
|
|
29396
|
+
var _loop3 = function _loop3(opt) {
|
|
29397
|
+
var option = articleOld.VariantBasketDatas.find(function (v) {
|
|
29985
29398
|
return 'OPT' + v.OPT == opt;
|
|
29986
29399
|
});
|
|
29987
29400
|
if (!option) {
|
|
@@ -29995,9 +29408,12 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
29995
29408
|
},
|
|
29996
29409
|
_ret;
|
|
29997
29410
|
for (var opt in articleNew) {
|
|
29998
|
-
_ret =
|
|
29411
|
+
_ret = _loop3(opt);
|
|
29999
29412
|
if (_ret === 0) continue;
|
|
30000
29413
|
}
|
|
29414
|
+
};
|
|
29415
|
+
for (var basketId in variant.targetArticles) {
|
|
29416
|
+
if (_loop2(basketId)) continue;
|
|
30001
29417
|
}
|
|
30002
29418
|
if (tryNext) continue;
|
|
30003
29419
|
return oldConfigVariant.VariantID;
|
|
@@ -30042,7 +29458,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
30042
29458
|
var optionValue = set.CatalogData.getOptionValue(opvs[i]);
|
|
30043
29459
|
var optionValueName = optionValue === null || optionValue === void 0 ? void 0 : optionValue.name;
|
|
30044
29460
|
var optionValueImage = optionValue === null || optionValue === void 0 ? void 0 : optionValue.image;
|
|
30045
|
-
favorit = new
|
|
29461
|
+
favorit = new Favorite(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
|
|
30046
29462
|
this.setFavorites(set, opt, opvs[i], favorit, remove);
|
|
30047
29463
|
}
|
|
30048
29464
|
set.disabledVariants = [];
|
|
@@ -30438,14 +29854,28 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
|
|
|
30438
29854
|
var optionsMatching = {};
|
|
30439
29855
|
for (var basketId in variant.targetArticles) {
|
|
30440
29856
|
var articleVariantValues = variant.targetArticles[basketId];
|
|
29857
|
+
var _loop4 = function _loop4(opt) {
|
|
29858
|
+
var _articleWithOption$Va;
|
|
29859
|
+
if (optionsMatching[opt]) return 0; // continue
|
|
29860
|
+
var articleWithOption = oldConfig.OrderSets[0].OrderLines.find(function (ol) {
|
|
29861
|
+
return ol.VariantBasketDatas.find(function (v) {
|
|
29862
|
+
return 'OPT' + v.OPT === opt;
|
|
29863
|
+
});
|
|
29864
|
+
});
|
|
29865
|
+
if ('OPV' + (articleWithOption === null || articleWithOption === void 0 || (_articleWithOption$Va = articleWithOption.VariantBasketDatas.find(function (v) {
|
|
29866
|
+
return 'OPT' + v.OPT === opt;
|
|
29867
|
+
})) === null || _articleWithOption$Va === void 0 ? void 0 : _articleWithOption$Va.OPV) == articleVariantValues[opt]) {
|
|
29868
|
+
optionsMatching[opt] = true;
|
|
29869
|
+
} else {
|
|
29870
|
+
tryNext = true;
|
|
29871
|
+
return 1; // break
|
|
29872
|
+
}
|
|
29873
|
+
},
|
|
29874
|
+
_ret2;
|
|
30441
29875
|
for (var opt in articleVariantValues) {
|
|
30442
|
-
|
|
30443
|
-
if (
|
|
30444
|
-
|
|
30445
|
-
} else {
|
|
30446
|
-
tryNext = true;
|
|
30447
|
-
break;
|
|
30448
|
-
}
|
|
29876
|
+
_ret2 = _loop4(opt);
|
|
29877
|
+
if (_ret2 === 0) continue;
|
|
29878
|
+
if (_ret2 === 1) break;
|
|
30449
29879
|
}
|
|
30450
29880
|
if (tryNext) break;
|
|
30451
29881
|
}
|
|
@@ -31277,6 +30707,53 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
|
|
|
31277
30707
|
}();
|
|
31278
30708
|
var configTreeHandler = new DivaConfigTreeHandler();
|
|
31279
30709
|
|
|
30710
|
+
//Diese Klasse verwaltet Productlogiken
|
|
30711
|
+
var DivaProductHandler = /*#__PURE__*/function () {
|
|
30712
|
+
function DivaProductHandler() {
|
|
30713
|
+
_classCallCheck(this, DivaProductHandler);
|
|
30714
|
+
}
|
|
30715
|
+
return _createClass(DivaProductHandler, [{
|
|
30716
|
+
key: "getPrice",
|
|
30717
|
+
value: function getPrice() {
|
|
30718
|
+
var price = 0;
|
|
30719
|
+
return price;
|
|
30720
|
+
}
|
|
30721
|
+
}, {
|
|
30722
|
+
key: "updateProducts",
|
|
30723
|
+
value: function () {
|
|
30724
|
+
var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, api, from) {
|
|
30725
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30726
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30727
|
+
case 0:
|
|
30728
|
+
({
|
|
30729
|
+
catalogs: sets.map(function (set) {
|
|
30730
|
+
return {
|
|
30731
|
+
articles: Object.values(set.getDivaArticles()).map(function (article) {
|
|
30732
|
+
return {
|
|
30733
|
+
codex: article.articleCodex,
|
|
30734
|
+
hash: article.articleProductHash
|
|
30735
|
+
};
|
|
30736
|
+
}),
|
|
30737
|
+
catalogGuid: set.CatalogData.catalogGuid
|
|
30738
|
+
};
|
|
30739
|
+
})
|
|
30740
|
+
});
|
|
30741
|
+
return _context.abrupt("return");
|
|
30742
|
+
case 2:
|
|
30743
|
+
case "end":
|
|
30744
|
+
return _context.stop();
|
|
30745
|
+
}
|
|
30746
|
+
}, _callee);
|
|
30747
|
+
}));
|
|
30748
|
+
function updateProducts(_x, _x2, _x3) {
|
|
30749
|
+
return _updateProducts.apply(this, arguments);
|
|
30750
|
+
}
|
|
30751
|
+
return updateProducts;
|
|
30752
|
+
}()
|
|
30753
|
+
}]);
|
|
30754
|
+
}();
|
|
30755
|
+
var productHandlerInstance = new DivaProductHandler();
|
|
30756
|
+
|
|
31280
30757
|
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31281
30758
|
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31282
30759
|
var LOG$8 = DivaUtils.initLog('Planner', 'DIVA-SET-HANDLER');
|
|
@@ -31325,11 +30802,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
31325
30802
|
_context.next = 12;
|
|
31326
30803
|
return set.plannerHandler.initSet(set, catalogData, undefined);
|
|
31327
30804
|
case 12:
|
|
31328
|
-
_context.next = 14;
|
|
31329
|
-
return productHandlerInstance.updateProducts(set, 'onAdd');
|
|
31330
|
-
case 14:
|
|
31331
30805
|
return _context.abrupt("return", set);
|
|
31332
|
-
case
|
|
30806
|
+
case 13:
|
|
31333
30807
|
case "end":
|
|
31334
30808
|
return _context.stop();
|
|
31335
30809
|
}
|
|
@@ -31386,7 +30860,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
31386
30860
|
PosNr: orderline.PosNr,
|
|
31387
30861
|
VariantValues: variantValues,
|
|
31388
30862
|
VariantItemData: orderline.VariantBasketDatas,
|
|
31389
|
-
|
|
30863
|
+
ShelfPlandata: orderline.ShelfPlandata,
|
|
31390
30864
|
elementId: (_orderline$ElementID = orderline.ElementID) !== null && _orderline$ElementID !== void 0 ? _orderline$ElementID : elements === null || elements === void 0 || (_elements$find = elements.find(function (element) {
|
|
31391
30865
|
return element.basketID == orderline.BasketID;
|
|
31392
30866
|
})) === null || _elements$find === void 0 ? void 0 : _elements$find.elementID
|
|
@@ -32113,19 +31587,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
32113
31587
|
_context13.next = 16;
|
|
32114
31588
|
return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
|
|
32115
31589
|
case 16:
|
|
32116
|
-
if (!(from === 'initializing')) {
|
|
32117
|
-
_context13.next = 19;
|
|
32118
|
-
break;
|
|
32119
|
-
}
|
|
32120
|
-
_context13.next = 19;
|
|
32121
|
-
return productHandlerInstance.updateProducts(set, 'onAdd');
|
|
32122
|
-
case 19:
|
|
32123
31590
|
LOG$8.successTransaction('ON_PLAN_ARTICLE', {
|
|
32124
31591
|
art: articleCodex,
|
|
32125
31592
|
artName: newArticle.name
|
|
32126
31593
|
});
|
|
32127
31594
|
return _context13.abrupt("return", newArticle);
|
|
32128
|
-
case
|
|
31595
|
+
case 18:
|
|
32129
31596
|
case "end":
|
|
32130
31597
|
return _context13.stop();
|
|
32131
31598
|
}
|
|
@@ -32258,7 +31725,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
32258
31725
|
key: "deleteElementFromSet",
|
|
32259
31726
|
value: function () {
|
|
32260
31727
|
var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
|
|
32261
|
-
var _deletedArticle$doorP, _set$CatalogData
|
|
31728
|
+
var _deletedArticle$doorP, _set$CatalogData;
|
|
32262
31729
|
var setId, deletedArticle, articles, key, newSelectedElement, oldTransform, result, _set$getArticleByBask3, elementDeleted;
|
|
32263
31730
|
return _regeneratorRuntime.wrap(function _callee14$(_context16) {
|
|
32264
31731
|
while (1) switch (_context16.prev = _context16.next) {
|
|
@@ -32318,20 +31785,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
32318
31785
|
_context16.next = 27;
|
|
32319
31786
|
return this.updateArticlesOptionStatesOfActSet(set, {}, []);
|
|
32320
31787
|
case 27:
|
|
32321
|
-
if (dontReload) {
|
|
32322
|
-
_context16.next = 30;
|
|
32323
|
-
break;
|
|
32324
|
-
}
|
|
32325
|
-
_context16.next = 30;
|
|
32326
|
-
return productHandlerInstance.updateProducts(set, 'onDelete', deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$curPr = deletedArticle.curProduct) === null || _deletedArticle$curPr === void 0 ? void 0 : _deletedArticle$curPr.productId);
|
|
32327
|
-
case 30:
|
|
32328
31788
|
return _context16.abrupt("return", {
|
|
32329
31789
|
success: elementDeleted,
|
|
32330
31790
|
selectElementId: newSelectedElement,
|
|
32331
31791
|
setId: setId,
|
|
32332
31792
|
oldTransform: oldTransform
|
|
32333
31793
|
});
|
|
32334
|
-
case
|
|
31794
|
+
case 28:
|
|
32335
31795
|
case "end":
|
|
32336
31796
|
return _context16.stop();
|
|
32337
31797
|
}
|
|
@@ -33113,8 +32573,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33113
32573
|
key: "variantsEvaluator",
|
|
33114
32574
|
value: (function () {
|
|
33115
32575
|
var _variantsEvaluator = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(set, configItems, configStepKey, paletteType) {
|
|
33116
|
-
var _set$
|
|
33117
|
-
var opt,
|
|
32576
|
+
var _set$ViewConfig, _configItems$;
|
|
32577
|
+
var opt, calcVariantsForPricePreview, previewType, _set$api$ReturnToFrom, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
|
|
33118
32578
|
return _regeneratorRuntime.wrap(function _callee23$(_context25) {
|
|
33119
32579
|
while (1) switch (_context25.prev = _context25.next) {
|
|
33120
32580
|
case 0:
|
|
@@ -33125,37 +32585,33 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33125
32585
|
}
|
|
33126
32586
|
return _context25.abrupt("return", configItems);
|
|
33127
32587
|
case 3:
|
|
33128
|
-
checkForProductsInStock = ((_set$WebConfig = set.WebConfig) === null || _set$WebConfig === void 0 ? void 0 : _set$WebConfig.checkForProductsInStock) && !(opt !== null && opt !== void 0 && opt.isDescribingState);
|
|
33129
32588
|
calcVariantsForPricePreview = false;
|
|
33130
32589
|
previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
|
|
33131
32590
|
if (previewType) {
|
|
33132
|
-
calcVariantsForPricePreview = !set.dontCalcPricePreviewDueToPerformanceIssues && !opt.showOnSeparatTabgroup && (!((_set$CatalogData$show = set.CatalogData.showPricePreviewOnlyOnOptions) !== null && _set$CatalogData$show !== void 0 && _set$CatalogData$show.length) || set.CatalogData.showPricePreviewOnlyOnOptions.includes(opt.codex));
|
|
32591
|
+
calcVariantsForPricePreview = !set.dontCalcPricePreviewDueToPerformanceIssues && !((_set$api$ReturnToFrom = set.api.ReturnToFromParams) !== null && _set$api$ReturnToFrom !== void 0 && _set$api$ReturnToFrom.includes('PRODUCTCREATOR')) && !opt.showOnSeparatTabgroup && (!((_set$CatalogData$show = set.CatalogData.showPricePreviewOnlyOnOptions) !== null && _set$CatalogData$show !== void 0 && _set$CatalogData$show.length) || set.CatalogData.showPricePreviewOnlyOnOptions.includes(opt.codex));
|
|
33133
32592
|
}
|
|
33134
32593
|
if (set.PlannerMode === 'BoxPlanner') calcVariantsForPricePreview = false;
|
|
33135
32594
|
if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
|
|
33136
32595
|
calcVariantsForPricePreview = false;
|
|
33137
32596
|
}
|
|
33138
|
-
if (!
|
|
33139
|
-
_context25.next =
|
|
32597
|
+
if (!calcVariantsForPricePreview) {
|
|
32598
|
+
_context25.next = 17;
|
|
33140
32599
|
break;
|
|
33141
32600
|
}
|
|
33142
32601
|
targetArticles = set.configTree.getTargetArticles(configStepKey);
|
|
33143
32602
|
startTime = new Date();
|
|
33144
|
-
_context25.next =
|
|
32603
|
+
_context25.next = 13;
|
|
33145
32604
|
return this.calcVariants(set, configItems, targetArticles);
|
|
33146
|
-
case
|
|
32605
|
+
case 13:
|
|
33147
32606
|
variants = _context25.sent;
|
|
33148
32607
|
endTime = new Date();
|
|
33149
32608
|
if (endTime.getTime() - startTime.getTime() > 1000) set.dontCalcPricePreviewDueToPerformanceIssues = true;
|
|
33150
32609
|
if (previewType) {
|
|
33151
32610
|
this.calcPricePreview(set, configItems, variants);
|
|
33152
32611
|
}
|
|
33153
|
-
|
|
33154
|
-
configItems = productHandlerInstance.checkProductInStock(configItems, variants, set.getDivaArticles(), targetArticles);
|
|
33155
|
-
}
|
|
33156
|
-
case 19:
|
|
32612
|
+
case 17:
|
|
33157
32613
|
return _context25.abrupt("return", configItems);
|
|
33158
|
-
case
|
|
32614
|
+
case 18:
|
|
33159
32615
|
case "end":
|
|
33160
32616
|
return _context25.stop();
|
|
33161
32617
|
}
|
|
@@ -33329,29 +32785,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33329
32785
|
_context27.next = 19;
|
|
33330
32786
|
return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
|
|
33331
32787
|
case 19:
|
|
33332
|
-
if (!(from == 'FromViewClick')) {
|
|
33333
|
-
_context27.next = 22;
|
|
33334
|
-
break;
|
|
33335
|
-
}
|
|
33336
|
-
_context27.next = 22;
|
|
33337
|
-
return productHandlerInstance.updateProducts(set, 'onConfig');
|
|
33338
|
-
case 22:
|
|
33339
32788
|
if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
|
|
33340
32789
|
|
|
33341
32790
|
//Update Planner - check if planner data changed
|
|
33342
32791
|
if (!(!ignorePlanner && from != 'calcVariant')) {
|
|
33343
|
-
_context27.next =
|
|
32792
|
+
_context27.next = 48;
|
|
33344
32793
|
break;
|
|
33345
32794
|
}
|
|
33346
32795
|
targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
|
|
33347
|
-
_context27.next =
|
|
32796
|
+
_context27.next = 24;
|
|
33348
32797
|
return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds);
|
|
33349
|
-
case
|
|
32798
|
+
case 24:
|
|
33350
32799
|
resultPlannerUpdate = _context27.sent;
|
|
33351
32800
|
i = 0;
|
|
33352
|
-
case
|
|
32801
|
+
case 26:
|
|
33353
32802
|
if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
|
|
33354
|
-
_context27.next =
|
|
32803
|
+
_context27.next = 35;
|
|
33355
32804
|
break;
|
|
33356
32805
|
}
|
|
33357
32806
|
articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
|
|
@@ -33359,43 +32808,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33359
32808
|
if (index > -1) {
|
|
33360
32809
|
targetArticlesWithNewValues.splice(index, 1);
|
|
33361
32810
|
}
|
|
33362
|
-
_context27.next =
|
|
32811
|
+
_context27.next = 32;
|
|
33363
32812
|
return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
|
|
33364
|
-
case
|
|
32813
|
+
case 32:
|
|
33365
32814
|
i++;
|
|
33366
|
-
_context27.next =
|
|
32815
|
+
_context27.next = 26;
|
|
33367
32816
|
break;
|
|
33368
|
-
case
|
|
32817
|
+
case 35:
|
|
33369
32818
|
if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
|
|
33370
|
-
_context27.next =
|
|
32819
|
+
_context27.next = 48;
|
|
33371
32820
|
break;
|
|
33372
32821
|
}
|
|
33373
32822
|
//Todo copy these elements
|
|
33374
32823
|
articleCopyRelation = new Map();
|
|
33375
32824
|
i = 0;
|
|
33376
|
-
case
|
|
32825
|
+
case 38:
|
|
33377
32826
|
if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
|
|
33378
|
-
_context27.next =
|
|
32827
|
+
_context27.next = 46;
|
|
33379
32828
|
break;
|
|
33380
32829
|
}
|
|
33381
|
-
_context27.next =
|
|
32830
|
+
_context27.next = 41;
|
|
33382
32831
|
return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
|
|
33383
|
-
case
|
|
32832
|
+
case 41:
|
|
33384
32833
|
newArticle = _context27.sent;
|
|
33385
32834
|
articleCopyRelation.set(resultPlannerUpdate.elementIdToCopy[i], newArticle.basketId);
|
|
33386
|
-
case
|
|
32835
|
+
case 43:
|
|
33387
32836
|
i++;
|
|
33388
|
-
_context27.next =
|
|
32837
|
+
_context27.next = 38;
|
|
33389
32838
|
break;
|
|
33390
|
-
case
|
|
33391
|
-
_context27.next =
|
|
32839
|
+
case 46:
|
|
32840
|
+
_context27.next = 48;
|
|
33392
32841
|
return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
|
|
33393
32842
|
dpType: resultPlannerUpdate.copyDPType ? resultPlannerUpdate.copyDPType : 'NO',
|
|
33394
32843
|
copyType: resultPlannerUpdate.copyType,
|
|
33395
32844
|
changedOPT: resultPlannerUpdate.changedOPT,
|
|
33396
32845
|
targetElements: resultPlannerUpdate.targetElements
|
|
33397
32846
|
});
|
|
33398
|
-
case
|
|
32847
|
+
case 48:
|
|
33399
32848
|
this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
|
|
33400
32849
|
if (from == 'FromViewClick' && (_Object$keys = Object.keys(myValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
|
|
33401
32850
|
this.confirmOptionsInMetric(set, [Object.keys(myValues)[0]], 'onSelectConfig');
|
|
@@ -33405,7 +32854,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33405
32854
|
elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
|
|
33406
32855
|
setId: set.getSetId()
|
|
33407
32856
|
});
|
|
33408
|
-
case
|
|
32857
|
+
case 51:
|
|
33409
32858
|
case "end":
|
|
33410
32859
|
return _context27.stop();
|
|
33411
32860
|
}
|
|
@@ -33551,7 +33000,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33551
33000
|
articleHandlerInstance.defineAllOptionsOfArticles(articles);
|
|
33552
33001
|
} else if (key === set.getSetId()) {
|
|
33553
33002
|
for (var _key in basketIdsOnOptions) {
|
|
33554
|
-
articlesAndOptions[_key] = {
|
|
33003
|
+
if (articles[_key]) articlesAndOptions[_key] = {
|
|
33555
33004
|
article: articles[_key],
|
|
33556
33005
|
options: basketIdsOnOptions[_key]
|
|
33557
33006
|
};
|
|
@@ -33702,7 +33151,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33702
33151
|
value: function getTotalPrice(sets) {
|
|
33703
33152
|
var _this$actSet;
|
|
33704
33153
|
var price = 0;
|
|
33705
|
-
if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.
|
|
33154
|
+
if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsPrice && productHandlerInstance.getPrice()) {
|
|
33706
33155
|
return productHandlerInstance.getPrice();
|
|
33707
33156
|
}
|
|
33708
33157
|
for (var key in sets) {
|
|
@@ -33716,7 +33165,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33716
33165
|
var _this$actSet2;
|
|
33717
33166
|
var price = 0;
|
|
33718
33167
|
var bruttoActive = false;
|
|
33719
|
-
if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.
|
|
33168
|
+
if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsPrice && productHandlerInstance.getPrice()) {
|
|
33720
33169
|
return productHandlerInstance.getPrice();
|
|
33721
33170
|
}
|
|
33722
33171
|
for (var key in sets) {
|
|
@@ -33743,7 +33192,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33743
33192
|
key: "fillOrderLinesAndOrderSets",
|
|
33744
33193
|
value: function () {
|
|
33745
33194
|
var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
|
|
33746
|
-
var _set$
|
|
33195
|
+
var _set$WebConfig;
|
|
33747
33196
|
var orderSets, basketData, set, setPosNr, price, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, orderLineInitInfos, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
|
|
33748
33197
|
return _regeneratorRuntime.wrap(function _callee28$(_context30) {
|
|
33749
33198
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -33753,7 +33202,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33753
33202
|
set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
|
|
33754
33203
|
basketData.setSAPOrderLines([]);
|
|
33755
33204
|
setPosNr = 0;
|
|
33756
|
-
if (set !== null && set !== void 0 && (_set$
|
|
33205
|
+
if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
|
|
33757
33206
|
price = set.priceForActHash();
|
|
33758
33207
|
if (!price) {
|
|
33759
33208
|
basketData.OrigProductId = undefined;
|
|
@@ -33790,7 +33239,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33790
33239
|
if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
|
|
33791
33240
|
newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
|
|
33792
33241
|
}
|
|
33793
|
-
ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet
|
|
33242
|
+
ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet);
|
|
33794
33243
|
for (_key2 in ret) {
|
|
33795
33244
|
if (_key2 == 'orderlines') {
|
|
33796
33245
|
OrderLinesOfActSet = ret[_key2];
|
|
@@ -33894,8 +33343,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33894
33343
|
});
|
|
33895
33344
|
if (origOrderSet) {
|
|
33896
33345
|
origOrderSet.CatalogName = actOrderSet.CatalogName;
|
|
33346
|
+
origOrderSet.AccountName = actOrderSet.AccountName;
|
|
33347
|
+
origOrderSet.AccountLogo = actOrderSet.AccountLogo;
|
|
33897
33348
|
origOrderSet.CatalogOfflineVersion = actOrderSet.CatalogOfflineVersion;
|
|
33898
33349
|
origOrderSet.CatalogGUID = actOrderSet.CatalogGUID;
|
|
33350
|
+
origOrderSet.CollectionGUID = actOrderSet.CollectionGUID;
|
|
33899
33351
|
origOrderSet.OrderLines = actOrderSet.OrderLines;
|
|
33900
33352
|
origOrderSet.OrderSetDesc = actOrderSet.OrderSetDesc;
|
|
33901
33353
|
origOrderSet.OrigZKATNr = actOrderSet.OrigZKATNr;
|
|
@@ -33908,11 +33360,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33908
33360
|
origOrderSet.BBox = actOrderSet.BBox;
|
|
33909
33361
|
origOrderSet.VariantDescription = actOrderSet.VariantDescription;
|
|
33910
33362
|
if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
|
|
33363
|
+
var _origOrderSet$ConfigV;
|
|
33364
|
+
var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
|
|
33365
|
+
if (!configVariant) return variant;
|
|
33911
33366
|
return _objectSpread$8(_objectSpread$8({}, variant), {}, {
|
|
33912
|
-
SetImage:
|
|
33913
|
-
HQRenderScript:
|
|
33914
|
-
Set2DImage:
|
|
33915
|
-
Diva3DProject:
|
|
33367
|
+
SetImage: configVariant.SetImage,
|
|
33368
|
+
HQRenderScript: configVariant.HQRenderScript,
|
|
33369
|
+
Set2DImage: configVariant.Set2DImage,
|
|
33370
|
+
Diva3DProject: configVariant.Diva3DProject
|
|
33916
33371
|
});
|
|
33917
33372
|
});
|
|
33918
33373
|
}
|
|
@@ -33921,7 +33376,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
33921
33376
|
_loop7();
|
|
33922
33377
|
}
|
|
33923
33378
|
}
|
|
33924
|
-
|
|
33925
33379
|
/**************************SpeicherRoutinen*************************************/
|
|
33926
33380
|
}, {
|
|
33927
33381
|
key: "isNoArticleToSave",
|
|
@@ -34005,7 +33459,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
34005
33459
|
CatalogOfflineFilesLastUpdate: catalogData.offlineFilesLastUpdate,
|
|
34006
33460
|
Description: catalogData.description,
|
|
34007
33461
|
GroupType: GroupType,
|
|
34008
|
-
MainPosNr: posNr,
|
|
34009
33462
|
OfflineData: catalogData.offlineData,
|
|
34010
33463
|
SetArticleNr: set.SetArticleNr ? set.SetArticleNr : catalogData.retailArticleNr,
|
|
34011
33464
|
SetArticleNrPrefix: set.SetArticleNrPrefix,
|
|
@@ -34254,31 +33707,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
34254
33707
|
Info: ((_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 || (_set$api$getI18n$t2 = _set$api$getI18n.t) === null || _set$api$getI18n$t2 === void 0 ? void 0 : _set$api$getI18n$t2.call(_set$api$getI18n, 'utils.width_first_letter', 'B')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'B') + ': ' + dim.X + ' cm x ' + ((_set$api$getI18n$t3 = (_set$api$getI18n2 = set.api.getI18n()) === null || _set$api$getI18n2 === void 0 || (_set$api$getI18n2$t = _set$api$getI18n2.t) === null || _set$api$getI18n2$t === void 0 ? void 0 : _set$api$getI18n2$t.call(_set$api$getI18n2, 'utils.depth_first_letter', 'T')) !== null && _set$api$getI18n$t3 !== void 0 ? _set$api$getI18n$t3 : 'T') + ': ' + dim.Y + ' cm' + (dim.Z ? ' x ' + ((_set$api$getI18n$t4 = (_set$api$getI18n3 = set.api.getI18n()) === null || _set$api$getI18n3 === void 0 || (_set$api$getI18n3$t = _set$api$getI18n3.t) === null || _set$api$getI18n3$t === void 0 ? void 0 : _set$api$getI18n3$t.call(_set$api$getI18n3, 'utils.height_first_letter', 'H')) !== null && _set$api$getI18n$t4 !== void 0 ? _set$api$getI18n$t4 : 'H') + ': ' + dim.X + ' cm' : '')
|
|
34255
33708
|
});
|
|
34256
33709
|
}
|
|
34257
|
-
}, {
|
|
34258
|
-
key: "loadProductsOfSets",
|
|
34259
|
-
value: function () {
|
|
34260
|
-
var _loadProductsOfSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(orderSets, involvedSetIds) {
|
|
34261
|
-
return _regeneratorRuntime.wrap(function _callee34$(_context36) {
|
|
34262
|
-
while (1) switch (_context36.prev = _context36.next) {
|
|
34263
|
-
case 0:
|
|
34264
|
-
_context36.next = 2;
|
|
34265
|
-
return productHandlerInstance.loadProductsOfSets(orderSets, involvedSetIds);
|
|
34266
|
-
case 2:
|
|
34267
|
-
case "end":
|
|
34268
|
-
return _context36.stop();
|
|
34269
|
-
}
|
|
34270
|
-
}, _callee34);
|
|
34271
|
-
}));
|
|
34272
|
-
function loadProductsOfSets(_x113, _x114) {
|
|
34273
|
-
return _loadProductsOfSets.apply(this, arguments);
|
|
34274
|
-
}
|
|
34275
|
-
return loadProductsOfSets;
|
|
34276
|
-
}()
|
|
34277
|
-
}, {
|
|
34278
|
-
key: "addProducts",
|
|
34279
|
-
value: function addProducts(variants, families) {
|
|
34280
|
-
productHandlerInstance.addProducts(variants, families);
|
|
34281
|
-
}
|
|
34282
33710
|
}, {
|
|
34283
33711
|
key: "getAllProducts",
|
|
34284
33712
|
value: function getAllProducts(sets) {
|
|
@@ -34306,28 +33734,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
|
|
|
34306
33734
|
}, {
|
|
34307
33735
|
key: "addOrderSetArticlesToExistingSet",
|
|
34308
33736
|
value: function () {
|
|
34309
|
-
var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
34310
|
-
return _regeneratorRuntime.wrap(function
|
|
34311
|
-
while (1) switch (
|
|
33737
|
+
var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(set, orderSet, lastSetToInitialize) {
|
|
33738
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context36) {
|
|
33739
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
34312
33740
|
case 0:
|
|
34313
33741
|
//TODO: GLOBAL STUFF
|
|
34314
33742
|
//this.updateActSet(set);
|
|
34315
33743
|
orderSet.changeBasketIds();
|
|
34316
|
-
|
|
33744
|
+
_context36.next = 3;
|
|
34317
33745
|
return this.initOrderLineArticles(set, orderSet);
|
|
34318
33746
|
case 3:
|
|
34319
|
-
|
|
33747
|
+
_context36.next = 5;
|
|
34320
33748
|
return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
|
|
34321
33749
|
case 5:
|
|
34322
|
-
_context37.next = 7;
|
|
34323
|
-
return productHandlerInstance.updateProducts(set, 'onAdd');
|
|
34324
|
-
case 7:
|
|
34325
33750
|
case "end":
|
|
34326
|
-
return
|
|
33751
|
+
return _context36.stop();
|
|
34327
33752
|
}
|
|
34328
|
-
},
|
|
33753
|
+
}, _callee34, this);
|
|
34329
33754
|
}));
|
|
34330
|
-
function addOrderSetArticlesToExistingSet(
|
|
33755
|
+
function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
|
|
34331
33756
|
return _addOrderSetArticlesToExistingSet.apply(this, arguments);
|
|
34332
33757
|
}
|
|
34333
33758
|
return addOrderSetArticlesToExistingSet;
|
|
@@ -34652,21 +34077,29 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34652
34077
|
}, {
|
|
34653
34078
|
key: "initProductId",
|
|
34654
34079
|
value: function () {
|
|
34655
|
-
var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(api, productId
|
|
34080
|
+
var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(api, productId) {
|
|
34081
|
+
var result;
|
|
34656
34082
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
34657
34083
|
while (1) switch (_context2.prev = _context2.next) {
|
|
34658
34084
|
case 0:
|
|
34659
34085
|
_context2.next = 2;
|
|
34660
|
-
return this.
|
|
34086
|
+
return this.getProduct(api, productId);
|
|
34661
34087
|
case 2:
|
|
34088
|
+
result = _context2.sent;
|
|
34089
|
+
this.assignNewDivaNr = true;
|
|
34090
|
+
_context2.next = 6;
|
|
34091
|
+
return this.initBasket(api, result.divaNr, {
|
|
34092
|
+
basket: result.configuration
|
|
34093
|
+
}, false);
|
|
34094
|
+
case 6:
|
|
34662
34095
|
return _context2.abrupt("return", _context2.sent);
|
|
34663
|
-
case
|
|
34096
|
+
case 7:
|
|
34664
34097
|
case "end":
|
|
34665
34098
|
return _context2.stop();
|
|
34666
34099
|
}
|
|
34667
34100
|
}, _callee2, this);
|
|
34668
34101
|
}));
|
|
34669
|
-
function initProductId(_x2, _x3
|
|
34102
|
+
function initProductId(_x2, _x3) {
|
|
34670
34103
|
return _initProductId.apply(this, arguments);
|
|
34671
34104
|
}
|
|
34672
34105
|
return initProductId;
|
|
@@ -34712,7 +34145,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34712
34145
|
}
|
|
34713
34146
|
}, _callee3, this);
|
|
34714
34147
|
}));
|
|
34715
|
-
function tryInitFirstCatalog(
|
|
34148
|
+
function tryInitFirstCatalog(_x4) {
|
|
34716
34149
|
return _tryInitFirstCatalog.apply(this, arguments);
|
|
34717
34150
|
}
|
|
34718
34151
|
return tryInitFirstCatalog;
|
|
@@ -34747,7 +34180,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34747
34180
|
}
|
|
34748
34181
|
}, _callee4, this);
|
|
34749
34182
|
}));
|
|
34750
|
-
function createNewDivaNr(
|
|
34183
|
+
function createNewDivaNr(_x5) {
|
|
34751
34184
|
return _createNewDivaNr.apply(this, arguments);
|
|
34752
34185
|
}
|
|
34753
34186
|
return createNewDivaNr;
|
|
@@ -34777,7 +34210,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34777
34210
|
} else {
|
|
34778
34211
|
this.origConfiguration.originDivaNr = divaNr;
|
|
34779
34212
|
}
|
|
34780
|
-
if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && basket.StatusKey == 'BASE_CONFIGURATION') {
|
|
34213
|
+
if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && (basket.StatusKey == 'BASE_CONFIGURATION' || keepOldDivaNr === false)) {
|
|
34781
34214
|
this.assignNewDivaNr = true;
|
|
34782
34215
|
basket.CustomerJourneyId = nanoid();
|
|
34783
34216
|
basket.StatusKey = 'USER_CONFIGURATION';
|
|
@@ -34795,7 +34228,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34795
34228
|
basket.OrderSets[i].SetID = newSetId;
|
|
34796
34229
|
}
|
|
34797
34230
|
}
|
|
34798
|
-
if (!
|
|
34231
|
+
if (!this.assignNewDivaNr) {
|
|
34799
34232
|
_context5.next = 29;
|
|
34800
34233
|
break;
|
|
34801
34234
|
}
|
|
@@ -34875,7 +34308,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34875
34308
|
}
|
|
34876
34309
|
}, _callee5, this);
|
|
34877
34310
|
}));
|
|
34878
|
-
function initBasket(_x7, _x8, _x9, _x10
|
|
34311
|
+
function initBasket(_x6, _x7, _x8, _x9, _x10) {
|
|
34879
34312
|
return _initBasket.apply(this, arguments);
|
|
34880
34313
|
}
|
|
34881
34314
|
return initBasket;
|
|
@@ -34954,7 +34387,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34954
34387
|
}
|
|
34955
34388
|
}, _callee6, this);
|
|
34956
34389
|
}));
|
|
34957
|
-
function loadBasketByCatalogCodex(
|
|
34390
|
+
function loadBasketByCatalogCodex(_x11) {
|
|
34958
34391
|
return _loadBasketByCatalogCodex.apply(this, arguments);
|
|
34959
34392
|
}
|
|
34960
34393
|
return loadBasketByCatalogCodex;
|
|
@@ -34962,7 +34395,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34962
34395
|
}, {
|
|
34963
34396
|
key: "loadBasketByDivaNr",
|
|
34964
34397
|
value: function () {
|
|
34965
|
-
var _loadBasketByDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(api, divaNr
|
|
34398
|
+
var _loadBasketByDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(api, divaNr) {
|
|
34966
34399
|
var variantData;
|
|
34967
34400
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
34968
34401
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -34973,13 +34406,13 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34973
34406
|
case 3:
|
|
34974
34407
|
variantData = _context7.sent;
|
|
34975
34408
|
_context7.next = 6;
|
|
34976
|
-
return this.initBasket(api, divaNr, variantData
|
|
34409
|
+
return this.initBasket(api, divaNr, variantData);
|
|
34977
34410
|
case 6:
|
|
34978
34411
|
return _context7.abrupt("return", _context7.sent);
|
|
34979
34412
|
case 9:
|
|
34980
34413
|
_context7.prev = 9;
|
|
34981
34414
|
_context7.t0 = _context7["catch"](0);
|
|
34982
|
-
LOG$7.error(new DivaError('DivaNr
|
|
34415
|
+
LOG$7.error(new DivaError('DivaNr cannot be found in Database', {
|
|
34983
34416
|
code: 'WC_0004',
|
|
34984
34417
|
custom: {
|
|
34985
34418
|
divaNr: divaNr
|
|
@@ -34992,7 +34425,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
34992
34425
|
}
|
|
34993
34426
|
}, _callee7, this, [[0, 9]]);
|
|
34994
34427
|
}));
|
|
34995
|
-
function loadBasketByDivaNr(
|
|
34428
|
+
function loadBasketByDivaNr(_x12, _x13) {
|
|
34996
34429
|
return _loadBasketByDivaNr.apply(this, arguments);
|
|
34997
34430
|
}
|
|
34998
34431
|
return loadBasketByDivaNr;
|
|
@@ -35005,98 +34438,65 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35005
34438
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
35006
34439
|
while (1) switch (_context8.prev = _context8.next) {
|
|
35007
34440
|
case 0:
|
|
35008
|
-
_context8.
|
|
34441
|
+
_context8.prev = 0;
|
|
34442
|
+
_context8.next = 3;
|
|
35009
34443
|
return api.getDataCache(api.getProductBasketUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
|
|
35010
34444
|
fields: fields !== null && fields !== void 0 && fields.length ? fields : undefined
|
|
35011
34445
|
});
|
|
35012
|
-
case
|
|
34446
|
+
case 3:
|
|
35013
34447
|
variantData = _context8.sent;
|
|
35014
34448
|
if (!(variantData.Error || !variantData.basket)) {
|
|
35015
|
-
_context8.next =
|
|
34449
|
+
_context8.next = 9;
|
|
35016
34450
|
break;
|
|
35017
34451
|
}
|
|
35018
|
-
LOG$7.error(new DivaError('
|
|
34452
|
+
LOG$7.error(new DivaError('CustomProductId cannot be found in Database', {
|
|
35019
34453
|
code: 'WC_0005',
|
|
35020
34454
|
custom: {
|
|
34455
|
+
key: key,
|
|
35021
34456
|
productId: productId
|
|
35022
34457
|
}
|
|
35023
34458
|
}));
|
|
35024
34459
|
return _context8.abrupt("return", false);
|
|
35025
|
-
case 8:
|
|
35026
|
-
return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
|
|
35027
34460
|
case 9:
|
|
34461
|
+
return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
|
|
34462
|
+
case 10:
|
|
34463
|
+
_context8.next = 16;
|
|
34464
|
+
break;
|
|
34465
|
+
case 12:
|
|
34466
|
+
_context8.prev = 12;
|
|
34467
|
+
_context8.t0 = _context8["catch"](0);
|
|
34468
|
+
LOG$7.error(new DivaError('Error while fetching product data', {
|
|
34469
|
+
code: 'WC_0005',
|
|
34470
|
+
custom: {
|
|
34471
|
+
productId: productId
|
|
34472
|
+
}
|
|
34473
|
+
}));
|
|
34474
|
+
return _context8.abrupt("return", false);
|
|
34475
|
+
case 16:
|
|
35028
34476
|
case "end":
|
|
35029
34477
|
return _context8.stop();
|
|
35030
34478
|
}
|
|
35031
|
-
}, _callee8, this);
|
|
34479
|
+
}, _callee8, this, [[0, 12]]);
|
|
35032
34480
|
}));
|
|
35033
|
-
function loadBasketByCustomProductId(
|
|
34481
|
+
function loadBasketByCustomProductId(_x14, _x15, _x16, _x17) {
|
|
35034
34482
|
return _loadBasketByCustomProductId.apply(this, arguments);
|
|
35035
34483
|
}
|
|
35036
34484
|
return loadBasketByCustomProductId;
|
|
35037
34485
|
}()
|
|
35038
34486
|
}, {
|
|
35039
|
-
key: "
|
|
34487
|
+
key: "getProduct",
|
|
35040
34488
|
value: function () {
|
|
35041
|
-
var
|
|
35042
|
-
var result
|
|
34489
|
+
var _getProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(api, productId) {
|
|
34490
|
+
var result;
|
|
35043
34491
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
35044
34492
|
while (1) switch (_context9.prev = _context9.next) {
|
|
35045
34493
|
case 0:
|
|
35046
34494
|
_context9.next = 2;
|
|
35047
|
-
return this.getProduct(api, productId);
|
|
35048
|
-
case 2:
|
|
35049
|
-
result = _context9.sent;
|
|
35050
|
-
if (!(result === false)) {
|
|
35051
|
-
_context9.next = 5;
|
|
35052
|
-
break;
|
|
35053
|
-
}
|
|
35054
|
-
return _context9.abrupt("return", false);
|
|
35055
|
-
case 5:
|
|
35056
|
-
divaNr = result.divaNr;
|
|
35057
|
-
if (result.originDivaNr) {
|
|
35058
|
-
divaNr = result.originDivaNr;
|
|
35059
|
-
} else if (result.variantId !== undefined) {
|
|
35060
|
-
id = result.variantId;
|
|
35061
|
-
divaNr = result.divaNr + '_' + id.toString().padStart(4, '0');
|
|
35062
|
-
}
|
|
35063
|
-
_context9.next = 9;
|
|
35064
|
-
return this.loadBasketByDivaNr(api, divaNr, keepOldDivaNr, productId);
|
|
35065
|
-
case 9:
|
|
35066
|
-
successfully = _context9.sent;
|
|
35067
|
-
result.type = 'ProductId';
|
|
35068
|
-
if (!successfully) {
|
|
35069
|
-
_context9.next = 15;
|
|
35070
|
-
break;
|
|
35071
|
-
}
|
|
35072
|
-
return _context9.abrupt("return", result);
|
|
35073
|
-
case 15:
|
|
35074
|
-
return _context9.abrupt("return", false);
|
|
35075
|
-
case 16:
|
|
35076
|
-
case "end":
|
|
35077
|
-
return _context9.stop();
|
|
35078
|
-
}
|
|
35079
|
-
}, _callee9, this);
|
|
35080
|
-
}));
|
|
35081
|
-
function loadProduct(_x21, _x22, _x23) {
|
|
35082
|
-
return _loadProduct.apply(this, arguments);
|
|
35083
|
-
}
|
|
35084
|
-
return loadProduct;
|
|
35085
|
-
}()
|
|
35086
|
-
}, {
|
|
35087
|
-
key: "getProduct",
|
|
35088
|
-
value: function () {
|
|
35089
|
-
var _getProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(api, productId) {
|
|
35090
|
-
var result;
|
|
35091
|
-
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
35092
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
35093
|
-
case 0:
|
|
35094
|
-
_context10.next = 2;
|
|
35095
34495
|
return api.getDataCache(api.getProductUrl(productId), undefined, undefined, 'catalog');
|
|
35096
34496
|
case 2:
|
|
35097
|
-
result =
|
|
34497
|
+
result = _context9.sent;
|
|
35098
34498
|
if (!(result.Error || !result)) {
|
|
35099
|
-
|
|
34499
|
+
_context9.next = 6;
|
|
35100
34500
|
break;
|
|
35101
34501
|
}
|
|
35102
34502
|
LOG$7.error(new DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
|
|
@@ -35105,16 +34505,16 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35105
34505
|
productId: productId
|
|
35106
34506
|
}
|
|
35107
34507
|
}));
|
|
35108
|
-
return
|
|
34508
|
+
return _context9.abrupt("return", false);
|
|
35109
34509
|
case 6:
|
|
35110
|
-
return
|
|
34510
|
+
return _context9.abrupt("return", result[0]);
|
|
35111
34511
|
case 7:
|
|
35112
34512
|
case "end":
|
|
35113
|
-
return
|
|
34513
|
+
return _context9.stop();
|
|
35114
34514
|
}
|
|
35115
|
-
},
|
|
34515
|
+
}, _callee9);
|
|
35116
34516
|
}));
|
|
35117
|
-
function getProduct(
|
|
34517
|
+
function getProduct(_x18, _x19) {
|
|
35118
34518
|
return _getProduct.apply(this, arguments);
|
|
35119
34519
|
}
|
|
35120
34520
|
return getProduct;
|
|
@@ -35122,15 +34522,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35122
34522
|
}, {
|
|
35123
34523
|
key: "createNewBasket",
|
|
35124
34524
|
value: function () {
|
|
35125
|
-
var _createNewBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
34525
|
+
var _createNewBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(api, initObject, divaNr, lang) {
|
|
35126
34526
|
var setId, orderSet, basketInitObejct, basket;
|
|
35127
|
-
return _regeneratorRuntime.wrap(function
|
|
35128
|
-
while (1) switch (
|
|
34527
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
34528
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
35129
34529
|
case 0:
|
|
35130
34530
|
setId = 'PLANNING_' + Math.random().toString(36).substring(6);
|
|
35131
34531
|
orderSet = new OrderSetData({
|
|
35132
34532
|
SetID: setId,
|
|
35133
|
-
MainPosNr: 1,
|
|
35134
34533
|
AccountSessionGUID: initObject.accountSessionGuid,
|
|
35135
34534
|
CatalogCodex: initObject.catalogCodex,
|
|
35136
34535
|
CatalogGUID: initObject.catalogGuid,
|
|
@@ -35138,10 +34537,10 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35138
34537
|
Favorites: new Favorites()
|
|
35139
34538
|
});
|
|
35140
34539
|
if (!(initObject.accountGuid && !orderSet.AccountSessionGUID)) {
|
|
35141
|
-
|
|
34540
|
+
_context10.next = 5;
|
|
35142
34541
|
break;
|
|
35143
34542
|
}
|
|
35144
|
-
|
|
34543
|
+
_context10.next = 5;
|
|
35145
34544
|
return api.setAccountSessionGuid({
|
|
35146
34545
|
os: orderSet,
|
|
35147
34546
|
accountGuid: initObject.accountGuid,
|
|
@@ -35159,14 +34558,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35159
34558
|
CustomerJourneyId: nanoid()
|
|
35160
34559
|
};
|
|
35161
34560
|
basket = new BasketData(basketInitObejct);
|
|
35162
|
-
return
|
|
34561
|
+
return _context10.abrupt("return", basket);
|
|
35163
34562
|
case 8:
|
|
35164
34563
|
case "end":
|
|
35165
|
-
return
|
|
34564
|
+
return _context10.stop();
|
|
35166
34565
|
}
|
|
35167
|
-
},
|
|
34566
|
+
}, _callee10);
|
|
35168
34567
|
}));
|
|
35169
|
-
function createNewBasket(
|
|
34568
|
+
function createNewBasket(_x20, _x21, _x22, _x23) {
|
|
35170
34569
|
return _createNewBasket.apply(this, arguments);
|
|
35171
34570
|
}
|
|
35172
34571
|
return createNewBasket;
|
|
@@ -35185,11 +34584,11 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35185
34584
|
}, {
|
|
35186
34585
|
key: "saveToBasket",
|
|
35187
34586
|
value: function () {
|
|
35188
|
-
var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
34587
|
+
var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(api, actBasket, returnTo) {
|
|
35189
34588
|
var _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt;
|
|
35190
34589
|
var response;
|
|
35191
|
-
return _regeneratorRuntime.wrap(function
|
|
35192
|
-
while (1) switch (
|
|
34590
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
34591
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
35193
34592
|
case 0:
|
|
35194
34593
|
LOG$7.startTransaction({
|
|
35195
34594
|
event: 'SaveBasketOnAPI',
|
|
@@ -35201,12 +34600,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35201
34600
|
actBasket.ReportConfigIdentifier = api.getReportConfigIdentifier();
|
|
35202
34601
|
actBasket.PrintOptions = api.getPrintOptions(this.reportConfig);
|
|
35203
34602
|
actBasket.ClientLanguage = api.getLanguage();
|
|
35204
|
-
|
|
34603
|
+
_context11.next = 8;
|
|
35205
34604
|
return DivaUtils.updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, this.plannerConfig.settings.keepSalesPersonDataInBasket);
|
|
35206
34605
|
case 8:
|
|
35207
34606
|
actBasket.UserLanguage = api.getLanguage();
|
|
35208
34607
|
actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
|
|
35209
|
-
|
|
34608
|
+
_context11.next = 12;
|
|
35210
34609
|
return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
|
|
35211
34610
|
jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
|
|
35212
34611
|
basket: actBasket,
|
|
@@ -35215,30 +34614,30 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35215
34614
|
apiKey: api.getApiKey()
|
|
35216
34615
|
});
|
|
35217
34616
|
case 12:
|
|
35218
|
-
response =
|
|
34617
|
+
response = _context11.sent;
|
|
35219
34618
|
if (!(response != 'ERROR_NO_BASKET_SAVED')) {
|
|
35220
|
-
|
|
34619
|
+
_context11.next = 17;
|
|
35221
34620
|
break;
|
|
35222
34621
|
}
|
|
35223
34622
|
this.baskets[this.actDivaNr] = new BasketData(response);
|
|
35224
|
-
|
|
34623
|
+
_context11.next = 19;
|
|
35225
34624
|
break;
|
|
35226
34625
|
case 17:
|
|
35227
34626
|
if (!(response === 'ERROR_NO_BASKET_SAVED' || response === 'ERROR_BASKET_AFTER_SAVE')) {
|
|
35228
|
-
|
|
34627
|
+
_context11.next = 19;
|
|
35229
34628
|
break;
|
|
35230
34629
|
}
|
|
35231
|
-
return
|
|
34630
|
+
return _context11.abrupt("return", response);
|
|
35232
34631
|
case 19:
|
|
35233
34632
|
LOG$7.successTransaction('saveBasketOnAPI');
|
|
35234
|
-
return
|
|
34633
|
+
return _context11.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
|
|
35235
34634
|
case 21:
|
|
35236
34635
|
case "end":
|
|
35237
|
-
return
|
|
34636
|
+
return _context11.stop();
|
|
35238
34637
|
}
|
|
35239
|
-
},
|
|
34638
|
+
}, _callee11, this);
|
|
35240
34639
|
}));
|
|
35241
|
-
function saveToBasket(
|
|
34640
|
+
function saveToBasket(_x24, _x25, _x26) {
|
|
35242
34641
|
return _saveToBasket.apply(this, arguments);
|
|
35243
34642
|
}
|
|
35244
34643
|
return saveToBasket;
|
|
@@ -35351,61 +34750,53 @@ var DivaBasketHandler = /*#__PURE__*/function () {
|
|
|
35351
34750
|
}, {
|
|
35352
34751
|
key: "initWWSClient",
|
|
35353
34752
|
value: function () {
|
|
35354
|
-
var _initWWSClient = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
35355
|
-
var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4,
|
|
35356
|
-
return _regeneratorRuntime.wrap(function
|
|
35357
|
-
while (1) switch (
|
|
34753
|
+
var _initWWSClient = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(wwsClient) {
|
|
34754
|
+
var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, StandardWWSHandler;
|
|
34755
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
34756
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
35358
34757
|
case 0:
|
|
35359
|
-
|
|
35360
|
-
|
|
34758
|
+
_context12.t0 = wwsClient;
|
|
34759
|
+
_context12.next = _context12.t0 === 'Pfister' ? 3 : _context12.t0 === 'Livique' ? 9 : _context12.t0 === 'Serious' ? 15 : 21;
|
|
35361
34760
|
break;
|
|
35362
34761
|
case 3:
|
|
35363
|
-
|
|
35364
|
-
return import('./PfisterWWSHandler-
|
|
34762
|
+
_context12.next = 5;
|
|
34763
|
+
return import('./PfisterWWSHandler-3ab3de4e.js');
|
|
35365
34764
|
case 5:
|
|
35366
|
-
_yield$import =
|
|
34765
|
+
_yield$import = _context12.sent;
|
|
35367
34766
|
PfisterWWSHandler = _yield$import["default"];
|
|
35368
34767
|
this._divaWWSHandler = new PfisterWWSHandler();
|
|
35369
|
-
return
|
|
34768
|
+
return _context12.abrupt("break", 27);
|
|
35370
34769
|
case 9:
|
|
35371
|
-
|
|
35372
|
-
return import('./LiviqueWWSHandler-
|
|
34770
|
+
_context12.next = 11;
|
|
34771
|
+
return import('./LiviqueWWSHandler-049eb5fd.js');
|
|
35373
34772
|
case 11:
|
|
35374
|
-
_yield$import2 =
|
|
34773
|
+
_yield$import2 = _context12.sent;
|
|
35375
34774
|
LiviqueWWSHandler = _yield$import2["default"];
|
|
35376
34775
|
this._divaWWSHandler = new LiviqueWWSHandler();
|
|
35377
|
-
return
|
|
34776
|
+
return _context12.abrupt("break", 27);
|
|
35378
34777
|
case 15:
|
|
35379
|
-
|
|
35380
|
-
return import('./SeriousBasketHandler-
|
|
34778
|
+
_context12.next = 17;
|
|
34779
|
+
return import('./SeriousBasketHandler-53dd21ff.js');
|
|
35381
34780
|
case 17:
|
|
35382
|
-
_yield$import3 =
|
|
34781
|
+
_yield$import3 = _context12.sent;
|
|
35383
34782
|
SeriousWWSHandler = _yield$import3["default"];
|
|
35384
34783
|
this._divaWWSHandler = new SeriousWWSHandler();
|
|
35385
|
-
return
|
|
34784
|
+
return _context12.abrupt("break", 27);
|
|
35386
34785
|
case 21:
|
|
35387
|
-
|
|
35388
|
-
return import('./
|
|
34786
|
+
_context12.next = 23;
|
|
34787
|
+
return import('./StandardWWSHandler-385a2299.js');
|
|
35389
34788
|
case 23:
|
|
35390
|
-
_yield$import4 =
|
|
35391
|
-
|
|
35392
|
-
this._divaWWSHandler = new ProductWWSHandler();
|
|
35393
|
-
return _context13.abrupt("break", 33);
|
|
35394
|
-
case 27:
|
|
35395
|
-
_context13.next = 29;
|
|
35396
|
-
return import('./StandardWWSHandler-b903e37c.js');
|
|
35397
|
-
case 29:
|
|
35398
|
-
_yield$import5 = _context13.sent;
|
|
35399
|
-
StandardWWSHandler = _yield$import5["default"];
|
|
34789
|
+
_yield$import4 = _context12.sent;
|
|
34790
|
+
StandardWWSHandler = _yield$import4["default"];
|
|
35400
34791
|
this._divaWWSHandler = new StandardWWSHandler();
|
|
35401
|
-
return
|
|
35402
|
-
case
|
|
34792
|
+
return _context12.abrupt("break", 27);
|
|
34793
|
+
case 27:
|
|
35403
34794
|
case "end":
|
|
35404
|
-
return
|
|
34795
|
+
return _context12.stop();
|
|
35405
34796
|
}
|
|
35406
|
-
},
|
|
34797
|
+
}, _callee12, this);
|
|
35407
34798
|
}));
|
|
35408
|
-
function initWWSClient(
|
|
34799
|
+
function initWWSClient(_x27) {
|
|
35409
34800
|
return _initWWSClient.apply(this, arguments);
|
|
35410
34801
|
}
|
|
35411
34802
|
return initWWSClient;
|
|
@@ -36008,7 +35399,7 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36008
35399
|
this.creationTime = new Date();
|
|
36009
35400
|
this.layerMaskThreeTexture = undefined;
|
|
36010
35401
|
this.hasStaticBackground = hasStaticBG;
|
|
36011
|
-
this.mediaServiceSaveMode = mediaServiceSaveMode;
|
|
35402
|
+
this.mediaServiceSaveMode = mediaServiceSaveMode !== null && mediaServiceSaveMode !== void 0 ? mediaServiceSaveMode : 'STREAM';
|
|
36012
35403
|
this.urlToSavedRendering = '';
|
|
36013
35404
|
this.catalogData = {
|
|
36014
35405
|
catalogCodex: '',
|
|
@@ -36053,12 +35444,12 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36053
35444
|
}, {
|
|
36054
35445
|
key: "getHasStaticBackground",
|
|
36055
35446
|
value: function getHasStaticBackground() {
|
|
36056
|
-
return this.hasStaticBackground;
|
|
35447
|
+
return !!this.hasStaticBackground;
|
|
36057
35448
|
}
|
|
36058
35449
|
}, {
|
|
36059
35450
|
key: "getIsFullscreenRendering",
|
|
36060
35451
|
value: function getIsFullscreenRendering() {
|
|
36061
|
-
return this.isFullscreenRendering;
|
|
35452
|
+
return !!this.isFullscreenRendering;
|
|
36062
35453
|
}
|
|
36063
35454
|
}, {
|
|
36064
35455
|
key: "setIsFullscreenRendering",
|
|
@@ -36068,12 +35459,13 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36068
35459
|
}, {
|
|
36069
35460
|
key: "getHasDimensionLines",
|
|
36070
35461
|
value: function getHasDimensionLines() {
|
|
36071
|
-
return this.hasDimensionLines;
|
|
35462
|
+
return !!this.hasDimensionLines;
|
|
36072
35463
|
}
|
|
36073
35464
|
}, {
|
|
36074
35465
|
key: "getPlannerMeasureDigits",
|
|
36075
35466
|
value: function getPlannerMeasureDigits() {
|
|
36076
|
-
|
|
35467
|
+
var _this$plannerMeasureD;
|
|
35468
|
+
return (_this$plannerMeasureD = this.plannerMeasureDigits) !== null && _this$plannerMeasureD !== void 0 ? _this$plannerMeasureD : 0;
|
|
36077
35469
|
}
|
|
36078
35470
|
}, {
|
|
36079
35471
|
key: "getIsAlternateRendering",
|
|
@@ -36293,6 +35685,7 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36293
35685
|
return this.catalogData.catalogCodex;
|
|
36294
35686
|
},
|
|
36295
35687
|
set: function set(val) {
|
|
35688
|
+
if (!val) return;
|
|
36296
35689
|
this.catalogData.catalogCodex = val;
|
|
36297
35690
|
}
|
|
36298
35691
|
}, {
|
|
@@ -36301,6 +35694,7 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36301
35694
|
return this.catalogData.catalogGUID;
|
|
36302
35695
|
},
|
|
36303
35696
|
set: function set(val) {
|
|
35697
|
+
if (!val) return;
|
|
36304
35698
|
this.catalogData.catalogGUID = val;
|
|
36305
35699
|
}
|
|
36306
35700
|
}, {
|
|
@@ -36324,7 +35718,7 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36324
35718
|
}, {
|
|
36325
35719
|
key: "HasLayerMask",
|
|
36326
35720
|
get: function get() {
|
|
36327
|
-
return this.hasLayerMask;
|
|
35721
|
+
return !!this.hasLayerMask;
|
|
36328
35722
|
},
|
|
36329
35723
|
set: function set(hasLayerMask) {
|
|
36330
35724
|
this.hasLayerMask = hasLayerMask;
|
|
@@ -36332,17 +35726,19 @@ var Rendering = /*#__PURE__*/function () {
|
|
|
36332
35726
|
}, {
|
|
36333
35727
|
key: "RenderWidth",
|
|
36334
35728
|
get: function get() {
|
|
36335
|
-
|
|
35729
|
+
var _this$renderWidth;
|
|
35730
|
+
return (_this$renderWidth = this.renderWidth) !== null && _this$renderWidth !== void 0 ? _this$renderWidth : 0;
|
|
36336
35731
|
}
|
|
36337
35732
|
}, {
|
|
36338
35733
|
key: "RenderHeight",
|
|
36339
35734
|
get: function get() {
|
|
36340
|
-
|
|
35735
|
+
var _this$renderHeight;
|
|
35736
|
+
return (_this$renderHeight = this.renderHeight) !== null && _this$renderHeight !== void 0 ? _this$renderHeight : 0;
|
|
36341
35737
|
}
|
|
36342
35738
|
}, {
|
|
36343
35739
|
key: "getHasLayerMask",
|
|
36344
35740
|
value: function getHasLayerMask() {
|
|
36345
|
-
return this.hasLayerMask;
|
|
35741
|
+
return !!this.hasLayerMask;
|
|
36346
35742
|
}
|
|
36347
35743
|
}, {
|
|
36348
35744
|
key: "getLayerMaskForSrc",
|
|
@@ -36778,7 +36174,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
|
|
|
36778
36174
|
while (1) switch (_context3.prev = _context3.next) {
|
|
36779
36175
|
case 0:
|
|
36780
36176
|
_context3.next = 2;
|
|
36781
|
-
return import('./Host3DSignalR-
|
|
36177
|
+
return import('./Host3DSignalR-42b4d1d2.js');
|
|
36782
36178
|
case 2:
|
|
36783
36179
|
_yield$import = _context3.sent;
|
|
36784
36180
|
Host3DSignalR = _yield$import["default"];
|
|
@@ -38330,7 +37726,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
|
|
|
38330
37726
|
break;
|
|
38331
37727
|
case 8:
|
|
38332
37728
|
_context4.next = 10;
|
|
38333
|
-
return import('./DivaStandardPlanner-
|
|
37729
|
+
return import('./DivaStandardPlanner-7d18b2c2.js');
|
|
38334
37730
|
case 10:
|
|
38335
37731
|
_yield$import = _context4.sent;
|
|
38336
37732
|
DivaStandardPlanner = _yield$import["default"];
|
|
@@ -38341,7 +37737,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
|
|
|
38341
37737
|
return _context4.abrupt("break", 21);
|
|
38342
37738
|
case 15:
|
|
38343
37739
|
_context4.next = 17;
|
|
38344
|
-
return import('./DivaBoxPlanner-
|
|
37740
|
+
return import('./DivaBoxPlanner-0f855505.js');
|
|
38345
37741
|
case 17:
|
|
38346
37742
|
_yield$import2 = _context4.sent;
|
|
38347
37743
|
DivaBoxPlanner = _yield$import2["default"];
|
|
@@ -38475,6 +37871,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
|
|
|
38475
37871
|
key: "getSetImageAsUrl",
|
|
38476
37872
|
value: (function () {
|
|
38477
37873
|
var _getSetImageAsUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(setId) {
|
|
37874
|
+
var _rendering$get3DDimIn, _rendering$get3DDimIn2, _rendering$get3DDimIn3;
|
|
38478
37875
|
var rendering;
|
|
38479
37876
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
38480
37877
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -38487,9 +37884,9 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
|
|
|
38487
37884
|
return _context6.abrupt("return", {
|
|
38488
37885
|
url: rendering === null || rendering === void 0 ? void 0 : rendering.UrlToSavedRendering,
|
|
38489
37886
|
dimensions: {
|
|
38490
|
-
w: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w,
|
|
38491
|
-
h: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h,
|
|
38492
|
-
d: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d
|
|
37887
|
+
w: ((_rendering$get3DDimIn = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w) !== null && _rendering$get3DDimIn !== void 0 ? _rendering$get3DDimIn : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w : undefined,
|
|
37888
|
+
h: ((_rendering$get3DDimIn2 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h) !== null && _rendering$get3DDimIn2 !== void 0 ? _rendering$get3DDimIn2 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h : undefined,
|
|
37889
|
+
d: ((_rendering$get3DDimIn3 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d) !== null && _rendering$get3DDimIn3 !== void 0 ? _rendering$get3DDimIn3 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d : undefined
|
|
38493
37890
|
}
|
|
38494
37891
|
});
|
|
38495
37892
|
case 5:
|
|
@@ -39486,7 +38883,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39486
38883
|
//Do also pass the correct price format
|
|
39487
38884
|
(_this$actions = _this.actions) === null || _this$actions === void 0 || (_this$actions$toggleL = _this$actions.toggleLoading) === null || _this$actions$toggleL === void 0 || _this$actions$toggleL.call(_this$actions, 'SUMMARY');
|
|
39488
38885
|
_context2.next = 6;
|
|
39489
|
-
return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this)
|
|
38886
|
+
return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this));
|
|
39490
38887
|
case 6:
|
|
39491
38888
|
summaryItems = _context2.sent;
|
|
39492
38889
|
(_this$updateSummaryIt = _this.updateSummaryItems) === null || _this$updateSummaryIt === void 0 || _this$updateSummaryIt.call(_this, summaryItems, setPriceFormat, summaryHandlerInstance.getSummaryStepWarning(_this.actSet(), summaryItems));
|
|
@@ -39571,11 +38968,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39571
38968
|
_this.updateViewButtonsDependigOnConfigStructure();
|
|
39572
38969
|
baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
|
|
39573
38970
|
if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
|
|
39574
|
-
|
|
38971
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
|
|
38972
|
+
_context3.next = 30;
|
|
39575
38973
|
return _this.checkVariantData();
|
|
39576
|
-
case 29:
|
|
39577
|
-
return _context3.abrupt("return", 'ElementAdded');
|
|
39578
38974
|
case 30:
|
|
38975
|
+
return _context3.abrupt("return", 'ElementAdded');
|
|
38976
|
+
case 31:
|
|
39579
38977
|
case "end":
|
|
39580
38978
|
return _context3.stop();
|
|
39581
38979
|
}
|
|
@@ -39655,8 +39053,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39655
39053
|
(_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
|
|
39656
39054
|
_this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
|
|
39657
39055
|
}
|
|
39056
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
|
|
39057
|
+
_this.checkVariantData();
|
|
39658
39058
|
return _context5.abrupt("return", retVal);
|
|
39659
|
-
case
|
|
39059
|
+
case 10:
|
|
39660
39060
|
case "end":
|
|
39661
39061
|
return _context5.stop();
|
|
39662
39062
|
}
|
|
@@ -39700,7 +39100,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39700
39100
|
_this.updateViewButtonsDependigOnConfigStructure();
|
|
39701
39101
|
(_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
|
|
39702
39102
|
_this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
|
|
39703
|
-
|
|
39103
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
|
|
39104
|
+
_this.checkVariantData();
|
|
39105
|
+
case 11:
|
|
39704
39106
|
case "end":
|
|
39705
39107
|
return _context6.stop();
|
|
39706
39108
|
}
|
|
@@ -39758,22 +39160,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39758
39160
|
_defineProperty(this, "updateAccessoireQuantity", /*#__PURE__*/function () {
|
|
39759
39161
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle) {
|
|
39760
39162
|
var _this$actions11, _this$actions11$toggl, _this$actions12, _this$actions12$toggl;
|
|
39761
|
-
var ret;
|
|
39163
|
+
var set, ret;
|
|
39762
39164
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
39763
39165
|
while (1) switch (_context8.prev = _context8.next) {
|
|
39764
39166
|
case 0:
|
|
39167
|
+
set = _this.actSet();
|
|
39765
39168
|
(_this$actions11 = _this.actions) === null || _this$actions11 === void 0 || (_this$actions11$toggl = _this$actions11.toggleLoading) === null || _this$actions11$toggl === void 0 || _this$actions11$toggl.call(_this$actions11, 'LoadingArticles_' + accessoireItem.articleCodex, false, true);
|
|
39766
|
-
_context8.next =
|
|
39767
|
-
return setHandlerInstance.updateAccessoireQuantity(
|
|
39768
|
-
case
|
|
39169
|
+
_context8.next = 4;
|
|
39170
|
+
return setHandlerInstance.updateAccessoireQuantity(set, accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
|
|
39171
|
+
case 4:
|
|
39769
39172
|
ret = _context8.sent;
|
|
39770
39173
|
(_this$actions12 = _this.actions) === null || _this$actions12 === void 0 || (_this$actions12$toggl = _this$actions12.toggleLoading) === null || _this$actions12$toggl === void 0 || _this$actions12$toggl.call(_this$actions12, 'LoadingArticles_' + accessoireItem.articleCodex, false, false);
|
|
39771
39174
|
if (ret.somethingChanged) _this.updateConfigStructure();
|
|
39772
39175
|
_this.updatePlannerView('UPDATE_ACC_QUANTITY');
|
|
39773
39176
|
_this.updatePriceInView();
|
|
39774
39177
|
_this.updateViewButtonsDependigOnConfigStructure();
|
|
39178
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
|
|
39775
39179
|
_this.checkVariantData();
|
|
39776
|
-
case
|
|
39180
|
+
case 12:
|
|
39777
39181
|
case "end":
|
|
39778
39182
|
return _context8.stop();
|
|
39779
39183
|
}
|
|
@@ -39801,9 +39205,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39801
39205
|
_this.updatePriceInView();
|
|
39802
39206
|
_this.updateViewButtonsDependigOnConfigStructure();
|
|
39803
39207
|
}
|
|
39208
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
|
|
39804
39209
|
_this.checkVariantData();
|
|
39805
39210
|
return _context9.abrupt("return", wasDeleted);
|
|
39806
|
-
case
|
|
39211
|
+
case 8:
|
|
39807
39212
|
case "end":
|
|
39808
39213
|
return _context9.stop();
|
|
39809
39214
|
}
|
|
@@ -39885,9 +39290,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39885
39290
|
returnValues = _context11.sent;
|
|
39886
39291
|
(_this$actions14 = _this.actions) === null || _this$actions14 === void 0 || (_this$actions14$toggl = _this$actions14.toggleLoading) === null || _this$actions14$toggl === void 0 || _this$actions14$toggl.call(_this$actions14, 'doConfigure', false, false);
|
|
39887
39292
|
structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
|
|
39293
|
+
productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
|
|
39888
39294
|
_this.checkVariantData();
|
|
39889
39295
|
if (dontUpdatePlannerView) {
|
|
39890
|
-
_context11.next =
|
|
39296
|
+
_context11.next = 19;
|
|
39891
39297
|
break;
|
|
39892
39298
|
}
|
|
39893
39299
|
_this.updateConfiguratorStructure(structure);
|
|
@@ -39901,16 +39307,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
39901
39307
|
_this.updateViewButtonsDependigOnConfigStructure();
|
|
39902
39308
|
_this.updatePlannerView('DO_CONFIGURE', myValues);
|
|
39903
39309
|
_this.updateWebConfiguratorTitle();
|
|
39904
|
-
_context11.next =
|
|
39310
|
+
_context11.next = 19;
|
|
39905
39311
|
return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
|
|
39906
|
-
case
|
|
39312
|
+
case 19:
|
|
39907
39313
|
if (dontCallEvents) {
|
|
39908
|
-
_context11.next =
|
|
39314
|
+
_context11.next = 22;
|
|
39909
39315
|
break;
|
|
39910
39316
|
}
|
|
39911
|
-
_context11.next =
|
|
39317
|
+
_context11.next = 22;
|
|
39912
39318
|
return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
|
|
39913
|
-
case
|
|
39319
|
+
case 22:
|
|
39914
39320
|
case "end":
|
|
39915
39321
|
return _context11.stop();
|
|
39916
39322
|
}
|
|
@@ -40036,11 +39442,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40036
39442
|
case 12:
|
|
40037
39443
|
loadSuccessful = _context13.sent;
|
|
40038
39444
|
if (!loadSuccessful) {
|
|
40039
|
-
_context13.next =
|
|
39445
|
+
_context13.next = 58;
|
|
40040
39446
|
break;
|
|
40041
39447
|
}
|
|
40042
39448
|
if (!(typeof loadSuccessful != 'boolean')) {
|
|
40043
|
-
_context13.next =
|
|
39449
|
+
_context13.next = 25;
|
|
40044
39450
|
break;
|
|
40045
39451
|
}
|
|
40046
39452
|
if (!(loadSuccessful.type == 'ProductList')) {
|
|
@@ -40057,53 +39463,49 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40057
39463
|
(_this$actions15 = this.actions) === null || _this$actions15 === void 0 || (_this$actions15$toggl = _this$actions15.toggleLoading) === null || _this$actions15$toggl === void 0 || _this$actions15$toggl.call(_this$actions15, 'Planner_Loading', false, false);
|
|
40058
39464
|
return _context13.abrupt("return", true);
|
|
40059
39465
|
case 23:
|
|
40060
|
-
|
|
40061
|
-
|
|
40062
|
-
|
|
40063
|
-
|
|
40064
|
-
|
|
40065
|
-
// this.divaBasketHandler.actBasket.SetPlannerInfos?.InvolvedSetIds,
|
|
40066
|
-
// );
|
|
40067
|
-
//}
|
|
40068
|
-
|
|
39466
|
+
_context13.next = 26;
|
|
39467
|
+
break;
|
|
39468
|
+
case 25:
|
|
39469
|
+
if (this.api.doCheckForProductsPrice()) ;
|
|
39470
|
+
case 26:
|
|
40069
39471
|
this.divaNr = this.divaBasketHandler.actDivaNr;
|
|
40070
39472
|
initSetState = this.getInitStateForSet();
|
|
40071
39473
|
this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
|
|
40072
|
-
_context13.next =
|
|
39474
|
+
_context13.next = 31;
|
|
40073
39475
|
return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
|
|
40074
|
-
case
|
|
39476
|
+
case 31:
|
|
40075
39477
|
set = this.actSet();
|
|
40076
39478
|
if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
|
|
40077
|
-
_context13.next =
|
|
39479
|
+
_context13.next = 43;
|
|
40078
39480
|
break;
|
|
40079
39481
|
}
|
|
40080
39482
|
if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
|
|
40081
|
-
_context13.next =
|
|
39483
|
+
_context13.next = 38;
|
|
40082
39484
|
break;
|
|
40083
39485
|
}
|
|
40084
39486
|
products = loadSuccessful;
|
|
40085
39487
|
set === null || set === void 0 || set.remindPriceForHash(products);
|
|
40086
|
-
_context13.next =
|
|
39488
|
+
_context13.next = 43;
|
|
40087
39489
|
break;
|
|
40088
|
-
case
|
|
39490
|
+
case 38:
|
|
40089
39491
|
if (!this.divaBasketHandler.actBasket.OrigProductId) {
|
|
40090
|
-
_context13.next =
|
|
39492
|
+
_context13.next = 43;
|
|
40091
39493
|
break;
|
|
40092
39494
|
}
|
|
40093
|
-
_context13.next =
|
|
39495
|
+
_context13.next = 41;
|
|
40094
39496
|
return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
|
|
40095
|
-
case
|
|
39497
|
+
case 41:
|
|
40096
39498
|
result = _context13.sent;
|
|
40097
39499
|
if (result) {
|
|
40098
39500
|
set === null || set === void 0 || set.remindPriceForHash(result);
|
|
40099
39501
|
}
|
|
40100
|
-
case
|
|
40101
|
-
_context13.next =
|
|
39502
|
+
case 43:
|
|
39503
|
+
_context13.next = 45;
|
|
40102
39504
|
return viewReadyPromise;
|
|
40103
|
-
case
|
|
40104
|
-
_context13.next =
|
|
39505
|
+
case 45:
|
|
39506
|
+
_context13.next = 47;
|
|
40105
39507
|
return this.initView();
|
|
40106
|
-
case
|
|
39508
|
+
case 47:
|
|
40107
39509
|
(_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
|
|
40108
39510
|
type: 'onConfiguratorReady'
|
|
40109
39511
|
});
|
|
@@ -40127,11 +39529,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40127
39529
|
divaNr: basket.DivaNr,
|
|
40128
39530
|
documentVersion: basket.DocumentVersion.toString()
|
|
40129
39531
|
});
|
|
40130
|
-
_context13.next =
|
|
39532
|
+
_context13.next = 55;
|
|
40131
39533
|
return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
|
|
40132
|
-
case 52:
|
|
40133
|
-
return _context13.abrupt("return", true);
|
|
40134
39534
|
case 55:
|
|
39535
|
+
return _context13.abrupt("return", true);
|
|
39536
|
+
case 58:
|
|
40135
39537
|
this.onInitializationError();
|
|
40136
39538
|
//fehler beim laden vom basket..
|
|
40137
39539
|
LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {
|
|
@@ -40149,7 +39551,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40149
39551
|
plannerMode: this.getCurImageMode(),*/
|
|
40150
39552
|
});
|
|
40151
39553
|
return _context13.abrupt("return", false);
|
|
40152
|
-
case
|
|
39554
|
+
case 61:
|
|
40153
39555
|
case "end":
|
|
40154
39556
|
return _context13.stop();
|
|
40155
39557
|
}
|
|
@@ -40311,7 +39713,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40311
39713
|
break;
|
|
40312
39714
|
}
|
|
40313
39715
|
(_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
|
|
40314
|
-
_context15.next =
|
|
39716
|
+
_context15.next = 18;
|
|
40315
39717
|
break;
|
|
40316
39718
|
case 7:
|
|
40317
39719
|
_context15.next = 9;
|
|
@@ -40326,11 +39728,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40326
39728
|
(_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
|
|
40327
39729
|
this.updatePlannerView('INIT_VIEW');
|
|
40328
39730
|
this.onBasketInitialized();
|
|
39731
|
+
productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
|
|
40329
39732
|
this.checkVariantData();
|
|
40330
|
-
case
|
|
40331
|
-
_context15.next =
|
|
39733
|
+
case 18:
|
|
39734
|
+
_context15.next = 20;
|
|
40332
39735
|
return this.runInitMode(plannerMode);
|
|
40333
|
-
case
|
|
39736
|
+
case 20:
|
|
40334
39737
|
case "end":
|
|
40335
39738
|
return _context15.stop();
|
|
40336
39739
|
}
|
|
@@ -40429,31 +39832,32 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40429
39832
|
i = 0;
|
|
40430
39833
|
case 8:
|
|
40431
39834
|
if (!(i < orderSets.length)) {
|
|
40432
|
-
_context17.next =
|
|
39835
|
+
_context17.next = 24;
|
|
40433
39836
|
break;
|
|
40434
39837
|
}
|
|
40435
39838
|
orderset = orderSets[i];
|
|
40436
39839
|
lastSetToInitialize = setHandlerInstance.getOrderSetShouldInitPlanner(orderSets, i);
|
|
40437
39840
|
loadedSet = setHandlerInstance.findLoadedSet(this.sets, orderset.CatalogCodex, orderset.AccountGUID);
|
|
40438
39841
|
if (!loadedSet) {
|
|
40439
|
-
_context17.next =
|
|
39842
|
+
_context17.next = 18;
|
|
40440
39843
|
break;
|
|
40441
39844
|
}
|
|
40442
39845
|
_context17.next = 15;
|
|
40443
39846
|
return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
|
|
40444
39847
|
case 15:
|
|
40445
|
-
|
|
39848
|
+
productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
|
|
39849
|
+
_context17.next = 20;
|
|
40446
39850
|
break;
|
|
40447
|
-
case
|
|
40448
|
-
_context17.next =
|
|
39851
|
+
case 18:
|
|
39852
|
+
_context17.next = 20;
|
|
40449
39853
|
return setHandlerInstance.initSet(orderset, this.getInitStateForSet(), lastSetToInitialize);
|
|
40450
|
-
case 19:
|
|
40451
|
-
this.cleanUpEmptySets(true);
|
|
40452
39854
|
case 20:
|
|
39855
|
+
this.cleanUpEmptySets(true);
|
|
39856
|
+
case 21:
|
|
40453
39857
|
i++;
|
|
40454
39858
|
_context17.next = 8;
|
|
40455
39859
|
break;
|
|
40456
|
-
case
|
|
39860
|
+
case 24:
|
|
40457
39861
|
this.divaBasketHandler.actBasket.OrderSets = [];
|
|
40458
39862
|
this.updatePriceInView();
|
|
40459
39863
|
this.updateWebConfiguratorTitle();
|
|
@@ -40461,7 +39865,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40461
39865
|
(_this$updateViewPlann10 = this.updateViewPlannerElements) === null || _this$updateViewPlann10 === void 0 || _this$updateViewPlann10.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
|
|
40462
39866
|
articlesKeys = Object.keys(this.actSet().getDivaArticles());
|
|
40463
39867
|
this.loadPaletteInfos(undefined, [articlesKeys[0]], articlesKeys);
|
|
40464
|
-
case
|
|
39868
|
+
case 31:
|
|
40465
39869
|
case "end":
|
|
40466
39870
|
return _context17.stop();
|
|
40467
39871
|
}
|
|
@@ -40472,37 +39876,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40472
39876
|
}
|
|
40473
39877
|
return addSetToActPlanningByDivaNr;
|
|
40474
39878
|
}()
|
|
40475
|
-
}, {
|
|
40476
|
-
key: "initProductId",
|
|
40477
|
-
value: function () {
|
|
40478
|
-
var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(productId) {
|
|
40479
|
-
var loadSuccessful;
|
|
40480
|
-
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
40481
|
-
while (1) switch (_context18.prev = _context18.next) {
|
|
40482
|
-
case 0:
|
|
40483
|
-
_context18.next = 2;
|
|
40484
|
-
return this.divaBasketHandler.initProductId(this.api, productId, true);
|
|
40485
|
-
case 2:
|
|
40486
|
-
loadSuccessful = _context18.sent;
|
|
40487
|
-
if (!(typeof loadSuccessful != 'boolean')) {
|
|
40488
|
-
_context18.next = 6;
|
|
40489
|
-
break;
|
|
40490
|
-
}
|
|
40491
|
-
setHandlerInstance.addProducts([loadSuccessful], []);
|
|
40492
|
-
return _context18.abrupt("return", loadSuccessful.divaNr);
|
|
40493
|
-
case 6:
|
|
40494
|
-
return _context18.abrupt("return", false);
|
|
40495
|
-
case 7:
|
|
40496
|
-
case "end":
|
|
40497
|
-
return _context18.stop();
|
|
40498
|
-
}
|
|
40499
|
-
}, _callee18, this);
|
|
40500
|
-
}));
|
|
40501
|
-
function initProductId(_x49) {
|
|
40502
|
-
return _initProductId.apply(this, arguments);
|
|
40503
|
-
}
|
|
40504
|
-
return initProductId;
|
|
40505
|
-
}()
|
|
40506
39879
|
}, {
|
|
40507
39880
|
key: "cleanUpEmptySets",
|
|
40508
39881
|
value: function cleanUpEmptySets(ignoreActSet) {
|
|
@@ -40531,28 +39904,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40531
39904
|
}, {
|
|
40532
39905
|
key: "setActSetCurConfigStepKey",
|
|
40533
39906
|
value: function () {
|
|
40534
|
-
var _setActSetCurConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
39907
|
+
var _setActSetCurConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(curConfigStepKey) {
|
|
40535
39908
|
var set;
|
|
40536
|
-
return _regeneratorRuntime.wrap(function
|
|
40537
|
-
while (1) switch (
|
|
39909
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
39910
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
40538
39911
|
case 0:
|
|
40539
39912
|
set = this.actSet();
|
|
40540
39913
|
if (set) {
|
|
40541
|
-
|
|
39914
|
+
_context18.next = 3;
|
|
40542
39915
|
break;
|
|
40543
39916
|
}
|
|
40544
|
-
return
|
|
39917
|
+
return _context18.abrupt("return");
|
|
40545
39918
|
case 3:
|
|
40546
39919
|
set.ActConfigStepKey = curConfigStepKey;
|
|
40547
|
-
|
|
39920
|
+
_context18.next = 6;
|
|
40548
39921
|
return setHandlerInstance.updateNavigation(set);
|
|
40549
39922
|
case 6:
|
|
40550
39923
|
case "end":
|
|
40551
|
-
return
|
|
39924
|
+
return _context18.stop();
|
|
40552
39925
|
}
|
|
40553
|
-
},
|
|
39926
|
+
}, _callee18, this);
|
|
40554
39927
|
}));
|
|
40555
|
-
function setActSetCurConfigStepKey(
|
|
39928
|
+
function setActSetCurConfigStepKey(_x49) {
|
|
40556
39929
|
return _setActSetCurConfigStepKey.apply(this, arguments);
|
|
40557
39930
|
}
|
|
40558
39931
|
return setActSetCurConfigStepKey;
|
|
@@ -40691,17 +40064,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40691
40064
|
}, {
|
|
40692
40065
|
key: "deletePlannerElement",
|
|
40693
40066
|
value: function () {
|
|
40694
|
-
var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40067
|
+
var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(setId, elementId, denyElementSelectionClear) {
|
|
40695
40068
|
var _this$updateViewPlann11;
|
|
40696
40069
|
var set, result, _this$updateElementSe5, _this$updateElementSe6;
|
|
40697
|
-
return _regeneratorRuntime.wrap(function
|
|
40698
|
-
while (1) switch (
|
|
40070
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
40071
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
40699
40072
|
case 0:
|
|
40700
40073
|
set = this.sets[setId];
|
|
40701
|
-
|
|
40074
|
+
_context19.next = 3;
|
|
40702
40075
|
return setHandlerInstance.deleteElementFromSetByElemId(set, elementId, true);
|
|
40703
40076
|
case 3:
|
|
40704
|
-
result =
|
|
40077
|
+
result = _context19.sent;
|
|
40705
40078
|
this.updateConfigStructure();
|
|
40706
40079
|
(_this$updateViewPlann11 = this.updateViewPlannerElements) === null || _this$updateViewPlann11 === void 0 || _this$updateViewPlann11.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
|
|
40707
40080
|
this.updatePlannerView('DELETE_PLANNER_ELEMENT');
|
|
@@ -40711,16 +40084,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40711
40084
|
if (result.selectElementId) (_this$updateElementSe5 = this.updateElementSelectionPlanner) === null || _this$updateElementSe5 === void 0 || _this$updateElementSe5.call(this, [result.setId], [result.selectElementId], true);else (_this$updateElementSe6 = this.updateElementSelectionPlanner) === null || _this$updateElementSe6 === void 0 || _this$updateElementSe6.call(this, [], [], true);
|
|
40712
40085
|
}
|
|
40713
40086
|
this.updatePriceInView();
|
|
40087
|
+
productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
|
|
40714
40088
|
this.checkVariantData();
|
|
40715
|
-
|
|
40089
|
+
_context19.next = 15;
|
|
40716
40090
|
return this.getFreePlacesOnGrids(undefined, 'deleteElement');
|
|
40717
|
-
case
|
|
40091
|
+
case 15:
|
|
40718
40092
|
case "end":
|
|
40719
|
-
return
|
|
40093
|
+
return _context19.stop();
|
|
40720
40094
|
}
|
|
40721
|
-
},
|
|
40095
|
+
}, _callee19, this);
|
|
40722
40096
|
}));
|
|
40723
|
-
function deletePlannerElement(_x51, _x52
|
|
40097
|
+
function deletePlannerElement(_x50, _x51, _x52) {
|
|
40724
40098
|
return _deletePlannerElement.apply(this, arguments);
|
|
40725
40099
|
}
|
|
40726
40100
|
return deletePlannerElement;
|
|
@@ -40734,17 +40108,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40734
40108
|
}, {
|
|
40735
40109
|
key: "copyPlannerElement",
|
|
40736
40110
|
value: (function () {
|
|
40737
|
-
var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40111
|
+
var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(setId, elementId, curConfigKey, copyInfo) {
|
|
40738
40112
|
var _this$updateViewPlann12;
|
|
40739
40113
|
var set, newSelectedArticle, newConfigStepKey, _this$updateElementSe7, baseArticle;
|
|
40740
|
-
return _regeneratorRuntime.wrap(function
|
|
40741
|
-
while (1) switch (
|
|
40114
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
40115
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
40742
40116
|
case 0:
|
|
40743
40117
|
set = this.sets[setId];
|
|
40744
|
-
|
|
40118
|
+
_context20.next = 3;
|
|
40745
40119
|
return setHandlerInstance.copyPlannerElement(set, elementId, copyInfo);
|
|
40746
40120
|
case 3:
|
|
40747
|
-
newSelectedArticle =
|
|
40121
|
+
newSelectedArticle = _context20.sent;
|
|
40748
40122
|
this.updateConfigStructure();
|
|
40749
40123
|
(_this$updateViewPlann12 = this.updateViewPlannerElements) === null || _this$updateViewPlann12 === void 0 || _this$updateViewPlann12.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
|
|
40750
40124
|
this.updatePlannerView('COPY_PLANNER_ELEMENT');
|
|
@@ -40757,17 +40131,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40757
40131
|
baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
|
|
40758
40132
|
(_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
|
|
40759
40133
|
}
|
|
40760
|
-
|
|
40134
|
+
productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
|
|
40135
|
+
_context20.next = 14;
|
|
40761
40136
|
return this.checkVariantData();
|
|
40762
|
-
case 13:
|
|
40763
|
-
return _context21.abrupt("return", newConfigStepKey);
|
|
40764
40137
|
case 14:
|
|
40138
|
+
return _context20.abrupt("return", newConfigStepKey);
|
|
40139
|
+
case 15:
|
|
40765
40140
|
case "end":
|
|
40766
|
-
return
|
|
40141
|
+
return _context20.stop();
|
|
40767
40142
|
}
|
|
40768
|
-
},
|
|
40143
|
+
}, _callee20, this);
|
|
40769
40144
|
}));
|
|
40770
|
-
function copyPlannerElement(_x54, _x55, _x56
|
|
40145
|
+
function copyPlannerElement(_x53, _x54, _x55, _x56) {
|
|
40771
40146
|
return _copyPlannerElement.apply(this, arguments);
|
|
40772
40147
|
}
|
|
40773
40148
|
return copyPlannerElement;
|
|
@@ -40796,33 +40171,33 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40796
40171
|
}, {
|
|
40797
40172
|
key: "getFreePlacesOnGrids",
|
|
40798
40173
|
value: function () {
|
|
40799
|
-
var _getFreePlacesOnGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40174
|
+
var _getFreePlacesOnGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(gridGroup, from) {
|
|
40800
40175
|
var _this$updateFreePlace;
|
|
40801
40176
|
var set, freeShelfGrids, plannedShelfGrids;
|
|
40802
|
-
return _regeneratorRuntime.wrap(function
|
|
40803
|
-
while (1) switch (
|
|
40177
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
40178
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
40804
40179
|
case 0:
|
|
40805
40180
|
set = this.actSet();
|
|
40806
40181
|
if (set) {
|
|
40807
|
-
|
|
40182
|
+
_context21.next = 3;
|
|
40808
40183
|
break;
|
|
40809
40184
|
}
|
|
40810
40185
|
throw new Error('getFreePlacesOnGrids: act set is not defined!');
|
|
40811
40186
|
case 3:
|
|
40812
40187
|
if (!gridGroup) {
|
|
40813
|
-
|
|
40188
|
+
_context21.next = 9;
|
|
40814
40189
|
break;
|
|
40815
40190
|
}
|
|
40816
|
-
|
|
40191
|
+
_context21.next = 6;
|
|
40817
40192
|
return setHandlerInstance.getFreeShelfGrids(set, gridGroup);
|
|
40818
40193
|
case 6:
|
|
40819
|
-
|
|
40820
|
-
|
|
40194
|
+
_context21.t0 = _context21.sent;
|
|
40195
|
+
_context21.next = 10;
|
|
40821
40196
|
break;
|
|
40822
40197
|
case 9:
|
|
40823
|
-
|
|
40198
|
+
_context21.t0 = undefined;
|
|
40824
40199
|
case 10:
|
|
40825
|
-
freeShelfGrids =
|
|
40200
|
+
freeShelfGrids = _context21.t0;
|
|
40826
40201
|
plannedShelfGrids = setHandlerInstance.getPlannedShelfGrids(set);
|
|
40827
40202
|
LOG$1.debug('TOULA', 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
|
|
40828
40203
|
LOG$1.debug('update free from: ' + from, 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
|
|
@@ -40830,17 +40205,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40830
40205
|
freeShelfGrids: freeShelfGrids,
|
|
40831
40206
|
plannedShelfGrids: plannedShelfGrids
|
|
40832
40207
|
});
|
|
40833
|
-
return
|
|
40208
|
+
return _context21.abrupt("return", {
|
|
40834
40209
|
freeShelfGrids: freeShelfGrids,
|
|
40835
40210
|
plannedShelfGrids: plannedShelfGrids
|
|
40836
40211
|
});
|
|
40837
40212
|
case 16:
|
|
40838
40213
|
case "end":
|
|
40839
|
-
return
|
|
40214
|
+
return _context21.stop();
|
|
40840
40215
|
}
|
|
40841
|
-
},
|
|
40216
|
+
}, _callee21, this);
|
|
40842
40217
|
}));
|
|
40843
|
-
function getFreePlacesOnGrids(
|
|
40218
|
+
function getFreePlacesOnGrids(_x57, _x58) {
|
|
40844
40219
|
return _getFreePlacesOnGrids.apply(this, arguments);
|
|
40845
40220
|
}
|
|
40846
40221
|
return getFreePlacesOnGrids;
|
|
@@ -40857,36 +40232,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40857
40232
|
}, {
|
|
40858
40233
|
key: "moveShelfItemToGrid",
|
|
40859
40234
|
value: function () {
|
|
40860
|
-
var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40235
|
+
var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(accessoireBasketId, parentBasketId, gridName, cellIndex) {
|
|
40861
40236
|
var set, newGridId;
|
|
40862
|
-
return _regeneratorRuntime.wrap(function
|
|
40863
|
-
while (1) switch (
|
|
40237
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
40238
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
40864
40239
|
case 0:
|
|
40865
40240
|
set = this.actSet();
|
|
40866
40241
|
if (set) {
|
|
40867
|
-
|
|
40242
|
+
_context22.next = 3;
|
|
40868
40243
|
break;
|
|
40869
40244
|
}
|
|
40870
|
-
return
|
|
40245
|
+
return _context22.abrupt("return");
|
|
40871
40246
|
case 3:
|
|
40872
|
-
|
|
40247
|
+
_context22.next = 5;
|
|
40873
40248
|
return setHandlerInstance.moveShelfItemToGrid(set, accessoireBasketId, parentBasketId, gridName, cellIndex);
|
|
40874
40249
|
case 5:
|
|
40875
|
-
newGridId =
|
|
40250
|
+
newGridId = _context22.sent;
|
|
40876
40251
|
this.updatePlannerView('MOVE_SHELF_ITEM');
|
|
40877
40252
|
if (!newGridId) {
|
|
40878
|
-
|
|
40253
|
+
_context22.next = 10;
|
|
40879
40254
|
break;
|
|
40880
40255
|
}
|
|
40881
|
-
|
|
40256
|
+
_context22.next = 10;
|
|
40882
40257
|
return this.getFreePlacesOnGrids(newGridId, 'move shelf');
|
|
40883
40258
|
case 10:
|
|
40884
40259
|
case "end":
|
|
40885
|
-
return
|
|
40260
|
+
return _context22.stop();
|
|
40886
40261
|
}
|
|
40887
|
-
},
|
|
40262
|
+
}, _callee22, this);
|
|
40888
40263
|
}));
|
|
40889
|
-
function moveShelfItemToGrid(_x60, _x61, _x62
|
|
40264
|
+
function moveShelfItemToGrid(_x59, _x60, _x61, _x62) {
|
|
40890
40265
|
return _moveShelfItemToGrid.apply(this, arguments);
|
|
40891
40266
|
}
|
|
40892
40267
|
return moveShelfItemToGrid;
|
|
@@ -40894,27 +40269,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40894
40269
|
}, {
|
|
40895
40270
|
key: "resetArticle",
|
|
40896
40271
|
value: function () {
|
|
40897
|
-
var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40272
|
+
var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(basketId) {
|
|
40898
40273
|
var set;
|
|
40899
|
-
return _regeneratorRuntime.wrap(function
|
|
40900
|
-
while (1) switch (
|
|
40274
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
40275
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
40901
40276
|
case 0:
|
|
40902
40277
|
set = this.actSet();
|
|
40903
40278
|
if (set) {
|
|
40904
|
-
|
|
40279
|
+
_context23.next = 3;
|
|
40905
40280
|
break;
|
|
40906
40281
|
}
|
|
40907
|
-
return
|
|
40282
|
+
return _context23.abrupt("return");
|
|
40908
40283
|
case 3:
|
|
40909
|
-
|
|
40284
|
+
_context23.next = 5;
|
|
40910
40285
|
return setHandlerInstance.resetArticle(set, basketId);
|
|
40911
40286
|
case 5:
|
|
40912
40287
|
case "end":
|
|
40913
|
-
return
|
|
40288
|
+
return _context23.stop();
|
|
40914
40289
|
}
|
|
40915
|
-
},
|
|
40290
|
+
}, _callee23, this);
|
|
40916
40291
|
}));
|
|
40917
|
-
function resetArticle(
|
|
40292
|
+
function resetArticle(_x63) {
|
|
40918
40293
|
return _resetArticle.apply(this, arguments);
|
|
40919
40294
|
}
|
|
40920
40295
|
return resetArticle;
|
|
@@ -40922,27 +40297,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
40922
40297
|
}, {
|
|
40923
40298
|
key: "checkVariantData",
|
|
40924
40299
|
value: function () {
|
|
40925
|
-
var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40300
|
+
var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
40926
40301
|
var somethingChanged;
|
|
40927
|
-
return _regeneratorRuntime.wrap(function
|
|
40928
|
-
while (1) switch (
|
|
40302
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
40303
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
40929
40304
|
case 0:
|
|
40930
40305
|
if (!this.api.getDoCheckVariantData()) {
|
|
40931
|
-
|
|
40306
|
+
_context24.next = 5;
|
|
40932
40307
|
break;
|
|
40933
40308
|
}
|
|
40934
|
-
|
|
40309
|
+
_context24.next = 3;
|
|
40935
40310
|
return setHandlerInstance.checkVariantData(this.actSet());
|
|
40936
40311
|
case 3:
|
|
40937
|
-
somethingChanged =
|
|
40312
|
+
somethingChanged = _context24.sent;
|
|
40938
40313
|
if (somethingChanged) {
|
|
40939
40314
|
this.updatePriceInView();
|
|
40940
40315
|
}
|
|
40941
40316
|
case 5:
|
|
40942
40317
|
case "end":
|
|
40943
|
-
return
|
|
40318
|
+
return _context24.stop();
|
|
40944
40319
|
}
|
|
40945
|
-
},
|
|
40320
|
+
}, _callee24, this);
|
|
40946
40321
|
}));
|
|
40947
40322
|
function checkVariantData() {
|
|
40948
40323
|
return _checkVariantData.apply(this, arguments);
|
|
@@ -41038,7 +40413,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41038
40413
|
}, {
|
|
41039
40414
|
key: "saveToBasketWrapper",
|
|
41040
40415
|
value: function () {
|
|
41041
|
-
var _saveToBasketWrapper = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40416
|
+
var _saveToBasketWrapper = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(event, repairOnly, force) {
|
|
41042
40417
|
var _this$actions25,
|
|
41043
40418
|
_this$actions25$toggl,
|
|
41044
40419
|
_this$actions26,
|
|
@@ -41046,48 +40421,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41046
40421
|
_this2 = this,
|
|
41047
40422
|
_this$actions30,
|
|
41048
40423
|
_this$i18n14;
|
|
41049
|
-
var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product,
|
|
41050
|
-
return _regeneratorRuntime.wrap(function
|
|
41051
|
-
while (1) switch (
|
|
40424
|
+
var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2;
|
|
40425
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
40426
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
41052
40427
|
case 0:
|
|
41053
40428
|
returnTo = this.getReturnTo(event);
|
|
41054
40429
|
finalEvent = event;
|
|
41055
40430
|
if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
|
|
41056
|
-
|
|
40431
|
+
_context25.next = 14;
|
|
41057
40432
|
break;
|
|
41058
40433
|
}
|
|
41059
40434
|
product = undefined;
|
|
41060
40435
|
if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
|
|
41061
|
-
|
|
40436
|
+
_context25.next = 8;
|
|
41062
40437
|
break;
|
|
41063
40438
|
}
|
|
41064
|
-
|
|
40439
|
+
_context25.next = 7;
|
|
41065
40440
|
return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
|
|
41066
40441
|
case 7:
|
|
41067
|
-
|
|
41068
|
-
|
|
41069
|
-
|
|
41070
|
-
case 10:
|
|
41071
|
-
_context26.next = 12;
|
|
40442
|
+
_context25.sent;
|
|
40443
|
+
case 8:
|
|
40444
|
+
_context25.next = 10;
|
|
41072
40445
|
return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
|
|
41073
|
-
case
|
|
41074
|
-
finalEvent =
|
|
40446
|
+
case 10:
|
|
40447
|
+
finalEvent = _context25.sent;
|
|
41075
40448
|
if (finalEvent) {
|
|
41076
|
-
|
|
40449
|
+
_context25.next = 13;
|
|
41077
40450
|
break;
|
|
41078
40451
|
}
|
|
41079
|
-
return
|
|
41080
|
-
case
|
|
40452
|
+
return _context25.abrupt("return", 'canceled');
|
|
40453
|
+
case 13:
|
|
41081
40454
|
returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
|
|
41082
|
-
case
|
|
40455
|
+
case 14:
|
|
41083
40456
|
(_this$actions25 = this.actions) === null || _this$actions25 === void 0 || (_this$actions25$toggl = _this$actions25.toggleLoading) === null || _this$actions25$toggl === void 0 || _this$actions25$toggl.call(_this$actions25, 'Planner_Saving', false, true);
|
|
41084
|
-
|
|
40457
|
+
_context25.next = 17;
|
|
41085
40458
|
return this.saveToBasket(finalEvent, repairOnly, force);
|
|
41086
|
-
case
|
|
41087
|
-
result =
|
|
40459
|
+
case 17:
|
|
40460
|
+
result = _context25.sent;
|
|
41088
40461
|
(_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, false);
|
|
41089
40462
|
if (!(result === 'canceled')) {
|
|
41090
|
-
|
|
40463
|
+
_context25.next = 23;
|
|
41091
40464
|
break;
|
|
41092
40465
|
}
|
|
41093
40466
|
LOG$1.error(new DivaError('failed to save Basket'));
|
|
@@ -41095,12 +40468,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41095
40468
|
text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils.formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils.getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils.getCurrentTraceId() : '',
|
|
41096
40469
|
accept: true
|
|
41097
40470
|
});
|
|
41098
|
-
return
|
|
41099
|
-
case
|
|
41100
|
-
|
|
41101
|
-
|
|
40471
|
+
return _context25.abrupt("return", result);
|
|
40472
|
+
case 23:
|
|
40473
|
+
_context25.t0 = returnTo;
|
|
40474
|
+
_context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
|
|
41102
40475
|
break;
|
|
41103
|
-
case
|
|
40476
|
+
case 26:
|
|
41104
40477
|
if (!this.getBasket().PDFDocumentURL) {
|
|
41105
40478
|
LOG$1.error(new DivaError('PDF url is missing in basket', {
|
|
41106
40479
|
code: 'WC_0010'
|
|
@@ -41118,39 +40491,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41118
40491
|
}
|
|
41119
40492
|
});
|
|
41120
40493
|
}
|
|
41121
|
-
return
|
|
41122
|
-
case
|
|
40494
|
+
return _context25.abrupt("break", 29);
|
|
40495
|
+
case 28:
|
|
41123
40496
|
(_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
|
|
41124
40497
|
text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
|
|
41125
40498
|
accept: true
|
|
41126
40499
|
});
|
|
41127
|
-
case
|
|
40500
|
+
case 29:
|
|
41128
40501
|
if (!(result == 'noArticleToSave')) {
|
|
41129
|
-
|
|
40502
|
+
_context25.next = 32;
|
|
41130
40503
|
break;
|
|
41131
40504
|
}
|
|
41132
40505
|
(_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
|
|
41133
|
-
return
|
|
41134
|
-
case
|
|
41135
|
-
|
|
41136
|
-
|
|
41137
|
-
break;
|
|
41138
|
-
}
|
|
41139
|
-
(_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
|
|
41140
|
-
accept: true,
|
|
41141
|
-
text: (_this$i18n15 = this.i18n()) === null || _this$i18n15 === void 0 ? void 0 : _this$i18n15.t('configurator.PAYLOAD_TO_BIG'),
|
|
41142
|
-
title: 'modals.error_saving'
|
|
41143
|
-
});
|
|
41144
|
-
return _context26.abrupt("return", 'canceled');
|
|
41145
|
-
case 37:
|
|
41146
|
-
return _context26.abrupt("return", result);
|
|
41147
|
-
case 38:
|
|
40506
|
+
return _context25.abrupt("return", 'canceled');
|
|
40507
|
+
case 32:
|
|
40508
|
+
return _context25.abrupt("return", result);
|
|
40509
|
+
case 33:
|
|
41148
40510
|
case "end":
|
|
41149
|
-
return
|
|
40511
|
+
return _context25.stop();
|
|
41150
40512
|
}
|
|
41151
|
-
},
|
|
40513
|
+
}, _callee25, this);
|
|
41152
40514
|
}));
|
|
41153
|
-
function saveToBasketWrapper(_x65, _x66
|
|
40515
|
+
function saveToBasketWrapper(_x64, _x65, _x66) {
|
|
41154
40516
|
return _saveToBasketWrapper.apply(this, arguments);
|
|
41155
40517
|
}
|
|
41156
40518
|
return saveToBasketWrapper;
|
|
@@ -41158,51 +40520,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41158
40520
|
}, {
|
|
41159
40521
|
key: "saveToBasket",
|
|
41160
40522
|
value: function () {
|
|
41161
|
-
var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41162
|
-
var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33;
|
|
41163
|
-
var set, actBasket, returnTo, oldReturnTo,
|
|
41164
|
-
return _regeneratorRuntime.wrap(function
|
|
41165
|
-
while (1) switch (
|
|
40523
|
+
var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(event, repairOnly, force) {
|
|
40524
|
+
var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions31, _this$actions32, _this$actions33;
|
|
40525
|
+
var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
|
|
40526
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
40527
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
41166
40528
|
case 0:
|
|
41167
40529
|
set = this.actSet();
|
|
41168
40530
|
if (!(setHandlerInstance.isNoArticleToSave(this.sets) && !force)) {
|
|
41169
|
-
|
|
40531
|
+
_context26.next = 3;
|
|
41170
40532
|
break;
|
|
41171
40533
|
}
|
|
41172
|
-
return
|
|
40534
|
+
return _context26.abrupt("return", 'noArticleToSave');
|
|
41173
40535
|
case 3:
|
|
41174
40536
|
actBasket = this.divaBasketHandler.actBasket;
|
|
41175
40537
|
returnTo = this.getReturnTo(event);
|
|
41176
40538
|
if (!((_returnTo = returnTo) !== null && _returnTo !== void 0 && _returnTo.startsWith('FAVORITS') && favoritesHandlerInstance.FavoritesDefined(set))) {
|
|
41177
|
-
|
|
40539
|
+
_context26.next = 13;
|
|
41178
40540
|
break;
|
|
41179
40541
|
}
|
|
41180
40542
|
oldReturnTo = returnTo;
|
|
41181
40543
|
this.ReturnTo = returnTo.replace('FAVORITS_', '');
|
|
41182
|
-
|
|
41183
|
-
return this.getValidVariantsLength();
|
|
41184
|
-
case 10:
|
|
41185
|
-
count = _context27.sent;
|
|
41186
|
-
_context27.next = 13;
|
|
41187
|
-
return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
|
|
41188
|
-
case 13:
|
|
41189
|
-
basketData = _context27.sent;
|
|
41190
|
-
bytes = new TextEncoder().encode(JSON.stringify(basketData.getAsJson())).length;
|
|
41191
|
-
if (!(bytes * count > 15000000)) {
|
|
41192
|
-
_context27.next = 17;
|
|
41193
|
-
break;
|
|
41194
|
-
}
|
|
41195
|
-
return _context27.abrupt("return", 'payloadToBig');
|
|
41196
|
-
case 17:
|
|
41197
|
-
_context27.next = 19;
|
|
40544
|
+
_context26.next = 10;
|
|
41198
40545
|
return this.handleFavorites('SAVE');
|
|
41199
|
-
case
|
|
41200
|
-
result =
|
|
40546
|
+
case 10:
|
|
40547
|
+
result = _context26.sent;
|
|
41201
40548
|
if (result === 'canceled') {
|
|
41202
40549
|
this.ReturnTo = oldReturnTo;
|
|
41203
40550
|
}
|
|
41204
|
-
return
|
|
41205
|
-
case
|
|
40551
|
+
return _context26.abrupt("return", result);
|
|
40552
|
+
case 13:
|
|
41206
40553
|
LOG$1.startTransaction({
|
|
41207
40554
|
event: (_event = event) !== null && _event !== void 0 ? _event : 'onAddToBasket',
|
|
41208
40555
|
message: 'Perform case: ' + ((_event2 = event) !== null && _event2 !== void 0 ? _event2 : 'onAddToBasket'),
|
|
@@ -41217,13 +40564,13 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41217
40564
|
warningTime: 2000,
|
|
41218
40565
|
errorTime: 4000
|
|
41219
40566
|
});
|
|
41220
|
-
|
|
41221
|
-
|
|
41222
|
-
|
|
40567
|
+
_context26.t0 = this.divaBasketHandler;
|
|
40568
|
+
_context26.t1 = this.divaBasketHandler.actDivaNr;
|
|
40569
|
+
_context26.next = 18;
|
|
41223
40570
|
return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
|
|
41224
|
-
case
|
|
41225
|
-
|
|
41226
|
-
|
|
40571
|
+
case 18:
|
|
40572
|
+
_context26.t2 = _context26.sent;
|
|
40573
|
+
_context26.t0.setBasketData.call(_context26.t0, _context26.t1, _context26.t2);
|
|
41227
40574
|
if ((_returnTo2 = returnTo) !== null && _returnTo2 !== void 0 && _returnTo2.endsWith('OPEN_SELLER_BASKET')) {
|
|
41228
40575
|
this.ReturnTo = 'OPEN_SELLER_BASKET';
|
|
41229
40576
|
returnTo = this.ReturnTo;
|
|
@@ -41239,13 +40586,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41239
40586
|
actBasket.Updated = Date.now();
|
|
41240
40587
|
LOG$1.successTransaction('FILL_BASKET');
|
|
41241
40588
|
if (!returnTo) {
|
|
41242
|
-
|
|
40589
|
+
_context26.next = 55;
|
|
41243
40590
|
break;
|
|
41244
40591
|
}
|
|
41245
|
-
|
|
41246
|
-
|
|
40592
|
+
_context26.t3 = returnTo;
|
|
40593
|
+
_context26.next = _context26.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 30 : _context26.t3 === 'OPEN_SELLER_BASKET' ? 33 : _context26.t3 === 'OPEN_PDF' ? 35 : _context26.t3 === 'SAVE_BASKET_WITH_MODAL' ? 35 : _context26.t3 === 'SAVE_BASKET' ? 35 : _context26.t3 === 'SAVE_BASKET_SYNC' ? 35 : _context26.t3 === 'OPEN_LEAFLET_BARRIER' ? 35 : 55;
|
|
41247
40594
|
break;
|
|
41248
|
-
case
|
|
40595
|
+
case 30:
|
|
40596
|
+
(_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.toggleLoading('buildScene', false, false);
|
|
41249
40597
|
(_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
|
|
41250
40598
|
type: 'SELLER',
|
|
41251
40599
|
parameters: {
|
|
@@ -41253,12 +40601,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41253
40601
|
divaNr: actBasket.DivaNr
|
|
41254
40602
|
},
|
|
41255
40603
|
internal: {
|
|
41256
|
-
basketData: actBasket
|
|
41257
|
-
edited: true
|
|
40604
|
+
basketData: actBasket
|
|
41258
40605
|
}
|
|
41259
40606
|
});
|
|
41260
|
-
return
|
|
41261
|
-
case
|
|
40607
|
+
return _context26.abrupt("break", 55);
|
|
40608
|
+
case 33:
|
|
41262
40609
|
(_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
|
|
41263
40610
|
type: 'SELLER',
|
|
41264
40611
|
parameters: {
|
|
@@ -41269,37 +40616,37 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41269
40616
|
basketData: actBasket
|
|
41270
40617
|
}
|
|
41271
40618
|
});
|
|
41272
|
-
return
|
|
41273
|
-
case
|
|
40619
|
+
return _context26.abrupt("break", 55);
|
|
40620
|
+
case 35:
|
|
41274
40621
|
if (!(event == 'onSaveProduct')) {
|
|
41275
|
-
|
|
40622
|
+
_context26.next = 45;
|
|
41276
40623
|
break;
|
|
41277
40624
|
}
|
|
41278
40625
|
//copy basket, so we only save a copy as baseconfiguration and can continue working with the original basket
|
|
41279
40626
|
actBasket = new BasketData(JSON.parse(JSON.stringify(actBasket)));
|
|
41280
|
-
|
|
40627
|
+
_context26.next = 39;
|
|
41281
40628
|
return DivaUtils.updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser);
|
|
41282
|
-
case
|
|
41283
|
-
|
|
40629
|
+
case 39:
|
|
40630
|
+
_context26.next = 41;
|
|
41284
40631
|
return this.api.getDataWithoutCache(this.api.getUniqueNewDivaNr(), undefined, 'basket');
|
|
41285
|
-
case
|
|
41286
|
-
newDivaNr =
|
|
40632
|
+
case 41:
|
|
40633
|
+
newDivaNr = _context26.sent;
|
|
41287
40634
|
actBasket.convertToBaseConfiguration(newDivaNr.divaNr);
|
|
41288
|
-
|
|
40635
|
+
_context26.next = 54;
|
|
41289
40636
|
break;
|
|
41290
|
-
case
|
|
40637
|
+
case 45:
|
|
41291
40638
|
if (this.divaBasketHandler.basketWasSavedWithCurrentDocVersion) {
|
|
41292
40639
|
this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = undefined;
|
|
41293
40640
|
actBasket.setDocumentVersion(actBasket.getDocumentVersion() + 1);
|
|
41294
40641
|
}
|
|
41295
40642
|
this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = true;
|
|
41296
40643
|
actBasket.setDivaNr(this.divaBasketHandler.actDivaNr.split('-').length > 2 ? this.divaBasketHandler.actDivaNr.split('-')[0] + '-' + this.divaBasketHandler.actDivaNr.split('-')[1] : this.divaBasketHandler.actDivaNr);
|
|
41297
|
-
|
|
40644
|
+
_context26.next = 50;
|
|
41298
40645
|
return this.divaBasketHandler.saveToBasket(this.api, actBasket, returnTo);
|
|
41299
|
-
case
|
|
41300
|
-
_result2 =
|
|
40646
|
+
case 50:
|
|
40647
|
+
_result2 = _context26.sent;
|
|
41301
40648
|
if (!(_result2 === 'ERROR_NO_BASKET_SAVED' || _result2 === 'ERROR_BASKET_AFTER_SAVE')) {
|
|
41302
|
-
|
|
40649
|
+
_context26.next = 54;
|
|
41303
40650
|
break;
|
|
41304
40651
|
}
|
|
41305
40652
|
LOG$1.errorTransaction((_event4 = event) !== null && _event4 !== void 0 ? _event4 : 'onAddToBasket', 'WC_0019', 'Error saving basket', {
|
|
@@ -41308,23 +40655,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41308
40655
|
status: this.getBasketData().Status,
|
|
41309
40656
|
bv: set.getSetPrice() / 1000
|
|
41310
40657
|
});
|
|
41311
|
-
return
|
|
41312
|
-
case
|
|
41313
|
-
return
|
|
41314
|
-
case
|
|
40658
|
+
return _context26.abrupt("return", 'canceled');
|
|
40659
|
+
case 54:
|
|
40660
|
+
return _context26.abrupt("break", 55);
|
|
40661
|
+
case 55:
|
|
41315
40662
|
if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
|
|
41316
|
-
|
|
40663
|
+
_context26.next = 58;
|
|
41317
40664
|
return this.addToBasket(actBasket, event);
|
|
41318
|
-
case
|
|
41319
|
-
product =
|
|
41320
|
-
return
|
|
41321
|
-
case
|
|
40665
|
+
case 58:
|
|
40666
|
+
product = _context26.sent;
|
|
40667
|
+
return _context26.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
|
|
40668
|
+
case 60:
|
|
41322
40669
|
case "end":
|
|
41323
|
-
return
|
|
40670
|
+
return _context26.stop();
|
|
41324
40671
|
}
|
|
41325
|
-
},
|
|
40672
|
+
}, _callee26, this);
|
|
41326
40673
|
}));
|
|
41327
|
-
function saveToBasket(_x68, _x69
|
|
40674
|
+
function saveToBasket(_x67, _x68, _x69) {
|
|
41328
40675
|
return _saveToBasket.apply(this, arguments);
|
|
41329
40676
|
}
|
|
41330
40677
|
return saveToBasket;
|
|
@@ -41525,16 +40872,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41525
40872
|
}, {
|
|
41526
40873
|
key: "getEnableUnityRtvKombi",
|
|
41527
40874
|
value: function getEnableUnityRtvKombi() {
|
|
41528
|
-
var _this$actSet24;
|
|
40875
|
+
var _this$actSet24, _this$actSet25;
|
|
41529
40876
|
// if force rtv disable unity kombi - biohort
|
|
41530
40877
|
if ((_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaForceRTV) return false;
|
|
41531
|
-
return this.api.getEnableRTVUnityKombi();
|
|
40878
|
+
return ((_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
|
|
41532
40879
|
}
|
|
41533
40880
|
}, {
|
|
41534
40881
|
key: "getShelfPlannerRTV",
|
|
41535
40882
|
value: function getShelfPlannerRTV() {
|
|
41536
|
-
var _this$
|
|
41537
|
-
return (_this$
|
|
40883
|
+
var _this$actSet26;
|
|
40884
|
+
return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.useShelfPlannerRTV;
|
|
41538
40885
|
}
|
|
41539
40886
|
}, {
|
|
41540
40887
|
key: "getBasketData",
|
|
@@ -41549,23 +40896,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41549
40896
|
}, {
|
|
41550
40897
|
key: "getBasketDataWithEkText",
|
|
41551
40898
|
value: function () {
|
|
41552
|
-
var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41553
|
-
return _regeneratorRuntime.wrap(function
|
|
41554
|
-
while (1) switch (
|
|
40899
|
+
var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
40900
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
40901
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
41555
40902
|
case 0:
|
|
41556
|
-
|
|
41557
|
-
|
|
41558
|
-
|
|
40903
|
+
_context27.t0 = this.divaBasketHandler;
|
|
40904
|
+
_context27.t1 = this.divaBasketHandler.actDivaNr;
|
|
40905
|
+
_context27.next = 4;
|
|
41559
40906
|
return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
|
|
41560
40907
|
case 4:
|
|
41561
|
-
|
|
41562
|
-
|
|
41563
|
-
return
|
|
40908
|
+
_context27.t2 = _context27.sent;
|
|
40909
|
+
_context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
|
|
40910
|
+
return _context27.abrupt("return", this.divaBasketHandler.actBasket);
|
|
41564
40911
|
case 7:
|
|
41565
40912
|
case "end":
|
|
41566
|
-
return
|
|
40913
|
+
return _context27.stop();
|
|
41567
40914
|
}
|
|
41568
|
-
},
|
|
40915
|
+
}, _callee27, this);
|
|
41569
40916
|
}));
|
|
41570
40917
|
function getBasketDataWithEkText() {
|
|
41571
40918
|
return _getBasketDataWithEkText.apply(this, arguments);
|
|
@@ -41575,8 +40922,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41575
40922
|
}, {
|
|
41576
40923
|
key: "getCatalogData",
|
|
41577
40924
|
value: function getCatalogData() {
|
|
41578
|
-
var _this$
|
|
41579
|
-
return (_this$
|
|
40925
|
+
var _this$actSet27;
|
|
40926
|
+
return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData;
|
|
41580
40927
|
}
|
|
41581
40928
|
}, {
|
|
41582
40929
|
key: "ReturnTo",
|
|
@@ -41591,7 +40938,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41591
40938
|
}, {
|
|
41592
40939
|
key: "addToBasket",
|
|
41593
40940
|
value: function () {
|
|
41594
|
-
var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
40941
|
+
var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(actBasket) {
|
|
41595
40942
|
var _this$actions34,
|
|
41596
40943
|
_this$actions35,
|
|
41597
40944
|
_this$actions36,
|
|
@@ -41610,14 +40957,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41610
40957
|
to,
|
|
41611
40958
|
variants,
|
|
41612
40959
|
products,
|
|
41613
|
-
|
|
41614
|
-
return _regeneratorRuntime.wrap(function
|
|
41615
|
-
while (1) switch (
|
|
40960
|
+
_args28 = arguments;
|
|
40961
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
40962
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
41616
40963
|
case 0:
|
|
41617
|
-
event =
|
|
40964
|
+
event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
|
|
41618
40965
|
addToBasketLog = true;
|
|
41619
|
-
|
|
41620
|
-
|
|
40966
|
+
_context28.t0 = event;
|
|
40967
|
+
_context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 35;
|
|
41621
40968
|
break;
|
|
41622
40969
|
case 5:
|
|
41623
40970
|
this.handleSuccessTransaction('onPrintBasket', actBasket);
|
|
@@ -41625,35 +40972,35 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41625
40972
|
type: 'onWebPlanerPrint',
|
|
41626
40973
|
data: actBasket.getAsJson()
|
|
41627
40974
|
});
|
|
41628
|
-
return
|
|
40975
|
+
return _context28.abrupt("break", 38);
|
|
41629
40976
|
case 8:
|
|
41630
40977
|
this.handleSuccessTransaction('onSaveBasket', actBasket);
|
|
41631
40978
|
(_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
|
|
41632
40979
|
type: 'onWebPlanerSave',
|
|
41633
40980
|
data: actBasket.getAsJson()
|
|
41634
40981
|
});
|
|
41635
|
-
return
|
|
40982
|
+
return _context28.abrupt("break", 38);
|
|
41636
40983
|
case 11:
|
|
41637
40984
|
this.handleSuccessTransaction('onShareBasket', actBasket);
|
|
41638
40985
|
(_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
|
|
41639
40986
|
type: 'onWebPlanerShare',
|
|
41640
40987
|
data: actBasket.getAsJson()
|
|
41641
40988
|
});
|
|
41642
|
-
return
|
|
40989
|
+
return _context28.abrupt("break", 38);
|
|
41643
40990
|
case 14:
|
|
41644
40991
|
this.handleSuccessTransaction('onRequestConsulation', actBasket);
|
|
41645
40992
|
(_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
|
|
41646
40993
|
type: 'onRequestConsulation',
|
|
41647
40994
|
data: actBasket.getAsJson()
|
|
41648
40995
|
});
|
|
41649
|
-
return
|
|
40996
|
+
return _context28.abrupt("break", 38);
|
|
41650
40997
|
case 17:
|
|
41651
40998
|
this.handleSuccessTransaction('onSave', actBasket);
|
|
41652
40999
|
(_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
|
|
41653
41000
|
type: 'onSave',
|
|
41654
41001
|
data: actBasket.getAsJson()
|
|
41655
41002
|
});
|
|
41656
|
-
return
|
|
41003
|
+
return _context28.abrupt("break", 38);
|
|
41657
41004
|
case 20:
|
|
41658
41005
|
emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
|
|
41659
41006
|
this.divaBasketHandler.emailConfig = undefined;
|
|
@@ -41689,23 +41036,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41689
41036
|
type: 'onAddToBasket',
|
|
41690
41037
|
data: actBasket.getAsJson()
|
|
41691
41038
|
});
|
|
41692
|
-
return
|
|
41039
|
+
return _context28.abrupt("break", 38);
|
|
41693
41040
|
case 25:
|
|
41694
41041
|
this.actSet().CatalogData;
|
|
41695
|
-
|
|
41042
|
+
_context28.next = 28;
|
|
41696
41043
|
return this.api.saveAsProduct(this.sets, actBasket);
|
|
41697
41044
|
case 28:
|
|
41698
|
-
products =
|
|
41045
|
+
products = _context28.sent;
|
|
41699
41046
|
this.handleSuccessTransaction('onSaveProduct', actBasket);
|
|
41700
41047
|
(_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
|
|
41701
41048
|
type: 'onAddToBasket',
|
|
41702
41049
|
data: actBasket.getAsJson()
|
|
41703
41050
|
});
|
|
41704
41051
|
if (!products) {
|
|
41705
|
-
|
|
41052
|
+
_context28.next = 33;
|
|
41706
41053
|
break;
|
|
41707
41054
|
}
|
|
41708
|
-
return
|
|
41055
|
+
return _context28.abrupt("return", products[0]);
|
|
41709
41056
|
case 33:
|
|
41710
41057
|
this.handleSuccessTransaction('onAddToBasketCallback', actBasket);
|
|
41711
41058
|
addToBasketLog = false;
|
|
@@ -41715,16 +41062,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
41715
41062
|
type: 'onAddToBasket',
|
|
41716
41063
|
data: actBasket.getAsJson()
|
|
41717
41064
|
});
|
|
41718
|
-
return
|
|
41065
|
+
return _context28.abrupt("break", 38);
|
|
41719
41066
|
case 38:
|
|
41720
|
-
return
|
|
41067
|
+
return _context28.abrupt("return");
|
|
41721
41068
|
case 39:
|
|
41722
41069
|
case "end":
|
|
41723
|
-
return
|
|
41070
|
+
return _context28.stop();
|
|
41724
41071
|
}
|
|
41725
|
-
},
|
|
41072
|
+
}, _callee28, this);
|
|
41726
41073
|
}));
|
|
41727
|
-
function addToBasket(
|
|
41074
|
+
function addToBasket(_x70) {
|
|
41728
41075
|
return _addToBasket.apply(this, arguments);
|
|
41729
41076
|
}
|
|
41730
41077
|
return addToBasket;
|
|
@@ -42005,9 +41352,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42005
41352
|
key: "initApiForLogicOnly",
|
|
42006
41353
|
value: //just for testing purposes
|
|
42007
41354
|
function () {
|
|
42008
|
-
var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
42009
|
-
return _regeneratorRuntime.wrap(function
|
|
42010
|
-
while (1) switch (
|
|
41355
|
+
var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
|
|
41356
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
41357
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
42011
41358
|
case 0:
|
|
42012
41359
|
//empty services
|
|
42013
41360
|
this.api = new DivaApiHandler(_objectSpread$5(_objectSpread$5({}, this.plannerConfig), {}, {
|
|
@@ -42020,17 +41367,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42020
41367
|
jwt: jwt,
|
|
42021
41368
|
apiKey: apiKey
|
|
42022
41369
|
}), handler);
|
|
42023
|
-
|
|
41370
|
+
_context29.next = 3;
|
|
42024
41371
|
return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
|
|
42025
41372
|
case 3:
|
|
42026
41373
|
this.plannerHandler = new DivaPlannerHandler(true);
|
|
42027
41374
|
case 4:
|
|
42028
41375
|
case "end":
|
|
42029
|
-
return
|
|
41376
|
+
return _context29.stop();
|
|
42030
41377
|
}
|
|
42031
|
-
},
|
|
41378
|
+
}, _callee29, this);
|
|
42032
41379
|
}));
|
|
42033
|
-
function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77
|
|
41380
|
+
function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
|
|
42034
41381
|
return _initApiForLogicOnly.apply(this, arguments);
|
|
42035
41382
|
}
|
|
42036
41383
|
return initApiForLogicOnly;
|
|
@@ -42043,16 +41390,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42043
41390
|
}, {
|
|
42044
41391
|
key: "loadBasket",
|
|
42045
41392
|
value: function () {
|
|
42046
|
-
var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
42047
|
-
return _regeneratorRuntime.wrap(function
|
|
42048
|
-
while (1) switch (
|
|
41393
|
+
var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
41394
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
41395
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
42049
41396
|
case 0:
|
|
42050
|
-
return
|
|
41397
|
+
return _context30.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
|
|
42051
41398
|
case 1:
|
|
42052
41399
|
case "end":
|
|
42053
|
-
return
|
|
41400
|
+
return _context30.stop();
|
|
42054
41401
|
}
|
|
42055
|
-
},
|
|
41402
|
+
}, _callee30, this);
|
|
42056
41403
|
}));
|
|
42057
41404
|
function loadBasket() {
|
|
42058
41405
|
return _loadBasket.apply(this, arguments);
|
|
@@ -42067,31 +41414,31 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42067
41414
|
}, {
|
|
42068
41415
|
key: "initBasket",
|
|
42069
41416
|
value: function () {
|
|
42070
|
-
var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41417
|
+
var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(init3D, ignoreFavorites) {
|
|
42071
41418
|
var _initSetState$api$web2;
|
|
42072
41419
|
var initSetState, sets, result, _sets$, set, basket;
|
|
42073
|
-
return _regeneratorRuntime.wrap(function
|
|
42074
|
-
while (1) switch (
|
|
41420
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
41421
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
42075
41422
|
case 0:
|
|
42076
41423
|
this.divaNr = this.divaBasketHandler.actDivaNr;
|
|
42077
41424
|
initSetState = this.getInitStateForSet(!init3D);
|
|
42078
41425
|
this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
|
|
42079
|
-
|
|
41426
|
+
_context31.next = 5;
|
|
42080
41427
|
return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
|
|
42081
41428
|
case 5:
|
|
42082
|
-
sets =
|
|
41429
|
+
sets = _context31.sent;
|
|
42083
41430
|
if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
|
|
42084
|
-
|
|
41431
|
+
_context31.next = 12;
|
|
42085
41432
|
break;
|
|
42086
41433
|
}
|
|
42087
41434
|
if (!this.divaBasketHandler.actBasket.OrigProductId) {
|
|
42088
|
-
|
|
41435
|
+
_context31.next = 12;
|
|
42089
41436
|
break;
|
|
42090
41437
|
}
|
|
42091
|
-
|
|
41438
|
+
_context31.next = 10;
|
|
42092
41439
|
return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
|
|
42093
41440
|
case 10:
|
|
42094
|
-
result =
|
|
41441
|
+
result = _context31.sent;
|
|
42095
41442
|
if (result) {
|
|
42096
41443
|
(_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
|
|
42097
41444
|
}
|
|
@@ -42100,24 +41447,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42100
41447
|
set = this.actSet();
|
|
42101
41448
|
setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
|
|
42102
41449
|
if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
|
|
42103
|
-
|
|
41450
|
+
_context31.next = 17;
|
|
42104
41451
|
break;
|
|
42105
41452
|
}
|
|
42106
|
-
|
|
41453
|
+
_context31.next = 17;
|
|
42107
41454
|
return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
|
|
42108
41455
|
case 17:
|
|
42109
|
-
|
|
41456
|
+
_context31.next = 19;
|
|
42110
41457
|
return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
|
|
42111
41458
|
case 19:
|
|
42112
|
-
basket =
|
|
42113
|
-
return
|
|
41459
|
+
basket = _context31.sent;
|
|
41460
|
+
return _context31.abrupt("return", basket);
|
|
42114
41461
|
case 21:
|
|
42115
41462
|
case "end":
|
|
42116
|
-
return
|
|
41463
|
+
return _context31.stop();
|
|
42117
41464
|
}
|
|
42118
|
-
},
|
|
41465
|
+
}, _callee31, this);
|
|
42119
41466
|
}));
|
|
42120
|
-
function initBasket(
|
|
41467
|
+
function initBasket(_x78, _x79) {
|
|
42121
41468
|
return _initBasket.apply(this, arguments);
|
|
42122
41469
|
}
|
|
42123
41470
|
return initBasket;
|
|
@@ -42131,21 +41478,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42131
41478
|
}, {
|
|
42132
41479
|
key: "getValidVariantsLength",
|
|
42133
41480
|
value: function () {
|
|
42134
|
-
var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41481
|
+
var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
|
|
42135
41482
|
var set;
|
|
42136
|
-
return _regeneratorRuntime.wrap(function
|
|
42137
|
-
while (1) switch (
|
|
41483
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
41484
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
42138
41485
|
case 0:
|
|
42139
41486
|
set = this.actSet();
|
|
42140
|
-
|
|
41487
|
+
_context32.next = 3;
|
|
42141
41488
|
return favoritesHandlerInstance.getValidVariants(set, true);
|
|
42142
41489
|
case 3:
|
|
42143
|
-
return
|
|
41490
|
+
return _context32.abrupt("return", _context32.sent.length);
|
|
42144
41491
|
case 4:
|
|
42145
41492
|
case "end":
|
|
42146
|
-
return
|
|
41493
|
+
return _context32.stop();
|
|
42147
41494
|
}
|
|
42148
|
-
},
|
|
41495
|
+
}, _callee32, this);
|
|
42149
41496
|
}));
|
|
42150
41497
|
function getValidVariantsLength() {
|
|
42151
41498
|
return _getValidVariantsLength.apply(this, arguments);
|
|
@@ -42155,46 +41502,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42155
41502
|
}, {
|
|
42156
41503
|
key: "handleFavorites",
|
|
42157
41504
|
value: function () {
|
|
42158
|
-
var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41505
|
+
var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(mode) {
|
|
42159
41506
|
var _this4 = this;
|
|
42160
41507
|
var set, i;
|
|
42161
|
-
return _regeneratorRuntime.wrap(function
|
|
42162
|
-
while (1) switch (
|
|
41508
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
41509
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
42163
41510
|
case 0:
|
|
42164
41511
|
set = this.actSet();
|
|
42165
41512
|
i = 0;
|
|
42166
41513
|
case 2:
|
|
42167
41514
|
if (!favoritesHandlerInstance.IsCalcForSummary) {
|
|
42168
|
-
|
|
41515
|
+
_context33.next = 11;
|
|
42169
41516
|
break;
|
|
42170
41517
|
}
|
|
42171
|
-
|
|
41518
|
+
_context33.next = 5;
|
|
42172
41519
|
return DivaUtils.Sleep(200);
|
|
42173
41520
|
case 5:
|
|
42174
41521
|
i++;
|
|
42175
41522
|
if (!(i > 1000)) {
|
|
42176
|
-
|
|
41523
|
+
_context33.next = 9;
|
|
42177
41524
|
break;
|
|
42178
41525
|
}
|
|
42179
41526
|
LOG$1.error(new DivaError('error on generating Variants of Summary'));
|
|
42180
|
-
return
|
|
41527
|
+
return _context33.abrupt("break", 11);
|
|
42181
41528
|
case 9:
|
|
42182
|
-
|
|
41529
|
+
_context33.next = 2;
|
|
42183
41530
|
break;
|
|
42184
41531
|
case 11:
|
|
42185
|
-
|
|
41532
|
+
_context33.next = 13;
|
|
42186
41533
|
return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
|
|
42187
41534
|
return _this4.update2DGrid(set);
|
|
42188
41535
|
}, this.actions);
|
|
42189
41536
|
case 13:
|
|
42190
|
-
return
|
|
41537
|
+
return _context33.abrupt("return", _context33.sent);
|
|
42191
41538
|
case 14:
|
|
42192
41539
|
case "end":
|
|
42193
|
-
return
|
|
41540
|
+
return _context33.stop();
|
|
42194
41541
|
}
|
|
42195
|
-
},
|
|
41542
|
+
}, _callee33, this);
|
|
42196
41543
|
}));
|
|
42197
|
-
function handleFavorites(
|
|
41544
|
+
function handleFavorites(_x80) {
|
|
42198
41545
|
return _handleFavorites.apply(this, arguments);
|
|
42199
41546
|
}
|
|
42200
41547
|
return handleFavorites;
|
|
@@ -42207,48 +41554,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42207
41554
|
}, {
|
|
42208
41555
|
key: "initSapOrderLinesFromBasket",
|
|
42209
41556
|
value: function () {
|
|
42210
|
-
var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
41557
|
+
var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(divaNr, init3D, onlyLoadOldBakset) {
|
|
42211
41558
|
var result, oldBasket, basket;
|
|
42212
|
-
return _regeneratorRuntime.wrap(function
|
|
42213
|
-
while (1) switch (
|
|
41559
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
41560
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
42214
41561
|
case 0:
|
|
42215
41562
|
if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
|
|
42216
|
-
|
|
41563
|
+
_context34.next = 3;
|
|
42217
41564
|
return this.loadBasket();
|
|
42218
41565
|
case 3:
|
|
42219
|
-
result =
|
|
41566
|
+
result = _context34.sent;
|
|
42220
41567
|
if (!onlyLoadOldBakset) {
|
|
42221
|
-
|
|
41568
|
+
_context34.next = 6;
|
|
42222
41569
|
break;
|
|
42223
41570
|
}
|
|
42224
|
-
return
|
|
41571
|
+
return _context34.abrupt("return", {
|
|
42225
41572
|
oldBasket: new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
|
|
42226
41573
|
cache: {}
|
|
42227
41574
|
});
|
|
42228
41575
|
case 6:
|
|
42229
41576
|
if (!(result === false)) {
|
|
42230
|
-
|
|
41577
|
+
_context34.next = 8;
|
|
42231
41578
|
break;
|
|
42232
41579
|
}
|
|
42233
41580
|
throw new Error('Could not load basket! ' + divaNr);
|
|
42234
41581
|
case 8:
|
|
42235
41582
|
oldBasket = new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
|
|
42236
|
-
|
|
41583
|
+
_context34.next = 11;
|
|
42237
41584
|
return this.initBasket(init3D);
|
|
42238
41585
|
case 11:
|
|
42239
|
-
basket =
|
|
42240
|
-
return
|
|
41586
|
+
basket = _context34.sent;
|
|
41587
|
+
return _context34.abrupt("return", {
|
|
42241
41588
|
basket: basket,
|
|
42242
41589
|
oldBasket: oldBasket,
|
|
42243
41590
|
cache: this.api.getJsonDataCache()
|
|
42244
41591
|
});
|
|
42245
41592
|
case 13:
|
|
42246
41593
|
case "end":
|
|
42247
|
-
return
|
|
41594
|
+
return _context34.stop();
|
|
42248
41595
|
}
|
|
42249
|
-
},
|
|
41596
|
+
}, _callee34, this);
|
|
42250
41597
|
}));
|
|
42251
|
-
function initSapOrderLinesFromBasket(_x82, _x83
|
|
41598
|
+
function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
|
|
42252
41599
|
return _initSapOrderLinesFromBasket.apply(this, arguments);
|
|
42253
41600
|
}
|
|
42254
41601
|
return initSapOrderLinesFromBasket;
|
|
@@ -42273,6 +41620,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
|
|
|
42273
41620
|
}
|
|
42274
41621
|
return undefined;
|
|
42275
41622
|
}
|
|
41623
|
+
}, {
|
|
41624
|
+
key: "setsAsArray",
|
|
41625
|
+
get: function get() {
|
|
41626
|
+
return Object.values(this.sets);
|
|
41627
|
+
}
|
|
42276
41628
|
|
|
42277
41629
|
/**
|
|
42278
41630
|
* This function returns the planner mode.
|
|
@@ -60206,7 +59558,7 @@ var ProductHandler = /*#__PURE__*/function () {
|
|
|
60206
59558
|
}, {
|
|
60207
59559
|
key: "isSameProduct",
|
|
60208
59560
|
value: function isSameProduct(product, setHash, diva3dProject, orderLines, varinatData, catalogCodex) {
|
|
60209
|
-
var _product$articles;
|
|
59561
|
+
var _product$articles, _product$configuratio, _product$configuratio2;
|
|
60210
59562
|
//For new products we store the setHash and hqRenderScript in order to determine if the product changed.
|
|
60211
59563
|
if (product.uniqueHash !== undefined) {
|
|
60212
59564
|
return product.uniqueHash === 'v1' + setHash + md5(diva3dProject);
|
|
@@ -60217,22 +59569,22 @@ var ProductHandler = /*#__PURE__*/function () {
|
|
|
60217
59569
|
return false;
|
|
60218
59570
|
}
|
|
60219
59571
|
//For older products without setHash we use the old comparison logic
|
|
59572
|
+
var orderlines = (_product$configuratio = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[0].OrderLines) !== null && _product$configuratio !== void 0 ? _product$configuratio : [];
|
|
60220
59573
|
var _loop = function _loop() {
|
|
60221
|
-
var
|
|
60222
|
-
var article = product.articles[i];
|
|
59574
|
+
var article = orderlines[i];
|
|
60223
59575
|
var orderLine = orderLines.find(function (ol) {
|
|
60224
|
-
return ol.ArticleCodex == article.
|
|
59576
|
+
return ol.ArticleCodex == article.ArticleCodex && catalogCodex == article.CatalogCodex;
|
|
60225
59577
|
});
|
|
60226
|
-
if (!orderLine
|
|
59578
|
+
if (!orderLine) {
|
|
60227
59579
|
return {
|
|
60228
59580
|
v: false
|
|
60229
59581
|
};
|
|
60230
59582
|
}
|
|
60231
59583
|
var _loop2 = function _loop2() {
|
|
60232
|
-
var varinatValue = article.
|
|
60233
|
-
if (!
|
|
59584
|
+
var varinatValue = article.VariantBasketDatas[j];
|
|
59585
|
+
if (!varinatData.find(function (vb) {
|
|
60234
59586
|
return vb.OPT == varinatValue['OPT'] && vb.OPV == varinatValue['OPV'];
|
|
60235
|
-
}))
|
|
59587
|
+
})) {
|
|
60236
59588
|
return {
|
|
60237
59589
|
v: {
|
|
60238
59590
|
v: false
|
|
@@ -60241,14 +59593,14 @@ var ProductHandler = /*#__PURE__*/function () {
|
|
|
60241
59593
|
}
|
|
60242
59594
|
},
|
|
60243
59595
|
_ret2;
|
|
60244
|
-
for (var j = 0; j < (((_article$
|
|
60245
|
-
var _article$
|
|
59596
|
+
for (var j = 0; j < (((_article$VariantBaske = article.VariantBasketDatas) === null || _article$VariantBaske === void 0 ? void 0 : _article$VariantBaske.length) || 0); j++) {
|
|
59597
|
+
var _article$VariantBaske;
|
|
60246
59598
|
_ret2 = _loop2();
|
|
60247
59599
|
if (_ret2) return _ret2.v;
|
|
60248
59600
|
}
|
|
60249
59601
|
},
|
|
60250
59602
|
_ret;
|
|
60251
|
-
for (var i = 0; i <
|
|
59603
|
+
for (var i = 0; i < orderlines.length; i++) {
|
|
60252
59604
|
_ret = _loop();
|
|
60253
59605
|
if (_ret) return _ret.v;
|
|
60254
59606
|
}
|
|
@@ -60777,4 +60129,4 @@ var getOrigProductId = /*#__PURE__*/function () {
|
|
|
60777
60129
|
};
|
|
60778
60130
|
}();
|
|
60779
60131
|
|
|
60780
|
-
export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O,
|
|
60132
|
+
export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O, Rendering as R, Vector3 as V, setHandlerInstance as a, articleHandlerInstance as b, Vector2 as c, DivaWebPlanner as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, Vector4 as i, creatRenderOrders as j, getOrigProductId as k, loadAndRepairBasket as l, summaryHandlerInstance as s };
|