@colijnit/product 12.0.3 → 12.0.5
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/components/product-addtocart/product-addtocart.component.d.ts +1 -0
- package/app/components/product-external-source/product-external-source.component.d.ts +5 -1
- package/app/components/product-page/product-page.component.d.ts +1 -0
- package/app/components/product-stock/product-stock.component.d.ts +9 -7
- package/app/ione-product.component.d.ts +6 -1
- package/app/service/product-connector-adapter.service.d.ts +4 -3
- package/app/service/product-connector.service.d.ts +4 -3
- package/app/service/product-event.service.d.ts +5 -1
- package/bundles/colijnit-product.umd.js +113 -102
- package/bundles/colijnit-product.umd.js.map +1 -1
- package/colijnit-product.metadata.json +1 -1
- package/esm2015/app/components/product-addtocart/product-addtocart.component.js +10 -2
- package/esm2015/app/components/product-external-source/product-external-source.component.js +1 -1
- package/esm2015/app/components/product-page/product-page.component.js +4 -2
- package/esm2015/app/components/product-stock/product-stock.component.js +30 -10
- package/esm2015/app/ione-product.component.js +11 -36
- package/esm2015/app/ione-product.module.js +7 -3
- package/esm2015/app/product-version.js +3 -3
- package/esm2015/app/service/product-connector-adapter.service.js +26 -8
- package/esm2015/app/service/product-connector.service.js +9 -8
- package/esm2015/app/service/product-event.service.js +1 -1
- package/esm2015/assets/dictionary/text.properties.js +3 -1
- package/fesm2015/colijnit-product.js +92 -63
- package/fesm2015/colijnit-product.js.map +1 -1
- package/package.json +3 -3
|
@@ -11,11 +11,12 @@ import { DocumentContent } from '@colijnit/articleapi/build/model/document-conte
|
|
|
11
11
|
import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
|
|
12
12
|
import { Transaction } from '@colijnit/transactionapi/build/transaction';
|
|
13
13
|
import { MainApi } from '@colijnit/mainapi';
|
|
14
|
+
import { TransactionInfoResponse } from '@colijnit/transactionapi/build/model/transaction-info-response.bo';
|
|
15
|
+
import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
|
|
14
16
|
import * as i1 from '@angular/common/http';
|
|
15
17
|
import { HttpClient } from '@angular/common/http';
|
|
16
18
|
import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
|
|
17
19
|
import { CommonModule } from '@angular/common';
|
|
18
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
19
20
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
20
21
|
import * as i1$1 from '@angular/platform-browser';
|
|
21
22
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -28,8 +29,8 @@ class Version {
|
|
|
28
29
|
constructor() {
|
|
29
30
|
this.name = "@colijnit/product";
|
|
30
31
|
this.description = "Product detail page project for iOne";
|
|
31
|
-
this.symVer = "12.0.
|
|
32
|
-
this.publishDate = "
|
|
32
|
+
this.symVer = "12.0.5";
|
|
33
|
+
this.publishDate = "30-11-2023 11:58:33";
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -136,6 +137,11 @@ class ProductConnectorAdapterService {
|
|
|
136
137
|
return "";
|
|
137
138
|
});
|
|
138
139
|
}
|
|
140
|
+
convertArticleFullObjectToArticleExtended(article) {
|
|
141
|
+
if (article) {
|
|
142
|
+
return this._boFactory.makeWithRawBackendData(ArticleExtended, article);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
139
145
|
getDeliveryPrognosis(goodId, branchNr) {
|
|
140
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
147
|
const deliveryPrognosis = yield this.getSelectorDeliveryDate();
|
|
@@ -156,6 +162,17 @@ class ProductConnectorAdapterService {
|
|
|
156
162
|
}
|
|
157
163
|
});
|
|
158
164
|
}
|
|
165
|
+
getArtStockStatus(goodId) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const response = yield this.articleConnector.getArtStockStatus(goodId);
|
|
168
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
169
|
+
return response.resultObject;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
159
176
|
getDeliveryDate2(goodId) {
|
|
160
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
178
|
const response = yield this.articleConnector.getDeliveryDate2(goodId);
|
|
@@ -227,14 +244,14 @@ class ProductConnectorAdapterService {
|
|
|
227
244
|
}
|
|
228
245
|
});
|
|
229
246
|
}
|
|
230
|
-
addWebSessionTransactionLine(sku, quantity) {
|
|
231
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
-
return yield this.transactionConnector.addWebSessionTransactionLine(sku, quantity);
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
getWebTransaction() {
|
|
247
|
+
addWebSessionTransactionLine(transactionUuid, sku, quantity) {
|
|
236
248
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
|
|
249
|
+
const response = yield this.transactionConnector.addWebSessionTransactionLine(transactionUuid, sku, quantity);
|
|
250
|
+
if (response && response.validationResult && response.validationResult.success) {
|
|
251
|
+
const infoResponse = this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
|
|
252
|
+
return infoResponse.transactionInfo.uuid;
|
|
253
|
+
}
|
|
254
|
+
return "";
|
|
238
255
|
});
|
|
239
256
|
}
|
|
240
257
|
}
|
|
@@ -269,6 +286,7 @@ class Dictionary {
|
|
|
269
286
|
"HEIGHT": "Hoogte",
|
|
270
287
|
"MATERIAL": "Materiaal",
|
|
271
288
|
"PRODUCT_IN_STOCK": "Op voorraad",
|
|
289
|
+
"PRODUCT_LIMITED_STOCK": "Beperkt op voorraad",
|
|
272
290
|
"PRODUCT_NOT_IN_STOCK": "Niet op voorraad",
|
|
273
291
|
"PROPERTIES": "Eigenschappen",
|
|
274
292
|
"QUOTATION": "Quotatie",
|
|
@@ -298,6 +316,7 @@ class Dictionary {
|
|
|
298
316
|
"HEIGHT": "Höhe",
|
|
299
317
|
"MATERIAL": "Material",
|
|
300
318
|
"PRODUCT_IN_STOCK": "Auf lager",
|
|
319
|
+
"PRODUCT_LIMITED_STOCK": "Begrentzt auf lager",
|
|
301
320
|
"PRODUCT_NOT_IN_STOCK": "Nicht auf lager",
|
|
302
321
|
"PROPERTIES": "Eigenschaften",
|
|
303
322
|
"QUOTATION": "Angebot",
|
|
@@ -527,6 +546,9 @@ class ProductConnectorService {
|
|
|
527
546
|
this._instanceId = instanceId;
|
|
528
547
|
this._adapterService.setInstance(instanceId);
|
|
529
548
|
}
|
|
549
|
+
convertArticleFullObjectToArticleExtended(article) {
|
|
550
|
+
return this._adapterService.convertArticleFullObjectToArticleExtended(article);
|
|
551
|
+
}
|
|
530
552
|
getFullArticle(sku) {
|
|
531
553
|
return __awaiter(this, void 0, void 0, function* () {
|
|
532
554
|
const goodId = yield this._adapterService.getGoodIdFromArticleNr(sku);
|
|
@@ -547,6 +569,9 @@ class ProductConnectorService {
|
|
|
547
569
|
return this._adapterService.getSelectorDeliveryDate();
|
|
548
570
|
});
|
|
549
571
|
}
|
|
572
|
+
getArtStockStatus(goodId) {
|
|
573
|
+
return this._adapterService.getArtStockStatus(goodId);
|
|
574
|
+
}
|
|
550
575
|
getDeliveryDate2(goodId) {
|
|
551
576
|
return this._adapterService.getDeliveryDate2(goodId);
|
|
552
577
|
}
|
|
@@ -556,14 +581,9 @@ class ProductConnectorService {
|
|
|
556
581
|
getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, configuratorStatistics) {
|
|
557
582
|
return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, this._instanceId, configuratorStatistics);
|
|
558
583
|
}
|
|
559
|
-
addWebSessionTransactionLine(sku, quantity) {
|
|
584
|
+
addWebSessionTransactionLine(transactionUuid, sku, quantity) {
|
|
560
585
|
return __awaiter(this, void 0, void 0, function* () {
|
|
561
|
-
return yield this._adapterService.addWebSessionTransactionLine(sku, quantity);
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
getWebTransaction() {
|
|
565
|
-
this._adapterService.getWebTransaction().then((response) => {
|
|
566
|
-
console.log(response);
|
|
586
|
+
return yield this._adapterService.addWebSessionTransactionLine(transactionUuid, sku, quantity);
|
|
567
587
|
});
|
|
568
588
|
}
|
|
569
589
|
onShowLoaderChange(showLoader) {
|
|
@@ -617,12 +637,15 @@ class IoneProductComponent {
|
|
|
617
637
|
// this.sku = '1000234793';
|
|
618
638
|
// this.sku = '1066';
|
|
619
639
|
// this.sku = '104';
|
|
640
|
+
// this.sku = "70000107";
|
|
641
|
+
// this.sku = "grover";
|
|
620
642
|
this._dictionary = _dictionary;
|
|
621
643
|
this._jsonUtils = _jsonUtils;
|
|
622
644
|
this._ione = _ione;
|
|
623
645
|
this._changeDetector = _changeDetector;
|
|
624
646
|
this._appEventService = _appEventService;
|
|
625
647
|
this._settingsService = _settingsService;
|
|
648
|
+
this.handleAddArticleInternally = true;
|
|
626
649
|
this.onAddToCart = new EventEmitter();
|
|
627
650
|
this.forceRenderImage = new EventEmitter();
|
|
628
651
|
this.onAlternativeClick = new EventEmitter();
|
|
@@ -633,11 +656,10 @@ class IoneProductComponent {
|
|
|
633
656
|
this.openStockEvent = new EventEmitter();
|
|
634
657
|
this.settingsLoaded = false;
|
|
635
658
|
this._subs = [];
|
|
636
|
-
// this.sku = "70000107";
|
|
637
659
|
this._subs.push(
|
|
638
660
|
// this._dictionary.dictionaryLoaded.subscribe(d => this.upAndLoaded = true),
|
|
639
|
-
this._appEventService.onAddToCart.subscribe((
|
|
640
|
-
this._handleAddToCart(
|
|
661
|
+
this._appEventService.onAddToCart.subscribe((data) => {
|
|
662
|
+
this._handleAddToCart(data);
|
|
641
663
|
}), this._appEventService.onAddToQuote.subscribe(json => this.onAddToQuote.emit(json)), this._appEventService.onAlternativeClick.subscribe(article => this.onAlternativeClick.emit(article)), this._appEventService.onArticleInfoReceived.subscribe(info => this._handleAnswerInfoReceived(info)), this._appEventService.onArticleReceived.subscribe(article => this.onArticleReceived.emit(article)), this._appEventService.onSelectionsReceived.subscribe(selections => this.onSelectionsReceived.emit(selections)), this._settingsService.settingsLoaded.subscribe(loaded => {
|
|
642
664
|
this.settingsLoaded = loaded;
|
|
643
665
|
}));
|
|
@@ -657,7 +679,7 @@ class IoneProductComponent {
|
|
|
657
679
|
}
|
|
658
680
|
ngOnInit() {
|
|
659
681
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
|
-
yield this._settingsService.initializeSettings(this._settings
|
|
682
|
+
yield this._settingsService.initializeSettings(this._settings === undefined);
|
|
661
683
|
if (this._settings) {
|
|
662
684
|
this._settingsService.createSettingsFromObject(this._settings);
|
|
663
685
|
}
|
|
@@ -672,32 +694,9 @@ class IoneProductComponent {
|
|
|
672
694
|
_handleAnswerInfoReceived(info) {
|
|
673
695
|
this.onArticleInfoReceived.next(info);
|
|
674
696
|
}
|
|
675
|
-
_handleAddToCart(
|
|
697
|
+
_handleAddToCart(data) {
|
|
676
698
|
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
-
|
|
678
|
-
if (json) {
|
|
679
|
-
const articleTreeData = JSON.parse(json);
|
|
680
|
-
if (articleTreeData.articleTree && articleTreeData.articleTree.article) {
|
|
681
|
-
if (articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
|
|
682
|
-
articleTreeData.articleTree.compositeGoods.length > 0 &&
|
|
683
|
-
articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles)) {
|
|
684
|
-
const compositeGoods = articleTreeData.articleTree.compositeGoods;
|
|
685
|
-
compositeGoods.sort((a, b) => a.versionNumber < b.versionNumber ? -1 : 1);
|
|
686
|
-
for (let i = 0; i < compositeGoods.length; i++) {
|
|
687
|
-
const good = compositeGoods[i];
|
|
688
|
-
const subArticle = articleTreeData.articleTree.subArticles.find(s => s.goodId === good.memberGoodId);
|
|
689
|
-
if (subArticle) {
|
|
690
|
-
yield this._ione.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity);
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
else {
|
|
695
|
-
yield this._ione.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1);
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
this.onAddToCart.emit(json);
|
|
699
|
+
this.onAddToCart.emit(data);
|
|
701
700
|
});
|
|
702
701
|
}
|
|
703
702
|
openStock() {
|
|
@@ -709,14 +708,10 @@ IoneProductComponent.decorators = [
|
|
|
709
708
|
selector: 'app-ione-product',
|
|
710
709
|
template: `
|
|
711
710
|
<app-product-page *ngIf="settingsLoaded"
|
|
711
|
+
[createFrozenArticle]="handleAddArticleInternally"
|
|
712
712
|
(openStockEvent)="openStock()" [sku]="sku"
|
|
713
713
|
></app-product-page>
|
|
714
714
|
`,
|
|
715
|
-
providers: [
|
|
716
|
-
ProductEventService,
|
|
717
|
-
ProductConnectorAdapterService,
|
|
718
|
-
ProductConnectorService
|
|
719
|
-
],
|
|
720
715
|
encapsulation: ViewEncapsulation.Emulated,
|
|
721
716
|
styles: [""]
|
|
722
717
|
},] }
|
|
@@ -732,6 +727,7 @@ IoneProductComponent.ctorParameters = () => [
|
|
|
732
727
|
IoneProductComponent.propDecorators = {
|
|
733
728
|
sku: [{ type: Input }],
|
|
734
729
|
settings: [{ type: Input }],
|
|
730
|
+
handleAddArticleInternally: [{ type: Input }],
|
|
735
731
|
onAddToCart: [{ type: Output }],
|
|
736
732
|
forceRenderImage: [{ type: Output }],
|
|
737
733
|
onAlternativeClick: [{ type: Output }],
|
|
@@ -838,6 +834,7 @@ class ProductPageComponent {
|
|
|
838
834
|
this.settingsService = settingsService;
|
|
839
835
|
this.appEventService = appEventService;
|
|
840
836
|
this.icon = IconEnum;
|
|
837
|
+
this.createFrozenArticle = true;
|
|
841
838
|
this.openStockEvent = new EventEmitter();
|
|
842
839
|
this.configurable = false;
|
|
843
840
|
this.threeD = false;
|
|
@@ -979,7 +976,7 @@ class ProductPageComponent {
|
|
|
979
976
|
ProductPageComponent.decorators = [
|
|
980
977
|
{ type: Component, args: [{
|
|
981
978
|
selector: 'app-product-page',
|
|
982
|
-
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" (openStockEvent)=\"openStock()\"
|
|
979
|
+
template: "<ng-container *ngIf=\"settingsLoaded\">\r\n <div class=\"page-wrapper\">\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <div class=\"product-image-container\">\r\n <div class=\"product-page-block-selector-type\">\r\n <app-product-selector-type class=\"default-padding\"\r\n [(currentType)]=\"currentView\"\r\n [show2D]=\"configurable\"\r\n [show3D]=\"threeD\"\r\n ></app-product-selector-type>\r\n </div>\r\n <div class=\"product-page-block-image default-padding\" [class.full]=\"fullScreen\">\r\n <app-image-carousel [@toggleVisibilityByState]=\"show2D ? 'show' : 'hide'\" [images]=\"article?.images\" [showRefresh]=\"configurable && threeD\"></app-image-carousel>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-configurator #configurator class=\"threed-configurator\"\r\n [class.configurator-full-screen]=\"fullScreen\"\r\n [@toggleVisibilityByState]=\"show3D ? 'show' : 'hide'\"\r\n [@toggleFullScreen]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n ></threed-configurator>\r\n </ng-container>\r\n <co-icon #fullscreenbutton class=\"fullscreen-button\" *ngIf=\"show3D\"\r\n [@toggleTopLeft]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [iconData]=\"iconCache.getIcon(fullScreenIcon)\"\r\n (click)=\"showFullScreen()\"></co-icon>\r\n <co-icon class=\"threed-watermark\" *ngIf=\"show3D && fullScreen\"\r\n [iconData]=\"iconCache.getIcon(icon.Logo)\"></co-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-description\">\r\n <app-product-description class=\"default-padding\" [article]=\"article\"></app-product-description>\r\n </div>\r\n <div class=\"product-page-block-additional\">\r\n <div class=\"product-page-block-additional-description\">\r\n <app-product-additional-description class=\"default-padding\" [article]=\"article\"></app-product-additional-description>\r\n </div>\r\n <div class=\"product-page-block-price\" [class.full]=\"configuring\">\r\n <app-product-price class=\"s-padding\" *ngIf=\"!configuring\"\r\n [pricing]=\"article?.pricing\"\r\n [configurable]=\"configurable\"\r\n ></app-product-price>\r\n <ng-container *ngIf=\"settingsLoaded\">\r\n <threed-selections #selections class=\"threed-selections\" [class.show-selections]=\"configuring\" [@toggleFullScreenRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\"\r\n [class.default-padding]=\"!fullScreen\"\r\n [class.show-full-screen]=\"fullScreen\"\r\n [class.mini-scrollbar]=\"fullScreen\"\r\n [sku]=\"sku\"\r\n [settings]=\"settings\"\r\n (onUserActionFromThreeD)=\"configuring = true\"\r\n (instanceSet)=\"setInstance($event)\"\r\n (onImageReceived)=\"appEventService.onImageReceived.next($event)\"\r\n (onRenderStarted)=\"appEventService.onRenderStarted.next()\"\r\n (onDraftRenderImageReceived)=\"appEventService.onDraftRenderImageReceived.next($event)\"\r\n (onArticleReceived)=\"appEventService.onArticleReceived.next($event.detail)\"\r\n (onSelectionsReceived)=\"appEventService.onSelectionsReceived.next($event.detail)\"\r\n (onArticleInfoReceived)=\"appEventService.onArticleInfoReceived.next($event.detail)\"\r\n ></threed-selections>\r\n </ng-container>\r\n </div>\r\n <div class=\"product-page-block-addtocart no-padding product-action-buttons\" *ngIf=\"!configuring\" [@toggleTopRight]=\"fullScreen ? 'fullscreen' : 'halfscreen'\">\r\n <app-product-addtocart\r\n [configurable]=\"configurable\"\r\n [createFrozenArticle]=\"createFrozenArticle\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"addtocart-reserved product-action-buttons\" *ngIf=\"configuring\" [class.full-screen]=\"fullScreen\">\r\n <app-product-addtocart class=\"default-padding\"\r\n [configurable]=\"false\"\r\n [fullscreen]=\"fullScreen\"\r\n [configuring]=\"configuring\"\r\n [article]=\"article\"\r\n (startConfiguration)=\"handleStartConfiguration()\"\r\n ></app-product-addtocart>\r\n </div>\r\n <div class=\"product-page-block-variants\">\r\n <app-product-related class=\"no-padding\" *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"64\" [label]=\"'VARIANTS' | localize\"></app-product-related>\r\n </div>\r\n <div class=\"product-page-block-stock\">\r\n <app-product-stock class=\"no-padding\" [goodId]=\"article?.goodId\" (openStockEvent)=\"openStock()\"></app-product-stock>\r\n </div>\r\n <div class=\"product-page-block-delivery\">\r\n <app-product-delivery class=\"no-padding\" [stockAndDelivery]=\"stockAndDelivery\"></app-product-delivery>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content\">\r\n <div class=\"page-wrapper-left\">\r\n <app-product-info-tabs class=\"no-padding\" [article]=\"article\"></app-product-info-tabs>\r\n </div>\r\n <div class=\"page-wrapper-right\">\r\n <div class=\"product-page-block-related s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"1\" [label]=\"'RELATED_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"page-wrapper-content no-top-margin\">\r\n <div class=\"page-wrapper-full\">\r\n <div class=\"product-page-block-alternatives s-padding\">\r\n <app-product-related *ngIf=\"article?.relatedArticles && article?.relatedArticles.length > 0\"\r\n [articles]=\"article?.relatedArticles\" [refType]=\"4\" [isSmallModus]=\"false\" [label]=\"'ALTERNATIVE_PRODUCTS' | localize\"></app-product-related>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n",
|
|
983
980
|
animations: [
|
|
984
981
|
trigger('toggleFullScreen', [
|
|
985
982
|
state('fullscreen', style({ 'position': 'fixed', 'top': '0', 'left': '0', 'width': '100%', 'height': '100%' })),
|
|
@@ -1029,6 +1026,7 @@ ProductPageComponent.propDecorators = {
|
|
|
1029
1026
|
fullscreenbutton: [{ type: ViewChild, args: ['fullscreenbutton', { read: ElementRef },] }],
|
|
1030
1027
|
sku: [{ type: Input }],
|
|
1031
1028
|
settings: [{ type: Input }],
|
|
1029
|
+
createFrozenArticle: [{ type: Input }],
|
|
1032
1030
|
openStockEvent: [{ type: Output }]
|
|
1033
1031
|
};
|
|
1034
1032
|
|
|
@@ -1555,6 +1553,7 @@ class ProductAddtocartComponent {
|
|
|
1555
1553
|
this._appEventService = _appEventService;
|
|
1556
1554
|
this._settingsService = _settingsService;
|
|
1557
1555
|
this.icon = IconEnum;
|
|
1556
|
+
this.createFrozenArticle = true;
|
|
1558
1557
|
this.configurable = false;
|
|
1559
1558
|
this.configuring = false;
|
|
1560
1559
|
this.fullscreen = false;
|
|
@@ -1577,7 +1576,13 @@ class ProductAddtocartComponent {
|
|
|
1577
1576
|
}
|
|
1578
1577
|
handleAddToCartClick(quantity) {
|
|
1579
1578
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1580
|
-
|
|
1579
|
+
if (this.createFrozenArticle) {
|
|
1580
|
+
this._appEventService.onAddToCart.next({ article: yield this._getJSONFromArticleObject({ article: this.article, quantity: quantity }), quantity: quantity });
|
|
1581
|
+
}
|
|
1582
|
+
else {
|
|
1583
|
+
const article = this._ioneControllerService.convertArticleFullObjectToArticleExtended(this.article);
|
|
1584
|
+
this._appEventService.onAddToCart.next({ article: article, quantity: quantity });
|
|
1585
|
+
}
|
|
1581
1586
|
});
|
|
1582
1587
|
}
|
|
1583
1588
|
handleAddToQuoteClick(quantity) {
|
|
@@ -1635,6 +1640,7 @@ ProductAddtocartComponent.ctorParameters = () => [
|
|
|
1635
1640
|
ProductAddtocartComponent.propDecorators = {
|
|
1636
1641
|
addToCartButton: [{ type: ViewChild, args: ['addtocartbutton', { read: ElementRef },] }],
|
|
1637
1642
|
article: [{ type: Input }],
|
|
1643
|
+
createFrozenArticle: [{ type: Input }],
|
|
1638
1644
|
configurable: [{ type: Input }],
|
|
1639
1645
|
configuring: [{ type: Input }],
|
|
1640
1646
|
fullscreen: [{ type: HostBinding, args: ['class.full-screen',] }, { type: Input }],
|
|
@@ -1806,18 +1812,39 @@ class ProductStockComponent {
|
|
|
1806
1812
|
this._iconCache = _iconCache;
|
|
1807
1813
|
this.icon = IconEnum;
|
|
1808
1814
|
this.openStockEvent = new EventEmitter();
|
|
1815
|
+
this.inStock = false;
|
|
1809
1816
|
this.iconData = this._iconCache.getIcon(this.icon.Warehouse);
|
|
1810
1817
|
}
|
|
1811
|
-
set
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
}
|
|
1818
|
+
set goodId(value) {
|
|
1819
|
+
this._goodId = value;
|
|
1820
|
+
this._getStockStatus();
|
|
1815
1821
|
}
|
|
1816
|
-
|
|
1822
|
+
get goodId() {
|
|
1823
|
+
return this._goodId;
|
|
1817
1824
|
}
|
|
1818
1825
|
openStock() {
|
|
1819
1826
|
this.openStockEvent.emit();
|
|
1820
1827
|
}
|
|
1828
|
+
_getStockStatus() {
|
|
1829
|
+
if (this.goodId) {
|
|
1830
|
+
this._iOne.getArtStockStatus(this.goodId).then((result) => {
|
|
1831
|
+
switch (result) {
|
|
1832
|
+
case 1: // niet op voorraad
|
|
1833
|
+
this.stockLabel = 'PRODUCT_LIMITED_STOCK';
|
|
1834
|
+
this.inStock = true;
|
|
1835
|
+
break;
|
|
1836
|
+
case 2:
|
|
1837
|
+
this.stockLabel = 'PRODUCT_IN_STOCK';
|
|
1838
|
+
this.inStock = true;
|
|
1839
|
+
break;
|
|
1840
|
+
default:
|
|
1841
|
+
this.stockLabel = 'PRODUCT_NOT_IN_STOCK';
|
|
1842
|
+
this.inStock = false;
|
|
1843
|
+
break;
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1821
1848
|
}
|
|
1822
1849
|
ProductStockComponent.decorators = [
|
|
1823
1850
|
{ type: Component, args: [{
|
|
@@ -1828,12 +1855,11 @@ ProductStockComponent.decorators = [
|
|
|
1828
1855
|
<div class="product-stock-wrapper">
|
|
1829
1856
|
<co-icon class="stock-icon" [iconData]="iconData"></co-icon>
|
|
1830
1857
|
<div class="product-stock-fields" (click)="openStock()">
|
|
1831
|
-
<div class="pp-default-label in-stock" [textContent]="
|
|
1832
|
-
<div class="pp-default-label not-in-stock" [textContent]="'PRODUCT_NOT_IN_STOCK' | localize" *ngIf="!(numberInStock > 0)"></div>
|
|
1858
|
+
<div class="pp-default-label" [class.in-stock]="inStock" [textContent]="stockLabel | localize"></div>
|
|
1833
1859
|
</div>
|
|
1834
1860
|
</div>
|
|
1835
1861
|
`,
|
|
1836
|
-
styles: [":host{display:block}.product-stock-wrapper{display:flex;flex-direction:row;align-items:center;border-top:1px solid #f6f5f4;border-bottom:1px solid #f6f5f4;padding:20px 15px;cursor:pointer}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:40px;height:37px}.product-stock-wrapper .product-stock-fields{display:flex;flex-direction:row}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:14px;margin:0;color:#2b60a7;text-decoration:underline}.product-stock-wrapper .product-stock-fields .pp-default-label:after{content:\"\";width:10px;height:10px;border-radius:10px;background:#
|
|
1862
|
+
styles: [":host{display:block}.product-stock-wrapper{display:flex;flex-direction:row;align-items:center;border-top:1px solid #f6f5f4;border-bottom:1px solid #f6f5f4;padding:20px 15px;cursor:pointer}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:40px;height:37px}.product-stock-wrapper .product-stock-fields{display:flex;flex-direction:row}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:14px;margin:0;color:#2b60a7;text-decoration:underline}.product-stock-wrapper .product-stock-fields .pp-default-label:after{content:\"\";width:10px;height:10px;border-radius:10px;background:#f15152;display:inline-block;margin:0 0 0 15px}.product-stock-wrapper .product-stock-fields .pp-default-label.in-stock:after{background:#74B77F}@media screen and (max-width: 400px){.product-stock-wrapper{padding:15px 0 15px 10px}.product-stock-wrapper .stock-icon{margin:0 15px 0 0;width:32px;height:28px}.product-stock-wrapper .product-stock-fields .pp-default-label{font-size:13px}}\n"]
|
|
1837
1863
|
},] }
|
|
1838
1864
|
];
|
|
1839
1865
|
ProductStockComponent.ctorParameters = () => [
|
|
@@ -1841,7 +1867,7 @@ ProductStockComponent.ctorParameters = () => [
|
|
|
1841
1867
|
{ type: IconCacheService }
|
|
1842
1868
|
];
|
|
1843
1869
|
ProductStockComponent.propDecorators = {
|
|
1844
|
-
|
|
1870
|
+
goodId: [{ type: Input }],
|
|
1845
1871
|
openStockEvent: [{ type: Output }]
|
|
1846
1872
|
};
|
|
1847
1873
|
|
|
@@ -2372,7 +2398,7 @@ class IoneProductModule {
|
|
|
2372
2398
|
IoneProductModule.decorators = [
|
|
2373
2399
|
{ type: NgModule, args: [{
|
|
2374
2400
|
imports: [
|
|
2375
|
-
BrowserAnimationsModule,
|
|
2401
|
+
// BrowserAnimationsModule,
|
|
2376
2402
|
CommonModule,
|
|
2377
2403
|
ProductPageModule
|
|
2378
2404
|
],
|
|
@@ -2384,6 +2410,9 @@ IoneProductModule.decorators = [
|
|
|
2384
2410
|
],
|
|
2385
2411
|
bootstrap: [
|
|
2386
2412
|
IoneProductComponent
|
|
2413
|
+
],
|
|
2414
|
+
providers: [
|
|
2415
|
+
ProductSettingsService
|
|
2387
2416
|
]
|
|
2388
2417
|
},] }
|
|
2389
2418
|
];
|