@colijnit/catalog 12.1.37 → 12.1.40

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.
@@ -3,6 +3,7 @@ import { Injectable, EventEmitter, Component, ViewEncapsulation, Input, Output,
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { __awaiter } from 'tslib';
5
5
  import { Subject, BehaviorSubject } from 'rxjs';
6
+ import { Options } from '@colijnit/ioneconnector/build/model/options';
6
7
  import { StringUtils } from '@colijnit/ioneconnector/build/utils/string-utils';
7
8
  import { ArticleCategory } from '@colijnit/articleapi/build/model/article-category';
8
9
  import { CatalogDefinition } from '@colijnit/articleapi/build/model/catalog-definition.bo';
@@ -44,8 +45,8 @@ class Version {
44
45
  constructor() {
45
46
  this.name = "@colijnit/catalog";
46
47
  this.description = "iOne Catalog module based on Angular 12";
47
- this.symVer = "12.1.37";
48
- this.publishDate = "28-7-2023 11:07:47";
48
+ this.symVer = "12.1.40";
49
+ this.publishDate = "1-8-2023 18:53:26";
49
50
  }
50
51
  }
51
52
 
@@ -69,13 +70,12 @@ class SettingsOptions {
69
70
  }
70
71
  }
71
72
 
72
- class Settings {
73
+ class CatalogSettings extends Options {
73
74
  constructor() {
74
- this.session = undefined;
75
- this.useLoginEncryption = true;
75
+ super(...arguments);
76
76
  this.type = "V";
77
77
  this.options = new SettingsOptions();
78
- this.jwtEnabled = false;
78
+ this.useLoginEncryption = true;
79
79
  }
80
80
  }
81
81
 
@@ -195,7 +195,7 @@ class CatalogSettingsService {
195
195
  constructor(_dictionaryService) {
196
196
  this._dictionaryService = _dictionaryService;
197
197
  this.settingsLoaded = new BehaviorSubject(false);
198
- this._settings = new Settings();
198
+ this._settings = new CatalogSettings();
199
199
  }
200
200
  set settings(value) {
201
201
  this._settings = value;
@@ -209,13 +209,13 @@ class CatalogSettingsService {
209
209
  if (typeof settings === 'undefined') {
210
210
  const jsonSettings = yield JsonUtils.ReadJsonFile('catalog-settings.json');
211
211
  if (jsonSettings) {
212
- this.settings = Object.assign(new Settings(), jsonSettings);
212
+ this.settings = Object.assign(new CatalogSettings(), jsonSettings);
213
213
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
214
214
  this.settingsFinished();
215
215
  }
216
216
  }
217
217
  else {
218
- this.settings = Object.assign(new Settings(), settings);
218
+ this.settings = Object.assign(new CatalogSettings(), settings);
219
219
  this.settings.options = Object.assign(new SettingsOptions(), this.settings.options);
220
220
  this.settingsFinished();
221
221
  }
@@ -224,55 +224,11 @@ class CatalogSettingsService {
224
224
  createSettingsFromObject(obj) {
225
225
  return __awaiter(this, void 0, void 0, function* () {
226
226
  if (!this.settings) {
227
- this.settings = new Settings();
228
- }
229
- if (obj.hasOwnProperty('url')) {
230
- this.settings.url = obj['url'];
231
- }
232
- if (obj.hasOwnProperty('schema')) {
233
- this.settings.schema = obj['schema'];
234
- }
235
- if (obj.hasOwnProperty('version')) {
236
- this.settings.version = obj['version'];
237
- }
238
- if (obj.hasOwnProperty('branch')) {
239
- this.settings.branch = obj['branch'];
240
- }
241
- if (obj.hasOwnProperty('currency')) {
242
- this.settings.currency = obj['currency'];
243
- }
244
- if (obj.hasOwnProperty('languageCode')) {
245
- this.settings.languageCode = obj['languageCode'];
246
- }
247
- if (obj.hasOwnProperty('username')) {
248
- this.settings.username = obj['username'];
227
+ this.settings = new CatalogSettings();
249
228
  }
250
- if (obj.hasOwnProperty('password')) {
251
- this.settings.password = obj['password'];
252
- }
253
- if (obj.hasOwnProperty('timeoutInMs')) {
254
- this.settings.timeoutInMs = obj['timeoutInMs'];
255
- }
256
- if (obj.hasOwnProperty('session')) {
257
- this.settings.session = obj['session'];
258
- }
259
- if (obj.hasOwnProperty('useEncryption')) {
260
- this.settings.useLoginEncryption = obj['useEncryption'];
261
- }
262
- if (obj.hasOwnProperty('useLoginEncryption')) {
263
- this.settings.useLoginEncryption = obj['useLoginEncryption'];
264
- }
265
- if (obj.hasOwnProperty('additionalTranslationFile')) {
266
- this.settings.additionalTranslationFile = obj['additionalTranslationFile'];
267
- }
268
- if (obj.hasOwnProperty('type')) {
269
- this.settings.type = obj['type'];
270
- }
271
- if (obj.hasOwnProperty('options')) {
272
- Object.assign(this.settings.options, obj['options']);
273
- }
274
- if (obj.hasOwnProperty('catalogParameters')) {
275
- this.settings.catalogParameters = obj['catalogParameters'];
229
+ this.settings = Object.assign(this.settings, obj);
230
+ if (obj.options) {
231
+ this.settings.options = Object.assign(new SettingsOptions(), obj.options);
276
232
  }
277
233
  this.settingsFinished();
278
234
  });
@@ -321,7 +277,7 @@ class CatalogConnectorAdapterService {
321
277
  }
322
278
  this._initializing = true;
323
279
  try {
324
- this.connectorOptions = Object.assign(new Settings(), settings);
280
+ this.connectorOptions = Object.assign(new CatalogSettings(), settings);
325
281
  this.connectorOptions.options = Object.assign(new SettingsOptions(), this.connectorOptions.options);
326
282
  this.assetPath = settings.assetPath;
327
283
  this.connector = new Articles(this.connectorOptions);
@@ -341,7 +297,7 @@ class CatalogConnectorAdapterService {
341
297
  }
342
298
  getCatalogBundleSettings(url, upId) {
343
299
  return __awaiter(this, void 0, void 0, function* () {
344
- const tempSettings = new Settings();
300
+ const tempSettings = new CatalogSettings();
345
301
  tempSettings.url = url;
346
302
  tempSettings.schema = upId.toString();
347
303
  const tempMainConnector = new MainApi(tempSettings);
@@ -2007,7 +1963,7 @@ CatalogCategoriesComponent.decorators = [
2007
1963
  <div class="category-item" *ngFor="let category of categories" (click)="handleCategoryClick($event, category.category)">
2008
1964
  <co-image [source]="category.imageData"></co-image>
2009
1965
  <div class="category-description">
2010
- <co-responsive-text [text]="category.category | localize"></co-responsive-text>
1966
+ <co-responsive-text [text]="category.description | localize"></co-responsive-text>
2011
1967
  </div>
2012
1968
  <!--
2013
1969
  <span [textContent]="category.category | localize"></span>
@@ -2017,7 +1973,7 @@ CatalogCategoriesComponent.decorators = [
2017
1973
  <ng-container *ngIf="showTurnoverGroups">
2018
1974
  <div class="turnovergroup-wrapper" *ngFor="let category of categories">
2019
1975
  <div class="turnovergroup-items-wrapper" *ngIf="category.turnoverGroups && category.turnoverGroups.length > 0">
2020
- <div class="category-title" [textContent]="category.category | localize"></div>
1976
+ <div class="category-title" [textContent]="category.description | localize"></div>
2021
1977
  <div class="turnovergroup-item-wrapper">
2022
1978
  <div class="turnovergroup-item" *ngFor="let turnoverGroup of category.turnoverGroups"
2023
1979
  (click)="handleTurnoverGroupClick($event, turnoverGroup.turnovergroupNr)">
@@ -2137,11 +2093,12 @@ IconCacheService.ctorParameters = () => [
2137
2093
  ];
2138
2094
 
2139
2095
  class CatalogFilterComponent {
2140
- constructor(iconCache, optionsService, changeDetector, _catalogConnectorService, searchService) {
2096
+ constructor(iconCache, optionsService, changeDetector, _catalogConnectorService, _adapterService, searchService) {
2141
2097
  this.iconCache = iconCache;
2142
2098
  this.optionsService = optionsService;
2143
2099
  this.changeDetector = changeDetector;
2144
2100
  this._catalogConnectorService = _catalogConnectorService;
2101
+ this._adapterService = _adapterService;
2145
2102
  this.searchService = searchService;
2146
2103
  this.icons = IconEnum;
2147
2104
  this.updatePreset = false;
@@ -2154,12 +2111,11 @@ class CatalogFilterComponent {
2154
2111
  ];
2155
2112
  this.collapsed = false;
2156
2113
  this._subs = [];
2157
- // this._subs = [
2158
- // this.catalog.onPrepareFilters.subscribe(() => {
2159
- // this.setupFilters();
2160
- // this.detectChanges();
2161
- // })
2162
- // ];
2114
+ this._subs.push(this._adapterService.controllerInitialized.subscribe((initialized) => {
2115
+ if (initialized) {
2116
+ this.getUserGroups();
2117
+ }
2118
+ }));
2163
2119
  }
2164
2120
  showClass() {
2165
2121
  return true;
@@ -2172,7 +2128,12 @@ class CatalogFilterComponent {
2172
2128
  }
2173
2129
  //this.initializePriceFilterMinMax();
2174
2130
  this.detectChanges();
2175
- this.getUserGroups();
2131
+ }
2132
+ ngOnDestroy() {
2133
+ this._destroyed = true;
2134
+ this._subs.forEach((x) => {
2135
+ x.unsubscribe();
2136
+ });
2176
2137
  }
2177
2138
  getUserGroups() {
2178
2139
  this._catalogConnectorService.getUserGroups().then((userGroups) => {
@@ -2190,12 +2151,6 @@ class CatalogFilterComponent {
2190
2151
  this.filterItems.nativeElement.scrollLeft = this.logisticsFilter.nativeElement.offsetLeft - this.filterItems.nativeElement.offsetLeft;
2191
2152
  }
2192
2153
  }
2193
- ngOnDestroy() {
2194
- this._destroyed = true;
2195
- this._subs.forEach((x) => {
2196
- x.unsubscribe();
2197
- });
2198
- }
2199
2154
  detectChanges() {
2200
2155
  if (!this._destroyed) {
2201
2156
  this.changeDetector.detectChanges();
@@ -2281,6 +2236,7 @@ CatalogFilterComponent.ctorParameters = () => [
2281
2236
  { type: CatalogOptionsService },
2282
2237
  { type: ChangeDetectorRef },
2283
2238
  { type: CatalogConnectorService },
2239
+ { type: CatalogConnectorAdapterService },
2284
2240
  { type: CatalogSearchService }
2285
2241
  ];
2286
2242
  CatalogFilterComponent.propDecorators = {
@@ -3472,15 +3428,11 @@ class CatalogSearchComponent {
3472
3428
  handleResetButtonClick(event) {
3473
3429
  this._catalogSearchService.resetFilters();
3474
3430
  }
3475
- handleGetTransactionClick() {
3476
- this._catalogService.getWebTransaction();
3477
- }
3478
3431
  }
3479
3432
  CatalogSearchComponent.decorators = [
3480
3433
  { type: Component, args: [{
3481
3434
  selector: 'co-catalog-search',
3482
3435
  template: `
3483
- <button (click)="handleGetTransactionClick()">get transaction</button>
3484
3436
  <div class="catalog-search-wrapper">
3485
3437
  <ng-container *ngIf="showFilter">
3486
3438
  <div class="filter-content" @showHideFilter>