@colijnit/catalog 12.1.41 → 12.1.43
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/bundles/colijnit-catalog.umd.js +128 -64
- package/bundles/colijnit-catalog.umd.js.map +1 -1
- package/colijnit-catalog.metadata.json +1 -1
- package/esm2015/lib/catalog-version.js +3 -3
- package/esm2015/lib/component/base/article-base.component.js +19 -1
- package/esm2015/lib/component/catalog-external-source/catalog-external-source.component.js +14 -3
- package/esm2015/lib/component/catalog-filter/catalog-filter.component.js +6 -12
- package/esm2015/lib/component/catalog-filter-content/catalog-filter-content-general/catalog-filter-content-general.component.js +45 -1
- package/esm2015/lib/component/catalog-filter-content/catalog-filter-content-general/catalog-filter-content-general.module.js +4 -2
- package/esm2015/lib/component/catalog-filter-content/catalog-filter-content-logistics/catalog-filter-content-logistics.component.js +2 -71
- package/esm2015/lib/component/catalog-search/catalog-search.component.js +19 -17
- package/esm2015/lib/model/settings-options.js +1 -2
- package/esm2015/lib/model/settings.js +2 -1
- package/esm2015/lib/service/catalog-connector-adapter.service.js +6 -4
- package/esm2015/lib/service/catalog-connector.service.js +11 -1
- package/esm2015/lib/service/catalog-options.service.js +1 -4
- package/esm2015/lib/service/catalog-search.service.js +8 -2
- package/esm2015/lib/service/catalog-settings.service.js +8 -3
- package/esm2015/lib/service/catalog.service.js +1 -7
- package/fesm2015/colijnit-catalog.js +129 -117
- package/fesm2015/colijnit-catalog.js.map +1 -1
- package/lib/component/catalog-external-source/catalog-external-source.component.d.ts +8 -3
- package/lib/component/catalog-filter/catalog-filter.component.d.ts +3 -4
- package/lib/component/catalog-filter-content/catalog-filter-content-general/catalog-filter-content-general.component.d.ts +1 -0
- package/lib/component/catalog-filter-content/catalog-filter-content-logistics/catalog-filter-content-logistics.component.d.ts +0 -1
- package/lib/component/catalog-search/catalog-search.component.d.ts +2 -1
- package/lib/model/settings-options.d.ts +0 -1
- package/lib/model/settings.d.ts +1 -0
- package/lib/service/catalog-connector-adapter.service.d.ts +3 -2
- package/lib/service/catalog-connector.service.d.ts +5 -3
- package/lib/service/catalog-options.service.d.ts +0 -1
- package/lib/service/catalog-search.service.d.ts +3 -1
- package/lib/service/catalog.service.d.ts +0 -2
- package/package.json +6 -6
|
@@ -45,8 +45,8 @@ class Version {
|
|
|
45
45
|
constructor() {
|
|
46
46
|
this.name = "@colijnit/catalog";
|
|
47
47
|
this.description = "iOne Catalog module based on Angular 12";
|
|
48
|
-
this.symVer = "12.1.
|
|
49
|
-
this.publishDate = "
|
|
48
|
+
this.symVer = "12.1.43";
|
|
49
|
+
this.publishDate = "15-9-2023 17:25:36";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -62,7 +62,6 @@ class SettingsOptions {
|
|
|
62
62
|
this.showARButton = false;
|
|
63
63
|
this.maxItemsPerPage = 20;
|
|
64
64
|
this.addArticleButtonText = 'ADD TO CART';
|
|
65
|
-
this.collapseFilterByDefault = false;
|
|
66
65
|
this.sortTurnoverGroupsByAlphabet = true;
|
|
67
66
|
this.searchOnStart = false;
|
|
68
67
|
this.showFilter = false;
|
|
@@ -74,6 +73,7 @@ class CatalogSettings extends Options {
|
|
|
74
73
|
constructor() {
|
|
75
74
|
super(...arguments);
|
|
76
75
|
this.type = "V";
|
|
76
|
+
this.createWebOrder = true;
|
|
77
77
|
this.options = new SettingsOptions();
|
|
78
78
|
this.useLoginEncryption = true;
|
|
79
79
|
}
|
|
@@ -226,9 +226,14 @@ class CatalogSettingsService {
|
|
|
226
226
|
if (!this.settings) {
|
|
227
227
|
this.settings = new CatalogSettings();
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
let ownOptions = Object.assign({}, this.settings.options);
|
|
230
|
+
let ownCatalogParameters = Object.assign({}, this.settings.catalogParameters);
|
|
231
|
+
this.settings = Object.assign({}, this.settings, obj);
|
|
232
|
+
if (obj.catalogParameters) {
|
|
233
|
+
this.settings.catalogParameters = Object.assign({}, ownCatalogParameters, obj.catalogParameters);
|
|
234
|
+
}
|
|
230
235
|
if (obj.options) {
|
|
231
|
-
this.settings.options = Object.assign(
|
|
236
|
+
this.settings.options = Object.assign({}, ownOptions, obj.options);
|
|
232
237
|
}
|
|
233
238
|
this.settingsFinished();
|
|
234
239
|
});
|
|
@@ -698,11 +703,13 @@ class CatalogConnectorAdapterService {
|
|
|
698
703
|
});
|
|
699
704
|
}
|
|
700
705
|
addWebSessionTransactionLine(sku, quantity) {
|
|
701
|
-
this
|
|
706
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
707
|
+
return yield this.transactionConnector.addWebSessionTransactionLine(sku, quantity);
|
|
708
|
+
});
|
|
702
709
|
}
|
|
703
710
|
getWebTransaction() {
|
|
704
|
-
this
|
|
705
|
-
|
|
711
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
712
|
+
return yield this.transactionConnector.getWebSessionSalesOrder();
|
|
706
713
|
});
|
|
707
714
|
}
|
|
708
715
|
getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
|
|
@@ -1281,6 +1288,16 @@ class CatalogConnectorService {
|
|
|
1281
1288
|
getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
|
|
1282
1289
|
return this._adapterService.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
|
|
1283
1290
|
}
|
|
1291
|
+
addWebSessionTransactionLine(sku, quantity) {
|
|
1292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1293
|
+
return yield this._adapterService.addWebSessionTransactionLine(sku, quantity);
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
getWebTransaction() {
|
|
1297
|
+
this._adapterService.getWebTransaction().then((response) => {
|
|
1298
|
+
console.log(response);
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1284
1301
|
}
|
|
1285
1302
|
CatalogConnectorService.decorators = [
|
|
1286
1303
|
{ type: Injectable }
|
|
@@ -1324,9 +1341,6 @@ class CatalogOptionsService {
|
|
|
1324
1341
|
get showBrandFilter() {
|
|
1325
1342
|
return !this.parameters.brand;
|
|
1326
1343
|
}
|
|
1327
|
-
get collapseFilterByDefault() {
|
|
1328
|
-
return this._settingsService.settings.options.collapseFilterByDefault;
|
|
1329
|
-
}
|
|
1330
1344
|
get showPriceFilter() {
|
|
1331
1345
|
return this._settingsService.settings.options.showPriceFilter;
|
|
1332
1346
|
}
|
|
@@ -1624,9 +1638,10 @@ CatalogFilterService.ctorParameters = () => [
|
|
|
1624
1638
|
];
|
|
1625
1639
|
|
|
1626
1640
|
class CatalogSearchService {
|
|
1627
|
-
constructor(_filterService, _catalogConnectorService, _settingsService, _optionService) {
|
|
1641
|
+
constructor(_filterService, _catalogConnectorService, _catalogConnectorAdapterService, _settingsService, _optionService) {
|
|
1628
1642
|
this._filterService = _filterService;
|
|
1629
1643
|
this._catalogConnectorService = _catalogConnectorService;
|
|
1644
|
+
this._catalogConnectorAdapterService = _catalogConnectorAdapterService;
|
|
1630
1645
|
this._settingsService = _settingsService;
|
|
1631
1646
|
this._optionService = _optionService;
|
|
1632
1647
|
this.searchRequest = new ArticleExtendedRequest();
|
|
@@ -1640,6 +1655,9 @@ class CatalogSearchService {
|
|
|
1640
1655
|
if (this._settingsService.settings.catalogParameters) {
|
|
1641
1656
|
this.searchRequest = this._settingsService.settings.catalogParameters;
|
|
1642
1657
|
}
|
|
1658
|
+
}
|
|
1659
|
+
}), this._catalogConnectorAdapterService.controllerInitialized.subscribe((initialized) => {
|
|
1660
|
+
if (initialized) {
|
|
1643
1661
|
if (this._settingsService.settings.options.searchOnStart) {
|
|
1644
1662
|
this.searchArticles();
|
|
1645
1663
|
}
|
|
@@ -1724,6 +1742,7 @@ CatalogSearchService.decorators = [
|
|
|
1724
1742
|
CatalogSearchService.ctorParameters = () => [
|
|
1725
1743
|
{ type: CatalogFilterService },
|
|
1726
1744
|
{ type: CatalogConnectorService },
|
|
1745
|
+
{ type: CatalogConnectorAdapterService },
|
|
1727
1746
|
{ type: CatalogSettingsService },
|
|
1728
1747
|
{ type: CatalogOptionsService }
|
|
1729
1748
|
];
|
|
@@ -1875,12 +1894,6 @@ class CatalogService {
|
|
|
1875
1894
|
return this._imageService.getTurnoverGroupImage(group);
|
|
1876
1895
|
});
|
|
1877
1896
|
}
|
|
1878
|
-
addWebSessionTransactionLine(sku, quantity) {
|
|
1879
|
-
this.connectorAdapter.addWebSessionTransactionLine(sku, quantity);
|
|
1880
|
-
}
|
|
1881
|
-
getWebTransaction() {
|
|
1882
|
-
this.connectorAdapter.getWebTransaction();
|
|
1883
|
-
}
|
|
1884
1897
|
reset() {
|
|
1885
1898
|
this.showCatOrTurnoverGroupArticles = false;
|
|
1886
1899
|
this.showExternalSource = false;
|
|
@@ -2090,9 +2103,9 @@ IconCacheService.ctorParameters = () => [
|
|
|
2090
2103
|
];
|
|
2091
2104
|
|
|
2092
2105
|
class CatalogFilterComponent {
|
|
2093
|
-
constructor(iconCache,
|
|
2106
|
+
constructor(iconCache, _settingsService, changeDetector, _catalogConnectorService, _adapterService, searchService) {
|
|
2094
2107
|
this.iconCache = iconCache;
|
|
2095
|
-
this.
|
|
2108
|
+
this._settingsService = _settingsService;
|
|
2096
2109
|
this.changeDetector = changeDetector;
|
|
2097
2110
|
this._catalogConnectorService = _catalogConnectorService;
|
|
2098
2111
|
this._adapterService = _adapterService;
|
|
@@ -2106,7 +2119,6 @@ class CatalogFilterComponent {
|
|
|
2106
2119
|
'Inkoop',
|
|
2107
2120
|
'Logistiek'
|
|
2108
2121
|
];
|
|
2109
|
-
this.collapsed = false;
|
|
2110
2122
|
this._subs = [];
|
|
2111
2123
|
this._subs.push(this._adapterService.controllerInitialized.subscribe((initialized) => {
|
|
2112
2124
|
if (initialized) {
|
|
@@ -2119,10 +2131,6 @@ class CatalogFilterComponent {
|
|
|
2119
2131
|
}
|
|
2120
2132
|
ngOnInit() {
|
|
2121
2133
|
// because our <co-checkbox-select> components will output a selectionStringChange on their init, which effectively changes this.filters
|
|
2122
|
-
this.collapsed = this.optionsService.collapseFilterByDefault;
|
|
2123
|
-
if (window.innerWidth <= 950) {
|
|
2124
|
-
this.collapsed = true;
|
|
2125
|
-
}
|
|
2126
2134
|
//this.initializePriceFilterMinMax();
|
|
2127
2135
|
this.detectChanges();
|
|
2128
2136
|
}
|
|
@@ -2230,7 +2238,7 @@ CatalogFilterComponent.decorators = [
|
|
|
2230
2238
|
];
|
|
2231
2239
|
CatalogFilterComponent.ctorParameters = () => [
|
|
2232
2240
|
{ type: IconCacheService },
|
|
2233
|
-
{ type:
|
|
2241
|
+
{ type: CatalogSettingsService },
|
|
2234
2242
|
{ type: ChangeDetectorRef },
|
|
2235
2243
|
{ type: CatalogConnectorService },
|
|
2236
2244
|
{ type: CatalogConnectorAdapterService },
|
|
@@ -2242,8 +2250,7 @@ CatalogFilterComponent.propDecorators = {
|
|
|
2242
2250
|
purchaseFilter: [{ type: ViewChild, args: ['purchaseFilter', { read: ElementRef },] }],
|
|
2243
2251
|
logisticsFilter: [{ type: ViewChild, args: ['logisticsFilter', { read: ElementRef },] }],
|
|
2244
2252
|
showResetFilter: [{ type: Input }],
|
|
2245
|
-
showClass: [{ type: HostBinding, args: ['class.co-catalog-filter',] }]
|
|
2246
|
-
collapsed: [{ type: HostBinding, args: ['class.collapsed',] }]
|
|
2253
|
+
showClass: [{ type: HostBinding, args: ['class.co-catalog-filter',] }]
|
|
2247
2254
|
};
|
|
2248
2255
|
|
|
2249
2256
|
class CatalogFilterCategoriesComponent {
|
|
@@ -2372,6 +2379,15 @@ class CatalogFilterContentGeneralComponent {
|
|
|
2372
2379
|
ngOnDestroy() {
|
|
2373
2380
|
this._subs.forEach(s => s.unsubscribe());
|
|
2374
2381
|
}
|
|
2382
|
+
handleAllChanged(value) {
|
|
2383
|
+
this.catalogSearchService.searchRequest["doSync"] = value ? "J" : "N";
|
|
2384
|
+
this.catalogSearchService.searchRequest["showRegularArticles"] = value;
|
|
2385
|
+
this.catalogSearchService.searchRequest["showConfiguredArticles"] = value;
|
|
2386
|
+
this.catalogSearchService.searchRequest["showConfigurableArticles"] = value;
|
|
2387
|
+
this.catalogSearchService.searchRequest["showCompositionArticles"] = value;
|
|
2388
|
+
this.catalogSearchService.searchRequest["showCustomizedArticles"] = value;
|
|
2389
|
+
this.catalogSearchService.searchRequest["showInactiveArticles"] = value;
|
|
2390
|
+
}
|
|
2375
2391
|
_setCollections() {
|
|
2376
2392
|
this._setStoreGroups();
|
|
2377
2393
|
this._setInOutCollection();
|
|
@@ -2484,6 +2500,41 @@ CatalogFilterContentGeneralComponent.decorators = [
|
|
|
2484
2500
|
>
|
|
2485
2501
|
</co-filter-item>
|
|
2486
2502
|
</div>
|
|
2503
|
+
<div class="filter-item-wrapper">
|
|
2504
|
+
<co-filter-item
|
|
2505
|
+
[placeholder]="'ARTICLE_TYPE'"
|
|
2506
|
+
[expanded]="true"
|
|
2507
|
+
[customContent]="true">
|
|
2508
|
+
<co-input-checkbox
|
|
2509
|
+
(modelChange)="this.handleAllChanged($event)"
|
|
2510
|
+
[label]="'ALL' | localize"></co-input-checkbox>
|
|
2511
|
+
<co-input-checkbox
|
|
2512
|
+
[label]="'SHOW_REGULAR_ARTICLES' | localize"
|
|
2513
|
+
[(model)]="catalogSearchService.searchRequest.showRegularArticles"></co-input-checkbox>
|
|
2514
|
+
<co-input-checkbox
|
|
2515
|
+
[label]="'SHOW_CONFIGURED_ARTICLES' | localize"
|
|
2516
|
+
[(model)]="catalogSearchService.searchRequest.showConfiguredArticles"></co-input-checkbox>
|
|
2517
|
+
<co-input-checkbox
|
|
2518
|
+
[label]="'BASE_ARTICLES' | localize"
|
|
2519
|
+
[(model)]="catalogSearchService.searchRequest.showConfigurableArticles"></co-input-checkbox>
|
|
2520
|
+
<co-input-checkbox
|
|
2521
|
+
[label]="'COMPOSITION_ARTICLES' | localize"
|
|
2522
|
+
[(model)]="catalogSearchService.searchRequest.showCompositionArticles"></co-input-checkbox>
|
|
2523
|
+
<co-input-checkbox
|
|
2524
|
+
[label]="'SHOW_CUSTOMIZED_ARTICLES' | localize"
|
|
2525
|
+
[(model)]="catalogSearchService.searchRequest.showCustomizedArticles"></co-input-checkbox>
|
|
2526
|
+
<co-input-checkbox
|
|
2527
|
+
[label]="'SHOW_INACTIVE_ARTICLES' | localize"
|
|
2528
|
+
[(model)]="catalogSearchService.searchRequest.showInactiveArticles"></co-input-checkbox>
|
|
2529
|
+
</co-filter-item>
|
|
2530
|
+
</div>
|
|
2531
|
+
<div class="filter-item-wrapper">
|
|
2532
|
+
<co-filter-item [placeholder]="'AUTOMATICALLY_UPDATE' | localize"
|
|
2533
|
+
[expanded]="true"
|
|
2534
|
+
[mode]="modes.CheckboxToText"
|
|
2535
|
+
[(model)]="catalogSearchService.searchRequest.doSync">
|
|
2536
|
+
</co-filter-item>
|
|
2537
|
+
</div>
|
|
2487
2538
|
<div class="filter-item-wrapper">
|
|
2488
2539
|
<co-filter-item [placeholder]="'RETAIL_FORMULA' | localize"
|
|
2489
2540
|
[expanded]="true"
|
|
@@ -2584,7 +2635,8 @@ CatalogFilterContentGeneralModule.decorators = [
|
|
|
2584
2635
|
InputTextModule,
|
|
2585
2636
|
ButtonModule,
|
|
2586
2637
|
IconModule,
|
|
2587
|
-
PipeModule
|
|
2638
|
+
PipeModule,
|
|
2639
|
+
InputCheckboxModule
|
|
2588
2640
|
],
|
|
2589
2641
|
declarations: [
|
|
2590
2642
|
CatalogFilterContentGeneralComponent
|
|
@@ -2728,15 +2780,6 @@ class CatalogFilterContentLogisticsComponent {
|
|
|
2728
2780
|
}
|
|
2729
2781
|
ngOnInit() {
|
|
2730
2782
|
}
|
|
2731
|
-
handleAllChanged(value) {
|
|
2732
|
-
this.catalogSearchService.searchRequest["doSync"] = value ? "J" : "N";
|
|
2733
|
-
this.catalogSearchService.searchRequest["showRegularArticles"] = value;
|
|
2734
|
-
this.catalogSearchService.searchRequest["showConfiguredArticles"] = value;
|
|
2735
|
-
this.catalogSearchService.searchRequest["showConfigurableArticles"] = value;
|
|
2736
|
-
this.catalogSearchService.searchRequest["showCompositionArticles"] = value;
|
|
2737
|
-
this.catalogSearchService.searchRequest["showCustomizedArticles"] = value;
|
|
2738
|
-
this.catalogSearchService.searchRequest["showInactiveArticles"] = value;
|
|
2739
|
-
}
|
|
2740
2783
|
}
|
|
2741
2784
|
CatalogFilterContentLogisticsComponent.decorators = [
|
|
2742
2785
|
{ type: Component, args: [{
|
|
@@ -2767,67 +2810,7 @@ CatalogFilterContentLogisticsComponent.decorators = [
|
|
|
2767
2810
|
[mode]="modes.DateField"
|
|
2768
2811
|
[(model)]="catalogSearchService.searchRequest.dateModified">
|
|
2769
2812
|
</co-filter-item>
|
|
2770
|
-
</div>
|
|
2771
|
-
|
|
2772
|
-
<div class="filter-item-wrapper">
|
|
2773
|
-
<co-filter-item
|
|
2774
|
-
[placeholder]="'ALL'"
|
|
2775
|
-
[expanded]="true"
|
|
2776
|
-
[customContent]="true">
|
|
2777
|
-
<co-input-checkbox
|
|
2778
|
-
(modelChange)="this.handleAllChanged($event)"
|
|
2779
|
-
[label]="'ALL' | localize"></co-input-checkbox>
|
|
2780
|
-
</co-filter-item>
|
|
2781
|
-
</div>
|
|
2782
|
-
<div class="filter-item-wrapper">
|
|
2783
|
-
<co-filter-item [placeholder]="'AUTOMATICALLY_UPDATE'"
|
|
2784
|
-
[expanded]="true"
|
|
2785
|
-
[mode]="modes.CheckboxToText"
|
|
2786
|
-
[(model)]="catalogSearchService.searchRequest.doSync">
|
|
2787
|
-
</co-filter-item>
|
|
2788
|
-
</div>
|
|
2789
|
-
<div class="filter-item-wrapper">
|
|
2790
|
-
<co-filter-item [placeholder]="'SHOW_REGULAR_ARTICLES'"
|
|
2791
|
-
[expanded]="true"
|
|
2792
|
-
[mode]="modes.Checkbox"
|
|
2793
|
-
[(model)]="catalogSearchService.searchRequest.showRegularArticles">
|
|
2794
|
-
</co-filter-item>
|
|
2795
|
-
</div>
|
|
2796
|
-
<div class="filter-item-wrapper">
|
|
2797
|
-
<co-filter-item [placeholder]="'SHOW_CONFIGURED_ARTICLES'"
|
|
2798
|
-
[expanded]="true"
|
|
2799
|
-
[mode]="modes.Checkbox"
|
|
2800
|
-
[(model)]="catalogSearchService.searchRequest.showConfiguredArticles">
|
|
2801
|
-
</co-filter-item>
|
|
2802
|
-
</div>
|
|
2803
|
-
<div class="filter-item-wrapper">
|
|
2804
|
-
<co-filter-item [placeholder]="'BASE_ARTICLES'"
|
|
2805
|
-
[expanded]="true"
|
|
2806
|
-
[mode]="modes.Checkbox"
|
|
2807
|
-
[(model)]="catalogSearchService.searchRequest.showConfigurableArticles">
|
|
2808
|
-
</co-filter-item>
|
|
2809
|
-
</div>
|
|
2810
|
-
<div class="filter-item-wrapper">
|
|
2811
|
-
<co-filter-item [placeholder]="'COMPOSITION_ARTICLES'"
|
|
2812
|
-
[expanded]="true"
|
|
2813
|
-
[mode]="modes.Checkbox"
|
|
2814
|
-
[(model)]="catalogSearchService.searchRequest.showCompositionArticles">
|
|
2815
|
-
</co-filter-item>
|
|
2816
|
-
</div>
|
|
2817
|
-
<div class="filter-item-wrapper">
|
|
2818
|
-
<co-filter-item [placeholder]="'SHOW_CUSTOMIZED_ARTICLES'"
|
|
2819
|
-
[expanded]="true"
|
|
2820
|
-
[mode]="modes.Checkbox"
|
|
2821
|
-
[(model)]="catalogSearchService.searchRequest.showCustomizedArticles">
|
|
2822
|
-
</co-filter-item>
|
|
2823
|
-
</div>
|
|
2824
|
-
<div class="filter-item-wrapper">
|
|
2825
|
-
<co-filter-item [placeholder]="'SHOW_INACTIVE_ARTICLES'"
|
|
2826
|
-
[expanded]="true"
|
|
2827
|
-
[mode]="modes.Checkbox"
|
|
2828
|
-
[(model)]="catalogSearchService.searchRequest.showInactiveArticles">
|
|
2829
|
-
</co-filter-item>
|
|
2830
|
-
</div>
|
|
2813
|
+
</div>
|
|
2831
2814
|
</div>
|
|
2832
2815
|
</div>
|
|
2833
2816
|
</div>
|
|
@@ -3386,32 +3369,33 @@ class CatalogSearchComponent {
|
|
|
3386
3369
|
}
|
|
3387
3370
|
set settings(value) {
|
|
3388
3371
|
if (value) {
|
|
3389
|
-
let settings;
|
|
3390
3372
|
if (typeof value === 'string') {
|
|
3391
|
-
|
|
3373
|
+
this._settings = JSON.parse(value);
|
|
3392
3374
|
}
|
|
3393
3375
|
else {
|
|
3394
|
-
|
|
3376
|
+
this._settings = value;
|
|
3395
3377
|
}
|
|
3396
|
-
this._settingsService.createSettingsFromObject(settings);
|
|
3397
|
-
this._catalogService.init(this._settingsService.settings);
|
|
3398
3378
|
}
|
|
3399
3379
|
}
|
|
3400
3380
|
showClass() {
|
|
3401
3381
|
return true;
|
|
3402
3382
|
}
|
|
3403
3383
|
ngOnInit() {
|
|
3404
|
-
|
|
3405
|
-
this.
|
|
3406
|
-
|
|
3407
|
-
this.
|
|
3408
|
-
|
|
3409
|
-
this.
|
|
3410
|
-
|
|
3411
|
-
this.
|
|
3412
|
-
|
|
3413
|
-
this.
|
|
3414
|
-
|
|
3384
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3385
|
+
yield this._settingsService.initializeSettings();
|
|
3386
|
+
this._catalogService.init(this._settings);
|
|
3387
|
+
this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((json) => {
|
|
3388
|
+
this.onAddArticleButtonClick.emit(json);
|
|
3389
|
+
}), this._catalogEventService.arButtonClick.subscribe((article) => {
|
|
3390
|
+
this.onArButtonClick.emit(article);
|
|
3391
|
+
}), this._catalogEventService.articleClick.subscribe((article) => {
|
|
3392
|
+
this.onArticleClick.emit(article);
|
|
3393
|
+
}), this._catalogEventService.lookAtArticleButtonClick.subscribe((article) => {
|
|
3394
|
+
this.onLookAtArticleButtonClick.emit(article);
|
|
3395
|
+
}), this._catalogEventService.stockDetailsClick.subscribe((article) => {
|
|
3396
|
+
this.onStockDetailsClick.emit(article);
|
|
3397
|
+
}));
|
|
3398
|
+
});
|
|
3415
3399
|
}
|
|
3416
3400
|
ngOnDestroy() {
|
|
3417
3401
|
this._subs.forEach(s => s.unsubscribe());
|
|
@@ -3753,6 +3737,24 @@ class ArticleBaseComponent {
|
|
|
3753
3737
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3754
3738
|
event.stopPropagation();
|
|
3755
3739
|
const json = yield this._getJSONFromArticleObject(this.article);
|
|
3740
|
+
if (this._settingsService.settings.createWebOrder) {
|
|
3741
|
+
if (json) {
|
|
3742
|
+
const articleTreeData = JSON.parse(json);
|
|
3743
|
+
if (articleTreeData.articleTree && articleTreeData.articleTree.article) {
|
|
3744
|
+
if (articleTreeData.articleTree.compositeGoods && Array.isArray(articleTreeData.articleTree.compositeGoods) &&
|
|
3745
|
+
articleTreeData.articleTree.compositeGoods.length > 0 && articleTreeData.articleTree.subArticles && Array.isArray(articleTreeData.articleTree.subArticles)) {
|
|
3746
|
+
for (let i = 0; i < articleTreeData.articleTree.compositeGoods.length - 1; i++) {
|
|
3747
|
+
const good = articleTreeData.articleTree.compositeGoods[i];
|
|
3748
|
+
const subArticle = articleTreeData.articleTree.subArticles[i];
|
|
3749
|
+
yield this._iOne.addWebSessionTransactionLine(subArticle.articleNumber, good.quantity);
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
else {
|
|
3753
|
+
yield this._iOne.addWebSessionTransactionLine(articleTreeData.articleTree.article.articleNumber, 1);
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3756
3758
|
this._appEventService.addArticleButtonClick.next(json);
|
|
3757
3759
|
this.onAddArticleButtonClick.emit(json);
|
|
3758
3760
|
});
|
|
@@ -4284,16 +4286,19 @@ CatalogSearchModule.decorators = [
|
|
|
4284
4286
|
];
|
|
4285
4287
|
|
|
4286
4288
|
class CatalogExternalSourceComponent {
|
|
4287
|
-
constructor(_sanitizer, _catalogConnectorService) {
|
|
4289
|
+
constructor(_sanitizer, _catalogConnectorService, _appEventService) {
|
|
4288
4290
|
this._sanitizer = _sanitizer;
|
|
4289
4291
|
this._catalogConnectorService = _catalogConnectorService;
|
|
4292
|
+
this._appEventService = _appEventService;
|
|
4290
4293
|
this.showFilter = true;
|
|
4291
4294
|
this.showNavigation = true;
|
|
4292
4295
|
this.articleClick = new EventEmitter();
|
|
4296
|
+
this.addArticleClick = new EventEmitter();
|
|
4293
4297
|
this.showClass = true;
|
|
4294
4298
|
this.showCatalog = false;
|
|
4295
4299
|
this.loaded = false;
|
|
4296
4300
|
this.externalSettings = {};
|
|
4301
|
+
this._subs = [];
|
|
4297
4302
|
}
|
|
4298
4303
|
set externalSource(value) {
|
|
4299
4304
|
this._externalSource = value;
|
|
@@ -4303,6 +4308,11 @@ class CatalogExternalSourceComponent {
|
|
|
4303
4308
|
get externalSource() {
|
|
4304
4309
|
return this._externalSource;
|
|
4305
4310
|
}
|
|
4311
|
+
ngOnInit() {
|
|
4312
|
+
this._subs.push(this._appEventService.addArticleButtonClick.subscribe((json) => {
|
|
4313
|
+
this.addArticleClick.next(json);
|
|
4314
|
+
}));
|
|
4315
|
+
}
|
|
4306
4316
|
handleArticleClick(article) {
|
|
4307
4317
|
if (article && this.externalSettings) {
|
|
4308
4318
|
this.articleClick.emit({ article: article, settings: { name: this.name, settings: this.externalSettings } });
|
|
@@ -4364,7 +4374,8 @@ CatalogExternalSourceComponent.decorators = [
|
|
|
4364
4374
|
];
|
|
4365
4375
|
CatalogExternalSourceComponent.ctorParameters = () => [
|
|
4366
4376
|
{ type: DomSanitizer },
|
|
4367
|
-
{ type: CatalogConnectorService }
|
|
4377
|
+
{ type: CatalogConnectorService },
|
|
4378
|
+
{ type: CatalogEventService }
|
|
4368
4379
|
];
|
|
4369
4380
|
CatalogExternalSourceComponent.propDecorators = {
|
|
4370
4381
|
externalSource: [{ type: Input }],
|
|
@@ -4376,6 +4387,7 @@ CatalogExternalSourceComponent.propDecorators = {
|
|
|
4376
4387
|
options: [{ type: Input }],
|
|
4377
4388
|
name: [{ type: Input }],
|
|
4378
4389
|
articleClick: [{ type: Output }],
|
|
4390
|
+
addArticleClick: [{ type: Output }],
|
|
4379
4391
|
showClass: [{ type: HostBinding, args: ['class.co-catalog-external-source',] }]
|
|
4380
4392
|
};
|
|
4381
4393
|
|