@colijnit/homedecorator 261.20.5 → 261.20.6
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.
|
@@ -43,9 +43,7 @@ import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerM
|
|
|
43
43
|
import { RGBFormat, LinearToneMapping, AgXToneMapping, LinearFilter as LinearFilter$1, LinearSRGBColorSpace as LinearSRGBColorSpace$1, SrcAlphaSaturateFactor, FloatType as FloatType$1 } from 'three/src/constants.js';
|
|
44
44
|
import md5 from 'md5';
|
|
45
45
|
import { NodeType } from '@colijnit/configuratorapi/build/enum/node-type.enum';
|
|
46
|
-
import { ConfiguratorStatisticsEnvironment } from '@colijnit/configuratorapi/build/model/configurator-statistics-environment';
|
|
47
46
|
import { Options } from '@colijnit/ioneconnector/build/model/options';
|
|
48
|
-
import { FrozenArticle } from '@colijnit/configuratorapi/build/model/frozen-article';
|
|
49
47
|
import { SelectorWithOptions } from '@colijnit/configuratorapi/build/model/selector-with-options';
|
|
50
48
|
import { ImageUtils } from '@colijnit/configuratorapi/build/utils/image-utils';
|
|
51
49
|
import * as i1 from '@angular/common/http';
|
|
@@ -3986,6 +3984,18 @@ class HomedecoratorConnectorAdapterService {
|
|
|
3986
3984
|
// public getJsonMatchTableArticles(): Promise<void> {
|
|
3987
3985
|
// return this.connector.getJsonMatchTableArticles();
|
|
3988
3986
|
// }
|
|
3987
|
+
async prepareArticleForCart(goodId, quantity = 1, shouldGetArticleTree = false, showLoader = true, instanceId = undefined) {
|
|
3988
|
+
const response = await this.articleApi.prepareArticleForCart('Homedecorator', 'Sales', 'Homedecorator', goodId, shouldGetArticleTree, quantity, instanceId, showLoader);
|
|
3989
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
3990
|
+
if (typeof response.resultObject !== 'string') {
|
|
3991
|
+
return this._boFactory.makeWithRawBackendData(ArticleFullObject, response.resultObject);
|
|
3992
|
+
}
|
|
3993
|
+
return response.resultObject;
|
|
3994
|
+
}
|
|
3995
|
+
else {
|
|
3996
|
+
return null;
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3989
3999
|
async setInstanceToConfigure(id) {
|
|
3990
4000
|
try {
|
|
3991
4001
|
if (id !== null) {
|
|
@@ -6843,8 +6853,8 @@ class HomedecoratorConnectorService {
|
|
|
6843
6853
|
googleTranslateEnabled() {
|
|
6844
6854
|
return this._connector.googleTranslateEnabled();
|
|
6845
6855
|
}
|
|
6846
|
-
|
|
6847
|
-
return this._connector.
|
|
6856
|
+
prepareArticleForCart(goodId, quantity, externalSource = false, showLoader = true, instanceId) {
|
|
6857
|
+
return this._connector.prepareArticleForCart(goodId, quantity, !!externalSource, showLoader, instanceId);
|
|
6848
6858
|
}
|
|
6849
6859
|
// public getJsonMatchTableArticles(): Promise<any> {
|
|
6850
6860
|
// return this._connector.getJsonMatchTableArticles();
|
|
@@ -7163,23 +7173,21 @@ class HomedecoratorConnectorService {
|
|
|
7163
7173
|
});
|
|
7164
7174
|
}
|
|
7165
7175
|
async addToCart(goodId, goodType, quantity, instanceId, externalSource) {
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
json = await this.getJsonConfiguredArticles(goodId, goodType, quantity, externalSource, true, instanceId, statistics);
|
|
7175
|
-
const frozenArticle = JSON.parse(json);
|
|
7176
|
+
const response = await this.prepareArticleForCart(goodId, quantity, externalSource, true, instanceId);
|
|
7177
|
+
let article;
|
|
7178
|
+
if (typeof response === 'string') {
|
|
7179
|
+
article = JSON.parse(response);
|
|
7180
|
+
}
|
|
7181
|
+
else {
|
|
7182
|
+
article = response;
|
|
7183
|
+
}
|
|
7176
7184
|
this._googleTagManager.sendEvent(GoogleTagManagerEvent.AddToCart, {
|
|
7177
|
-
'articleNr':
|
|
7178
|
-
'product':
|
|
7179
|
-
'composition':
|
|
7185
|
+
'articleNr': article.selectorData ? article.selectorData.articleNr : article.articleNr,
|
|
7186
|
+
'product': article.selectorData ? article.selectorData.articleName : article.name,
|
|
7187
|
+
'composition': article.selectorData ? article.selectorData.configurationText : article.configuration
|
|
7180
7188
|
});
|
|
7181
|
-
this._messageService.emit(MessageType.ArticleCreated,
|
|
7182
|
-
return
|
|
7189
|
+
this._messageService.emit(MessageType.ArticleCreated, article);
|
|
7190
|
+
return article;
|
|
7183
7191
|
}
|
|
7184
7192
|
handleAnswersReceived() {
|
|
7185
7193
|
this._preloadCachedImages(this.activeAnswers);
|
|
@@ -41693,10 +41701,10 @@ class RoomPlannerComponent {
|
|
|
41693
41701
|
if (object.metadata) {
|
|
41694
41702
|
this.showContextMenu = false;
|
|
41695
41703
|
await this._connectorAdapterService.initConnector(object.metadata.externalSettings ? object.metadata.externalSettings.settings : this.settingsService.settings, object.metadata.externalSettings ? object.metadata.externalSettings.name : undefined, false, object.metadata.externalSettings && object.metadata.externalSettings.externalSourceId ? object.metadata.externalSettings.externalSourceId : null);
|
|
41696
|
-
const
|
|
41704
|
+
const article = await this._connectorService.addToCart(+object.metadata.goodId, object.metadata.goodType, 1, object.metadata.itemId, !!(object.metadata.externalSettings && object.metadata.externalSettings.externalSourceId));
|
|
41697
41705
|
if (object.metadata.externalSettings) {
|
|
41698
41706
|
const externalSource = {
|
|
41699
|
-
article:
|
|
41707
|
+
article: article,
|
|
41700
41708
|
quantity: 1,
|
|
41701
41709
|
catalogDefinition: object.metadata.externalSettings.catalogDefinition,
|
|
41702
41710
|
externalSource: this._connectorAdapterService.getExternalSourceFromId(object.metadata.externalSettings.externalSourceId)
|
|
@@ -41704,7 +41712,7 @@ class RoomPlannerComponent {
|
|
|
41704
41712
|
this._appEventService.addExternalSourceToCart.next(externalSource);
|
|
41705
41713
|
}
|
|
41706
41714
|
else {
|
|
41707
|
-
this._appEventService.addToCart.next({ article:
|
|
41715
|
+
this._appEventService.addToCart.next({ article: article, quantity: 1 });
|
|
41708
41716
|
}
|
|
41709
41717
|
}
|
|
41710
41718
|
}
|