@colijnit/product 257.1.9 → 257.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/bundle/service/local-storage.service.d.ts +14 -0
- package/app/components/product-addtocart/product-addtocart.component.d.ts +4 -1
- package/app/ione-product.component.d.ts +6 -1
- package/app/service/product-connector-adapter.service.d.ts +1 -0
- package/app/service/product-connector.service.d.ts +1 -0
- package/bundles/colijnit-product.umd.js +154 -30
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.d.ts +1 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/bundle/service/local-storage.service.js +37 -0
- package/esm2015/app/components/product-addtocart/product-addtocart.component.js +24 -6
- package/esm2015/app/components/product-page/product-page.component.js +3 -3
- package/esm2015/app/components/product-price/product-price.component.js +8 -5
- package/esm2015/app/ione-product.component.js +35 -4
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-connector-adapter.service.js +9 -1
- package/esm2015/app/service/product-connector.service.js +4 -1
- package/esm2015/colijnit-product.js +2 -1
- package/fesm2015/colijnit-product.js +113 -17
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class RootStorageObject {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class LocalStorageService {
|
|
5
|
+
readonly storage: Storage;
|
|
6
|
+
protected _appRoot: string;
|
|
7
|
+
protected _storageObj: RootStorageObject;
|
|
8
|
+
constructor();
|
|
9
|
+
save(): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
set id(id: string);
|
|
12
|
+
get id(): string;
|
|
13
|
+
protected _initLocalStorageObj(): void;
|
|
14
|
+
}
|
|
@@ -6,11 +6,13 @@ import { ProductEventService } from '../../service/product-event.service';
|
|
|
6
6
|
import { ArticleFullObject } from '@colijnit/articleapi/build/model/article-full-object';
|
|
7
7
|
import { ProductSettingsService } from '../../service/product-settings.service';
|
|
8
8
|
import { ExternalSource } from '@colijnit/articleapi/build/model/external-source.bo';
|
|
9
|
+
import { ProductConnectorAdapterService } from '../../service/product-connector-adapter.service';
|
|
9
10
|
export declare class ProductAddtocartComponent implements OnInit, OnDestroy {
|
|
10
11
|
iconCache: IconCacheService;
|
|
11
12
|
private _ioneControllerService;
|
|
12
13
|
private _appEventService;
|
|
13
14
|
private _settingsService;
|
|
15
|
+
private _productConnectorAdapterService;
|
|
14
16
|
readonly icon: typeof IconEnum;
|
|
15
17
|
addToCartButton: ElementRef;
|
|
16
18
|
article: ArticleFullObject;
|
|
@@ -29,10 +31,11 @@ export declare class ProductAddtocartComponent implements OnInit, OnDestroy {
|
|
|
29
31
|
showRelatedPopup: EventEmitter<boolean>;
|
|
30
32
|
showQuoteButton: boolean;
|
|
31
33
|
private _quantity;
|
|
32
|
-
constructor(iconCache: IconCacheService, _ioneControllerService: ProductConnectorService, _appEventService: ProductEventService, _settingsService: ProductSettingsService);
|
|
34
|
+
constructor(iconCache: IconCacheService, _ioneControllerService: ProductConnectorService, _appEventService: ProductEventService, _settingsService: ProductSettingsService, _productConnectorAdapterService: ProductConnectorAdapterService);
|
|
33
35
|
ngOnInit(): void;
|
|
34
36
|
ngOnDestroy(): void;
|
|
35
37
|
handleAddToCartClick(quantity: number): Promise<void>;
|
|
36
38
|
handleAddToQuoteClick(quantity: number): Promise<void>;
|
|
37
39
|
private _getJSONFromArticleObject;
|
|
40
|
+
private _getGeneratedArtDirectly;
|
|
38
41
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ProductConnectorService } from './service/product-connector.service';
|
|
2
3
|
import { ProductEventService } from './service/product-event.service';
|
|
3
4
|
import { ArticleListObject } from '@colijnit/articleapi/build/model/article-list-object';
|
|
4
5
|
import { ProductSettingsService } from './service/product-settings.service';
|
|
5
6
|
import { Selection } from '@colijnit/articleapi/build/model/selection';
|
|
6
7
|
import { ArticleQuickSel } from '@colijnit/articleapi/build/model/article-quick-sel';
|
|
7
8
|
import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/article-list-object-extended.bo';
|
|
9
|
+
import { LocalStorageService } from "./bundle/service/local-storage.service";
|
|
8
10
|
export declare class IoneProductComponent implements OnInit, OnDestroy {
|
|
9
11
|
private _appEventService;
|
|
10
12
|
private _settingsService;
|
|
13
|
+
private _productConnectorService;
|
|
14
|
+
private _localStorageService;
|
|
11
15
|
sku: string;
|
|
12
16
|
isReturn: boolean;
|
|
13
17
|
showRelatedProductsPopup: boolean;
|
|
14
18
|
set settings(value: any);
|
|
15
19
|
get settings(): any;
|
|
16
20
|
handleAddArticleInternally: boolean;
|
|
21
|
+
handleAddToCartInternally: boolean;
|
|
17
22
|
onAddToCart: EventEmitter<{
|
|
18
23
|
article: string | ArticleListObjectExtended;
|
|
19
24
|
quantity: number;
|
|
@@ -30,7 +35,7 @@ export declare class IoneProductComponent implements OnInit, OnDestroy {
|
|
|
30
35
|
showHD: boolean;
|
|
31
36
|
private _settings;
|
|
32
37
|
private _subs;
|
|
33
|
-
constructor(_appEventService: ProductEventService, _settingsService: ProductSettingsService);
|
|
38
|
+
constructor(_appEventService: ProductEventService, _settingsService: ProductSettingsService, _productConnectorService: ProductConnectorService, _localStorageService: LocalStorageService);
|
|
34
39
|
ngOnInit(): Promise<void>;
|
|
35
40
|
ngOnDestroy(): void;
|
|
36
41
|
private _handleAnswerInfoReceived;
|
|
@@ -29,6 +29,7 @@ export declare class ProductConnectorAdapterService implements OnDestroy {
|
|
|
29
29
|
getDeliveryDate2(goodId: number): Promise<DeliveryPrognosis>;
|
|
30
30
|
getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
31
31
|
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, instanceId?: any, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
32
|
+
getGeneratedArtDirectly(goodId: number, showLoader: boolean): Promise<number>;
|
|
32
33
|
getGoodIdFromArticleNr(sku: string): Promise<number>;
|
|
33
34
|
getArticleFullObject(goodId: number, showLoader?: boolean): Promise<ArticleFullObject>;
|
|
34
35
|
getSuperArticle(id: string, branch?: string): Promise<SuperArticle>;
|
|
@@ -33,6 +33,7 @@ export declare class ProductConnectorService implements OnDestroy {
|
|
|
33
33
|
getDeliveryDate2(goodId: number): Promise<DeliveryPrognosis>;
|
|
34
34
|
getSuperArticle(id: string): Promise<SuperArticle>;
|
|
35
35
|
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
36
|
+
getGeneratedArtDirectly(goodId: number, showLoader?: boolean): Promise<number>;
|
|
36
37
|
addWebSessionTransactionLine(transactionUuid: string, sku: string, quantity: number): Promise<string>;
|
|
37
38
|
onShowLoaderChange(showLoader: boolean): void;
|
|
38
39
|
}
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
function Version() {
|
|
32
32
|
this.name = "@colijnit/product";
|
|
33
33
|
this.description = "Product detail page project for iOne";
|
|
34
|
-
this.symVer = "257.1.
|
|
35
|
-
this.publishDate = "
|
|
34
|
+
this.symVer = "257.1.11";
|
|
35
|
+
this.publishDate = "2-7-2025 11:03:13";
|
|
36
36
|
}
|
|
37
37
|
return Version;
|
|
38
38
|
}());
|
|
@@ -748,6 +748,17 @@
|
|
|
748
748
|
});
|
|
749
749
|
});
|
|
750
750
|
};
|
|
751
|
+
ProductConnectorAdapterService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
|
|
752
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
753
|
+
var _this = this;
|
|
754
|
+
return __generator(this, function (_a) {
|
|
755
|
+
return [2 /*return*/, this.articleConnector.getGeneratedArtDirectly(goodId, showLoader).catch(function (messages) {
|
|
756
|
+
_this._eventService.errorMessage.next(messages);
|
|
757
|
+
return null;
|
|
758
|
+
})];
|
|
759
|
+
});
|
|
760
|
+
});
|
|
761
|
+
};
|
|
751
762
|
ProductConnectorAdapterService.prototype.getGoodIdFromArticleNr = function (sku) {
|
|
752
763
|
return __awaiter(this, void 0, void 0, function () {
|
|
753
764
|
var response;
|
|
@@ -1302,6 +1313,10 @@
|
|
|
1302
1313
|
if (showLoader === void 0) { showLoader = true; }
|
|
1303
1314
|
return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, this._instanceId, configuratorStatistics);
|
|
1304
1315
|
};
|
|
1316
|
+
ProductConnectorService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
|
|
1317
|
+
if (showLoader === void 0) { showLoader = true; }
|
|
1318
|
+
return this._adapterService.getGeneratedArtDirectly(goodId, showLoader);
|
|
1319
|
+
};
|
|
1305
1320
|
ProductConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
|
|
1306
1321
|
return __awaiter(this, void 0, void 0, function () {
|
|
1307
1322
|
return __generator(this, function (_a) {
|
|
@@ -1325,8 +1340,51 @@
|
|
|
1325
1340
|
{ type: ProductSettingsService }
|
|
1326
1341
|
]; };
|
|
1327
1342
|
|
|
1343
|
+
var RootStorageObject = /** @class */ (function () {
|
|
1344
|
+
function RootStorageObject() {
|
|
1345
|
+
}
|
|
1346
|
+
return RootStorageObject;
|
|
1347
|
+
}());
|
|
1348
|
+
var LocalStorageService = /** @class */ (function () {
|
|
1349
|
+
function LocalStorageService() {
|
|
1350
|
+
this.storage = localStorage;
|
|
1351
|
+
this._appRoot = "web-order";
|
|
1352
|
+
this._storageObj = new RootStorageObject();
|
|
1353
|
+
this._initLocalStorageObj();
|
|
1354
|
+
}
|
|
1355
|
+
LocalStorageService.prototype.save = function () {
|
|
1356
|
+
this.storage.setItem(this._appRoot, JSON.stringify(this._storageObj));
|
|
1357
|
+
};
|
|
1358
|
+
LocalStorageService.prototype.clear = function () {
|
|
1359
|
+
this.storage.clear();
|
|
1360
|
+
};
|
|
1361
|
+
Object.defineProperty(LocalStorageService.prototype, "id", {
|
|
1362
|
+
get: function () {
|
|
1363
|
+
return this._storageObj ? this._storageObj.id : "";
|
|
1364
|
+
},
|
|
1365
|
+
set: function (id) {
|
|
1366
|
+
this._storageObj.id = id;
|
|
1367
|
+
this.save();
|
|
1368
|
+
},
|
|
1369
|
+
enumerable: false,
|
|
1370
|
+
configurable: true
|
|
1371
|
+
});
|
|
1372
|
+
LocalStorageService.prototype._initLocalStorageObj = function () {
|
|
1373
|
+
this._storageObj = JSON.parse(this.storage.getItem(this._appRoot)) || this._storageObj;
|
|
1374
|
+
this.save();
|
|
1375
|
+
};
|
|
1376
|
+
return LocalStorageService;
|
|
1377
|
+
}());
|
|
1378
|
+
LocalStorageService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalStorageService_Factory() { return new LocalStorageService(); }, token: LocalStorageService, providedIn: "root" });
|
|
1379
|
+
LocalStorageService.decorators = [
|
|
1380
|
+
{ type: i0.Injectable, args: [{
|
|
1381
|
+
providedIn: 'root'
|
|
1382
|
+
},] }
|
|
1383
|
+
];
|
|
1384
|
+
LocalStorageService.ctorParameters = function () { return []; };
|
|
1385
|
+
|
|
1328
1386
|
var IoneProductComponent = /** @class */ (function () {
|
|
1329
|
-
function IoneProductComponent(_appEventService, _settingsService) {
|
|
1387
|
+
function IoneProductComponent(_appEventService, _settingsService, _productConnectorService, _localStorageService) {
|
|
1330
1388
|
var _this = this;
|
|
1331
1389
|
// this.sku = 'CF-HILL';
|
|
1332
1390
|
// this.sku = 'CF-ALMADA';
|
|
@@ -1342,7 +1400,10 @@
|
|
|
1342
1400
|
// this.sku = "grover";
|
|
1343
1401
|
this._appEventService = _appEventService;
|
|
1344
1402
|
this._settingsService = _settingsService;
|
|
1403
|
+
this._productConnectorService = _productConnectorService;
|
|
1404
|
+
this._localStorageService = _localStorageService;
|
|
1345
1405
|
this.handleAddArticleInternally = true;
|
|
1406
|
+
this.handleAddToCartInternally = false;
|
|
1346
1407
|
this.onAddToCart = new i0.EventEmitter();
|
|
1347
1408
|
this.forceRenderImage = new i0.EventEmitter();
|
|
1348
1409
|
this.onAlternativeClick = new i0.EventEmitter();
|
|
@@ -1404,9 +1465,41 @@
|
|
|
1404
1465
|
};
|
|
1405
1466
|
IoneProductComponent.prototype._handleAddToCart = function (data) {
|
|
1406
1467
|
return __awaiter(this, void 0, void 0, function () {
|
|
1468
|
+
var article, transactionId, transactionId;
|
|
1407
1469
|
return __generator(this, function (_a) {
|
|
1408
|
-
|
|
1409
|
-
|
|
1470
|
+
switch (_a.label) {
|
|
1471
|
+
case 0:
|
|
1472
|
+
if (!this.handleAddToCartInternally) return [3 /*break*/, 7];
|
|
1473
|
+
if (!(data && data.article)) return [3 /*break*/, 6];
|
|
1474
|
+
if (!(typeof data.article === 'string')) return [3 /*break*/, 3];
|
|
1475
|
+
article = JSON.parse(data.article);
|
|
1476
|
+
if (!(article.selectorData && article.selectorData.compositions)) return [3 /*break*/, 2];
|
|
1477
|
+
return [4 /*yield*/, this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, article.selectorData.compositions[0].compositionArticleNo, data.quantity)];
|
|
1478
|
+
case 1:
|
|
1479
|
+
transactionId = _a.sent();
|
|
1480
|
+
if (transactionId) {
|
|
1481
|
+
this._localStorageService.id = transactionId;
|
|
1482
|
+
}
|
|
1483
|
+
_a.label = 2;
|
|
1484
|
+
case 2: return [3 /*break*/, 5];
|
|
1485
|
+
case 3:
|
|
1486
|
+
if (!data.article.hasOwnProperty('articleNr')) return [3 /*break*/, 5];
|
|
1487
|
+
return [4 /*yield*/, this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, data.article['articleNr'], data.quantity)];
|
|
1488
|
+
case 4:
|
|
1489
|
+
transactionId = _a.sent();
|
|
1490
|
+
if (transactionId) {
|
|
1491
|
+
this._localStorageService.id = transactionId;
|
|
1492
|
+
}
|
|
1493
|
+
_a.label = 5;
|
|
1494
|
+
case 5:
|
|
1495
|
+
this.onAddToCart.next(data);
|
|
1496
|
+
_a.label = 6;
|
|
1497
|
+
case 6: return [3 /*break*/, 8];
|
|
1498
|
+
case 7:
|
|
1499
|
+
this.onAddToCart.emit(data);
|
|
1500
|
+
_a.label = 8;
|
|
1501
|
+
case 8: return [2 /*return*/];
|
|
1502
|
+
}
|
|
1410
1503
|
});
|
|
1411
1504
|
});
|
|
1412
1505
|
};
|
|
@@ -1431,7 +1524,9 @@
|
|
|
1431
1524
|
];
|
|
1432
1525
|
IoneProductComponent.ctorParameters = function () { return [
|
|
1433
1526
|
{ type: ProductEventService },
|
|
1434
|
-
{ type: ProductSettingsService }
|
|
1527
|
+
{ type: ProductSettingsService },
|
|
1528
|
+
{ type: ProductConnectorService },
|
|
1529
|
+
{ type: LocalStorageService }
|
|
1435
1530
|
]; };
|
|
1436
1531
|
IoneProductComponent.propDecorators = {
|
|
1437
1532
|
sku: [{ type: i0.Input }],
|
|
@@ -1439,6 +1534,7 @@
|
|
|
1439
1534
|
showRelatedProductsPopup: [{ type: i0.Input }],
|
|
1440
1535
|
settings: [{ type: i0.Input }],
|
|
1441
1536
|
handleAddArticleInternally: [{ type: i0.Input }],
|
|
1537
|
+
handleAddToCartInternally: [{ type: i0.Input }],
|
|
1442
1538
|
onAddToCart: [{ type: i0.Output }],
|
|
1443
1539
|
forceRenderImage: [{ type: i0.Output }],
|
|
1444
1540
|
onAlternativeClick: [{ type: i0.Output }],
|
|
@@ -1710,7 +1806,7 @@
|
|
|
1710
1806
|
this._ione.getFullArticle(this._sku).then(function (article) {
|
|
1711
1807
|
_this.article = article;
|
|
1712
1808
|
if (_this.article) {
|
|
1713
|
-
_this.configurable = _this.article.goodType === 'B';
|
|
1809
|
+
_this.configurable = _this.article.goodType === 'B' && (_this.article.isConfigurable || _this.article.isConfigurable === undefined);
|
|
1714
1810
|
if (_this.configurable) {
|
|
1715
1811
|
_this.showAddToCart = false;
|
|
1716
1812
|
_this.currentView = SelectorType.TwoD;
|
|
@@ -1748,7 +1844,7 @@
|
|
|
1748
1844
|
ProductPageComponent.decorators = [
|
|
1749
1845
|
{ type: i0.Component, args: [{
|
|
1750
1846
|
selector: 'app-product-page',
|
|
1751
|
-
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n (onAnswersAvailable)=\"appEventService.onAnswersAvailable.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n (showRelatedPopup)=\"handlePopUpChange($event)\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n [label]=\"'RELATED_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"4\"\r\n [isSmallModus]=\"false\"\r\n [label]=\"'ALTERNATIVE_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"showRelatedProductsPopup\">\r\n <co-product-dialog\r\n [mainArticle]=\"article\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n (closeRelatedPopup)=\"handlePopUpChange($event)\"\r\n >\r\n </co-product-dialog>\r\n\r\n<!-- <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"-->\r\n<!-- [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>-->\r\n </div>\r\n\r\n\r\n </div>\r\n</ng-container>\r\n",
|
|
1847
|
+
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded && this.configurable\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n (onAnswersAvailable)=\"appEventService.onAnswersAvailable.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n (showRelatedPopup)=\"handlePopUpChange($event)\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [showAddToCart]=\"showAddToCart\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n [externalSource]=\"externalSource\"\r\n [isReturn]=\"isReturn\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n [label]=\"'RELATED_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related\r\n *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [externalSource]=\"externalSource\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"4\"\r\n [isSmallModus]=\"false\"\r\n [label]=\"'ALTERNATIVE_PRODUCTS' | localize\">\r\n </app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"showRelatedProductsPopup\">\r\n <co-product-dialog\r\n [mainArticle]=\"article\"\r\n [articles]=\"article?.relatedArticles\"\r\n [refType]=\"1\"\r\n (closeRelatedPopup)=\"handlePopUpChange($event)\"\r\n >\r\n </co-product-dialog>\r\n\r\n<!-- <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"-->\r\n<!-- [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>-->\r\n </div>\r\n\r\n\r\n </div>\r\n</ng-container>\r\n",
|
|
1752
1848
|
animations: [
|
|
1753
1849
|
animations.trigger('toggleFullScreen', [
|
|
1754
1850
|
animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
|
|
@@ -2327,12 +2423,15 @@
|
|
|
2327
2423
|
this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
|
|
2328
2424
|
this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
|
|
2329
2425
|
this.toPrice = undefined;
|
|
2426
|
+
this.toLabel = '';
|
|
2330
2427
|
}
|
|
2331
2428
|
else {
|
|
2332
|
-
|
|
2333
|
-
this.
|
|
2334
|
-
this.
|
|
2335
|
-
|
|
2429
|
+
var hasSuggested = this._pricing.retailSuggestedPrice !== undefined && this._pricing.retailSuggestedPrice !== null;
|
|
2430
|
+
this.fromPrice = hasSuggested ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
|
|
2431
|
+
this.fromLabel = hasSuggested ? 'Was' : 'PRICE';
|
|
2432
|
+
// Always set toPrice to base price
|
|
2433
|
+
this.toPrice = this._pricing.retailBasePrice;
|
|
2434
|
+
this.toLabel = hasSuggested ? 'IS_NOW' : 'PRICE';
|
|
2336
2435
|
}
|
|
2337
2436
|
this._changeDetector.detectChanges();
|
|
2338
2437
|
}
|
|
@@ -2384,11 +2483,12 @@
|
|
|
2384
2483
|
];
|
|
2385
2484
|
|
|
2386
2485
|
var ProductAddtocartComponent = /** @class */ (function () {
|
|
2387
|
-
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
|
|
2486
|
+
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService, _productConnectorAdapterService) {
|
|
2388
2487
|
this.iconCache = iconCache;
|
|
2389
2488
|
this._ioneControllerService = _ioneControllerService;
|
|
2390
2489
|
this._appEventService = _appEventService;
|
|
2391
2490
|
this._settingsService = _settingsService;
|
|
2491
|
+
this._productConnectorAdapterService = _productConnectorAdapterService;
|
|
2392
2492
|
this.icon = IconEnum;
|
|
2393
2493
|
this.createFrozenArticle = true;
|
|
2394
2494
|
this.configurable = false;
|
|
@@ -2430,40 +2530,52 @@
|
|
|
2430
2530
|
};
|
|
2431
2531
|
ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
|
|
2432
2532
|
return __awaiter(this, void 0, void 0, function () {
|
|
2433
|
-
var article, article, article;
|
|
2533
|
+
var article, generatedGoodId, articleFull, article, article, article;
|
|
2434
2534
|
return __generator(this, function (_a) {
|
|
2435
2535
|
switch (_a.label) {
|
|
2436
2536
|
case 0:
|
|
2437
|
-
if (!this.createFrozenArticle) return [3 /*break*/,
|
|
2438
|
-
if (!(this.article.goodType === 'B')) return [3 /*break*/,
|
|
2537
|
+
if (!this.createFrozenArticle) return [3 /*break*/, 11];
|
|
2538
|
+
if (!(this.article.goodType === 'B')) return [3 /*break*/, 6];
|
|
2539
|
+
if (!this.article.isConfigurable) return [3 /*break*/, 2];
|
|
2439
2540
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2440
2541
|
case 1:
|
|
2441
2542
|
article = _a.sent();
|
|
2442
2543
|
if (article) {
|
|
2443
2544
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2444
2545
|
}
|
|
2445
|
-
return [3 /*break*/,
|
|
2446
|
-
case 2:
|
|
2546
|
+
return [3 /*break*/, 5];
|
|
2547
|
+
case 2: return [4 /*yield*/, this._getGeneratedArtDirectly(this.article.goodId)];
|
|
2548
|
+
case 3:
|
|
2549
|
+
generatedGoodId = _a.sent();
|
|
2550
|
+
if (!generatedGoodId) return [3 /*break*/, 5];
|
|
2551
|
+
return [4 /*yield*/, this._productConnectorAdapterService.getArticleFullObject(generatedGoodId, true)];
|
|
2552
|
+
case 4:
|
|
2553
|
+
articleFull = _a.sent();
|
|
2554
|
+
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(articleFull);
|
|
2555
|
+
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2556
|
+
_a.label = 5;
|
|
2557
|
+
case 5: return [3 /*break*/, 10];
|
|
2558
|
+
case 6:
|
|
2447
2559
|
article = void 0;
|
|
2448
|
-
if (!!!this.externalSource) return [3 /*break*/,
|
|
2560
|
+
if (!!!this.externalSource) return [3 /*break*/, 8];
|
|
2449
2561
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2450
|
-
case
|
|
2562
|
+
case 7:
|
|
2451
2563
|
article = _a.sent();
|
|
2452
|
-
return [3 /*break*/,
|
|
2453
|
-
case
|
|
2564
|
+
return [3 /*break*/, 9];
|
|
2565
|
+
case 8:
|
|
2454
2566
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2455
|
-
_a.label =
|
|
2456
|
-
case
|
|
2567
|
+
_a.label = 9;
|
|
2568
|
+
case 9:
|
|
2457
2569
|
if (article) {
|
|
2458
2570
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2459
2571
|
}
|
|
2460
|
-
_a.label =
|
|
2461
|
-
case
|
|
2462
|
-
case
|
|
2572
|
+
_a.label = 10;
|
|
2573
|
+
case 10: return [3 /*break*/, 12];
|
|
2574
|
+
case 11:
|
|
2463
2575
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2464
2576
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2465
|
-
_a.label =
|
|
2466
|
-
case
|
|
2577
|
+
_a.label = 12;
|
|
2578
|
+
case 12: return [2 /*return*/];
|
|
2467
2579
|
}
|
|
2468
2580
|
});
|
|
2469
2581
|
});
|
|
@@ -2502,6 +2614,16 @@
|
|
|
2502
2614
|
});
|
|
2503
2615
|
});
|
|
2504
2616
|
};
|
|
2617
|
+
ProductAddtocartComponent.prototype._getGeneratedArtDirectly = function (goodId) {
|
|
2618
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2619
|
+
return __generator(this, function (_a) {
|
|
2620
|
+
switch (_a.label) {
|
|
2621
|
+
case 0: return [4 /*yield*/, this._ioneControllerService.getGeneratedArtDirectly(goodId, true)];
|
|
2622
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2625
|
+
});
|
|
2626
|
+
};
|
|
2505
2627
|
return ProductAddtocartComponent;
|
|
2506
2628
|
}());
|
|
2507
2629
|
ProductAddtocartComponent.decorators = [
|
|
@@ -2515,7 +2637,8 @@
|
|
|
2515
2637
|
{ type: IconCacheService },
|
|
2516
2638
|
{ type: ProductConnectorService },
|
|
2517
2639
|
{ type: ProductEventService },
|
|
2518
|
-
{ type: ProductSettingsService }
|
|
2640
|
+
{ type: ProductSettingsService },
|
|
2641
|
+
{ type: ProductConnectorAdapterService }
|
|
2519
2642
|
]; };
|
|
2520
2643
|
ProductAddtocartComponent.propDecorators = {
|
|
2521
2644
|
addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],
|
|
@@ -3910,6 +4033,7 @@
|
|
|
3910
4033
|
exports["ɵbn"] = ProductHdModule;
|
|
3911
4034
|
exports["ɵbo"] = ProductHdComponent;
|
|
3912
4035
|
exports["ɵbp"] = ProductScriptLoaderService;
|
|
4036
|
+
exports["ɵbq"] = LocalStorageService;
|
|
3913
4037
|
exports["ɵc"] = PipeModule;
|
|
3914
4038
|
exports["ɵd"] = LocalizePipe;
|
|
3915
4039
|
exports["ɵe"] = DictionaryService;
|