@colijnit/catalog 255.1.14 → 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.14";
34
- this.publishDate = "19-11-2024 17:56:15";
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) {
@@ -4747,8 +4772,10 @@
4747
4772
  function CatalogExternalSourcesComponent(_catalogConnectorService, _imageService) {
4748
4773
  this._catalogConnectorService = _catalogConnectorService;
4749
4774
  this._imageService = _imageService;
4775
+ this.isStandalone = false;
4750
4776
  this.externalSourceClick = new i0.EventEmitter();
4751
4777
  this.externalSourceViewModels = [];
4778
+ this.unavailableCatalogs = [];
4752
4779
  }
4753
4780
  CatalogExternalSourcesComponent.prototype.showClass = function () {
4754
4781
  return true;
@@ -4756,12 +4783,45 @@
4756
4783
  CatalogExternalSourcesComponent.prototype.ngOnInit = function () {
4757
4784
  var _this = this;
4758
4785
  this.externalSourceViewModels.length = 0;
4759
- 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 () {
4760
4821
  var i, viewModel, _a, _b, _c;
4761
4822
  return __generator(this, function (_d) {
4762
4823
  switch (_d.label) {
4763
4824
  case 0:
4764
- if (!defs) return [3 /*break*/, 6];
4765
4825
  i = 0;
4766
4826
  _d.label = 1;
4767
4827
  case 1:
@@ -4787,14 +4847,17 @@
4787
4847
  case 6: return [2 /*return*/];
4788
4848
  }
4789
4849
  });
4790
- }); });
4850
+ });
4851
+ };
4852
+ CatalogExternalSourcesComponent.prototype.loadUnavailableCatalogs = function (defs) {
4853
+ this.unavailableCatalogs = defs;
4791
4854
  };
4792
4855
  return CatalogExternalSourcesComponent;
4793
4856
  }());
4794
4857
  CatalogExternalSourcesComponent.decorators = [
4795
4858
  { type: i0.Component, args: [{
4796
4859
  selector: 'co-catalog-external-sources',
4797
- 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 ",
4798
4861
  encapsulation: i0.ViewEncapsulation.None
4799
4862
  },] }
4800
4863
  ];
@@ -4803,6 +4866,7 @@
4803
4866
  { type: CatalogImageService }
4804
4867
  ]; };
4805
4868
  CatalogExternalSourcesComponent.propDecorators = {
4869
+ isStandalone: [{ type: i0.Input }],
4806
4870
  externalSourceClick: [{ type: i0.Output }],
4807
4871
  showClass: [{ type: i0.HostBinding, args: ['class.co-catalog-external-sources',] }]
4808
4872
  };
@@ -4931,7 +4995,6 @@
4931
4995
  CatalogStockService.prototype.getArticleGridViewExcelFile = function () {
4932
4996
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeWarehouse: null, rangeStockStatus: null });
4933
4997
  this._catalogConnectorService.getArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
4934
- console.log('export: ', result);
4935
4998
  });
4936
4999
  };
4937
5000
  return CatalogStockService;
@@ -5025,7 +5088,6 @@
5025
5088
  CatalogStockTransferService.prototype.getArticleGridViewExcelFile = function () {
5026
5089
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeStockStatus: null, rangeSourceWarehouse: null, rangeTargetWarehouse: null });
5027
5090
  this._catalogConnectorService.getTransferArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5028
- console.log('export: ', result);
5029
5091
  });
5030
5092
  };
5031
5093
  return CatalogStockTransferService;
@@ -5119,7 +5181,6 @@
5119
5181
  CatalogStockComparisonService.prototype.getArticleGridViewExcelFile = function () {
5120
5182
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { sourceWarehouse: 0, targetWarehouse: 1 });
5121
5183
  this._catalogConnectorService.getComparisonArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5122
- console.log('export: ', result);
5123
5184
  });
5124
5185
  };
5125
5186
  return CatalogStockComparisonService;
@@ -6095,7 +6156,7 @@
6095
6156
  }).catch(function (e) {
6096
6157
  //If there is no price data, make that object null and pass data along
6097
6158
  _this.create3DimerseFeedback(configurationData_1, null);
6098
- console.log(e);
6159
+ // console.log(e);
6099
6160
  });
6100
6161
  }
6101
6162
  else {
@@ -6105,17 +6166,17 @@
6105
6166
  }).catch(function (e) {
6106
6167
  //If we cannot fetch price data
6107
6168
  _this.create3DimerseFeedback(configurationData_1, null);
6108
- console.log(e);
6169
+ // console.log(e);
6109
6170
  });
6110
6171
  }).catch(function (e) {
6111
6172
  //If there is an error fetching config data do not continue. just log the error.
6112
- console.log(e);
6173
+ // console.log(e);
6113
6174
  configurationData_1 = {};
6114
6175
  });
6115
6176
  }
6116
6177
  }).catch(function (e) {
6117
6178
  //If there is an error fetching config dat. just log the error.
6118
- console.log(e);
6179
+ // console.log(e);
6119
6180
  configurationData_1 = {};
6120
6181
  });
6121
6182
  }
@@ -6130,7 +6191,7 @@
6130
6191
  var resultObject = {};
6131
6192
  resultObject['configuratie-data'] = configurationData;
6132
6193
  resultObject['prijs-data'] = priceData;
6133
- console.log(resultObject);
6194
+ // console.log(resultObject);
6134
6195
  this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
6135
6196
  };
6136
6197
  CatalogExternalSourceComponent.prototype.fetchJsonFile = function (url) {