@colijnit/product 257.1.8 → 257.1.10
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/components/product-addtocart/product-addtocart.component.d.ts +4 -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 +69 -26
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product-257.1.9.tgz +0 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/components/image-carousel/image-carousel.component.js +2 -1
- 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/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/fesm2015/colijnit-product.js +45 -13
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -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.10";
|
|
35
|
+
this.publishDate = "20-6-2025 15:30:05";
|
|
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) {
|
|
@@ -1710,7 +1725,7 @@
|
|
|
1710
1725
|
this._ione.getFullArticle(this._sku).then(function (article) {
|
|
1711
1726
|
_this.article = article;
|
|
1712
1727
|
if (_this.article) {
|
|
1713
|
-
_this.configurable = _this.article.goodType === 'B';
|
|
1728
|
+
_this.configurable = !(_this.article.goodType === 'B' && !_this.article.isConfigurable);
|
|
1714
1729
|
if (_this.configurable) {
|
|
1715
1730
|
_this.showAddToCart = false;
|
|
1716
1731
|
_this.currentView = SelectorType.TwoD;
|
|
@@ -1748,7 +1763,7 @@
|
|
|
1748
1763
|
ProductPageComponent.decorators = [
|
|
1749
1764
|
{ type: i0.Component, args: [{
|
|
1750
1765
|
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",
|
|
1766
|
+
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
1767
|
animations: [
|
|
1753
1768
|
animations.trigger('toggleFullScreen', [
|
|
1754
1769
|
animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
|
|
@@ -2068,6 +2083,7 @@
|
|
|
2068
2083
|
var resizeCanvas = document.createElement('canvas');
|
|
2069
2084
|
var resizeCanvasContext = resizeCanvas.getContext('2d');
|
|
2070
2085
|
var resizeImage = document.createElement('img');
|
|
2086
|
+
resizeImage.crossOrigin = 'anonymous';
|
|
2071
2087
|
resizeImage.onload = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2072
2088
|
var originalWidth, originalHeight, aspectRatio, newWidth, newHeight, imageWidth, resizedSource;
|
|
2073
2089
|
return __generator(this, function (_a) {
|
|
@@ -2326,12 +2342,15 @@
|
|
|
2326
2342
|
this.fromPrice = this._pricing.retailBasePrice ? this._pricing.retailBasePrice : this._pricing.priceBaseline;
|
|
2327
2343
|
this.fromLabel = this._pricing.retailBasePrice ? 'PRICE' : 'FROM';
|
|
2328
2344
|
this.toPrice = undefined;
|
|
2345
|
+
this.toLabel = '';
|
|
2329
2346
|
}
|
|
2330
2347
|
else {
|
|
2331
|
-
|
|
2332
|
-
this.
|
|
2333
|
-
this.
|
|
2334
|
-
|
|
2348
|
+
var hasSuggested = this._pricing.retailSuggestedPrice !== undefined && this._pricing.retailSuggestedPrice !== null;
|
|
2349
|
+
this.fromPrice = hasSuggested ? this._pricing.retailSuggestedPrice : this._pricing.retailBasePrice;
|
|
2350
|
+
this.fromLabel = hasSuggested ? 'Was' : 'PRICE';
|
|
2351
|
+
// Always set toPrice to base price
|
|
2352
|
+
this.toPrice = this._pricing.retailBasePrice;
|
|
2353
|
+
this.toLabel = hasSuggested ? 'IS_NOW' : 'PRICE';
|
|
2335
2354
|
}
|
|
2336
2355
|
this._changeDetector.detectChanges();
|
|
2337
2356
|
}
|
|
@@ -2383,11 +2402,12 @@
|
|
|
2383
2402
|
];
|
|
2384
2403
|
|
|
2385
2404
|
var ProductAddtocartComponent = /** @class */ (function () {
|
|
2386
|
-
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
|
|
2405
|
+
function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService, _productConnectorAdapterService) {
|
|
2387
2406
|
this.iconCache = iconCache;
|
|
2388
2407
|
this._ioneControllerService = _ioneControllerService;
|
|
2389
2408
|
this._appEventService = _appEventService;
|
|
2390
2409
|
this._settingsService = _settingsService;
|
|
2410
|
+
this._productConnectorAdapterService = _productConnectorAdapterService;
|
|
2391
2411
|
this.icon = IconEnum;
|
|
2392
2412
|
this.createFrozenArticle = true;
|
|
2393
2413
|
this.configurable = false;
|
|
@@ -2429,40 +2449,52 @@
|
|
|
2429
2449
|
};
|
|
2430
2450
|
ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
|
|
2431
2451
|
return __awaiter(this, void 0, void 0, function () {
|
|
2432
|
-
var article, article, article;
|
|
2452
|
+
var article, generatedGoodId, articleFull, article, article, article;
|
|
2433
2453
|
return __generator(this, function (_a) {
|
|
2434
2454
|
switch (_a.label) {
|
|
2435
2455
|
case 0:
|
|
2436
|
-
if (!this.createFrozenArticle) return [3 /*break*/,
|
|
2437
|
-
if (!(this.article.goodType === 'B')) return [3 /*break*/,
|
|
2456
|
+
if (!this.createFrozenArticle) return [3 /*break*/, 11];
|
|
2457
|
+
if (!(this.article.goodType === 'B')) return [3 /*break*/, 6];
|
|
2458
|
+
if (!this.article.isConfigurable) return [3 /*break*/, 2];
|
|
2438
2459
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2439
2460
|
case 1:
|
|
2440
2461
|
article = _a.sent();
|
|
2441
2462
|
if (article) {
|
|
2442
2463
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2443
2464
|
}
|
|
2444
|
-
return [3 /*break*/,
|
|
2445
|
-
case 2:
|
|
2465
|
+
return [3 /*break*/, 5];
|
|
2466
|
+
case 2: return [4 /*yield*/, this._getGeneratedArtDirectly(this.article.goodId)];
|
|
2467
|
+
case 3:
|
|
2468
|
+
generatedGoodId = _a.sent();
|
|
2469
|
+
if (!generatedGoodId) return [3 /*break*/, 5];
|
|
2470
|
+
return [4 /*yield*/, this._productConnectorAdapterService.getArticleFullObject(generatedGoodId, true)];
|
|
2471
|
+
case 4:
|
|
2472
|
+
articleFull = _a.sent();
|
|
2473
|
+
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(articleFull);
|
|
2474
|
+
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2475
|
+
_a.label = 5;
|
|
2476
|
+
case 5: return [3 /*break*/, 10];
|
|
2477
|
+
case 6:
|
|
2446
2478
|
article = void 0;
|
|
2447
|
-
if (!!!this.externalSource) return [3 /*break*/,
|
|
2479
|
+
if (!!!this.externalSource) return [3 /*break*/, 8];
|
|
2448
2480
|
return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
|
|
2449
|
-
case
|
|
2481
|
+
case 7:
|
|
2450
2482
|
article = _a.sent();
|
|
2451
|
-
return [3 /*break*/,
|
|
2452
|
-
case
|
|
2483
|
+
return [3 /*break*/, 9];
|
|
2484
|
+
case 8:
|
|
2453
2485
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2454
|
-
_a.label =
|
|
2455
|
-
case
|
|
2486
|
+
_a.label = 9;
|
|
2487
|
+
case 9:
|
|
2456
2488
|
if (article) {
|
|
2457
2489
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2458
2490
|
}
|
|
2459
|
-
_a.label =
|
|
2460
|
-
case
|
|
2461
|
-
case
|
|
2491
|
+
_a.label = 10;
|
|
2492
|
+
case 10: return [3 /*break*/, 12];
|
|
2493
|
+
case 11:
|
|
2462
2494
|
article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
2463
2495
|
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
2464
|
-
_a.label =
|
|
2465
|
-
case
|
|
2496
|
+
_a.label = 12;
|
|
2497
|
+
case 12: return [2 /*return*/];
|
|
2466
2498
|
}
|
|
2467
2499
|
});
|
|
2468
2500
|
});
|
|
@@ -2501,6 +2533,16 @@
|
|
|
2501
2533
|
});
|
|
2502
2534
|
});
|
|
2503
2535
|
};
|
|
2536
|
+
ProductAddtocartComponent.prototype._getGeneratedArtDirectly = function (goodId) {
|
|
2537
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2538
|
+
return __generator(this, function (_a) {
|
|
2539
|
+
switch (_a.label) {
|
|
2540
|
+
case 0: return [4 /*yield*/, this._ioneControllerService.getGeneratedArtDirectly(goodId, true)];
|
|
2541
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
});
|
|
2545
|
+
};
|
|
2504
2546
|
return ProductAddtocartComponent;
|
|
2505
2547
|
}());
|
|
2506
2548
|
ProductAddtocartComponent.decorators = [
|
|
@@ -2514,7 +2556,8 @@
|
|
|
2514
2556
|
{ type: IconCacheService },
|
|
2515
2557
|
{ type: ProductConnectorService },
|
|
2516
2558
|
{ type: ProductEventService },
|
|
2517
|
-
{ type: ProductSettingsService }
|
|
2559
|
+
{ type: ProductSettingsService },
|
|
2560
|
+
{ type: ProductConnectorAdapterService }
|
|
2518
2561
|
]; };
|
|
2519
2562
|
ProductAddtocartComponent.propDecorators = {
|
|
2520
2563
|
addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],
|