@colijnit/catalog 255.1.9 → 256.1.0

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.9";
34
- this.publishDate = "17-9-2024 14:24:41";
33
+ this.symVer = "256.1.0";
34
+ this.publishDate = "10/15/2024, 12:15:14 PM";
35
35
  }
36
36
  return Version;
37
37
  }());
@@ -1805,10 +1805,11 @@
1805
1805
  });
1806
1806
  });
1807
1807
  };
1808
- CatalogConnectorAdapterService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics) {
1808
+ CatalogConnectorAdapterService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics) {
1809
+ if (externalSource === void 0) { externalSource = false; }
1809
1810
  if (showLoader === void 0) { showLoader = true; }
1810
1811
  if (instanceId === void 0) { instanceId = undefined; }
1811
- return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
1812
+ return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, undefined, configuratorStatistics);
1812
1813
  };
1813
1814
  CatalogConnectorAdapterService.prototype.onShowLoaderChange = function (showLoader) {
1814
1815
  this._shouldShowLoader = showLoader;
@@ -2624,10 +2625,11 @@
2624
2625
  });
2625
2626
  });
2626
2627
  };
2627
- CatalogConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, showLoader, instanceId, configuratorStatistics) {
2628
+ CatalogConnectorService.prototype.getJsonArticleFlatTree = function (goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics) {
2629
+ if (externalSource === void 0) { externalSource = false; }
2628
2630
  if (showLoader === void 0) { showLoader = true; }
2629
2631
  if (instanceId === void 0) { instanceId = undefined; }
2630
- return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
2632
+ return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, undefined, configuratorStatistics);
2631
2633
  };
2632
2634
  CatalogConnectorService.prototype.addWebSessionTransactionLine = function (transactionUuid, sku, quantity) {
2633
2635
  return __awaiter(this, void 0, void 0, function () {
@@ -5870,43 +5872,54 @@
5870
5872
  var customerName, configurationUrl, priceDataUrl, configurationData_1, priceData_1;
5871
5873
  var _this = this;
5872
5874
  return __generator(this, function (_a) {
5873
- customerName = 'Linteloo';
5875
+ customerName = this._externalSource.username;
5874
5876
  configurationUrl = this._externalSource.domain + '/configurationData/' + hash;
5875
- console.log('configurationUrl');
5876
5877
  priceDataUrl = this._externalSource.domain + '/rules/api/' + customerName.toLowerCase() + '/' + hash;
5877
- console.log('priceDataUrl');
5878
+ //test setup for local testing
5879
+ //const configurationUrl: string = "https://bertplantagie.platformapi-accept.3dimerce.com/configurationData/8eb5b35697c96716d3e253294344d98e4dcdcb68969c288189d45829164e3177";
5880
+ //console.log(configurationUrl);
5881
+ //const priceDataUrl: string = "https://bertplantagie.platformapi-accept.3dimerce.com/rules/api/bertplantagie/8eb5b35697c96716d3e253294344d98e4dcdcb68969c288189d45829164e3177";
5882
+ //console.log(priceDataUrl);
5878
5883
  try {
5879
5884
  //first fetch the configuration data
5880
5885
  this.fetchJsonFile(configurationUrl).then(function (configResponse) {
5881
5886
  if (configResponse && configResponse.ok) {
5882
5887
  configResponse.json().then(function (result) {
5883
- console.log(result);
5888
+ //console.log(result);
5884
5889
  configurationData_1 = result;
5885
- //if we have config data, fetch price data
5890
+ //if we have config data continue to fetch price data
5886
5891
  _this.fetchJsonFile(priceDataUrl).then(function (priceResponse) {
5887
5892
  if (priceResponse && priceResponse.ok) {
5888
5893
  priceResponse.json().then(function (result) {
5889
- console.log(result);
5894
+ //console.log(result);
5890
5895
  priceData_1 = result;
5891
5896
  //If we have config and price data. Create the necessary data object and pass it along.
5892
- var resultObject = {};
5893
- resultObject['configuratie-data'] = configurationData_1;
5894
- resultObject['prijs-data'] = priceData_1;
5895
- console.log(resultObject);
5896
- _this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
5897
+ _this.create3DimerseFeedback(configurationData_1, priceData_1);
5897
5898
  }).catch(function (e) {
5898
- //If there is no price data something has gone wrong. No further action should be taken besides showing any errors.
5899
+ //If there is no price data, make that object null and pass data along
5900
+ _this.create3DimerseFeedback(configurationData_1, null);
5899
5901
  console.log(e);
5900
- priceData_1 = {};
5901
5902
  });
5902
5903
  }
5904
+ else {
5905
+ //If there is no valid price data, make that object null and pass data along
5906
+ _this.create3DimerseFeedback(configurationData_1, null);
5907
+ }
5908
+ }).catch(function (e) {
5909
+ //If we cannot fetch price data
5910
+ _this.create3DimerseFeedback(configurationData_1, null);
5911
+ console.log(e);
5903
5912
  });
5904
5913
  }).catch(function (e) {
5905
- //If there is no config data something has gone wrong. No further action should be taken besides showing any errors.
5914
+ //If there is an error fetching config data do not continue. just log the error.
5906
5915
  console.log(e);
5907
5916
  configurationData_1 = {};
5908
5917
  });
5909
5918
  }
5919
+ }).catch(function (e) {
5920
+ //If there is an error fetching config dat. just log the error.
5921
+ console.log(e);
5922
+ configurationData_1 = {};
5910
5923
  });
5911
5924
  }
5912
5925
  catch (error) {
@@ -5916,6 +5929,13 @@
5916
5929
  });
5917
5930
  });
5918
5931
  };
5932
+ CatalogExternalSourceComponent.prototype.create3DimerseFeedback = function (configurationData, priceData) {
5933
+ var resultObject = {};
5934
+ resultObject['configuratie-data'] = configurationData;
5935
+ resultObject['prijs-data'] = priceData;
5936
+ console.log(resultObject);
5937
+ this.iFrameFeedbackReceived.emit(JSON.stringify(resultObject));
5938
+ };
5919
5939
  CatalogExternalSourceComponent.prototype.fetchJsonFile = function (url) {
5920
5940
  return __awaiter(this, void 0, void 0, function () {
5921
5941
  return __generator(this, function (_a) {