@colijnit/catalog 259.1.0 → 259.1.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.
@@ -57,8 +57,8 @@ class Version {
57
57
  constructor() {
58
58
  this.name = "@colijnit/catalog";
59
59
  this.description = "iOne Catalog module based on Angular 12";
60
- this.symVer = "259.1.0";
61
- this.publishDate = "7/9/2025, 9:55:45 AM";
60
+ this.symVer = "259.1.1";
61
+ this.publishDate = "9-7-2025 11:50:01";
62
62
  }
63
63
  }
64
64
 
@@ -1216,6 +1216,13 @@ class CatalogConnectorAdapterService {
1216
1216
  onShowLoaderChange(showLoader) {
1217
1217
  this._shouldShowLoader = showLoader;
1218
1218
  }
1219
+ getGeneratedArtDirectly(goodId, showLoader) {
1220
+ return __awaiter(this, void 0, void 0, function* () {
1221
+ return this.connector.getGeneratedArtDirectly(goodId, showLoader).catch((messages) => {
1222
+ return null;
1223
+ });
1224
+ });
1225
+ }
1219
1226
  }
1220
1227
  CatalogConnectorAdapterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogConnectorAdapterService_Factory() { return new CatalogConnectorAdapterService(i0.ɵɵinject(CatalogRootService), i0.ɵɵinject(CatalogExternalSourcesService)); }, token: CatalogConnectorAdapterService, providedIn: "root" });
1221
1228
  CatalogConnectorAdapterService.decorators = [
@@ -1895,6 +1902,9 @@ class CatalogConnectorService {
1895
1902
  return yield this._adapterService.addWebSessionTransactionLine(transactionUuid, sku, quantity);
1896
1903
  });
1897
1904
  }
1905
+ getGeneratedArtDirectly(goodId, showLoader = true) {
1906
+ return this._adapterService.getGeneratedArtDirectly(goodId, showLoader);
1907
+ }
1898
1908
  }
1899
1909
  CatalogConnectorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogConnectorService_Factory() { return new CatalogConnectorService(i0.ɵɵinject(CatalogConnectorAdapterService), i0.ɵɵinject(CatalogSelectSingleCacheService), i0.ɵɵinject(CatalogSelectMultipleCacheService), i0.ɵɵinject(CatalogSelectMultipleParameterizedCacheService), i0.ɵɵinject(CatalogSelectSingleParameterizedCacheService)); }, token: CatalogConnectorService, providedIn: "root" });
1900
1910
  CatalogConnectorService.decorators = [
@@ -5346,9 +5356,25 @@ class ArticleBaseComponent {
5346
5356
  return __awaiter(this, void 0, void 0, function* () {
5347
5357
  event.stopPropagation();
5348
5358
  if (this.createFrozenArticle) {
5349
- const json = yield this._getJSONFromArticleObject(this.article, !!this.externalSource, isRetour);
5350
- this._appEventService.addArticleButtonClick.next(json);
5351
- this.onAddArticleButtonClick.emit(json);
5359
+ if (this.article.isConfigurable) {
5360
+ const json = yield this._getJSONFromArticleObject(this.article, !!this.externalSource, isRetour);
5361
+ this._appEventService.addArticleButtonClick.next(json);
5362
+ this.onAddArticleButtonClick.emit(json);
5363
+ }
5364
+ else {
5365
+ const generatedGoodId = yield this._getGeneratedArtDirectly(this.article.goodId);
5366
+ if (generatedGoodId) {
5367
+ const params = new ArticleExtendedRequest();
5368
+ params.goodId = generatedGoodId;
5369
+ const searchArticles = yield this._iOne.getArticlesForCatalog(params, true);
5370
+ // We should have a single result here
5371
+ if (searchArticles && searchArticles.articles.length > 0) {
5372
+ const article = searchArticles.articles[0];
5373
+ this._appEventService.addArticleButtonClick.next(article);
5374
+ this.onAddArticleButtonClick.emit(article);
5375
+ }
5376
+ }
5377
+ }
5352
5378
  }
5353
5379
  else {
5354
5380
  this._appEventService.addArticleButtonClick.next(this.article);
@@ -5443,6 +5469,11 @@ class ArticleBaseComponent {
5443
5469
  + ' ' + this._dictionaryService.get('DAYS', false);
5444
5470
  }
5445
5471
  }
5472
+ _getGeneratedArtDirectly(goodId) {
5473
+ return __awaiter(this, void 0, void 0, function* () {
5474
+ return yield this._iOne.getGeneratedArtDirectly(goodId, true);
5475
+ });
5476
+ }
5446
5477
  }
5447
5478
  ArticleBaseComponent.decorators = [
5448
5479
  { type: Directive }