@colijnit/product 258.1.4 → 259.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.
- package/app/bundle/service/local-storage.service.d.ts +14 -0
- package/app/ione-product.component.d.ts +6 -1
- package/bundles/colijnit-product.umd.js +586 -504
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.d.ts +1 -0
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/bundle/service/local-storage.service.js +37 -0
- package/esm2015/app/ione-product.component.js +36 -5
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/colijnit-product.js +2 -1
- package/fesm2015/colijnit-product.js +288 -223
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +8 -8
|
@@ -2,9 +2,6 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Directive, Injectable, EventEmitter, Component, ViewEncapsulation, Input, Output, Renderer2, ChangeDetectorRef, ViewChild, ElementRef, Pipe, NgModule, ChangeDetectionStrategy, HostListener, HostBinding, SecurityContext, CUSTOM_ELEMENTS_SCHEMA, Inject, PLATFORM_ID, NO_ERRORS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { __awaiter } from 'tslib';
|
|
4
4
|
import { Subject, BehaviorSubject } from 'rxjs';
|
|
5
|
-
import * as i1 from '@angular/common/http';
|
|
6
|
-
import { HttpClient } from '@angular/common/http';
|
|
7
|
-
import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
|
|
8
5
|
import { Options } from '@colijnit/ioneconnector/build/model/options';
|
|
9
6
|
import { ArticleFullObject } from '@colijnit/articleapi/build/model/article-full-object';
|
|
10
7
|
import { SuperArticle } from '@colijnit/articleapi/build/model/super-article';
|
|
@@ -16,6 +13,9 @@ import { Transaction } from '@colijnit/transactionapi/build/transaction';
|
|
|
16
13
|
import { MainApi } from '@colijnit/mainapi';
|
|
17
14
|
import { TransactionInfoResponse } from '@colijnit/transactionapi/build/model/transaction-info-response.bo';
|
|
18
15
|
import { ArticleListObjectExtended } from '@colijnit/articleapi/build/model/article-list-object-extended.bo';
|
|
16
|
+
import * as i1 from '@angular/common/http';
|
|
17
|
+
import { HttpClient } from '@angular/common/http';
|
|
18
|
+
import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
|
|
19
19
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
20
20
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
21
21
|
import * as i1$1 from '@angular/platform-browser';
|
|
@@ -30,8 +30,48 @@ class Version {
|
|
|
30
30
|
constructor() {
|
|
31
31
|
this.name = "@colijnit/product";
|
|
32
32
|
this.description = "Product detail page project for iOne";
|
|
33
|
-
this.symVer = "
|
|
34
|
-
this.publishDate = "
|
|
33
|
+
this.symVer = "259.1.0";
|
|
34
|
+
this.publishDate = "7/9/2025, 9:58:59 AM";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class SettingsOptions {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.showStockStatus = false;
|
|
41
|
+
this.showZoomButton = false;
|
|
42
|
+
this.showTagFilter = false;
|
|
43
|
+
this.showAsConfigured = false;
|
|
44
|
+
this.inlineAnswers = false;
|
|
45
|
+
this.showArButton = false;
|
|
46
|
+
this.arEnabled = false;
|
|
47
|
+
this.vrEnabled = false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var RenderModes;
|
|
52
|
+
(function (RenderModes) {
|
|
53
|
+
RenderModes["RenderRoom"] = "render_room";
|
|
54
|
+
RenderModes["RenderShop"] = "render_shop";
|
|
55
|
+
RenderModes["RenderIone"] = "render_ione";
|
|
56
|
+
})(RenderModes || (RenderModes = {}));
|
|
57
|
+
|
|
58
|
+
class RenderParameters$1 {
|
|
59
|
+
constructor() {
|
|
60
|
+
this.host = "";
|
|
61
|
+
this.port = 0;
|
|
62
|
+
this.secure = false;
|
|
63
|
+
this.renderMode = RenderModes.RenderShop;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
class ProductSettings extends Options {
|
|
68
|
+
constructor() {
|
|
69
|
+
super(...arguments);
|
|
70
|
+
this.session = undefined;
|
|
71
|
+
this.createWebOrder = true;
|
|
72
|
+
this.currencySymbol = '€';
|
|
73
|
+
this.options = new SettingsOptions();
|
|
74
|
+
this.renderParameters = new RenderParameters$1();
|
|
35
75
|
}
|
|
36
76
|
}
|
|
37
77
|
|
|
@@ -60,6 +100,180 @@ ProductEventService.decorators = [
|
|
|
60
100
|
{ type: Injectable }
|
|
61
101
|
];
|
|
62
102
|
|
|
103
|
+
// Sole responsibility is simply to wrap around a colijn.Connector to create a stable inner interface to the library in a 1:1 method way.
|
|
104
|
+
// Only to be used by the IOneControllerService.
|
|
105
|
+
class ProductConnectorAdapterService {
|
|
106
|
+
constructor(_eventService) {
|
|
107
|
+
this._eventService = _eventService;
|
|
108
|
+
this.showLoader = new Subject();
|
|
109
|
+
this._boFactory = new BusinessObjectFactory();
|
|
110
|
+
this._subs = [];
|
|
111
|
+
}
|
|
112
|
+
ngOnDestroy() {
|
|
113
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
114
|
+
}
|
|
115
|
+
initConnector(options) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
this.articleConnector = new Articles(options);
|
|
118
|
+
yield this.articleConnector.connect();
|
|
119
|
+
this.transactionConnector = new Transaction(options);
|
|
120
|
+
this._subs.push(
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
this.articleConnector.showLoader.subscribe(value => this.showLoader.next(value)));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
setInstance(instanceId) {
|
|
126
|
+
// this.articleConnector.setInstanceToConfigure(instanceId, false);
|
|
127
|
+
}
|
|
128
|
+
getProductBundleSettings(url, upId) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const tempSettings = new ProductSettings();
|
|
131
|
+
tempSettings.url = url;
|
|
132
|
+
tempSettings.schema = upId.toString();
|
|
133
|
+
const tempMainConnector = new MainApi(tempSettings);
|
|
134
|
+
const response = yield tempMainConnector.getPublicParams(upId);
|
|
135
|
+
if (response) {
|
|
136
|
+
return response.productSettings;
|
|
137
|
+
}
|
|
138
|
+
return "";
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
convertArticleFullObjectToArticleExtended(article) {
|
|
142
|
+
if (article) {
|
|
143
|
+
return this._boFactory.makeWithRawBackendData(ArticleListObjectExtended, article);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
getDeliveryPrognosis(goodId, branchNr) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const deliveryPrognosis = yield this.getSelectorDeliveryDate();
|
|
149
|
+
if (!deliveryPrognosis || !deliveryPrognosis.returnValue) {
|
|
150
|
+
return this.getDeliveryDate2(goodId);
|
|
151
|
+
}
|
|
152
|
+
return deliveryPrognosis;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
getSelectorDeliveryDate() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const response = yield this.articleConnector.getSelectorDeliveryDate();
|
|
158
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
159
|
+
return this._boFactory.makeWithRawBackendData(DeliveryPrognosis, response.resultObject);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
getArtStockStatus(goodId) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const response = yield this.articleConnector.getArtStockStatus(goodId);
|
|
169
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
170
|
+
return response.resultObject;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
getDeliveryDate2(goodId) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const response = yield this.articleConnector.getDeliveryDate2(goodId);
|
|
180
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
181
|
+
return this._boFactory.makeWithRawBackendData(DeliveryPrognosis, response.resultObject);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
getJsonConfiguredArticles(configuratorStatistics) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
const response = yield this.articleConnector.getJsonConfiguredArticles(configuratorStatistics);
|
|
191
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
192
|
+
return response.resultObject;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
return '';
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
getJsonArticleFlatTree(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId, configuratorStatistics) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
return this.articleConnector.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics).catch((messages) => {
|
|
202
|
+
this._eventService.errorMessage.next(messages);
|
|
203
|
+
return null;
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
getGeneratedArtDirectly(goodId, showLoader) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
return this.articleConnector.getGeneratedArtDirectly(goodId, showLoader).catch((messages) => {
|
|
210
|
+
this._eventService.errorMessage.next(messages);
|
|
211
|
+
return null;
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
getGoodIdFromArticleNr(sku) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const response = yield this.articleConnector.getGoodIdFromArticleNr(sku);
|
|
218
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
219
|
+
return response.resultObject;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
getArticleFullObject(goodId, showLoader = true) {
|
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
const response = yield this.articleConnector.getArticleFullObject(goodId, showLoader);
|
|
229
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
230
|
+
return this._boFactory.makeWithRawBackendData(ArticleFullObject, response.resultObject);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
getSuperArticle(id, branch) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
const response = yield this.articleConnector.getSuperArticleQuickSel(id, branch);
|
|
240
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
241
|
+
return this._boFactory.makeWithRawBackendData(SuperArticle, response.resultObject);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
getDocumentContent(docId, thumbnail = true) {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
const response = yield this.articleConnector.getDocumentContent(docId, thumbnail);
|
|
251
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
252
|
+
return this._boFactory.makeWithRawBackendData(DocumentContent, response.resultObject);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
addWebSessionTransactionLine(transactionUuid, sku, quantity) {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
const response = yield this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity);
|
|
262
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
263
|
+
const infoResponse = this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
|
|
264
|
+
return infoResponse.transactionInfo.uuid;
|
|
265
|
+
}
|
|
266
|
+
return "";
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
ProductConnectorAdapterService.decorators = [
|
|
271
|
+
{ type: Injectable }
|
|
272
|
+
];
|
|
273
|
+
ProductConnectorAdapterService.ctorParameters = () => [
|
|
274
|
+
{ type: ProductEventService }
|
|
275
|
+
];
|
|
276
|
+
|
|
63
277
|
class JsonUtilsService {
|
|
64
278
|
readJsonFile(filePath) {
|
|
65
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -280,46 +494,6 @@ DictionaryService.ctorParameters = () => [
|
|
|
280
494
|
{ type: JsonUtilsService }
|
|
281
495
|
];
|
|
282
496
|
|
|
283
|
-
class SettingsOptions {
|
|
284
|
-
constructor() {
|
|
285
|
-
this.showStockStatus = false;
|
|
286
|
-
this.showZoomButton = false;
|
|
287
|
-
this.showTagFilter = false;
|
|
288
|
-
this.showAsConfigured = false;
|
|
289
|
-
this.inlineAnswers = false;
|
|
290
|
-
this.showArButton = false;
|
|
291
|
-
this.arEnabled = false;
|
|
292
|
-
this.vrEnabled = false;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
var RenderModes;
|
|
297
|
-
(function (RenderModes) {
|
|
298
|
-
RenderModes["RenderRoom"] = "render_room";
|
|
299
|
-
RenderModes["RenderShop"] = "render_shop";
|
|
300
|
-
RenderModes["RenderIone"] = "render_ione";
|
|
301
|
-
})(RenderModes || (RenderModes = {}));
|
|
302
|
-
|
|
303
|
-
class RenderParameters$1 {
|
|
304
|
-
constructor() {
|
|
305
|
-
this.host = "";
|
|
306
|
-
this.port = 0;
|
|
307
|
-
this.secure = false;
|
|
308
|
-
this.renderMode = RenderModes.RenderShop;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
class ProductSettings extends Options {
|
|
313
|
-
constructor() {
|
|
314
|
-
super(...arguments);
|
|
315
|
-
this.session = undefined;
|
|
316
|
-
this.createWebOrder = true;
|
|
317
|
-
this.currencySymbol = '€';
|
|
318
|
-
this.options = new SettingsOptions();
|
|
319
|
-
this.renderParameters = new RenderParameters$1();
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
497
|
class ProductSettingsService {
|
|
324
498
|
constructor(_jsonUtilsService, _dictionaryService) {
|
|
325
499
|
this._jsonUtilsService = _jsonUtilsService;
|
|
@@ -399,180 +573,6 @@ ProductSettingsService.ctorParameters = () => [
|
|
|
399
573
|
{ type: DictionaryService }
|
|
400
574
|
];
|
|
401
575
|
|
|
402
|
-
// Sole responsibility is simply to wrap around a colijn.Connector to create a stable inner interface to the library in a 1:1 method way.
|
|
403
|
-
// Only to be used by the IOneControllerService.
|
|
404
|
-
class ProductConnectorAdapterService {
|
|
405
|
-
constructor(_eventService) {
|
|
406
|
-
this._eventService = _eventService;
|
|
407
|
-
this.showLoader = new Subject();
|
|
408
|
-
this._boFactory = new BusinessObjectFactory();
|
|
409
|
-
this._subs = [];
|
|
410
|
-
}
|
|
411
|
-
ngOnDestroy() {
|
|
412
|
-
this._subs.forEach(s => s.unsubscribe());
|
|
413
|
-
}
|
|
414
|
-
initConnector(options) {
|
|
415
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
416
|
-
this.articleConnector = new Articles(options);
|
|
417
|
-
yield this.articleConnector.connect();
|
|
418
|
-
this.transactionConnector = new Transaction(options);
|
|
419
|
-
this._subs.push(
|
|
420
|
-
// @ts-ignore
|
|
421
|
-
this.articleConnector.showLoader.subscribe(value => this.showLoader.next(value)));
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
setInstance(instanceId) {
|
|
425
|
-
// this.articleConnector.setInstanceToConfigure(instanceId, false);
|
|
426
|
-
}
|
|
427
|
-
getProductBundleSettings(url, upId) {
|
|
428
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
const tempSettings = new ProductSettings();
|
|
430
|
-
tempSettings.url = url;
|
|
431
|
-
tempSettings.schema = upId.toString();
|
|
432
|
-
const tempMainConnector = new MainApi(tempSettings);
|
|
433
|
-
const response = yield tempMainConnector.getPublicParams(upId);
|
|
434
|
-
if (response) {
|
|
435
|
-
return response.productSettings;
|
|
436
|
-
}
|
|
437
|
-
return "";
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
convertArticleFullObjectToArticleExtended(article) {
|
|
441
|
-
if (article) {
|
|
442
|
-
return this._boFactory.makeWithRawBackendData(ArticleListObjectExtended, article);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
getDeliveryPrognosis(goodId, branchNr) {
|
|
446
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
447
|
-
const deliveryPrognosis = yield this.getSelectorDeliveryDate();
|
|
448
|
-
if (!deliveryPrognosis || !deliveryPrognosis.returnValue) {
|
|
449
|
-
return this.getDeliveryDate2(goodId);
|
|
450
|
-
}
|
|
451
|
-
return deliveryPrognosis;
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
getSelectorDeliveryDate() {
|
|
455
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
456
|
-
const response = yield this.articleConnector.getSelectorDeliveryDate();
|
|
457
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
458
|
-
return this._boFactory.makeWithRawBackendData(DeliveryPrognosis, response.resultObject);
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
return null;
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
getArtStockStatus(goodId) {
|
|
466
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
-
const response = yield this.articleConnector.getArtStockStatus(goodId);
|
|
468
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
469
|
-
return response.resultObject;
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
getDeliveryDate2(goodId) {
|
|
477
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
478
|
-
const response = yield this.articleConnector.getDeliveryDate2(goodId);
|
|
479
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
480
|
-
return this._boFactory.makeWithRawBackendData(DeliveryPrognosis, response.resultObject);
|
|
481
|
-
}
|
|
482
|
-
else {
|
|
483
|
-
return null;
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
getJsonConfiguredArticles(configuratorStatistics) {
|
|
488
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
489
|
-
const response = yield this.articleConnector.getJsonConfiguredArticles(configuratorStatistics);
|
|
490
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
491
|
-
return response.resultObject;
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
return '';
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
getJsonArticleFlatTree(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId, configuratorStatistics) {
|
|
499
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
500
|
-
return this.articleConnector.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics).catch((messages) => {
|
|
501
|
-
this._eventService.errorMessage.next(messages);
|
|
502
|
-
return null;
|
|
503
|
-
});
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
getGeneratedArtDirectly(goodId, showLoader) {
|
|
507
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
508
|
-
return this.articleConnector.getGeneratedArtDirectly(goodId, showLoader).catch((messages) => {
|
|
509
|
-
this._eventService.errorMessage.next(messages);
|
|
510
|
-
return null;
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
getGoodIdFromArticleNr(sku) {
|
|
515
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
-
const response = yield this.articleConnector.getGoodIdFromArticleNr(sku);
|
|
517
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
518
|
-
return response.resultObject;
|
|
519
|
-
}
|
|
520
|
-
else {
|
|
521
|
-
return null;
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
getArticleFullObject(goodId, showLoader = true) {
|
|
526
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
527
|
-
const response = yield this.articleConnector.getArticleFullObject(goodId, showLoader);
|
|
528
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
529
|
-
return this._boFactory.makeWithRawBackendData(ArticleFullObject, response.resultObject);
|
|
530
|
-
}
|
|
531
|
-
else {
|
|
532
|
-
return null;
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
getSuperArticle(id, branch) {
|
|
537
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
538
|
-
const response = yield this.articleConnector.getSuperArticleQuickSel(id, branch);
|
|
539
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
540
|
-
return this._boFactory.makeWithRawBackendData(SuperArticle, response.resultObject);
|
|
541
|
-
}
|
|
542
|
-
else {
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
getDocumentContent(docId, thumbnail = true) {
|
|
548
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
549
|
-
const response = yield this.articleConnector.getDocumentContent(docId, thumbnail);
|
|
550
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
551
|
-
return this._boFactory.makeWithRawBackendData(DocumentContent, response.resultObject);
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
addWebSessionTransactionLine(transactionUuid, sku, quantity) {
|
|
559
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
560
|
-
const response = yield this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity);
|
|
561
|
-
if (response && response.validationResult && response.validationResult.success) {
|
|
562
|
-
const infoResponse = this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
|
|
563
|
-
return infoResponse.transactionInfo.uuid;
|
|
564
|
-
}
|
|
565
|
-
return "";
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
ProductConnectorAdapterService.decorators = [
|
|
570
|
-
{ type: Injectable }
|
|
571
|
-
];
|
|
572
|
-
ProductConnectorAdapterService.ctorParameters = () => [
|
|
573
|
-
{ type: ProductEventService }
|
|
574
|
-
];
|
|
575
|
-
|
|
576
576
|
// Holds all iONE backend related state and methods for a running HomeDecorator. To be used anywhere internally.
|
|
577
577
|
class ProductConnectorService {
|
|
578
578
|
constructor(_adapterService, _settingsService) {
|
|
@@ -676,8 +676,43 @@ ProductConnectorService.ctorParameters = () => [
|
|
|
676
676
|
{ type: ProductSettingsService }
|
|
677
677
|
];
|
|
678
678
|
|
|
679
|
+
class RootStorageObject {
|
|
680
|
+
}
|
|
681
|
+
class LocalStorageService {
|
|
682
|
+
constructor() {
|
|
683
|
+
this.storage = localStorage;
|
|
684
|
+
this._appRoot = "web-order";
|
|
685
|
+
this._storageObj = new RootStorageObject();
|
|
686
|
+
this._initLocalStorageObj();
|
|
687
|
+
}
|
|
688
|
+
save() {
|
|
689
|
+
this.storage.setItem(this._appRoot, JSON.stringify(this._storageObj));
|
|
690
|
+
}
|
|
691
|
+
clear() {
|
|
692
|
+
this.storage.clear();
|
|
693
|
+
}
|
|
694
|
+
set id(id) {
|
|
695
|
+
this._storageObj.id = id;
|
|
696
|
+
this.save();
|
|
697
|
+
}
|
|
698
|
+
get id() {
|
|
699
|
+
return this._storageObj ? this._storageObj.id : "";
|
|
700
|
+
}
|
|
701
|
+
_initLocalStorageObj() {
|
|
702
|
+
this._storageObj = JSON.parse(this.storage.getItem(this._appRoot)) || this._storageObj;
|
|
703
|
+
this.save();
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
LocalStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LocalStorageService_Factory() { return new LocalStorageService(); }, token: LocalStorageService, providedIn: "root" });
|
|
707
|
+
LocalStorageService.decorators = [
|
|
708
|
+
{ type: Injectable, args: [{
|
|
709
|
+
providedIn: 'root'
|
|
710
|
+
},] }
|
|
711
|
+
];
|
|
712
|
+
LocalStorageService.ctorParameters = () => [];
|
|
713
|
+
|
|
679
714
|
class IoneProductComponent {
|
|
680
|
-
constructor(_appEventService, _settingsService) {
|
|
715
|
+
constructor(_appEventService, _settingsService, _productConnectorService, _localStorageService) {
|
|
681
716
|
// this.sku = 'CF-HILL';
|
|
682
717
|
// this.sku = 'CF-ALMADA';
|
|
683
718
|
// this.sku = 'CF-39904ANT';
|
|
@@ -695,8 +730,11 @@ class IoneProductComponent {
|
|
|
695
730
|
// this.sku = "1000612725";
|
|
696
731
|
this._appEventService = _appEventService;
|
|
697
732
|
this._settingsService = _settingsService;
|
|
733
|
+
this._productConnectorService = _productConnectorService;
|
|
734
|
+
this._localStorageService = _localStorageService;
|
|
698
735
|
this.enableRenderCarousel = false;
|
|
699
736
|
this.handleAddArticleInternally = true;
|
|
737
|
+
this.handleAddToCartInternally = false;
|
|
700
738
|
this.onAddToCart = new EventEmitter();
|
|
701
739
|
this.forceRenderImage = new EventEmitter();
|
|
702
740
|
this.getRenderForRenderCarousel = new EventEmitter();
|
|
@@ -748,7 +786,31 @@ class IoneProductComponent {
|
|
|
748
786
|
}
|
|
749
787
|
_handleAddToCart(data) {
|
|
750
788
|
return __awaiter(this, void 0, void 0, function* () {
|
|
751
|
-
this.
|
|
789
|
+
if (this.handleAddToCartInternally) {
|
|
790
|
+
if (data && data.article) {
|
|
791
|
+
if (typeof data.article === 'string') {
|
|
792
|
+
const article = JSON.parse(data.article);
|
|
793
|
+
if (article.selectorData && article.selectorData.compositions) { // configured (frozen) article
|
|
794
|
+
const transactionId = yield this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, article.selectorData.compositions[0].compositionArticleNo, data.quantity);
|
|
795
|
+
if (transactionId) {
|
|
796
|
+
this._localStorageService.id = transactionId;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
else { // flat (simple) article
|
|
801
|
+
if (data.article.hasOwnProperty('articleNr')) {
|
|
802
|
+
const transactionId = yield this._productConnectorService.addWebSessionTransactionLine(this._localStorageService.id, data.article['articleNr'], data.quantity);
|
|
803
|
+
if (transactionId) {
|
|
804
|
+
this._localStorageService.id = transactionId;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
this.onAddToCart.next(data);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
this.onAddToCart.emit(data);
|
|
813
|
+
}
|
|
752
814
|
});
|
|
753
815
|
}
|
|
754
816
|
openStock() {
|
|
@@ -782,7 +844,9 @@ IoneProductComponent.decorators = [
|
|
|
782
844
|
];
|
|
783
845
|
IoneProductComponent.ctorParameters = () => [
|
|
784
846
|
{ type: ProductEventService },
|
|
785
|
-
{ type: ProductSettingsService }
|
|
847
|
+
{ type: ProductSettingsService },
|
|
848
|
+
{ type: ProductConnectorService },
|
|
849
|
+
{ type: LocalStorageService }
|
|
786
850
|
];
|
|
787
851
|
IoneProductComponent.propDecorators = {
|
|
788
852
|
sku: [{ type: Input }],
|
|
@@ -791,6 +855,7 @@ IoneProductComponent.propDecorators = {
|
|
|
791
855
|
enableRenderCarousel: [{ type: Input }],
|
|
792
856
|
settings: [{ type: Input }],
|
|
793
857
|
handleAddArticleInternally: [{ type: Input }],
|
|
858
|
+
handleAddToCartInternally: [{ type: Input }],
|
|
794
859
|
onAddToCart: [{ type: Output }],
|
|
795
860
|
forceRenderImage: [{ type: Output }],
|
|
796
861
|
getRenderForRenderCarousel: [{ type: Output }],
|
|
@@ -3364,5 +3429,5 @@ IoneProductModule.decorators = [
|
|
|
3364
3429
|
* Generated bundle index. Do not edit.
|
|
3365
3430
|
*/
|
|
3366
3431
|
|
|
3367
|
-
export { IoneProductComponent, IoneProductModule, ProductConnectorAdapterService, ProductConnectorService, ProductEventService, ProductExternalSourceComponent, ProductExternalSourceModule, ProductSettingsService, Version, ProductPageModule as ɵa, ProductSelectorTypeModule as ɵb, ProductInfoTabsModule as ɵba, ProductAdditionalInfoModule as ɵbb, ProductAdditionalInfoComponent as ɵbc, ProductPropertiesModule as ɵbd, ProductPropertiesComponent as ɵbe, ProductDocumentModule as ɵbf, ProductDocumentsComponent as ɵbg, ProductSymbolsModule as ɵbh, ProductSymbolsComponent as ɵbi, ProductInfoTabsComponent as ɵbj, ProductDialogModule as ɵbk, ProductDialogComponent as ɵbl, RenderCarouselModule as ɵbm, RenderCarouselComponent as ɵbn, ProductPageComponent as ɵbo, ProductHdModule as ɵbp, ProductHdComponent as ɵbq, ProductScriptLoaderService as ɵbr, PipeModule as ɵc, LocalizePipe as ɵd, DictionaryService as ɵe, JsonUtilsService as ɵf, ProductSelectorTypeComponent as ɵg, IconCacheService as ɵh, ImageCarouselModule as ɵi, ImageCarouselComponent as ɵj, ProductDescriptionModule as ɵk, ProductDescriptionComponent as ɵl, ProductAdditionalDescriptionModule as ɵm, ProductAdditionalDescriptionComponent as ɵn, ProductPriceModule as ɵo, ProductPriceComponent as ɵp, ProductAddtocartModule as ɵq, ProductAddtocartComponent as ɵr, ProductRelatedModule as ɵs, HeaderModule as ɵt, HeaderComponent as ɵu, ProductRelatedComponent as ɵv, ProductStockModule as ɵw, ProductStockComponent as ɵx, ProductDeliveryModule as ɵy, ProductDeliveryComponent as ɵz };
|
|
3432
|
+
export { IoneProductComponent, IoneProductModule, ProductConnectorAdapterService, ProductConnectorService, ProductEventService, ProductExternalSourceComponent, ProductExternalSourceModule, ProductSettingsService, Version, ProductPageModule as ɵa, ProductSelectorTypeModule as ɵb, ProductInfoTabsModule as ɵba, ProductAdditionalInfoModule as ɵbb, ProductAdditionalInfoComponent as ɵbc, ProductPropertiesModule as ɵbd, ProductPropertiesComponent as ɵbe, ProductDocumentModule as ɵbf, ProductDocumentsComponent as ɵbg, ProductSymbolsModule as ɵbh, ProductSymbolsComponent as ɵbi, ProductInfoTabsComponent as ɵbj, ProductDialogModule as ɵbk, ProductDialogComponent as ɵbl, RenderCarouselModule as ɵbm, RenderCarouselComponent as ɵbn, ProductPageComponent as ɵbo, ProductHdModule as ɵbp, ProductHdComponent as ɵbq, ProductScriptLoaderService as ɵbr, LocalStorageService as ɵbs, PipeModule as ɵc, LocalizePipe as ɵd, DictionaryService as ɵe, JsonUtilsService as ɵf, ProductSelectorTypeComponent as ɵg, IconCacheService as ɵh, ImageCarouselModule as ɵi, ImageCarouselComponent as ɵj, ProductDescriptionModule as ɵk, ProductDescriptionComponent as ɵl, ProductAdditionalDescriptionModule as ɵm, ProductAdditionalDescriptionComponent as ɵn, ProductPriceModule as ɵo, ProductPriceComponent as ɵp, ProductAddtocartModule as ɵq, ProductAddtocartComponent as ɵr, ProductRelatedModule as ɵs, HeaderModule as ɵt, HeaderComponent as ɵu, ProductRelatedComponent as ɵv, ProductStockModule as ɵw, ProductStockComponent as ɵx, ProductDeliveryModule as ɵy, ProductDeliveryComponent as ɵz };
|
|
3368
3433
|
//# sourceMappingURL=colijnit-product.js.map
|