@colijnit/catalog 256.1.5 → 256.1.6

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 = "256.1.5";
57
- this.publishDate = "1-11-2024 14:45:45";
57
+ this.symVer = "256.1.6";
58
+ this.publishDate = "6-11-2024 17:11:51";
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, externalSource = false, showLoader = true, instanceId = undefined, configuratorStatistics) {
939
941
  return this.connector.getJsonArticleFlatTree(goodId, goodType, quantity, externalSource, 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 },
@@ -4299,11 +4358,12 @@ CatalogStockComparisonService.ctorParameters = () => [
4299
4358
  ];
4300
4359
 
4301
4360
  class CatalogSearchComponent {
4302
- constructor(_settingsService, _catalogService, _catalogSearchService, _catalogEventService, iconCacheService, _cfgService) {
4361
+ constructor(_settingsService, _catalogService, _catalogSearchService, _catalogEventService, _catalogAdapterService, iconCacheService, _cfgService) {
4303
4362
  this._settingsService = _settingsService;
4304
4363
  this._catalogService = _catalogService;
4305
4364
  this._catalogSearchService = _catalogSearchService;
4306
4365
  this._catalogEventService = _catalogEventService;
4366
+ this._catalogAdapterService = _catalogAdapterService;
4307
4367
  this.iconCacheService = iconCacheService;
4308
4368
  this._cfgService = _cfgService;
4309
4369
  this.icons = IconEnum;
@@ -4322,6 +4382,7 @@ class CatalogSearchComponent {
4322
4382
  this.onExternalSourceClick = new EventEmitter();
4323
4383
  this.mode = 'tile';
4324
4384
  this.showCategories = true;
4385
+ this.configLoaded = false;
4325
4386
  this._subs = [];
4326
4387
  }
4327
4388
  set settings(value) {
@@ -4332,7 +4393,6 @@ class CatalogSearchComponent {
4332
4393
  else {
4333
4394
  this._settings = value;
4334
4395
  }
4335
- this._catalogService.init(this._settings, true);
4336
4396
  }
4337
4397
  }
4338
4398
  showClass() {
@@ -4341,10 +4401,25 @@ class CatalogSearchComponent {
4341
4401
  ngOnInit() {
4342
4402
  return __awaiter(this, void 0, void 0, function* () {
4343
4403
  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) => {
4404
+ yield this._catalogService.init(this._settings, true);
4405
+ this._subs.push(this._catalogAdapterService.controllerInitialized.subscribe((initialized) => {
4406
+ if (initialized) {
4407
+ this._cfgService.loadConfig().then((configs) => {
4408
+ if (configs && configs.length > 0) {
4409
+ this.configLoaded = true;
4410
+ let configObject = this._cfgService.getObjectConfigurationFor('resultSetting');
4411
+ if (configObject) {
4412
+ if (configObject.getDefaultBooleanValue()) {
4413
+ this.mode = 'tile';
4414
+ }
4415
+ else {
4416
+ this.mode = 'list';
4417
+ }
4418
+ }
4419
+ }
4420
+ });
4421
+ }
4422
+ }), this._catalogEventService.addArticleButtonClick.subscribe((article) => {
4348
4423
  this.onAddArticleButtonClick.emit(article);
4349
4424
  }), this._catalogEventService.arButtonClick.subscribe((article) => {
4350
4425
  this.onArButtonClick.emit(article);
@@ -4354,30 +4429,7 @@ class CatalogSearchComponent {
4354
4429
  this.onLookAtArticleButtonClick.emit(article);
4355
4430
  }), this._catalogEventService.stockDetailsClick.subscribe((article) => {
4356
4431
  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
4432
  }));
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
4433
  });
4382
4434
  }
4383
4435
  ngOnDestroy() {
@@ -4400,7 +4452,7 @@ CatalogSearchComponent.decorators = [
4400
4452
  { type: Component, args: [{
4401
4453
  selector: 'co-catalog-search',
4402
4454
  template: `
4403
- <div class="catalog-search-wrapper">
4455
+ <div class="catalog-search-wrapper" *ngIf="configLoaded">
4404
4456
  <ng-container *ngIf="tempFilter">
4405
4457
  <div class="filter-content" @showHideFilter>
4406
4458
  <div class="search-filter-panel-header-wrapper">
@@ -4487,17 +4539,20 @@ CatalogSearchComponent.decorators = [
4487
4539
  CatalogSelectMultipleParameterizedCacheService,
4488
4540
  CatalogSelectSingleParameterizedCacheService,
4489
4541
  CatalogBusinessObjectCacheManagerService,
4542
+ CatalogService,
4543
+ CatalogScreenConfigurationService,
4490
4544
  CatalogImageService,
4491
4545
  CatalogFilterService,
4492
4546
  CatalogOptionsService,
4493
4547
  CatalogConnectorService,
4494
4548
  CatalogConnectorAdapterService,
4495
- CatalogService,
4496
4549
  CatalogSettingsService,
4497
4550
  CatalogSearchService,
4498
4551
  CatalogStockService,
4499
4552
  CatalogStockComparisonService,
4500
4553
  CatalogStockTransferService,
4554
+ { provide: BaseModuleService, useExisting: CatalogService },
4555
+ { provide: BaseModuleScreenConfigService, useExisting: CatalogScreenConfigurationService },
4501
4556
  {
4502
4557
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
4503
4558
  useExisting: forwardRef(() => CatalogSearchComponent)
@@ -4518,8 +4573,9 @@ CatalogSearchComponent.ctorParameters = () => [
4518
4573
  { type: CatalogService, decorators: [{ type: Host }] },
4519
4574
  { type: CatalogSearchService, decorators: [{ type: Host }] },
4520
4575
  { type: CatalogEventService },
4576
+ { type: CatalogConnectorAdapterService },
4521
4577
  { type: IconCacheService },
4522
- { type: BaseModuleScreenConfigService }
4578
+ { type: CatalogScreenConfigurationService }
4523
4579
  ];
4524
4580
  CatalogSearchComponent.propDecorators = {
4525
4581
  settings: [{ type: Input }],
@@ -6385,5 +6441,5 @@ CatalogNavigationService.ctorParameters = () => [
6385
6441
  * Generated bundle index. Do not edit.
6386
6442
  */
6387
6443
 
6388
- 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 };
6444
+ 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, CatalogFilterContentGeneralComponent as ɵj, IconCacheService as ɵk, CatalogFilterContentPurchaseModule as ɵl, CatalogFilterContentPurchaseComponent as ɵm, CatalogFilterContentLogisticsModule as ɵn, CatalogFilterContentLogisticsComponent as ɵo, CatalogScreenConfigurationService 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 };
6389
6445
  //# sourceMappingURL=colijnit-catalog.js.map