@colijnit/catalog 255.1.14 → 255.1.16

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.16";
34
+ this.publishDate = "3-12-2024 09:51:00";
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,61 @@
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
+ var e_1, _a;
4789
+ if (result['validationResult']['success'] === true) {
4790
+ if (result['resultObject']['availableCatalogs']) {
4791
+ var availableCatalogs = [];
4792
+ try {
4793
+ for (var _b = __values(result['resultObject']['availableCatalogs']), _c = _b.next(); !_c.done; _c = _b.next()) {
4794
+ var availableCatalog = _c.value;
4795
+ var instance = Object.assign(new catalogDefinition_bo.CatalogDefinition(), availableCatalog);
4796
+ availableCatalogs.push(instance);
4797
+ }
4798
+ }
4799
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4800
+ finally {
4801
+ try {
4802
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
4803
+ }
4804
+ finally { if (e_1) throw e_1.error; }
4805
+ }
4806
+ _this.loadCatalogs(availableCatalogs).then(function (result) { });
4807
+ }
4808
+ if (result['resultObject']['unavailableCatalogs']) {
4809
+ _this.loadUnavailableCatalogs(result['resultObject']['unavailableCatalogs']);
4810
+ }
4811
+ }
4812
+ else {
4813
+ _this._catalogConnectorService.getCatalogDefinitions().then(function (defs) { return __awaiter(_this, void 0, void 0, function () {
4814
+ return __generator(this, function (_a) {
4815
+ if (defs) {
4816
+ this.loadCatalogs(defs).then(function (result) { });
4817
+ }
4818
+ return [2 /*return*/];
4819
+ });
4820
+ }); });
4821
+ }
4822
+ });
4823
+ }
4824
+ else {
4825
+ this._catalogConnectorService.getCatalogDefinitions().then(function (defs) { return __awaiter(_this, void 0, void 0, function () {
4826
+ return __generator(this, function (_a) {
4827
+ if (defs) {
4828
+ this.loadCatalogs(defs).then(function (result) { });
4829
+ }
4830
+ return [2 /*return*/];
4831
+ });
4832
+ }); });
4833
+ }
4834
+ };
4835
+ CatalogExternalSourcesComponent.prototype.loadCatalogs = function (defs) {
4836
+ return __awaiter(this, void 0, void 0, function () {
4760
4837
  var i, viewModel, _a, _b, _c;
4761
4838
  return __generator(this, function (_d) {
4762
4839
  switch (_d.label) {
4763
4840
  case 0:
4764
- if (!defs) return [3 /*break*/, 6];
4765
4841
  i = 0;
4766
4842
  _d.label = 1;
4767
4843
  case 1:
@@ -4787,14 +4863,17 @@
4787
4863
  case 6: return [2 /*return*/];
4788
4864
  }
4789
4865
  });
4790
- }); });
4866
+ });
4867
+ };
4868
+ CatalogExternalSourcesComponent.prototype.loadUnavailableCatalogs = function (defs) {
4869
+ this.unavailableCatalogs = defs;
4791
4870
  };
4792
4871
  return CatalogExternalSourcesComponent;
4793
4872
  }());
4794
4873
  CatalogExternalSourcesComponent.decorators = [
4795
4874
  { type: i0.Component, args: [{
4796
4875
  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 ",
4876
+ 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
4877
  encapsulation: i0.ViewEncapsulation.None
4799
4878
  },] }
4800
4879
  ];
@@ -4803,6 +4882,7 @@
4803
4882
  { type: CatalogImageService }
4804
4883
  ]; };
4805
4884
  CatalogExternalSourcesComponent.propDecorators = {
4885
+ isStandalone: [{ type: i0.Input }],
4806
4886
  externalSourceClick: [{ type: i0.Output }],
4807
4887
  showClass: [{ type: i0.HostBinding, args: ['class.co-catalog-external-sources',] }]
4808
4888
  };
@@ -4931,7 +5011,6 @@
4931
5011
  CatalogStockService.prototype.getArticleGridViewExcelFile = function () {
4932
5012
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeWarehouse: null, rangeStockStatus: null });
4933
5013
  this._catalogConnectorService.getArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
4934
- console.log('export: ', result);
4935
5014
  });
4936
5015
  };
4937
5016
  return CatalogStockService;
@@ -5025,7 +5104,6 @@
5025
5104
  CatalogStockTransferService.prototype.getArticleGridViewExcelFile = function () {
5026
5105
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { rangeStockMutationDate: null, rangeStockStatus: null, rangeSourceWarehouse: null, rangeTargetWarehouse: null });
5027
5106
  this._catalogConnectorService.getTransferArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5028
- console.log('export: ', result);
5029
5107
  });
5030
5108
  };
5031
5109
  return CatalogStockTransferService;
@@ -5119,7 +5197,6 @@
5119
5197
  CatalogStockComparisonService.prototype.getArticleGridViewExcelFile = function () {
5120
5198
  this.stockSearchRequest = Object.assign(Object.assign({}, this.searchRequest), { sourceWarehouse: 0, targetWarehouse: 1 });
5121
5199
  this._catalogConnectorService.getComparisonArticleGridViewExcelFile(this.stockSearchRequest).then(function (result) {
5122
- console.log('export: ', result);
5123
5200
  });
5124
5201
  };
5125
5202
  return CatalogStockComparisonService;
@@ -6095,7 +6172,7 @@
6095
6172
  }).catch(function (e) {
6096
6173
  //If there is no price data, make that object null and pass data along
6097
6174
  _this.create3DimerseFeedback(configurationData_1, null);
6098
- console.log(e);
6175
+ // console.log(e);
6099
6176
  });
6100
6177
  }
6101
6178
  else {
@@ -6105,17 +6182,17 @@
6105
6182
  }).catch(function (e) {
6106
6183
  //If we cannot fetch price data
6107
6184
  _this.create3DimerseFeedback(configurationData_1, null);
6108
- console.log(e);
6185
+ // console.log(e);
6109
6186
  });
6110
6187
  }).catch(function (e) {
6111
6188
  //If there is an error fetching config data do not continue. just log the error.
6112
- console.log(e);
6189
+ // console.log(e);
6113
6190
  configurationData_1 = {};
6114
6191
  });
6115
6192
  }
6116
6193
  }).catch(function (e) {
6117
6194
  //If there is an error fetching config dat. just log the error.
6118
- console.log(e);
6195
+ // console.log(e);
6119
6196
  configurationData_1 = {};
6120
6197
  });
6121
6198
  }
@@ -6130,7 +6207,7 @@
6130
6207
  var resultObject = {};
6131
6208
  resultObject['configuratie-data'] = configurationData;
6132
6209
  resultObject['prijs-data'] = priceData;
6133
- console.log(resultObject);
6210
+ // console.log(resultObject);
6134
6211
  this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
6135
6212
  };
6136
6213
  CatalogExternalSourceComponent.prototype.fetchJsonFile = function (url) {