@colijnit/catalog 12.1.51 → 12.1.53

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.
Files changed (26) hide show
  1. package/bundles/colijnit-catalog.umd.js +80 -62
  2. package/bundles/colijnit-catalog.umd.js.map +1 -1
  3. package/colijnit-catalog.metadata.json +1 -1
  4. package/esm2015/lib/catalog-version.js +3 -3
  5. package/esm2015/lib/component/base/article-base.component.js +11 -21
  6. package/esm2015/lib/component/base/catalog-search-base.component.js +6 -2
  7. package/esm2015/lib/component/catalog-external-source/catalog-external-source.component.js +6 -3
  8. package/esm2015/lib/component/catalog-filter-content/catalog-filter-content-general/catalog-filter-content-general.component.js +15 -1
  9. package/esm2015/lib/component/catalog-search/catalog-search.component.js +11 -5
  10. package/esm2015/lib/component/catalog-search-result-list/catalog-search-result-list.component.js +2 -1
  11. package/esm2015/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.js +5 -2
  12. package/esm2015/lib/service/catalog-connector-adapter.service.js +21 -8
  13. package/esm2015/lib/service/catalog-connector.service.js +8 -8
  14. package/esm2015/lib/service/catalog-event.service.js +1 -1
  15. package/fesm2015/colijnit-catalog.js +76 -43
  16. package/fesm2015/colijnit-catalog.js.map +1 -1
  17. package/lib/component/base/article-base.component.d.ts +2 -1
  18. package/lib/component/base/catalog-search-base.component.d.ts +1 -0
  19. package/lib/component/catalog-filter-content/catalog-filter-content-general/catalog-filter-content-general.component.d.ts +2 -0
  20. package/lib/component/catalog-search/catalog-search.component.d.ts +2 -1
  21. package/lib/component/catalog-search-result-tile/catalog-search-result-tile.component.d.ts +2 -1
  22. package/lib/service/catalog-connector-adapter.service.d.ts +3 -3
  23. package/lib/service/catalog-connector.service.d.ts +3 -3
  24. package/lib/service/catalog-event.service.d.ts +1 -1
  25. package/package.json +6 -6
  26. package/colijnit-catalog-12.1.50.tgz +0 -0
@@ -30,6 +30,8 @@ import { UserGroup } from '@colijnit/mainapi/build/model/user-group.bo';
30
30
  import { PriceList } from '@colijnit/transactionapi/build/model/price-list';
31
31
  import { Transaction } from '@colijnit/transactionapi/build/transaction';
32
32
  import { ExternalCatalogStartupInfo } from '@colijnit/articleapi/build/model/external-catalog-startup-info';
33
+ import { Color } from '@colijnit/mainapi/build/model/color.bo';
34
+ import { TransactionInfoResponse } from '@colijnit/transactionapi/build/model/transaction-info-response.bo';
33
35
  import { ObjectUtils } from '@colijnit/ioneconnector/build/utils/object-utils';
34
36
  import { FileUtils } from '@colijnit/ioneconnector/build/utils/file-utils';
35
37
  import { FilterViewmodel, FilterItemViewmodel, FilterItemModule, InputTextModule, ButtonModule, IconModule, FilterItemMode as FilterItemMode$1, InputDatePickerModule, IconCollapseHandleModule, CoDialogModule, ListOfValuesModule, CheckmarkOverlayModule, ImageModule, OverlayModule, OverlayService, InputSearchModule, PaginationBarModule } from '@colijnit/corecomponents_v12';
@@ -47,8 +49,8 @@ class Version {
47
49
  constructor() {
48
50
  this.name = "@colijnit/catalog";
49
51
  this.description = "iOne Catalog module based on Angular 12";
50
- this.symVer = "12.1.51";
51
- this.publishDate = "27-10-2023 12:09:46";
52
+ this.symVer = "12.1.53";
53
+ this.publishDate = "30-11-2023 11:19:44";
52
54
  }
53
55
  }
54
56
 
@@ -517,6 +519,17 @@ class CatalogConnectorAdapterService {
517
519
  }
518
520
  });
519
521
  }
522
+ getColors() {
523
+ return __awaiter(this, void 0, void 0, function* () {
524
+ const response = yield this.mainConnector.getColors();
525
+ if (response && response.validationResult && response.validationResult.success) {
526
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(Color, response.resultObjects);
527
+ }
528
+ else {
529
+ console.error(response.validationMessagesAsString);
530
+ }
531
+ });
532
+ }
520
533
  getDomainCollection(domainName) {
521
534
  return __awaiter(this, void 0, void 0, function* () {
522
535
  const response = yield this.mainConnector.getDomainCollection(this.connectorOptions.languageCode, domainName);
@@ -727,14 +740,14 @@ class CatalogConnectorAdapterService {
727
740
  }
728
741
  });
729
742
  }
730
- addWebSessionTransactionLine(sku, quantity) {
743
+ addWebSessionTransactionLine(transactionUuid, sku, quantity) {
731
744
  return __awaiter(this, void 0, void 0, function* () {
732
- return yield this.transactionConnector.addWebSessionTransactionLine(sku, quantity);
733
- });
734
- }
735
- getWebTransaction() {
736
- return __awaiter(this, void 0, void 0, function* () {
737
- return yield this.transactionConnector.getWebSessionSalesOrder();
745
+ const response = yield this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity);
746
+ if (response && response.validationResult && response.validationResult.success) {
747
+ const infoResponse = this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
748
+ return infoResponse.transactionInfo.uuid;
749
+ }
750
+ return "";
738
751
  });
739
752
  }
740
753
  getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
@@ -1263,6 +1276,11 @@ class CatalogConnectorService {
1263
1276
  return this._adapterService.getCategories();
1264
1277
  });
1265
1278
  }
1279
+ getColors() {
1280
+ return __awaiter(this, void 0, void 0, function* () {
1281
+ return this._adapterService.getColors();
1282
+ });
1283
+ }
1266
1284
  getDomainCollection(domainName) {
1267
1285
  return __awaiter(this, void 0, void 0, function* () {
1268
1286
  return this._adapterService.getDomainCollection(domainName);
@@ -1323,14 +1341,9 @@ class CatalogConnectorService {
1323
1341
  getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
1324
1342
  return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
1325
1343
  }
1326
- addWebSessionTransactionLine(sku, quantity) {
1344
+ addWebSessionTransactionLine(transactionUuid, sku, quantity) {
1327
1345
  return __awaiter(this, void 0, void 0, function* () {
1328
- return yield this._adapterService.addWebSessionTransactionLine(sku, quantity);
1329
- });
1330
- }
1331
- getWebTransaction() {
1332
- this._adapterService.getWebTransaction().then((response) => {
1333
- console.log(response);
1346
+ return yield this._adapterService.addWebSessionTransactionLine(transactionUuid, sku, quantity);
1334
1347
  });
1335
1348
  }
1336
1349
  }
@@ -2447,6 +2460,7 @@ class CatalogFilterContentGeneralComponent {
2447
2460
  this._setPublicationCodesSales();
2448
2461
  this._setPriceList();
2449
2462
  this._setCategories();
2463
+ this._setColors();
2450
2464
  }
2451
2465
  _setStoreGroups() {
2452
2466
  this._catalogConnectorService.getStoreGroups().then((storeGroups) => {
@@ -2468,6 +2482,11 @@ class CatalogFilterContentGeneralComponent {
2468
2482
  this.categoryCollection = this.filterService.createFilterSelectionsCollection(categories, "categoryCode", "description");
2469
2483
  });
2470
2484
  }
2485
+ _setColors() {
2486
+ this._catalogConnectorService.getColors().then((colors) => {
2487
+ this.colorCollection = this.filterService.createFilterSelectionsCollection(colors, "colorCode", "description");
2488
+ });
2489
+ }
2471
2490
  _setPublicationCodes() {
2472
2491
  this._catalogConnectorService.getRVDomainCollection(DomainName.ArtPublication).then((publicationCodes) => {
2473
2492
  this.artPublicationCollection = this.filterService.createFilterSelectionsCollection(publicationCodes, "code", "description");
@@ -2546,6 +2565,14 @@ CatalogFilterContentGeneralComponent.decorators = [
2546
2565
  >
2547
2566
  </co-catalog-filter-item>
2548
2567
  </div>
2568
+ <div class="filter-item-wrapper">
2569
+ <co-catalog-filter-item [placeholder]="'COLOR'"
2570
+ [(model)]="catalogSearchService.searchRequest.colourCodes"
2571
+ [mode]="modes.SelectListWithStringCollectionOutput"
2572
+ [collection]="colorCollection"
2573
+ >
2574
+ </co-catalog-filter-item>
2575
+ </div>
2549
2576
  <div class="filter-item-wrapper">
2550
2577
  <co-catalog-filter-item
2551
2578
  [placeholder]="'ARTICLE_TYPE'"
@@ -3480,6 +3507,7 @@ class CatalogSearchComponent {
3480
3507
  this._catalogEventService = _catalogEventService;
3481
3508
  this.iconCacheService = iconCacheService;
3482
3509
  this.icons = IconEnum;
3510
+ this.createFrozenArticle = true;
3483
3511
  this.showNavigation = false;
3484
3512
  this.showLandingPage = false;
3485
3513
  this.showFilter = false;
@@ -3512,8 +3540,8 @@ class CatalogSearchComponent {
3512
3540
  return __awaiter(this, void 0, void 0, function* () {
3513
3541
  yield this._settingsService.initializeSettings();
3514
3542
  this._catalogService.init(this._settings);
3515
- this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((json) => {
3516
- this.onAddArticleButtonClick.emit(json);
3543
+ this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((article) => {
3544
+ this.onAddArticleButtonClick.emit(article);
3517
3545
  }), this._catalogEventService.arButtonClick.subscribe((article) => {
3518
3546
  this.onArButtonClick.emit(article);
3519
3547
  }), this._catalogEventService.articleClick.subscribe((article) => {
@@ -3592,10 +3620,14 @@ CatalogSearchComponent.decorators = [
3592
3620
  (turnoverGroupClick)="handleTurnoverGroupClick($event)"></co-catalog-categories>
3593
3621
  <div class="search-content">
3594
3622
  <ng-container *ngIf="mode === 'tile'">
3595
- <co-catalog-search-result-tile></co-catalog-search-result-tile>
3623
+ <co-catalog-search-result-tile
3624
+ [createFrozenArticle]="createFrozenArticle"
3625
+ ></co-catalog-search-result-tile>
3596
3626
  </ng-container>
3597
3627
  <ng-container *ngIf="mode === 'list'">
3598
- <co-catalog-search-result-list></co-catalog-search-result-list>
3628
+ <co-catalog-search-result-list
3629
+ [createFrozenArticle]="createFrozenArticle"
3630
+ ></co-catalog-search-result-list>
3599
3631
  </ng-container>
3600
3632
  <ng-container *ngIf="mode === 'grid'">
3601
3633
  <!--
@@ -3644,6 +3676,7 @@ CatalogSearchComponent.propDecorators = {
3644
3676
  title: [{ type: Input }],
3645
3677
  subTitle: [{ type: Input }],
3646
3678
  searchPlaceholder: [{ type: Input }],
3679
+ createFrozenArticle: [{ type: Input }],
3647
3680
  showNavigation: [{ type: Input }],
3648
3681
  showLandingPage: [{ type: Input }],
3649
3682
  showFilter: [{ type: Input }],
@@ -3722,6 +3755,7 @@ CatalogSearchHeaderModule.decorators = [
3722
3755
  class CatalogSearchBaseComponent {
3723
3756
  constructor(catalogSearchService) {
3724
3757
  this.catalogSearchService = catalogSearchService;
3758
+ this.createFrozenArticle = true;
3725
3759
  }
3726
3760
  onPreviousClick() {
3727
3761
  this.catalogSearchService.currentPage -= 1;
@@ -3738,11 +3772,15 @@ CatalogSearchBaseComponent.decorators = [
3738
3772
  ];
3739
3773
  CatalogSearchBaseComponent.ctorParameters = () => [
3740
3774
  { type: CatalogSearchService }
3741
- ];
3775
+ ];
3776
+ CatalogSearchBaseComponent.propDecorators = {
3777
+ createFrozenArticle: [{ type: Input }]
3778
+ };
3742
3779
 
3743
3780
  class CatalogSearchResultTileComponent extends CatalogSearchBaseComponent {
3744
3781
  constructor() {
3745
3782
  super(...arguments);
3783
+ this.createFrozenArticle = true;
3746
3784
  this.onLookAtArticleButtonClick = new EventEmitter();
3747
3785
  this.onArButtonClick = new EventEmitter();
3748
3786
  this.onAddArticleButtonClick = new EventEmitter();
@@ -3762,6 +3800,7 @@ CatalogSearchResultTileComponent.decorators = [
3762
3800
  visibilityObserver
3763
3801
  #intersection="intersection"
3764
3802
  [observerEnabled]="!article.imageData"
3803
+ [createFrozenArticle]="createFrozenArticle"
3765
3804
  [showing]="intersection.isIntersecting"
3766
3805
  [article]="article"
3767
3806
  (onArticleClick)="onArticleClick.emit($event)"
@@ -3791,6 +3830,7 @@ CatalogSearchResultTileComponent.decorators = [
3791
3830
  },] }
3792
3831
  ];
3793
3832
  CatalogSearchResultTileComponent.propDecorators = {
3833
+ createFrozenArticle: [{ type: Input }],
3794
3834
  onLookAtArticleButtonClick: [{ type: Output }],
3795
3835
  onArButtonClick: [{ type: Output }],
3796
3836
  onAddArticleButtonClick: [{ type: Output }],
@@ -3811,6 +3851,7 @@ class ArticleBaseComponent {
3811
3851
  this._imageService = _imageService;
3812
3852
  this._settingsService = _settingsService;
3813
3853
  this.icons = IconEnum;
3854
+ this.createFrozenArticle = true;
3814
3855
  this.isSelected = false;
3815
3856
  this.isSmallModus = false;
3816
3857
  this.hasMagnifierButton = false;
@@ -3865,27 +3906,15 @@ class ArticleBaseComponent {
3865
3906
  handleAddArticleButtonClick(event) {
3866
3907
  return __awaiter(this, void 0, void 0, function* () {
3867
3908
  event.stopPropagation();
3868
- const json = yield this._getJSONFromArticleObject(this.article);
3869
- if (this._settingsService.settings.createWebOrder) {
3870
- if (json) {
3871
- const articleTreeData = JSON.parse(json);
3872
- if (articleTreeData.articleTree && articleTreeData.articleTree.article) {
3873
- if (articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
3874
- articleTreeData.articleTree.compositeGoods.length > 0 && articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles)) {
3875
- for (let i = 0; i < articleTreeData.articleTree.compositeGoods.length - 1; i++) {
3876
- const good = articleTreeData.articleTree.compositeGoods[i];
3877
- const subArticle = articleTreeData.articleTree.subArticles[i];
3878
- yield this._iOne.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity);
3879
- }
3880
- }
3881
- else {
3882
- yield this._iOne.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1);
3883
- }
3884
- }
3885
- }
3909
+ if (this.createFrozenArticle) {
3910
+ const json = yield this._getJSONFromArticleObject(this.article);
3911
+ this._appEventService.addArticleButtonClick.next(json);
3912
+ this.onAddArticleButtonClick.emit(json);
3913
+ }
3914
+ else {
3915
+ this._appEventService.addArticleButtonClick.next(this.article);
3916
+ this.onAddArticleButtonClick.emit(this.article);
3886
3917
  }
3887
- this._appEventService.addArticleButtonClick.next(json);
3888
- this.onAddArticleButtonClick.emit(json);
3889
3918
  });
3890
3919
  }
3891
3920
  handleStockDetailsButtonClick(event) {
@@ -3965,6 +3994,7 @@ ArticleBaseComponent.propDecorators = {
3965
3994
  article: [{ type: Input }],
3966
3995
  showing: [{ type: Input }],
3967
3996
  imageData: [{ type: Input }],
3997
+ createFrozenArticle: [{ type: Input }],
3968
3998
  price: [{ type: Input }],
3969
3999
  isSelected: [{ type: Input }],
3970
4000
  isSmallModus: [{ type: Input }, { type: HostBinding, args: ['class.small-modus',] }],
@@ -4228,6 +4258,7 @@ CatalogSearchResultListComponent.decorators = [
4228
4258
  visibilityObserver
4229
4259
  #intersection="intersection"
4230
4260
  [observerEnabled]="!article.imageData"
4261
+ [createFrozenArticle]="createFrozenArticle"
4231
4262
  [showing]="intersection.isIntersecting"
4232
4263
  [article]="article"
4233
4264
  >
@@ -4467,8 +4498,10 @@ class CatalogExternalSourceComponent {
4467
4498
  return this._externalCatalogStartupInfo;
4468
4499
  }
4469
4500
  ngOnInit() {
4470
- this._subs.push(this._appEventService.addArticleButtonClick.subscribe((json) => {
4471
- this.addArticleClick.next(json);
4501
+ this._subs.push(this._appEventService.addArticleButtonClick.subscribe((article) => {
4502
+ if (!(article instanceof ArticleExtended)) {
4503
+ this.addArticleClick.next(article);
4504
+ }
4472
4505
  }));
4473
4506
  }
4474
4507
  handleArticleClick(article) {