@colijnit/catalog 255.1.13 → 255.1.15

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.
@@ -30,8 +30,8 @@
30
30
  function Version() {
31
31
  this.name = "@colijnit/catalog";
32
32
  this.description = "iOne Catalog module based on Angular 12";
33
- this.symVer = "255.1.13";
34
- this.publishDate = "6-11-2024 17:29:42";
33
+ this.symVer = "255.1.15";
34
+ this.publishDate = "29-11-2024 17:08:34";
35
35
  }
36
36
  return Version;
37
37
  }());
@@ -807,7 +807,6 @@
807
807
  this._boFactory = new businessObjectFactory.BusinessObjectFactory();
808
808
  this._initializing = false;
809
809
  this._initialized = false;
810
- console.log('create');
811
810
  }
812
811
  Object.defineProperty(CatalogConnectorAdapterService.prototype, "shouldShowLoader", {
813
812
  get: function () {
@@ -1543,6 +1542,26 @@
1543
1542
  });
1544
1543
  });
1545
1544
  };
1545
+ CatalogConnectorAdapterService.prototype.getAvailabeCatalogsForLoggedInUser = function () {
1546
+ return __awaiter(this, void 0, void 0, function () {
1547
+ var response;
1548
+ return __generator(this, function (_a) {
1549
+ switch (_a.label) {
1550
+ case 0: return [4 /*yield*/, this.relationConnector.getAvailabeCatalogsForLoggedInUser(true)];
1551
+ case 1:
1552
+ response = _a.sent();
1553
+ if (response && response.validationResult && response.validationResult.success) {
1554
+ return [2 /*return*/, response];
1555
+ }
1556
+ else {
1557
+ console.error(response.validationMessagesAsString);
1558
+ return [2 /*return*/, response];
1559
+ }
1560
+ return [2 /*return*/];
1561
+ }
1562
+ });
1563
+ });
1564
+ };
1546
1565
  CatalogConnectorAdapterService.prototype.getPresets = function (module, user) {
1547
1566
  return __awaiter(this, void 0, void 0, function () {
1548
1567
  var response;
@@ -1840,8 +1859,7 @@
1840
1859
  { type: i0.Injectable, args: [{
1841
1860
  providedIn: 'root'
1842
1861
  },] }
1843
- ];
1844
- CatalogConnectorAdapterService.ctorParameters = function () { return []; };
1862
+ ];
1845
1863
 
1846
1864
  // Class represents a value that is to be loaded only once, lazily, by its .loadFunction, despite how many times or how fast its getValue() is called.
1847
1865
  var CacheField = /** @class */ (function () {
@@ -2599,6 +2617,13 @@
2599
2617
  });
2600
2618
  });
2601
2619
  };
2620
+ CatalogConnectorService.prototype.getAvailabeCatalogsForLoggedInUser = function () {
2621
+ return __awaiter(this, void 0, void 0, function () {
2622
+ return __generator(this, function (_a) {
2623
+ return [2 /*return*/, this._adapterService.getAvailabeCatalogsForLoggedInUser()];
2624
+ });
2625
+ });
2626
+ };
2602
2627
  CatalogConnectorService.prototype.getPresets = function (module, user) {
2603
2628
  return __awaiter(this, void 0, void 0, function () {
2604
2629
  return __generator(this, function (_a) {
@@ -4118,8 +4143,9 @@
4118
4143
  };
4119
4144
 
4120
4145
  var CatalogFilterItemComponent = /** @class */ (function () {
4121
- function CatalogFilterItemComponent(searchService) {
4146
+ function CatalogFilterItemComponent(searchService, _screenConfigService) {
4122
4147
  this.searchService = searchService;
4148
+ this._screenConfigService = _screenConfigService;
4123
4149
  this.collection = [];
4124
4150
  this.placeholder = '';
4125
4151
  this.customContent = false;
@@ -4136,7 +4162,23 @@
4136
4162
  this.showMoreLabel = "SHOW_MORE";
4137
4163
  this.showLessLabel = "SHOW_LESS";
4138
4164
  this.filterButtonLabel = "SEARCH_IMPERATIVE";
4165
+ this._subs = [];
4139
4166
  }
4167
+ CatalogFilterItemComponent.prototype.ngOnInit = function () {
4168
+ var _this = this;
4169
+ this._subs.push(
4170
+ // todo: remove this dirty hack when screenconfig is completed
4171
+ this._screenConfigService.configSet.subscribe(function (config) {
4172
+ if (config) {
4173
+ if (!_this._screenConfigService.getObjectConfigurationFor(_this.screenConfigurationObjectName)) {
4174
+ _this.screenConfigurationObjectName = undefined;
4175
+ }
4176
+ }
4177
+ }));
4178
+ };
4179
+ CatalogFilterItemComponent.prototype.ngOnDestroy = function () {
4180
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
4181
+ };
4140
4182
  CatalogFilterItemComponent.prototype.onFilterButtonClicked = function () {
4141
4183
  this.searchService.searchArticles();
4142
4184
  this._scrollToTop();
@@ -4158,7 +4200,8 @@
4158
4200
  },] }
4159
4201
  ];
4160
4202
  CatalogFilterItemComponent.ctorParameters = function () { return [
4161
- { type: CatalogSearchService }
4203
+ { type: CatalogSearchService },
4204
+ { type: CatalogScreenConfigurationService }
4162
4205
  ]; };
4163
4206
  CatalogFilterItemComponent.propDecorators = {
4164
4207
  model: [{ type: i0.Input }],
@@ -4729,8 +4772,10 @@
4729
4772
  function CatalogExternalSourcesComponent(_catalogConnectorService, _imageService) {
4730
4773
  this._catalogConnectorService = _catalogConnectorService;
4731
4774
  this._imageService = _imageService;
4775
+ this.isStandalone = false;
4732
4776
  this.externalSourceClick = new i0.EventEmitter();
4733
4777
  this.externalSourceViewModels = [];
4778
+ this.unavailableCatalogs = [];
4734
4779
  }
4735
4780
  CatalogExternalSourcesComponent.prototype.showClass = function () {
4736
4781
  return true;
@@ -4738,12 +4783,45 @@
4738
4783
  CatalogExternalSourcesComponent.prototype.ngOnInit = function () {
4739
4784
  var _this = this;
4740
4785
  this.externalSourceViewModels.length = 0;
4741
- this._catalogConnectorService.getCatalogDefinitions().then(function (defs) { return __awaiter(_this, void 0, void 0, function () {
4786
+ if (!this.isStandalone) {
4787
+ this._catalogConnectorService.getAvailabeCatalogsForLoggedInUser().then(function (result) {
4788
+ if (result['validationResult']['success'] === true) {
4789
+ if (result['resultObject']['availableCatalogs']) {
4790
+ _this.loadCatalogs(result['resultObject']['availableCatalogs']).then(function (result) { });
4791
+ }
4792
+ if (result['resultObject']['unavailableCatalogs']) {
4793
+ _this.loadUnavailableCatalogs(result['resultObject']['unavailableCatalogs']);
4794
+ }
4795
+ }
4796
+ else {
4797
+ _this._catalogConnectorService.getCatalogDefinitions().then(function (defs) { return __awaiter(_this, void 0, void 0, function () {
4798
+ return __generator(this, function (_a) {
4799
+ if (defs) {
4800
+ this.loadCatalogs(defs).then(function (result) { });
4801
+ }
4802
+ return [2 /*return*/];
4803
+ });
4804
+ }); });
4805
+ }
4806
+ });
4807
+ }
4808
+ else {
4809
+ this._catalogConnectorService.getCatalogDefinitions().then(function (defs) { return __awaiter(_this, void 0, void 0, function () {
4810
+ return __generator(this, function (_a) {
4811
+ if (defs) {
4812
+ this.loadCatalogs(defs).then(function (result) { });
4813
+ }
4814
+ return [2 /*return*/];
4815
+ });
4816
+ }); });
4817
+ }
4818
+ };
4819
+ CatalogExternalSourcesComponent.prototype.loadCatalogs = function (defs) {
4820
+ return __awaiter(this, void 0, void 0, function () {
4742
4821
  var i, viewModel, _a, _b, _c;
4743
4822
  return __generator(this, function (_d) {
4744
4823
  switch (_d.label) {
4745
4824
  case 0:
4746
- if (!defs) return [3 /*break*/, 6];
4747
4825
  i = 0;
4748
4826
  _d.label = 1;
4749
4827
  case 1:
@@ -4769,14 +4847,17 @@
4769
4847
  case 6: return [2 /*return*/];
4770
4848
  }
4771
4849
  });
4772
- }); });
4850
+ });
4851
+ };
4852
+ CatalogExternalSourcesComponent.prototype.loadUnavailableCatalogs = function (defs) {
4853
+ this.unavailableCatalogs = defs;
4773
4854
  };
4774
4855
  return CatalogExternalSourcesComponent;
4775
4856
  }());
4776
4857
  CatalogExternalSourcesComponent.decorators = [
4777
4858
  { type: i0.Component, args: [{
4778
4859
  selector: 'co-catalog-external-sources',
4779
- template: "\n <ng-container *ngIf=\"externalSourceViewModels && externalSourceViewModels.length > 0\">\n <div class=\"catalog-external-sources-wrapper\">\n <div class=\"external-source-item\" *ngFor=\"let externalSourceViewModel of externalSourceViewModels\" (click)=\"externalSourceClick.emit(externalSourceViewModel)\">\n <div class=\"external-source-description\" [textContent]=\"externalSourceViewModel.catalogDefinition.name\"></div>\n <co-image [source]=\"externalSourceViewModel.catalogDefinition.imageData\"></co-image>\n </div>\n </div>\n </ng-container>\n ",
4860
+ template: "\n <ng-container *ngIf=\"externalSourceViewModels && externalSourceViewModels.length > 0\">\n <div class=\"catalog-external-sources-wrapper\">\n <div class=\"external-source-item\" *ngFor=\"let externalSourceViewModel of externalSourceViewModels\"\n (click)=\"externalSourceClick.emit(externalSourceViewModel)\">\n <div class=\"external-source-description\"\n [textContent]=\"externalSourceViewModel.catalogDefinition.name\"></div>\n <co-image [source]=\"externalSourceViewModel.catalogDefinition.imageData\"></co-image>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unavailableCatalogs && unavailableCatalogs.length > 0\">\n <div class=\"catalog-external-sources-wrapper catalog-external-sources-wrapper-unavailable\">\n <div class=\"external-source-item external-source-item-unavailable\"\n *ngFor=\"let unavailableCatalog of unavailableCatalogs\">\n <div class=\"external-source-description\"\n [textContent]=\"unavailableCatalog.name\"></div>\n <co-image [source]=\"unavailableCatalog.imageData\"></co-image>\n </div>\n </div>\n </ng-container>\n\n ",
4780
4861
  encapsulation: i0.ViewEncapsulation.None
4781
4862
  },] }
4782
4863
  ];
@@ -4785,6 +4866,7 @@
4785
4866
  { type: CatalogImageService }
4786
4867
  ]; };
4787
4868
  CatalogExternalSourcesComponent.propDecorators = {
4869
+ isStandalone: [{ type: i0.Input }],
4788
4870
  externalSourceClick: [{ type: i0.Output }],
4789
4871
  showClass: [{ type: i0.HostBinding, args: ['class.co-catalog-external-sources',] }]
4790
4872
  };
@@ -4913,7 +4995,6 @@
4913
4995
  CatalogStockService.prototype.getArticleGridViewExcelFile = function () {
4914
4996
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeWarehouse: null, rangeStockStatus: null });
4915
4997
  this._catalogConnectorService.getArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
4916
- console.log('export: ', result);
4917
4998
  });
4918
4999
  };
4919
5000
  return CatalogStockService;
@@ -5007,7 +5088,6 @@
5007
5088
  CatalogStockTransferService.prototype.getArticleGridViewExcelFile = function () {
5008
5089
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeStockStatus: null, rangeSourceWarehouse: null, rangeTargetWarehouse: null });
5009
5090
  this._catalogConnectorService.getTransferArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5010
- console.log('export: ', result);
5011
5091
  });
5012
5092
  };
5013
5093
  return CatalogStockTransferService;
@@ -5101,7 +5181,6 @@
5101
5181
  CatalogStockComparisonService.prototype.getArticleGridViewExcelFile = function () {
5102
5182
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { sourceWarehouse: 0, targetWarehouse: 1 });
5103
5183
  this._catalogConnectorService.getComparisonArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5104
- console.log('export: ', result);
5105
5184
  });
5106
5185
  };
5107
5186
  return CatalogStockComparisonService;
@@ -6077,7 +6156,7 @@
6077
6156
  }).catch(function (e) {
6078
6157
  //If there is no price data, make that object null and pass data along
6079
6158
  _this.create3DimerseFeedback(configurationData_1, null);
6080
- console.log(e);
6159
+ // console.log(e);
6081
6160
  });
6082
6161
  }
6083
6162
  else {
@@ -6087,17 +6166,17 @@
6087
6166
  }).catch(function (e) {
6088
6167
  //If we cannot fetch price data
6089
6168
  _this.create3DimerseFeedback(configurationData_1, null);
6090
- console.log(e);
6169
+ // console.log(e);
6091
6170
  });
6092
6171
  }).catch(function (e) {
6093
6172
  //If there is an error fetching config data do not continue. just log the error.
6094
- console.log(e);
6173
+ // console.log(e);
6095
6174
  configurationData_1 = {};
6096
6175
  });
6097
6176
  }
6098
6177
  }).catch(function (e) {
6099
6178
  //If there is an error fetching config dat. just log the error.
6100
- console.log(e);
6179
+ // console.log(e);
6101
6180
  configurationData_1 = {};
6102
6181
  });
6103
6182
  }
@@ -6112,7 +6191,7 @@
6112
6191
  var resultObject = {};
6113
6192
  resultObject['configuratie-data'] = configurationData;
6114
6193
  resultObject['prijs-data'] = priceData;
6115
- console.log(resultObject);
6194
+ // console.log(resultObject);
6116
6195
  this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
6117
6196
  };
6118
6197
  CatalogExternalSourceComponent.prototype.fetchJsonFile = function (url) {
@@ -6734,13 +6813,13 @@
6734
6813
  exports["ɵg"] = CatalogFilterItemModule;
6735
6814
  exports["ɵh"] = CatalogFilterItemComponent;
6736
6815
  exports["ɵi"] = CacheField;
6737
- exports["ɵj"] = CatalogFilterContentGeneralComponent;
6738
- exports["ɵk"] = IconCacheService;
6739
- exports["ɵl"] = CatalogFilterContentPurchaseModule;
6740
- exports["ɵm"] = CatalogFilterContentPurchaseComponent;
6741
- exports["ɵn"] = CatalogFilterContentLogisticsModule;
6742
- exports["ɵo"] = CatalogFilterContentLogisticsComponent;
6743
- exports["ɵp"] = CatalogScreenConfigurationService;
6816
+ exports["ɵj"] = CatalogScreenConfigurationService;
6817
+ exports["ɵk"] = CatalogFilterContentGeneralComponent;
6818
+ exports["ɵl"] = IconCacheService;
6819
+ exports["ɵm"] = CatalogFilterContentPurchaseModule;
6820
+ exports["ɵn"] = CatalogFilterContentPurchaseComponent;
6821
+ exports["ɵo"] = CatalogFilterContentLogisticsModule;
6822
+ exports["ɵp"] = CatalogFilterContentLogisticsComponent;
6744
6823
  exports["ɵq"] = CatalogFilterComponent;
6745
6824
  exports["ɵr"] = ResponsiveTextModule;
6746
6825
  exports["ɵs"] = ResponsiveTextComponent;