@colijnit/catalog 255.1.12 → 255.1.14

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.
@@ -33,9 +33,10 @@ import { ExternalCatalogStartupInfo } from '@colijnit/articleapi/build/model/ext
33
33
  import { Color } from '@colijnit/mainapi/build/model/color.bo';
34
34
  import { TransactionInfoResponse } from '@colijnit/transactionapi/build/model/transaction-info-response.bo';
35
35
  import { DateField } from '@colijnit/ioneconnector/build/factory/decorators/date-field.decorator';
36
+ import { ObjectConfiguration } from '@colijnit/ioneconnector/build/model/object-configuration';
36
37
  import { ObjectUtils } from '@colijnit/ioneconnector/build/utils/object-utils';
37
38
  import { FileUtils } from '@colijnit/ioneconnector/build/utils/file-utils';
38
- import { FilterViewmodel, FilterItemViewmodel, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, FilterItemModule, ScreenConfigurationModule, InputTextModule, ButtonModule, IconModule, FilterItemMode as FilterItemMode$1, InputDatePickerModule, IconCollapseHandleModule, CoDialogModule, ListOfValuesModule, CheckmarkOverlayModule, ImageModule, OverlayModule, OverlayService, BaseModuleScreenConfigService, InputSearchModule, PaginationBarModule, SimpleGridModule } from '@colijnit/corecomponents_v12';
39
+ import { FilterViewmodel, FilterItemViewmodel, BaseModuleScreenConfigService, BaseModuleService, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, FilterItemModule, ScreenConfigurationModule, InputTextModule, ButtonModule, IconModule, FilterItemMode as FilterItemMode$1, InputDatePickerModule, IconCollapseHandleModule, CoDialogModule, ListOfValuesModule, CheckmarkOverlayModule, ImageModule, OverlayModule, OverlayService, InputSearchModule, PaginationBarModule, SimpleGridModule } from '@colijnit/corecomponents_v12';
39
40
  import { PagingParameters } from '@colijnit/ioneconnector/build/model/paging-parameters';
40
41
  import { trigger, state, style, transition, animate } from '@angular/animations';
41
42
  import * as i1 from '@angular/platform-browser';
@@ -53,8 +54,8 @@ class Version {
53
54
  constructor() {
54
55
  this.name = "@colijnit/catalog";
55
56
  this.description = "iOne Catalog module based on Angular 12";
56
- this.symVer = "255.1.12";
57
- this.publishDate = "31-10-2024 17:43:46";
57
+ this.symVer = "255.1.14";
58
+ this.publishDate = "19-11-2024 17:56:15";
58
59
  }
59
60
  }
60
61
 
@@ -328,6 +329,7 @@ class CatalogConnectorAdapterService {
328
329
  this._boFactory = new BusinessObjectFactory();
329
330
  this._initializing = false;
330
331
  this._initialized = false;
332
+ console.log('create');
331
333
  }
332
334
  get shouldShowLoader() {
333
335
  return this._shouldShowLoader;
@@ -938,6 +940,17 @@ class CatalogConnectorAdapterService {
938
940
  getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
939
941
  return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, showLoader, undefined, configuratorStatistics);
940
942
  }
943
+ getObjectConfiguration(screenCfgModule, params, insertMode) {
944
+ return __awaiter(this, void 0, void 0, function* () {
945
+ const response = yield this.mainConnector.getObjectConfigurations(screenCfgModule, params, insertMode);
946
+ if (response && response.validationResult && response.validationResult.success) {
947
+ return this._boFactory.makeBOArrayFromRawBackendDataArray(ObjectConfiguration, response.resultObjects);
948
+ }
949
+ else {
950
+ console.error(response.validationMessagesAsString);
951
+ }
952
+ });
953
+ }
941
954
  onShowLoaderChange(showLoader) {
942
955
  this._shouldShowLoader = showLoader;
943
956
  }
@@ -947,7 +960,8 @@ CatalogConnectorAdapterService.decorators = [
947
960
  { type: Injectable, args: [{
948
961
  providedIn: 'root'
949
962
  },] }
950
- ];
963
+ ];
964
+ CatalogConnectorAdapterService.ctorParameters = () => [];
951
965
 
952
966
  // Class represents a value that is to be loaded only once, lazily, by its .loadFunction, despite how many times or how fast its getValue() is called.
953
967
  class CacheField {
@@ -2114,10 +2128,54 @@ CatalogSearchService.ctorParameters = () => [
2114
2128
  { type: CatalogOptionsService }
2115
2129
  ];
2116
2130
 
2117
- class CatalogService {
2118
- constructor(connector, connectorAdapter, settingsService, optionsService, _imageService, _filterService, _catalogSearchService) {
2131
+ class CatalogScreenConfigurationService extends BaseModuleScreenConfigService {
2132
+ constructor(_catalogAdapterService) {
2133
+ super();
2134
+ this._catalogAdapterService = _catalogAdapterService;
2135
+ this.screenModuleName = "Selector";
2136
+ this._screenConfigurationObjectCache = [];
2137
+ }
2138
+ clear() {
2139
+ this._screenConfigurationObjectCache = [];
2140
+ }
2141
+ loadConfigForModule(params, insertRights) {
2142
+ return __awaiter(this, void 0, void 0, function* () {
2143
+ if (!this._screenConfigurationLoaded()) {
2144
+ const config = yield this._catalogAdapterService.getObjectConfiguration(this.screenModuleName);
2145
+ if (config) {
2146
+ this._setScreenConfigurationObjectCache(config);
2147
+ return config;
2148
+ }
2149
+ }
2150
+ else {
2151
+ return Promise.resolve(this._screenConfigurationObjectCache);
2152
+ }
2153
+ return Promise.resolve([]);
2154
+ });
2155
+ }
2156
+ _setScreenConfigurationObjectCache(objects) {
2157
+ this._screenConfigurationObjectCache = objects;
2158
+ }
2159
+ _screenConfigurationLoaded() {
2160
+ return this._screenConfigurationObjectCache.length !== 0;
2161
+ }
2162
+ }
2163
+ CatalogScreenConfigurationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogScreenConfigurationService_Factory() { return new CatalogScreenConfigurationService(i0.ɵɵinject(CatalogConnectorAdapterService)); }, token: CatalogScreenConfigurationService, providedIn: "root" });
2164
+ CatalogScreenConfigurationService.decorators = [
2165
+ { type: Injectable, args: [{
2166
+ providedIn: "root"
2167
+ },] }
2168
+ ];
2169
+ CatalogScreenConfigurationService.ctorParameters = () => [
2170
+ { type: CatalogConnectorAdapterService }
2171
+ ];
2172
+
2173
+ class CatalogService extends BaseModuleService {
2174
+ constructor(connector, connectorAdapter, screenConfigService, settingsService, optionsService, _imageService, _filterService, _catalogSearchService) {
2175
+ super(screenConfigService);
2119
2176
  this.connector = connector;
2120
2177
  this.connectorAdapter = connectorAdapter;
2178
+ this.screenConfigService = screenConfigService;
2121
2179
  this.settingsService = settingsService;
2122
2180
  this.optionsService = optionsService;
2123
2181
  this._imageService = _imageService;
@@ -2271,7 +2329,7 @@ class CatalogService {
2271
2329
  this.activeStockViewSubject.next(value);
2272
2330
  }
2273
2331
  }
2274
- CatalogService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogService_Factory() { return new CatalogService(i0.ɵɵinject(CatalogConnectorService), i0.ɵɵinject(CatalogConnectorAdapterService), i0.ɵɵinject(CatalogSettingsService), i0.ɵɵinject(CatalogOptionsService), i0.ɵɵinject(CatalogImageService), i0.ɵɵinject(CatalogFilterService), i0.ɵɵinject(CatalogSearchService)); }, token: CatalogService, providedIn: "root" });
2332
+ CatalogService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CatalogService_Factory() { return new CatalogService(i0.ɵɵinject(CatalogConnectorService), i0.ɵɵinject(CatalogConnectorAdapterService), i0.ɵɵinject(CatalogScreenConfigurationService), i0.ɵɵinject(CatalogSettingsService), i0.ɵɵinject(CatalogOptionsService), i0.ɵɵinject(CatalogImageService), i0.ɵɵinject(CatalogFilterService), i0.ɵɵinject(CatalogSearchService)); }, token: CatalogService, providedIn: "root" });
2275
2333
  CatalogService.decorators = [
2276
2334
  { type: Injectable, args: [{
2277
2335
  providedIn: 'root'
@@ -2280,6 +2338,7 @@ CatalogService.decorators = [
2280
2338
  CatalogService.ctorParameters = () => [
2281
2339
  { type: CatalogConnectorService },
2282
2340
  { type: CatalogConnectorAdapterService },
2341
+ { type: CatalogScreenConfigurationService },
2283
2342
  { type: CatalogSettingsService },
2284
2343
  { type: CatalogOptionsService },
2285
2344
  { type: CatalogImageService },
@@ -3114,8 +3173,9 @@ CatalogFilterContentGeneralComponent.propDecorators = {
3114
3173
  };
3115
3174
 
3116
3175
  class CatalogFilterItemComponent {
3117
- constructor(searchService) {
3176
+ constructor(searchService, _screenConfigService) {
3118
3177
  this.searchService = searchService;
3178
+ this._screenConfigService = _screenConfigService;
3119
3179
  this.collection = [];
3120
3180
  this.placeholder = '';
3121
3181
  this.customContent = false;
@@ -3132,6 +3192,21 @@ class CatalogFilterItemComponent {
3132
3192
  this.showMoreLabel = "SHOW_MORE";
3133
3193
  this.showLessLabel = "SHOW_LESS";
3134
3194
  this.filterButtonLabel = "SEARCH_IMPERATIVE";
3195
+ this._subs = [];
3196
+ }
3197
+ ngOnInit() {
3198
+ this._subs.push(
3199
+ // todo: remove this dirty hack when screenconfig is completed
3200
+ this._screenConfigService.configSet.subscribe((config) => {
3201
+ if (config) {
3202
+ if (!this._screenConfigService.getObjectConfigurationFor(this.screenConfigurationObjectName)) {
3203
+ this.screenConfigurationObjectName = undefined;
3204
+ }
3205
+ }
3206
+ }));
3207
+ }
3208
+ ngOnDestroy() {
3209
+ this._subs.forEach(s => s.unsubscribe());
3135
3210
  }
3136
3211
  onFilterButtonClicked() {
3137
3212
  this.searchService.searchArticles();
@@ -3177,7 +3252,8 @@ CatalogFilterItemComponent.decorators = [
3177
3252
  },] }
3178
3253
  ];
3179
3254
  CatalogFilterItemComponent.ctorParameters = () => [
3180
- { type: CatalogSearchService }
3255
+ { type: CatalogSearchService },
3256
+ { type: CatalogScreenConfigurationService }
3181
3257
  ];
3182
3258
  CatalogFilterItemComponent.propDecorators = {
3183
3259
  model: [{ type: Input }],
@@ -4299,11 +4375,12 @@ CatalogStockComparisonService.ctorParameters = () => [
4299
4375
  ];
4300
4376
 
4301
4377
  class CatalogSearchComponent {
4302
- constructor(_settingsService, _catalogService, _catalogSearchService, _catalogEventService, iconCacheService, _cfgService) {
4378
+ constructor(_settingsService, _catalogService, _catalogSearchService, _catalogEventService, _catalogAdapterService, iconCacheService, _cfgService) {
4303
4379
  this._settingsService = _settingsService;
4304
4380
  this._catalogService = _catalogService;
4305
4381
  this._catalogSearchService = _catalogSearchService;
4306
4382
  this._catalogEventService = _catalogEventService;
4383
+ this._catalogAdapterService = _catalogAdapterService;
4307
4384
  this.iconCacheService = iconCacheService;
4308
4385
  this._cfgService = _cfgService;
4309
4386
  this.icons = IconEnum;
@@ -4322,6 +4399,7 @@ class CatalogSearchComponent {
4322
4399
  this.onExternalSourceClick = new EventEmitter();
4323
4400
  this.mode = 'tile';
4324
4401
  this.showCategories = true;
4402
+ this.configLoaded = false;
4325
4403
  this._subs = [];
4326
4404
  }
4327
4405
  set settings(value) {
@@ -4332,7 +4410,6 @@ class CatalogSearchComponent {
4332
4410
  else {
4333
4411
  this._settings = value;
4334
4412
  }
4335
- this._catalogService.init(this._settings, true);
4336
4413
  }
4337
4414
  }
4338
4415
  showClass() {
@@ -4341,10 +4418,25 @@ class CatalogSearchComponent {
4341
4418
  ngOnInit() {
4342
4419
  return __awaiter(this, void 0, void 0, function* () {
4343
4420
  yield this._settingsService.initializeSettings();
4344
- if (this.settings) {
4345
- yield this._catalogService.init(this._settings, true);
4346
- }
4347
- this._subs.push(this._catalogEventService.addArticleButtonClick.subscribe((article) => {
4421
+ yield this._catalogService.init(this._settings, true);
4422
+ this._subs.push(this._catalogAdapterService.controllerInitialized.subscribe((initialized) => {
4423
+ if (initialized) {
4424
+ this._cfgService.loadConfig().then((configs) => {
4425
+ if (configs && configs.length > 0) {
4426
+ this.configLoaded = true;
4427
+ let configObject = this._cfgService.getObjectConfigurationFor('resultSetting');
4428
+ if (configObject) {
4429
+ if (configObject.getDefaultBooleanValue()) {
4430
+ this.mode = 'tile';
4431
+ }
4432
+ else {
4433
+ this.mode = 'list';
4434
+ }
4435
+ }
4436
+ }
4437
+ });
4438
+ }
4439
+ }), this._catalogEventService.addArticleButtonClick.subscribe((article) => {
4348
4440
  this.onAddArticleButtonClick.emit(article);
4349
4441
  }), this._catalogEventService.arButtonClick.subscribe((article) => {
4350
4442
  this.onArButtonClick.emit(article);
@@ -4354,30 +4446,7 @@ class CatalogSearchComponent {
4354
4446
  this.onLookAtArticleButtonClick.emit(article);
4355
4447
  }), this._catalogEventService.stockDetailsClick.subscribe((article) => {
4356
4448
  this.onStockDetailsClick.emit(article);
4357
- }), this._cfgService.configSet.subscribe((config) => {
4358
- if (config && config.length > 0) {
4359
- let configObject = this._cfgService.getObjectConfigurationFor('resultSetting');
4360
- if (configObject) {
4361
- if (configObject.getDefaultBooleanValue()) {
4362
- this.mode = 'tile';
4363
- }
4364
- else {
4365
- this.mode = 'list';
4366
- }
4367
- }
4368
- }
4369
4449
  }));
4370
- if (this._cfgService.configObjects && this._cfgService.configObjects.length > 0) {
4371
- let config = this._cfgService.getObjectConfigurationFor('resultSetting');
4372
- if (config) {
4373
- if (config.getDefaultBooleanValue()) {
4374
- this.mode = 'tile';
4375
- }
4376
- else {
4377
- this.mode = 'list';
4378
- }
4379
- }
4380
- }
4381
4450
  });
4382
4451
  }
4383
4452
  ngOnDestroy() {
@@ -4404,7 +4473,7 @@ CatalogSearchComponent.decorators = [
4404
4473
  { type: Component, args: [{
4405
4474
  selector: 'co-catalog-search',
4406
4475
  template: `
4407
- <div class="catalog-search-wrapper">
4476
+ <div class="catalog-search-wrapper" *ngIf="configLoaded">
4408
4477
  <ng-container *ngIf="showFilter || tempFilter">
4409
4478
  <div class="filter-content" @showHideFilter>
4410
4479
  <div class="search-filter-panel-header-wrapper">
@@ -4486,17 +4555,20 @@ CatalogSearchComponent.decorators = [
4486
4555
  CatalogSelectMultipleParameterizedCacheService,
4487
4556
  CatalogSelectSingleParameterizedCacheService,
4488
4557
  CatalogBusinessObjectCacheManagerService,
4558
+ CatalogService,
4559
+ CatalogScreenConfigurationService,
4489
4560
  CatalogImageService,
4490
4561
  CatalogFilterService,
4491
4562
  CatalogOptionsService,
4492
4563
  CatalogConnectorService,
4493
4564
  CatalogConnectorAdapterService,
4494
- CatalogService,
4495
4565
  CatalogSettingsService,
4496
4566
  CatalogSearchService,
4497
4567
  CatalogStockService,
4498
4568
  CatalogStockComparisonService,
4499
4569
  CatalogStockTransferService,
4570
+ { provide: BaseModuleService, useExisting: CatalogService },
4571
+ { provide: BaseModuleScreenConfigService, useExisting: CatalogScreenConfigurationService },
4500
4572
  {
4501
4573
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
4502
4574
  useExisting: forwardRef(() => CatalogSearchComponent)
@@ -4517,8 +4589,9 @@ CatalogSearchComponent.ctorParameters = () => [
4517
4589
  { type: CatalogService, decorators: [{ type: Host }] },
4518
4590
  { type: CatalogSearchService, decorators: [{ type: Host }] },
4519
4591
  { type: CatalogEventService },
4592
+ { type: CatalogConnectorAdapterService },
4520
4593
  { type: IconCacheService },
4521
- { type: BaseModuleScreenConfigService }
4594
+ { type: CatalogScreenConfigurationService }
4522
4595
  ];
4523
4596
  CatalogSearchComponent.propDecorators = {
4524
4597
  settings: [{ type: Input }],
@@ -6364,5 +6437,5 @@ CatalogNavigationService.ctorParameters = () => [
6364
6437
  * Generated bundle index. Do not edit.
6365
6438
  */
6366
6439
 
6367
- export { CatalogArticleListModule, CatalogArticleTileModule, CatalogBusinessObjectCacheManagerService, CatalogCategoriesModule, CatalogConnectorAdapterService, CatalogConnectorService, CatalogEventService, CatalogExternalSourceModule, CatalogExternalSourcesModule, CatalogFilterModule, CatalogFilterService, CatalogImageService, CatalogNavigationModule, CatalogNavigationService, CatalogOptionsService, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListModule, CatalogSearchResultTileModule, CatalogSearchService, CatalogSelectMultipleCacheService, CatalogSelectMultipleParameterizedCacheService, CatalogSelectSingleCacheService, CatalogSelectSingleParameterizedCacheService, CatalogService, CatalogSettingsService, CatalogStockComparisonListModule, CatalogStockComparisonService, CatalogStockComparisonTileModule, CatalogStockOverviewListModule, CatalogStockOverviewTileModule, CatalogStockService, CatalogStockTransferService, CatalogWarehouseTransfersListModule, CatalogWarehouseTransfersTileModule, StockView, Version, CatalogFilterCategoriesModule as ɵa, PipeModule as ɵb, VisibilityObserverDirective as ɵba, CatalogSearchResultTileComponent as ɵbb, CatalogSearchBaseComponent as ɵbc, CatalogArticleListComponent as ɵbd, CatalogSearchResultListComponent as ɵbe, CatalogSearchComponent as ɵbf, CatalogExternalSourceComponent as ɵbg, CatalogStockOverviewTileComponent as ɵbh, CatalogStockOverviewListComponent as ɵbi, CatalogStockComparisonTileComponent as ɵbj, CatalogStockComparisonListComponent as ɵbk, CatalogWarehouseTransfersTileComponent as ɵbl, CatalogWarehouseTransfersListComponent as ɵbm, LocalizePipe as ɵc, DictionaryService as ɵd, CatalogFilterCategoriesComponent as ɵe, CatalogFilterContentGeneralModule as ɵf, CatalogFilterItemModule as ɵg, CatalogFilterItemComponent as ɵh, CacheField as ɵi, CatalogFilterContentGeneralComponent as ɵj, IconCacheService as ɵk, CatalogFilterContentPurchaseModule as ɵl, CatalogFilterContentPurchaseComponent as ɵm, CatalogFilterContentLogisticsModule as ɵn, CatalogFilterContentLogisticsComponent as ɵo, CatalogFilterComponent as ɵp, ResponsiveTextModule as ɵq, ResponsiveTextComponent as ɵr, CatalogCategoriesComponent as ɵs, CatalogExternalSourcesComponent as ɵt, CatalogNavigationComponent as ɵu, CatalogSearchHeaderComponent as ɵv, CatalogArticleTileComponent as ɵw, ArticleBaseComponent as ɵx, VisibilityObserverModule as ɵy, VisibilityObserverMasterDirective as ɵz };
6440
+ export { CatalogArticleListModule, CatalogArticleTileModule, CatalogBusinessObjectCacheManagerService, CatalogCategoriesModule, CatalogConnectorAdapterService, CatalogConnectorService, CatalogEventService, CatalogExternalSourceModule, CatalogExternalSourcesModule, CatalogFilterModule, CatalogFilterService, CatalogImageService, CatalogNavigationModule, CatalogNavigationService, CatalogOptionsService, CatalogSearchHeaderModule, CatalogSearchModule, CatalogSearchResultListModule, CatalogSearchResultTileModule, CatalogSearchService, CatalogSelectMultipleCacheService, CatalogSelectMultipleParameterizedCacheService, CatalogSelectSingleCacheService, CatalogSelectSingleParameterizedCacheService, CatalogService, CatalogSettingsService, CatalogStockComparisonListModule, CatalogStockComparisonService, CatalogStockComparisonTileModule, CatalogStockOverviewListModule, CatalogStockOverviewTileModule, CatalogStockService, CatalogStockTransferService, CatalogWarehouseTransfersListModule, CatalogWarehouseTransfersTileModule, StockView, Version, CatalogFilterCategoriesModule as ɵa, PipeModule as ɵb, VisibilityObserverMasterDirective as ɵba, VisibilityObserverDirective as ɵbb, CatalogSearchResultTileComponent as ɵbc, CatalogSearchBaseComponent as ɵbd, CatalogArticleListComponent as ɵbe, CatalogSearchResultListComponent as ɵbf, CatalogSearchComponent as ɵbg, CatalogExternalSourceComponent as ɵbh, CatalogStockOverviewTileComponent as ɵbi, CatalogStockOverviewListComponent as ɵbj, CatalogStockComparisonTileComponent as ɵbk, CatalogStockComparisonListComponent as ɵbl, CatalogWarehouseTransfersTileComponent as ɵbm, CatalogWarehouseTransfersListComponent as ɵbn, LocalizePipe as ɵc, DictionaryService as ɵd, CatalogFilterCategoriesComponent as ɵe, CatalogFilterContentGeneralModule as ɵf, CatalogFilterItemModule as ɵg, CatalogFilterItemComponent as ɵh, CacheField as ɵi, CatalogScreenConfigurationService as ɵj, CatalogFilterContentGeneralComponent as ɵk, IconCacheService as ɵl, CatalogFilterContentPurchaseModule as ɵm, CatalogFilterContentPurchaseComponent as ɵn, CatalogFilterContentLogisticsModule as ɵo, CatalogFilterContentLogisticsComponent as ɵp, CatalogFilterComponent as ɵq, ResponsiveTextModule as ɵr, ResponsiveTextComponent as ɵs, CatalogCategoriesComponent as ɵt, CatalogExternalSourcesComponent as ɵu, CatalogNavigationComponent as ɵv, CatalogSearchHeaderComponent as ɵw, CatalogArticleTileComponent as ɵx, ArticleBaseComponent as ɵy, VisibilityObserverModule as ɵz };
6368
6441
  //# sourceMappingURL=colijnit-catalog.js.map