@colijnit/product 258.1.5 → 259.1.0

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.
@@ -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 = "258.1.5";
35
- this.publishDate = "9-7-2025 14:07:55";
34
+ this.symVer = "259.1.0";
35
+ this.publishDate = "7/9/2025, 9:58:59 AM";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -750,6 +750,17 @@
750
750
  });
751
751
  });
752
752
  };
753
+ ProductConnectorAdapterService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
754
+ return __awaiter(this, void 0, void 0, function () {
755
+ var _this = this;
756
+ return __generator(this, function (_a) {
757
+ return [2 /*return*/, this.articleConnector.getGeneratedArtDirectly(goodId, showLoader).catch(function (messages) {
758
+ _this._eventService.errorMessage.next(messages);
759
+ return null;
760
+ })];
761
+ });
762
+ });
763
+ };
753
764
  ProductConnectorAdapterService.prototype.getGoodIdFromArticleNr = function (sku) {
754
765
  return __awaiter(this, void 0, void 0, function () {
755
766
  var response;
@@ -1304,6 +1315,10 @@
1304
1315
  if (showLoader === void 0) { showLoader = true; }
1305
1316
  return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, this._instanceId, configuratorStatistics);
1306
1317
  };
1318
+ ProductConnectorService.prototype.getGeneratedArtDirectly = function (goodId, showLoader) {
1319
+ if (showLoader === void 0) { showLoader = true; }
1320
+ return this._adapterService.getGeneratedArtDirectly(goodId, showLoader);
1321
+ };
1307
1322
  ProductConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
1308
1323
  return __awaiter(this, void 0, void 0, function () {
1309
1324
  return __generator(this, function (_a) {
@@ -1808,7 +1823,8 @@
1808
1823
  this._ione.getFullArticle(this._sku).then(function (article) {
1809
1824
  _this.article = article;
1810
1825
  if (_this.article) {
1811
- _this.configurable = _this.article.goodType === 'B';
1826
+ _this.configurable = _this.article.goodType === 'B' && (_this.article.isConfigurable || _this.article.isConfigurable === undefined);
1827
+ // this.configurable = this.article.goodType === 'B';
1812
1828
  if (_this.configurable) {
1813
1829
  _this.showAddToCart = false;
1814
1830
  _this.currentView = SelectorType.TwoD;
@@ -1846,7 +1862,7 @@
1846
1862
  ProductPageComponent.decorators = [
1847
1863
  { type: i0.Component, args: [{
1848
1864
  selector: 'app-product-page',
1849
- 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\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator\r\n #configurator\r\n 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\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\"\r\n [class.show-selections]=\"configuring\"\r\n [@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 (onReadyToRender)=\"appEventService.onReadyToRender.next($event.detail)\"\r\n (onRenderImageReceived)=\"appEventService.onRenderImageReceived.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",
1865
+ 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\r\n <app-image-carousel\r\n *ngIf=\"!enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [images]=\"article?.images\"\r\n [showRefresh]=\"configurable && threeD\">\r\n </app-image-carousel>\r\n\r\n <app-render-carousel\r\n *ngIf=\"enableRenderCarousel\"\r\n [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\"\r\n [article]=\"article\">\r\n </app-render-carousel>\r\n\r\n <ng-container *ngIf=\"settingsLoaded && this.configurable\">\r\n <threed-configurator\r\n #configurator\r\n 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\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\"\r\n [class.show-selections]=\"configuring\"\r\n [@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 (onReadyToRender)=\"appEventService.onReadyToRender.next($event.detail)\"\r\n (onRenderImageReceived)=\"appEventService.onRenderImageReceived.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",
1850
1866
  animations: [
1851
1867
  animations.trigger('toggleFullScreen', [
1852
1868
  animations.state('fullscreen', animations.style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
@@ -2487,11 +2503,12 @@
2487
2503
  ];
2488
2504
 
2489
2505
  var ProductAddtocartComponent = /** @class */ (function () {
2490
- function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService) {
2506
+ function ProductAddtocartComponent(iconCache, _ioneControllerService, _appEventService, _settingsService, _productConnectorAdapterService) {
2491
2507
  this.iconCache = iconCache;
2492
2508
  this._ioneControllerService = _ioneControllerService;
2493
2509
  this._appEventService = _appEventService;
2494
2510
  this._settingsService = _settingsService;
2511
+ this._productConnectorAdapterService = _productConnectorAdapterService;
2495
2512
  this.icon = IconEnum;
2496
2513
  this.createFrozenArticle = true;
2497
2514
  this.configurable = false;
@@ -2533,40 +2550,52 @@
2533
2550
  };
2534
2551
  ProductAddtocartComponent.prototype.handleAddToCartClick = function (quantity) {
2535
2552
  return __awaiter(this, void 0, void 0, function () {
2536
- var article, article, article;
2553
+ var article, generatedGoodId, articleFull, article, article, article;
2537
2554
  return __generator(this, function (_a) {
2538
2555
  switch (_a.label) {
2539
2556
  case 0:
2540
- if (!this.createFrozenArticle) return [3 /*break*/, 7];
2541
- if (!(this.article.goodType === 'B')) return [3 /*break*/, 2];
2557
+ if (!this.createFrozenArticle) return [3 /*break*/, 11];
2558
+ if (!(this.article.goodType === 'B')) return [3 /*break*/, 6];
2559
+ if (!this.article.isConfigurable) return [3 /*break*/, 2];
2542
2560
  return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2543
2561
  case 1:
2544
2562
  article = _a.sent();
2545
2563
  if (article) {
2546
2564
  this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
2547
2565
  }
2548
- return [3 /*break*/, 6];
2549
- case 2:
2566
+ return [3 /*break*/, 5];
2567
+ case 2: return [4 /*yield*/, this._getGeneratedArtDirectly(this.article.goodId)];
2568
+ case 3:
2569
+ generatedGoodId = _a.sent();
2570
+ if (!generatedGoodId) return [3 /*break*/, 5];
2571
+ return [4 /*yield*/, this._productConnectorAdapterService.getArticleFullObject(generatedGoodId, true)];
2572
+ case 4:
2573
+ articleFull = _a.sent();
2574
+ article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(articleFull);
2575
+ this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
2576
+ _a.label = 5;
2577
+ case 5: return [3 /*break*/, 10];
2578
+ case 6:
2550
2579
  article = void 0;
2551
- if (!!!this.externalSource) return [3 /*break*/, 4];
2580
+ if (!!!this.externalSource) return [3 /*break*/, 8];
2552
2581
  return [4 /*yield*/, this._getJSONFromArticleObject({ article: this.article, quantity: quantity })];
2553
- case 3:
2582
+ case 7:
2554
2583
  article = _a.sent();
2555
- return [3 /*break*/, 5];
2556
- case 4:
2584
+ return [3 /*break*/, 9];
2585
+ case 8:
2557
2586
  article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
2558
- _a.label = 5;
2559
- case 5:
2587
+ _a.label = 9;
2588
+ case 9:
2560
2589
  if (article) {
2561
2590
  this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
2562
2591
  }
2563
- _a.label = 6;
2564
- case 6: return [3 /*break*/, 8];
2565
- case 7:
2592
+ _a.label = 10;
2593
+ case 10: return [3 /*break*/, 12];
2594
+ case 11:
2566
2595
  article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
2567
2596
  this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
2568
- _a.label = 8;
2569
- case 8: return [2 /*return*/];
2597
+ _a.label = 12;
2598
+ case 12: return [2 /*return*/];
2570
2599
  }
2571
2600
  });
2572
2601
  });
@@ -2605,6 +2634,16 @@
2605
2634
  });
2606
2635
  });
2607
2636
  };
2637
+ ProductAddtocartComponent.prototype._getGeneratedArtDirectly = function (goodId) {
2638
+ return __awaiter(this, void 0, void 0, function () {
2639
+ return __generator(this, function (_a) {
2640
+ switch (_a.label) {
2641
+ case 0: return [4 /*yield*/, this._ioneControllerService.getGeneratedArtDirectly(goodId, true)];
2642
+ case 1: return [2 /*return*/, _a.sent()];
2643
+ }
2644
+ });
2645
+ });
2646
+ };
2608
2647
  return ProductAddtocartComponent;
2609
2648
  }());
2610
2649
  ProductAddtocartComponent.decorators = [
@@ -2618,7 +2657,8 @@
2618
2657
  { type: IconCacheService },
2619
2658
  { type: ProductConnectorService },
2620
2659
  { type: ProductEventService },
2621
- { type: ProductSettingsService }
2660
+ { type: ProductSettingsService },
2661
+ { type: ProductConnectorAdapterService }
2622
2662
  ]; };
2623
2663
  ProductAddtocartComponent.propDecorators = {
2624
2664
  addToCartButton: [{ type: i0.ViewChild, args: ['addtocartbutton', { read: i0.ElementRef },] }],