@qbs-origin/origin-form 0.8.2 → 0.8.3

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.
@@ -16,7 +16,7 @@ import * as i4$1 from '@angular/material/checkbox';
16
16
  import { MatCheckboxModule } from '@angular/material/checkbox';
17
17
  import * as i6 from '@angular/material/autocomplete';
18
18
  import { MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
19
- import { catchError, throwError, BehaviorSubject, firstValueFrom, of, switchMap as switchMap$1, shareReplay, finalize, map, forkJoin, take, Subject, Subscription, interval, startWith, pairwise, debounceTime, takeUntil, timer, Observable, merge } from 'rxjs';
19
+ import { catchError, throwError, BehaviorSubject, firstValueFrom, of, switchMap as switchMap$1, shareReplay, finalize, map, forkJoin, take, Subject, Subscription, interval, startWith, pairwise, takeUntil, from, timer, Observable, merge } from 'rxjs';
20
20
  import * as i1$1 from '@angular/common/http';
21
21
  import { HttpHeaders, HttpParams, provideHttpClient, HTTP_INTERCEPTORS, withInterceptorsFromDi } from '@angular/common/http';
22
22
  import { tap, switchMap, catchError as catchError$1, map as map$1, takeWhile, finalize as finalize$1 } from 'rxjs/operators';
@@ -2718,14 +2718,14 @@ class AppDataFill {
2718
2718
  language: language || '',
2719
2719
  offerId: offerId || '',
2720
2720
  isSubmitted: isSubmitted || false,
2721
- parentAppDataUuid: parentAppDataUuid || '',
2721
+ parentAppDataUuid: parentAppDataUuid || ''
2722
2722
  };
2723
2723
  this.flux = flux || [];
2724
2724
  }
2725
2725
  }
2726
2726
  class AppData {
2727
2727
  constructor(data) {
2728
- (this.id = data.id ?? undefined), (this.appDataId = data.appDataId || '');
2728
+ ((this.id = data.id ?? undefined), (this.appDataId = data.appDataId || ''));
2729
2729
  this.appConfigurationId = data.appConfigurationId || 0;
2730
2730
  this.fillData = data.fillData;
2731
2731
  this.initFlowValues = data.initFlowValues;
@@ -2745,7 +2745,8 @@ class FormModelExtenxions {
2745
2745
  this.formModel = model;
2746
2746
  }
2747
2747
  addInitFlowValuesItems(items) {
2748
- const initFlowValuesRaw = this.formModel?.generalData?.initFlowValues;
2748
+ const initFlowValuesRaw = this.formModel?.generalData
2749
+ ?.initFlowValues;
2749
2750
  if (initFlowValuesRaw === null || initFlowValuesRaw === undefined) {
2750
2751
  return;
2751
2752
  }
@@ -2798,7 +2799,7 @@ class FormModelExtenxions {
2798
2799
  return {
2799
2800
  fieldName: `initFlowValues_${underscorePath}`,
2800
2801
  fieldType: StepControlType.Metadata,
2801
- id: `initFlowValues_${underscorePath}`,
2802
+ id: `initFlowValues_${underscorePath}`
2802
2803
  };
2803
2804
  }
2804
2805
  fluxItems(untilStepIdentifier = undefined) {
@@ -2808,7 +2809,7 @@ class FormModelExtenxions {
2808
2809
  items.push({
2809
2810
  fieldName: fieldValue,
2810
2811
  fieldType: StepControlType.Metadata,
2811
- id: `metadata.${fieldValue}`,
2812
+ id: `metadata.${fieldValue}`
2812
2813
  });
2813
2814
  });
2814
2815
  }
@@ -2836,13 +2837,13 @@ class FormModelExtenxions {
2836
2837
  StepControlType.Buttons,
2837
2838
  StepControlType.NewRow,
2838
2839
  StepControlType.FluxInfo,
2839
- StepControlType.Paragraph,
2840
+ StepControlType.Paragraph
2840
2841
  ].includes(control.type) == false) {
2841
2842
  items.push({
2842
2843
  fieldName: `${step.name} -> ${section.title} -> ${control.title}`,
2843
2844
  fieldType: control.type,
2844
2845
  manulInputControlType: control.specificControlData?.type,
2845
- id: control.identifier,
2846
+ id: control.identifier
2846
2847
  });
2847
2848
  }
2848
2849
  });
@@ -2862,7 +2863,7 @@ class FormModelExtenxions {
2862
2863
  fieldType: step.type,
2863
2864
  id: document?.documentId
2864
2865
  ? `upload.${document.documentId}`
2865
- : `${step.type}.${step.name}`,
2866
+ : `${step.type}.${step.name}`
2866
2867
  });
2867
2868
  });
2868
2869
  }
@@ -2874,7 +2875,7 @@ class FormModelExtenxions {
2874
2875
  fieldType: step.type,
2875
2876
  id: document?.id
2876
2877
  ? `generate.${document.id}`
2877
- : `${step.type}.${step.name}`,
2878
+ : `${step.type}.${step.name}`
2878
2879
  });
2879
2880
  });
2880
2881
  }
@@ -2886,7 +2887,7 @@ class FormModelExtenxions {
2886
2887
  fieldType: step.type,
2887
2888
  id: document?.id
2888
2889
  ? `sign.${document.id}`
2889
- : `${step.type}.${step.name}`,
2890
+ : `${step.type}.${step.name}`
2890
2891
  });
2891
2892
  });
2892
2893
  }
@@ -2897,7 +2898,7 @@ class FormModelExtenxions {
2897
2898
  fieldType: step.type,
2898
2899
  id: document?.id
2899
2900
  ? `system.${document.id}`
2900
- : `${step.type}.${step.name}`,
2901
+ : `${step.type}.${step.name}`
2901
2902
  });
2902
2903
  });
2903
2904
  }
@@ -2913,7 +2914,7 @@ class FormModelExtenxions {
2913
2914
  items.push({
2914
2915
  fieldName: `${apiMethod.method} -> ${f.fieldName}`,
2915
2916
  fieldType: StepControlType.ApiMethodField,
2916
- id: f.id,
2917
+ id: f.id
2917
2918
  });
2918
2919
  });
2919
2920
  }
@@ -2932,7 +2933,7 @@ class FormModelExtenxions {
2932
2933
  const allApiItems = [
2933
2934
  ...this.formModel.api.getItems,
2934
2935
  ...this.formModel.api.validationItems,
2935
- ...this.formModel.api.sendItems,
2936
+ ...this.formModel.api.sendItems
2936
2937
  ];
2937
2938
  offerMethodsIds.forEach((methodId) => {
2938
2939
  const apiMethod = allApiItems.find((item) => item.id === methodId);
@@ -2941,7 +2942,7 @@ class FormModelExtenxions {
2941
2942
  items.push({
2942
2943
  fieldName: `${apiMethod.method} -> ${f.fieldName}`,
2943
2944
  fieldType: FluxType.ViewOffer,
2944
- id: `api_${apiMethod.id} -> ${f.id}`,
2945
+ id: `api_${apiMethod.id} -> ${f.id}`
2945
2946
  });
2946
2947
  });
2947
2948
  }
@@ -3098,7 +3099,7 @@ const initialFormulareState = {
3098
3099
  showNameStep: false,
3099
3100
  showAllSteps: false,
3100
3101
  showProgressBar: false,
3101
- initFlowValues: '',
3102
+ initFlowValues: ''
3102
3103
  },
3103
3104
  design: {
3104
3105
  fonts: [],
@@ -3114,7 +3115,7 @@ const initialFormulareState = {
3114
3115
  marginLeft: '',
3115
3116
  marginRight: '',
3116
3117
  marginTop: '',
3117
- marginBottom: '',
3118
+ marginBottom: ''
3118
3119
  },
3119
3120
  flux: [],
3120
3121
  api: { getItems: [], validationItems: [], sendItems: [] },
@@ -3122,16 +3123,16 @@ const initialFormulareState = {
3122
3123
  documents: [],
3123
3124
  statuses: [],
3124
3125
  display: {
3125
- sections: [],
3126
+ sections: []
3126
3127
  },
3127
3128
  generatedCss: {},
3128
3129
  metadataFields: [],
3129
3130
  errors: {},
3130
3131
  applicationMappings: {
3131
3132
  applicationTypeId: 0,
3132
- columnMappings: [],
3133
+ columnMappings: []
3133
3134
  },
3134
- parentChildConfig: undefined,
3135
+ parentChildConfig: undefined
3135
3136
  },
3136
3137
  selectedTab: 'Date generale',
3137
3138
  canGetFromProd: false,
@@ -3139,7 +3140,7 @@ const initialFormulareState = {
3139
3140
  canPublishInProd: false,
3140
3141
  canPublishInTest: false,
3141
3142
  applicationUuid: '',
3142
- version: '',
3143
+ version: ''
3143
3144
  };
3144
3145
  class PartnerDictionaryMapping {
3145
3146
  }
@@ -3174,6 +3175,8 @@ class FieldsMapping {
3174
3175
  class MethodField {
3175
3176
  constructor() {
3176
3177
  this.manulInputControlType = undefined;
3178
+ this.fieldValue = undefined;
3179
+ this.expectedValue = undefined;
3177
3180
  }
3178
3181
  }
3179
3182
  class GetMethodField {
@@ -5169,7 +5172,7 @@ class ApplicationDataService {
5169
5172
  const payload = {
5170
5173
  ...appData,
5171
5174
  initFlowValues: appData.initFlowValues,
5172
- fillData: appData.fillData ? JSON.stringify(appData.fillData) : undefined,
5175
+ fillData: appData.fillData ? JSON.stringify(appData.fillData) : undefined
5173
5176
  };
5174
5177
  return this.http.post(saveUrl, payload);
5175
5178
  }
@@ -5180,7 +5183,7 @@ class ApplicationDataService {
5180
5183
  appDataId: appDataId,
5181
5184
  stepData: JSON.stringify(currentStep),
5182
5185
  withNextStep: true,
5183
- selectedOfferId: selectedOfferId,
5186
+ selectedOfferId: selectedOfferId
5184
5187
  };
5185
5188
  return this.http.post(saveUrl, payload);
5186
5189
  }
@@ -5190,9 +5193,16 @@ class ApplicationDataService {
5190
5193
  appDataId;
5191
5194
  return this.http.get(getUrl);
5192
5195
  }
5193
- validateApi(apiValidateRequest) {
5196
+ async validateApi(apiValidateRequest) {
5194
5197
  const url = this.configService.readConfig().baseUrlBusiness + '/ApiRequest/dorequest';
5195
- return this.http.post(url, apiValidateRequest);
5198
+ try {
5199
+ const response = await firstValueFrom(this.http.post(url, apiValidateRequest));
5200
+ return response === true;
5201
+ }
5202
+ catch (error) {
5203
+ console.warn('API validation request failed', error);
5204
+ return false;
5205
+ }
5196
5206
  }
5197
5207
  doDocumentRequest(apiValidateRequest) {
5198
5208
  const url = this.configService.readConfig().baseUrlBusiness +
@@ -5211,7 +5221,7 @@ class ApplicationDataService {
5211
5221
  makeProcessApiCall(appDataID) {
5212
5222
  const url = this.configService.readConfig().baseUrlInfrastructure + '/Process';
5213
5223
  return this.http.post(url, { appId: appDataID }).pipe(map((response) => {
5214
- console.log('response from makeProcessApiCall', response), response;
5224
+ (console.log('response from makeProcessApiCall', response), response);
5215
5225
  }), catchError((error) => of({ ...error, body: false })));
5216
5226
  }
5217
5227
  getProcessStatus(appDataID) {
@@ -5231,7 +5241,7 @@ class ApplicationDataService {
5231
5241
  return this.http.post(url, {
5232
5242
  appDataId: appDataId,
5233
5243
  stepId: stepId,
5234
- setNextStep: setNextStep,
5244
+ setNextStep: setNextStep
5235
5245
  });
5236
5246
  }
5237
5247
  async setCurrentStep(appDataId, stepId) {
@@ -5259,7 +5269,7 @@ class ApplicationDataService {
5259
5269
  '/appdata/changeLanguage';
5260
5270
  const payload = {
5261
5271
  appDataId: appDataUuid,
5262
- languageIso: languageISOCode,
5272
+ languageIso: languageISOCode
5263
5273
  };
5264
5274
  return this.http.post(url, payload);
5265
5275
  }
@@ -5476,7 +5486,31 @@ class ModelPopulationHelper {
5476
5486
  if (controlDefinition.type === StepControlType.Dictionary) {
5477
5487
  const specificData = controlDefinition.specificControlData;
5478
5488
  const isRadio = specificData.showAsRadioButtonsList === true;
5479
- if (filledValueId !== null) {
5489
+ // Check for multi-select values first
5490
+ const fillValueIds = filledControlData.fillValueIds;
5491
+ if (specificData.allowMultipleSelection &&
5492
+ fillValueIds &&
5493
+ Array.isArray(fillValueIds) &&
5494
+ fillValueIds.length > 0) {
5495
+ const dictionary = dictionaryMap.get(specificData.dictionaryUUID);
5496
+ const mappedValues = [];
5497
+ for (const valueId of fillValueIds) {
5498
+ const numericId = typeof valueId === 'string'
5499
+ ? parseInt(valueId, 10)
5500
+ : valueId;
5501
+ const valueDto = dictionary?.values?.find((v) => v.id === numericId);
5502
+ if (valueDto) {
5503
+ const mapped = ModelPopulationHelper.mapDictionaryValueDto(valueDto, availableLanguages);
5504
+ if (mapped) {
5505
+ mappedValues.push(mapped);
5506
+ }
5507
+ }
5508
+ }
5509
+ if (mappedValues.length > 0) {
5510
+ valueFromFillData = mappedValues;
5511
+ }
5512
+ }
5513
+ else if (filledValueId !== null) {
5480
5514
  if (isRadio) {
5481
5515
  valueFromFillData = filledValueId;
5482
5516
  }
@@ -5511,8 +5545,9 @@ class ModelPopulationHelper {
5511
5545
  }
5512
5546
  }
5513
5547
  }
5514
- // Handle reference values
5548
+ // Handle reference values (only for single-select)
5515
5549
  if (valueFromFillData &&
5550
+ !Array.isArray(valueFromFillData) &&
5516
5551
  dictionaryMap.has(specificData.dictionaryUUID)) {
5517
5552
  const mainDictionary = dictionaryMap.get(specificData.dictionaryUUID);
5518
5553
  if (mainDictionary?.id) {
@@ -5596,6 +5631,93 @@ class ModelPopulationHelper {
5596
5631
  }
5597
5632
  }
5598
5633
  }
5634
+ // Fallback: apply inherited fields for controls not populated from flux
5635
+ if (fillData.inheritedFields) {
5636
+ for (const step of flux) {
5637
+ if (!step.sections)
5638
+ continue;
5639
+ for (const section of step.sections) {
5640
+ if (!section.controls)
5641
+ continue;
5642
+ for (const controlDef of section.controls) {
5643
+ const controlId = controlDef.identifier;
5644
+ if (!controlId || model[controlId] !== undefined)
5645
+ continue;
5646
+ const inheritedValue = fillData.inheritedFields[controlId];
5647
+ if (inheritedValue === undefined || inheritedValue === null)
5648
+ continue;
5649
+ if (controlDef.type === StepControlType.Dictionary) {
5650
+ const specificData = controlDef.specificControlData;
5651
+ const isRadio = specificData.showAsRadioButtonsList === true;
5652
+ // Enriched format: { fillValue, fillValueId, fillValueIds, dictionaryUUID }
5653
+ if (typeof inheritedValue === 'object' &&
5654
+ !Array.isArray(inheritedValue) &&
5655
+ inheritedValue.dictionaryUUID) {
5656
+ const dictionary = dictionaryMap.get(specificData.dictionaryUUID);
5657
+ // Multi-select
5658
+ if (specificData.allowMultipleSelection &&
5659
+ inheritedValue.fillValueIds &&
5660
+ Array.isArray(inheritedValue.fillValueIds) &&
5661
+ inheritedValue.fillValueIds.length > 0) {
5662
+ const mappedValues = [];
5663
+ for (const valueId of inheritedValue.fillValueIds) {
5664
+ const numericId = typeof valueId === 'string'
5665
+ ? parseInt(valueId, 10)
5666
+ : valueId;
5667
+ const valueDto = dictionary?.values?.find((v) => v.id === numericId);
5668
+ if (valueDto) {
5669
+ const mapped = ModelPopulationHelper.mapDictionaryValueDto(valueDto, availableLanguages);
5670
+ if (mapped) {
5671
+ mappedValues.push(mapped);
5672
+ }
5673
+ }
5674
+ }
5675
+ if (mappedValues.length > 0) {
5676
+ model[controlId] = mappedValues;
5677
+ }
5678
+ }
5679
+ else if (inheritedValue.fillValueId !== undefined && inheritedValue.fillValueId !== null) {
5680
+ // Single-select
5681
+ const parsedId = parseInt(String(inheritedValue.fillValueId), 10);
5682
+ if (!isNaN(parsedId)) {
5683
+ if (isRadio) {
5684
+ model[controlId] = parsedId;
5685
+ }
5686
+ else {
5687
+ const valueDto = dictionary?.values?.find((v) => v.id === parsedId);
5688
+ if (valueDto) {
5689
+ model[controlId] =
5690
+ ModelPopulationHelper.mapDictionaryValueDto(valueDto, availableLanguages);
5691
+ }
5692
+ }
5693
+ }
5694
+ }
5695
+ }
5696
+ else {
5697
+ // Backward compatible: simple value (old format)
5698
+ const parsedId = parseInt(String(inheritedValue), 10);
5699
+ if (!isNaN(parsedId)) {
5700
+ if (isRadio) {
5701
+ model[controlId] = parsedId;
5702
+ }
5703
+ else {
5704
+ const dictionary = dictionaryMap.get(specificData.dictionaryUUID);
5705
+ const valueDto = dictionary?.values?.find((v) => v.id === parsedId);
5706
+ if (valueDto) {
5707
+ model[controlId] =
5708
+ ModelPopulationHelper.mapDictionaryValueDto(valueDto, availableLanguages);
5709
+ }
5710
+ }
5711
+ }
5712
+ }
5713
+ }
5714
+ else {
5715
+ model[controlId] = inheritedValue;
5716
+ }
5717
+ }
5718
+ }
5719
+ }
5720
+ }
5599
5721
  // Apply precompletion for ManualInput controls
5600
5722
  ModelPopulationHelper.applyPrecompletionToModel(model, flux);
5601
5723
  return model;
@@ -7072,33 +7194,33 @@ class CollectorFormComponent {
7072
7194
  language: 'English',
7073
7195
  code: 'en',
7074
7196
  type: 'US',
7075
- icon: FLAG_ICONS.en,
7197
+ icon: FLAG_ICONS.en
7076
7198
  },
7077
7199
  {
7078
7200
  language: 'Romana',
7079
7201
  code: 'ro',
7080
- icon: FLAG_ICONS.ro,
7202
+ icon: FLAG_ICONS.ro
7081
7203
  },
7082
7204
  {
7083
7205
  language: 'Deutsch',
7084
7206
  code: 'de',
7085
- icon: FLAG_ICONS.de,
7207
+ icon: FLAG_ICONS.de
7086
7208
  },
7087
7209
  {
7088
7210
  language: 'Français',
7089
7211
  code: 'fr',
7090
- icon: FLAG_ICONS.fr,
7212
+ icon: FLAG_ICONS.fr
7091
7213
  },
7092
7214
  {
7093
7215
  language: 'Italiano',
7094
7216
  code: 'it',
7095
- icon: FLAG_ICONS.it,
7217
+ icon: FLAG_ICONS.it
7096
7218
  },
7097
7219
  {
7098
7220
  language: 'Español',
7099
7221
  code: 'es',
7100
- icon: FLAG_ICONS.es,
7101
- },
7222
+ icon: FLAG_ICONS.es
7223
+ }
7102
7224
  ];
7103
7225
  this._self = this;
7104
7226
  this.loadingMessage = null;
@@ -7371,7 +7493,7 @@ class CollectorFormComponent {
7371
7493
  .map((control) => ({
7372
7494
  controlId: control.controlId,
7373
7495
  fillValue: control.fillValue,
7374
- fillValueId: control.fillValueId,
7496
+ fillValueId: control.fillValueId
7375
7497
  }))))
7376
7498
  .reduce((dictionary, { controlId, fillValue, fillValueId }) => {
7377
7499
  if (fillValueId) {
@@ -7429,6 +7551,51 @@ class CollectorFormComponent {
7429
7551
  if (initFlowValues !== null && initFlowValues !== undefined) {
7430
7552
  addInitFlowValues(initFlowValues, []);
7431
7553
  }
7554
+ // Add inherited fields from parent app
7555
+ const inheritedFields = this.fillData?.inheritedFields;
7556
+ if (inheritedFields && typeof inheritedFields === 'object') {
7557
+ for (const [key, value] of Object.entries(inheritedFields)) {
7558
+ let resolvedValue;
7559
+ if (typeof value === 'object' &&
7560
+ value !== null &&
7561
+ !Array.isArray(value) &&
7562
+ value.dictionaryUUID) {
7563
+ // Enriched format: handle multi-select and single-select
7564
+ const enriched = value;
7565
+ const fillValueIds = enriched.fillValueIds;
7566
+ if (Array.isArray(fillValueIds) && fillValueIds.length > 0) {
7567
+ // Multi-select: look up each ID in dictionaryMap for translated display
7568
+ const currentLanguageId = this.getCurrentLanguageId();
7569
+ const displayValues = [];
7570
+ for (const valueId of fillValueIds) {
7571
+ const numericId = typeof valueId === 'string' ? parseInt(valueId, 10) : valueId;
7572
+ for (const [, dict] of this.dictionaryMap.entries()) {
7573
+ const dv = dict.values?.find((v) => v.id === numericId);
7574
+ if (dv) {
7575
+ const translation = dv.valueTranslations?.find((t) => t.languageId == currentLanguageId);
7576
+ displayValues.push(translation?.value || dv.name);
7577
+ break;
7578
+ }
7579
+ }
7580
+ }
7581
+ resolvedValue = displayValues.length > 0
7582
+ ? displayValues.join(', ')
7583
+ : (enriched.fillValue ?? String(value));
7584
+ }
7585
+ else {
7586
+ // Single-select
7587
+ resolvedValue = enriched.fillValue ?? String(value);
7588
+ }
7589
+ }
7590
+ else {
7591
+ resolvedValue = value;
7592
+ }
7593
+ controlIdsWithValues[`inherited_${key}`] = resolvedValue;
7594
+ if (controlIdsWithValues[key] === undefined) {
7595
+ controlIdsWithValues[key] = resolvedValue;
7596
+ }
7597
+ }
7598
+ }
7432
7599
  this.controlIdsWithValues = controlIdsWithValues;
7433
7600
  }
7434
7601
  getCurrentLanguageId() {
@@ -7447,7 +7614,7 @@ class CollectorFormComponent {
7447
7614
  showProgressBar: this.generalData.showProgressBar &&
7448
7615
  this.generalData.showAllSteps == false
7449
7616
  ? true
7450
- : false,
7617
+ : false
7451
7618
  };
7452
7619
  this.formlyAllSteps = await this.buildFormlyFieldGroupAsync();
7453
7620
  var hasDictionaryDependentSteps = this.formlyAllSteps.some((f) => f.props?.['dependentDictionary']?.isDictionaryDependent);
@@ -7474,7 +7641,7 @@ class CollectorFormComponent {
7474
7641
  display: this.display,
7475
7642
  designConfig: {
7476
7643
  buttonsVerticalPosition: this.appModel.design.buttonsVerticalPosition,
7477
- buttonsHorizontalPosition: this.appModel.design.buttonsHorizontalPosition,
7644
+ buttonsHorizontalPosition: this.appModel.design.buttonsHorizontalPosition
7478
7645
  },
7479
7646
  stepsSettings: this.stepsSettings,
7480
7647
  metaData: this.fillData?.metadata,
@@ -7487,10 +7654,10 @@ class CollectorFormComponent {
7487
7654
  hasActionSteps: this.flux.some((step) => this.actionStepHandler.isActionStep(step)), // Indicate if there are action steps
7488
7655
  completionEvent: () => this.onCompletion(),
7489
7656
  onSelectedPageChanging: (index) => this.onSelectedPageChanging(index),
7490
- onSelectedPageChanged: (index) => this.onSelectedPageChanged(index),
7657
+ onSelectedPageChanged: (index) => this.onSelectedPageChanged(index)
7491
7658
  },
7492
- fieldGroup: formlyFilteredSteps,
7493
- },
7659
+ fieldGroup: formlyFilteredSteps
7660
+ }
7494
7661
  ];
7495
7662
  // For display mode, populate values immediately after config is built
7496
7663
  if (this.showDisplayMode && this.formlyConfig[0]?.fieldGroup) {
@@ -7515,7 +7682,8 @@ class CollectorFormComponent {
7515
7682
  let actionsExecuted = false;
7516
7683
  if (toIndex > fromIndex) {
7517
7684
  console.log('➡️ Moving forward - executing action steps after current step');
7518
- actionsExecuted = await this.executeActionStepsAfterCurrentStep(fromIndex);
7685
+ actionsExecuted =
7686
+ await this.executeActionStepsAfterCurrentStep(fromIndex);
7519
7687
  }
7520
7688
  else if (toIndex < fromIndex) {
7521
7689
  console.log('⬅️ Moving backward - no action execution needed');
@@ -7637,11 +7805,15 @@ class CollectorFormComponent {
7637
7805
  // Multiple selection - show values with comma
7638
7806
  const valueIdsArray = found.fillValueIds || found.fillvalueids || found.FillValueIds;
7639
7807
  const valuesArray = found.fillValues || found.fillvalues || found.FillValues;
7640
- if (valueIdsArray && Array.isArray(valueIdsArray) && valueIdsArray.length > 0) {
7808
+ if (valueIdsArray &&
7809
+ Array.isArray(valueIdsArray) &&
7810
+ valueIdsArray.length > 0) {
7641
7811
  const currentLanguageId = this.getCurrentLanguageId();
7642
7812
  const displayValues = [];
7643
7813
  for (const valueId of valueIdsArray) {
7644
- const numericValueId = typeof valueId === 'string' ? parseInt(valueId, 10) : valueId;
7814
+ const numericValueId = typeof valueId === 'string'
7815
+ ? parseInt(valueId, 10)
7816
+ : valueId;
7645
7817
  for (const [key, dict] of this.dictionaryMap.entries()) {
7646
7818
  const value = dict.values?.find((v) => v.id === numericValueId);
7647
7819
  if (value) {
@@ -7655,7 +7827,9 @@ class CollectorFormComponent {
7655
7827
  fg.defaultValue = displayValues.join(', ');
7656
7828
  }
7657
7829
  }
7658
- else if (valuesArray && Array.isArray(valuesArray) && valuesArray.length > 0) {
7830
+ else if (valuesArray &&
7831
+ Array.isArray(valuesArray) &&
7832
+ valuesArray.length > 0) {
7659
7833
  // Fallback: use fillValues array directly
7660
7834
  fg.defaultValue = valuesArray.join(', ');
7661
7835
  }
@@ -7678,8 +7852,13 @@ class CollectorFormComponent {
7678
7852
  }
7679
7853
  else {
7680
7854
  // Check controlIdsWithValues for initFlowValues
7681
- const initFlowValue = this.controlIdsWithValues?.[associatedControlId];
7855
+ let initFlowValue = this.controlIdsWithValues?.[associatedControlId];
7682
7856
  if (initFlowValue !== undefined) {
7857
+ if (typeof initFlowValue === 'object' &&
7858
+ initFlowValue !== null &&
7859
+ initFlowValue.fillValue !== undefined) {
7860
+ initFlowValue = initFlowValue.fillValue;
7861
+ }
7683
7862
  fg.defaultValue = initFlowValue;
7684
7863
  }
7685
7864
  else {
@@ -7782,9 +7961,9 @@ class CollectorFormComponent {
7782
7961
  description: step.name,
7783
7962
  buttons: this.constructButtons(step.buttons),
7784
7963
  dependentDictionary: step.dependentDictionary,
7785
- stepId: step.identifier,
7964
+ stepId: step.identifier
7786
7965
  },
7787
- fieldGroup: await this.buildSectionsFieldGroupAsync(step, step.sections),
7966
+ fieldGroup: await this.buildSectionsFieldGroupAsync(step, step.sections)
7788
7967
  };
7789
7968
  if (step.translations) {
7790
7969
  stepFormlyConfig.props['label'] = Utils.findTranslationInfo('name', step.translations, this.currentLanguageIso);
@@ -7825,9 +8004,9 @@ class CollectorFormComponent {
7825
8004
  props: {
7826
8005
  label: step.name,
7827
8006
  buttons: this.constructButtons(step.buttons),
7828
- fluxType: step.type,
8007
+ fluxType: step.type
7829
8008
  },
7830
- fieldGroup: [],
8009
+ fieldGroup: []
7831
8010
  };
7832
8011
  this.setStepBaseProps(step, formlyConfig);
7833
8012
  var fieldConfig = this.createFormlySystemFieldConfig(step);
@@ -7872,8 +8051,8 @@ class CollectorFormComponent {
7872
8051
  if (event === 'success') {
7873
8052
  await this.stepperGoNextAsync();
7874
8053
  }
7875
- },
7876
- },
8054
+ }
8055
+ }
7877
8056
  };
7878
8057
  }
7879
8058
  CreateDownloadDocsFieldConfig(controlData) {
@@ -7885,8 +8064,8 @@ class CollectorFormComponent {
7885
8064
  controlData: controlData,
7886
8065
  env: this.env,
7887
8066
  documentsData: this.appModel.documents,
7888
- langIso: this.currentLanguageIso,
7889
- },
8067
+ langIso: this.currentLanguageIso
8068
+ }
7890
8069
  };
7891
8070
  }
7892
8071
  CreateViewDocsFieldConfig(controlData) {
@@ -7898,8 +8077,8 @@ class CollectorFormComponent {
7898
8077
  controlData: controlData,
7899
8078
  env: this.env,
7900
8079
  documentsData: this.appModel.documents,
7901
- langIso: this.currentLanguageIso,
7902
- },
8080
+ langIso: this.currentLanguageIso
8081
+ }
7903
8082
  };
7904
8083
  }
7905
8084
  CreateUploadDocsFieldConfig(controlData) {
@@ -7911,8 +8090,8 @@ class CollectorFormComponent {
7911
8090
  controlData: controlData,
7912
8091
  env: this.env,
7913
8092
  documentsData: this.appModel.documents,
7914
- langIso: this.currentLanguageIso,
7915
- },
8093
+ langIso: this.currentLanguageIso
8094
+ }
7916
8095
  };
7917
8096
  }
7918
8097
  CreateGenerateDocsFieldConfig(step) {
@@ -7928,8 +8107,8 @@ class CollectorFormComponent {
7928
8107
  if (event === 'success') {
7929
8108
  await this.stepperGoNextAsync();
7930
8109
  }
7931
- },
7932
- },
8110
+ }
8111
+ }
7933
8112
  };
7934
8113
  }
7935
8114
  async stepperGoNextAsync() {
@@ -7954,8 +8133,8 @@ class CollectorFormComponent {
7954
8133
  dataUrlId: this.dataUrlId,
7955
8134
  stepData: step,
7956
8135
  labels: labels,
7957
- langIso: this.currentLanguageIso,
7958
- },
8136
+ langIso: this.currentLanguageIso
8137
+ }
7959
8138
  };
7960
8139
  }
7961
8140
  CreateIdScanFieldConfig(step) {
@@ -7974,8 +8153,8 @@ class CollectorFormComponent {
7974
8153
  appDataId: this.appDataUuid || Utils.generateUUID(),
7975
8154
  appId: this.appModel.applicationUuid,
7976
8155
  errorMessages: errorMessages,
7977
- event: (event) => this.onIdScanCompleted(event, step),
7978
- },
8156
+ event: (event) => this.onIdScanCompleted(event, step)
8157
+ }
7979
8158
  };
7980
8159
  }
7981
8160
  CreateKycFieldConfig(step) {
@@ -7998,8 +8177,8 @@ class CollectorFormComponent {
7998
8177
  ectCompleted: async () => {
7999
8178
  this.loadingMessage = translatedLoadingMessage;
8000
8179
  await this.originFormSignalrHandlerService.initiateKycProcessing(this.appDataUuid);
8001
- },
8002
- },
8180
+ }
8181
+ }
8003
8182
  };
8004
8183
  }
8005
8184
  CreatePhoneEmailFieldConfig(step) {
@@ -8013,8 +8192,8 @@ class CollectorFormComponent {
8013
8192
  if (event === 'success') {
8014
8193
  await this.stepperGoNextAsync();
8015
8194
  }
8016
- },
8017
- },
8195
+ }
8196
+ }
8018
8197
  };
8019
8198
  }
8020
8199
  CreateViewOfferFieldConfig(step) {
@@ -8026,8 +8205,8 @@ class CollectorFormComponent {
8026
8205
  env: this.env,
8027
8206
  appModel: this.appModel,
8028
8207
  langIso: this.currentLanguageIso,
8029
- event: (event) => this.onOfferSelected(event, step),
8030
- },
8208
+ event: (event) => this.onOfferSelected(event, step)
8209
+ }
8031
8210
  };
8032
8211
  }
8033
8212
  CreatePauseFieldConfig(step) {
@@ -8040,8 +8219,8 @@ class CollectorFormComponent {
8040
8219
  stepData: step,
8041
8220
  env: this.env,
8042
8221
  appModel: this.appModel,
8043
- langIso: this.currentLanguageIso,
8044
- },
8222
+ langIso: this.currentLanguageIso
8223
+ }
8045
8224
  };
8046
8225
  }
8047
8226
  CreateOpenBankingFieldConfig(step) {
@@ -8062,10 +8241,10 @@ class CollectorFormComponent {
8062
8241
  waitingMessage: Utils.findTranslation(step.config?.waitingMessageTranslations || [], this.currentLanguageIso),
8063
8242
  consentErrorMessage: Utils.findTranslation(step.config?.consentErrorMessageTranslations || [], this.currentLanguageIso),
8064
8243
  completionMessage: Utils.findTranslation(step.config?.completionMessageTranslations || [], this.currentLanguageIso),
8065
- retryButtonLabel: Utils.findTranslation(step.config?.retryButtonLabelTranslations || [], this.currentLanguageIso),
8244
+ retryButtonLabel: Utils.findTranslation(step.config?.retryButtonLabelTranslations || [], this.currentLanguageIso)
8066
8245
  },
8067
- event: (event) => this.onOpenBankingEvent(event, step),
8068
- },
8246
+ event: (event) => this.onOpenBankingEvent(event, step)
8247
+ }
8069
8248
  };
8070
8249
  }
8071
8250
  CreateStatusFieldConfig(step) {
@@ -8075,8 +8254,8 @@ class CollectorFormComponent {
8075
8254
  config: step.config,
8076
8255
  stepData: step,
8077
8256
  appDataId: this.appDataUuid,
8078
- appId: this.appModel.applicationUuid,
8079
- },
8257
+ appId: this.appModel.applicationUuid
8258
+ }
8080
8259
  };
8081
8260
  }
8082
8261
  createFormlySystemFieldConfig(step) {
@@ -8150,8 +8329,8 @@ class CollectorFormComponent {
8150
8329
  if (c.controlId) {
8151
8330
  const value = {
8152
8331
  [c.controlId]: {
8153
- value: c.fillValue,
8154
- },
8332
+ value: c.fillValue
8333
+ }
8155
8334
  };
8156
8335
  if (this.form.contains(c.controlId)) {
8157
8336
  this.form.patchValue(value);
@@ -8172,7 +8351,7 @@ class CollectorFormComponent {
8172
8351
  if (formlyStepField) {
8173
8352
  formlyStepField.props = {
8174
8353
  ...formlyStepField.props,
8175
- buttonsDisabled: false,
8354
+ buttonsDisabled: false
8176
8355
  };
8177
8356
  this.updateFormlyConfig();
8178
8357
  this.formlyConfigUpdated.emit();
@@ -8199,8 +8378,8 @@ class CollectorFormComponent {
8199
8378
  type: 'separator',
8200
8379
  props: {
8201
8380
  title: section.translations?.find((t) => t.languageIso === this.currentLanguageIso)?.value ?? '',
8202
- design: this.design,
8203
- },
8381
+ design: this.design
8382
+ }
8204
8383
  };
8205
8384
  }
8206
8385
  if (section.showSectionSeparator) {
@@ -8209,8 +8388,8 @@ class CollectorFormComponent {
8209
8388
  type: 'separator',
8210
8389
  props: {
8211
8390
  ...separatorFormlyConfig.props,
8212
- showSeparator: section.showSectionSeparator,
8213
- },
8391
+ showSeparator: section.showSectionSeparator
8392
+ }
8214
8393
  };
8215
8394
  }
8216
8395
  if (section.dependentDictionary) {
@@ -8222,10 +8401,10 @@ class CollectorFormComponent {
8222
8401
  props: {
8223
8402
  label: section.title,
8224
8403
  description: section.translations?.find((t) => t.languageIso === this.currentLanguageIso)?.value ?? '',
8225
- design: this.design,
8404
+ design: this.design
8226
8405
  },
8227
8406
  fieldGroup: await this.buildControlsFieldGroupAsync(step, section.controls || [], section.presentationControls || []),
8228
- fieldGroupClassName: 'display-flex',
8407
+ fieldGroupClassName: 'display-flex'
8229
8408
  };
8230
8409
  if (section.dependentDictionary) {
8231
8410
  this.attachToDependentDictionaryIfNecessary(section.dependentDictionary, sectionFormlyConfig);
@@ -8243,7 +8422,7 @@ class CollectorFormComponent {
8243
8422
  // buttons: this.constructButtons(step.buttons),
8244
8423
  // dependentDictionary: step.dependentDictionary,
8245
8424
  },
8246
- fieldGroup: await this.buildSectionsFieldGroupAsync(undefined, this.display.sections),
8425
+ fieldGroup: await this.buildSectionsFieldGroupAsync(undefined, this.display.sections)
8247
8426
  };
8248
8427
  }
8249
8428
  return stepFormlyConfig;
@@ -8284,8 +8463,8 @@ class CollectorFormComponent {
8284
8463
  props: {
8285
8464
  label: '',
8286
8465
  disabled: true,
8287
- hide: true,
8288
- },
8466
+ hide: true
8467
+ }
8289
8468
  };
8290
8469
  }
8291
8470
  async buildControlsFieldGroupAsync(step, controls, presentationControls) {
@@ -8409,7 +8588,7 @@ class CollectorFormComponent {
8409
8588
  '.component-checkbox',
8410
8589
  '.component-radio',
8411
8590
  '.component-date',
8412
- '.component-data',
8591
+ '.component-data'
8413
8592
  ];
8414
8593
  let formlyConfig = this.getDefaultFormlyFieldConfig(control, initialType, pattern, componentStyleKey, componentsToExcludeFromStyle);
8415
8594
  //control.specificControlData.type === 3 is email
@@ -8440,7 +8619,7 @@ class CollectorFormComponent {
8440
8619
  case ManualInputControlType.DateTime:
8441
8620
  formlyConfig.type = 'datepicker';
8442
8621
  formlyConfig.props = {
8443
- readonly: true,
8622
+ readonly: true
8444
8623
  };
8445
8624
  componentStyleKey = '.component-date';
8446
8625
  break;
@@ -8535,40 +8714,40 @@ class CollectorFormComponent {
8535
8714
  }
8536
8715
  return true;
8537
8716
  },
8538
- message: emailErrorLabelValue,
8539
- },
8717
+ message: emailErrorLabelValue
8718
+ }
8540
8719
  };
8541
8720
  }
8542
8721
  addApiValidators(formlyConfig, control) {
8543
- formlyConfig.asyncValidators = {
8722
+ const throughApiValidation = Utils.findErrorTranslationValueOrDefault(control.errorsTranslations, this.currentLanguageIso, 'throughApiValidation');
8723
+ formlyConfig.validators = {
8544
8724
  validateThroughApi: {
8545
- expression: (cont) => {
8546
- return (cont.valueChanges.pipe(debounceTime(500), switchMap$1(() => {
8547
- const apiValidationMethod = control.specificControlData.apiValidationMethod;
8548
- const bodyValue = this.appModel.partners
8549
- .flatMap((p) => p.partnerSettings.partnerMethodsApi)
8550
- .find((p) => p.methodId === apiValidationMethod)
8551
- ?.bodyConfiguration.bodyMapFields;
8552
- const fieldMap = bodyValue?.reduce((acc, f) => {
8553
- if (f.fluxFieldId === control.identifier) {
8554
- acc[f.partnerField] = cont.value || '';
8555
- }
8556
- else {
8557
- acc[f.partnerField] = '';
8558
- }
8559
- return acc;
8560
- }, {}) || {};
8561
- const dataRequest = {
8562
- appId: this.appModel.applicationId,
8563
- apiId: apiValidationMethod,
8564
- data: JSON.stringify(fieldMap),
8565
- };
8566
- return this.validateMethodApi(dataRequest).pipe(catchError(() => of(false)));
8567
- })) || 'ssssssssssssssss');
8725
+ expression: async (cont) => {
8726
+ if (!cont.value) {
8727
+ return of(null);
8728
+ }
8729
+ const apiValidationMethod = control.specificControlData.apiValidationMethod;
8730
+ const dataRequest = {
8731
+ appDataId: this.appDataUuid,
8732
+ apiMethodId: apiValidationMethod,
8733
+ controlIdentifier: control.identifier
8734
+ };
8735
+ var response = await this.validateMethodApi(dataRequest);
8736
+ if (response === false) {
8737
+ cont.setErrors({ validateThroughApi: true });
8738
+ return false;
8739
+ }
8740
+ return true;
8568
8741
  },
8569
- message: 'Validation failed.',
8570
- },
8742
+ message: throughApiValidation
8743
+ }
8571
8744
  };
8745
+ if (formlyConfig.validation) {
8746
+ formlyConfig.validation.messages = {
8747
+ ...formlyConfig.validation.messages,
8748
+ validateThroughApi: throughApiValidation
8749
+ };
8750
+ }
8572
8751
  }
8573
8752
  getDefaultFormlyFieldConfig(control, type, pattern, componentStyleKey, componentsToExcludeFromStyle) {
8574
8753
  const currentLanguageId = Utils.findLanguageIdByIso(this.availableLanguages, this.currentLanguageIso);
@@ -8585,16 +8764,16 @@ class CollectorFormComponent {
8585
8764
  attributes: {
8586
8765
  style: componentsToExcludeFromStyle.find((c) => c === componentStyleKey)
8587
8766
  ? ''
8588
- : componentStyleKey,
8767
+ : componentStyleKey
8589
8768
  },
8590
8769
  autosize: true,
8591
8770
  options: [{}],
8592
8771
  fieldGroup: [],
8593
- autoDimension: control.autoDimension,
8772
+ autoDimension: control.autoDimension
8594
8773
  },
8595
8774
  expressions: {},
8596
8775
  hooks: {},
8597
- validators: {},
8776
+ validators: {}
8598
8777
  };
8599
8778
  formlyConfig.validation = {};
8600
8779
  if (control.specificControlData?.isMandatory && formlyConfig.props) {
@@ -8602,7 +8781,7 @@ class CollectorFormComponent {
8602
8781
  formlyConfig.props.required = control.specificControlData?.isMandatory;
8603
8782
  formlyConfig.validation.messages = {
8604
8783
  ...formlyConfig.validation?.messages,
8605
- required: requiredMessage,
8784
+ required: requiredMessage
8606
8785
  };
8607
8786
  }
8608
8787
  if (control.type === StepControlType.Dictionary &&
@@ -8613,7 +8792,7 @@ class CollectorFormComponent {
8613
8792
  formlyConfig.props.required = control.specificControlData?.isMandatory;
8614
8793
  formlyConfig.validation.messages = {
8615
8794
  ...formlyConfig.validation?.messages,
8616
- required: requiredMessage,
8795
+ required: requiredMessage
8617
8796
  };
8618
8797
  }
8619
8798
  let simpleValidationMessage = '';
@@ -8625,14 +8804,14 @@ class CollectorFormComponent {
8625
8804
  formlyConfig.props.min = control.specificControlData.minValue;
8626
8805
  formlyConfig.validation.messages = {
8627
8806
  ...formlyConfig.validation?.messages,
8628
- min: simpleValidationMessage,
8807
+ min: simpleValidationMessage
8629
8808
  };
8630
8809
  }
8631
8810
  if (control.specificControlData?.maxValue?.toString()) {
8632
8811
  formlyConfig.props.max = control.specificControlData.maxValue;
8633
8812
  formlyConfig.validation.messages = {
8634
8813
  ...formlyConfig.validation?.messages,
8635
- max: simpleValidationMessage,
8814
+ max: simpleValidationMessage
8636
8815
  };
8637
8816
  }
8638
8817
  }
@@ -8655,12 +8834,12 @@ class CollectorFormComponent {
8655
8834
  }
8656
8835
  },
8657
8836
  message: simpleValidationMessage ||
8658
- 'Value does not match the required pattern',
8659
- },
8837
+ 'Value does not match the required pattern'
8838
+ }
8660
8839
  };
8661
8840
  formlyConfig.validation.messages = {
8662
8841
  ...formlyConfig.validation?.messages,
8663
- pattern: simpleValidationMessage,
8842
+ pattern: simpleValidationMessage
8664
8843
  };
8665
8844
  }
8666
8845
  // Apply maxLength validation if maxCharacters is defined
@@ -8669,7 +8848,7 @@ class CollectorFormComponent {
8669
8848
  control.specificControlData?.maxCharacters;
8670
8849
  formlyConfig.validation.messages = {
8671
8850
  ...formlyConfig.validation?.messages,
8672
- maxLength: simpleValidationMessage,
8851
+ maxLength: simpleValidationMessage
8673
8852
  };
8674
8853
  }
8675
8854
  if (control.specificControlData?.allowOnlyFuture ||
@@ -8696,12 +8875,12 @@ class CollectorFormComponent {
8696
8875
  },
8697
8876
  message: (error, field) => {
8698
8877
  return simpleValidationMessage;
8699
- },
8700
- },
8878
+ }
8879
+ }
8701
8880
  };
8702
8881
  formlyConfig.validators = {
8703
8882
  ...formlyConfig.validators,
8704
- ...checkDateValidation,
8883
+ ...checkDateValidation
8705
8884
  };
8706
8885
  }
8707
8886
  }
@@ -8724,8 +8903,8 @@ class CollectorFormComponent {
8724
8903
  }
8725
8904
  return true;
8726
8905
  },
8727
- message: phoneErrorLabelValue,
8728
- },
8906
+ message: phoneErrorLabelValue
8907
+ }
8729
8908
  };
8730
8909
  }
8731
8910
  if (control.specificControlData?.type === 2) {
@@ -8747,12 +8926,12 @@ class CollectorFormComponent {
8747
8926
  if (simpleValidationMessage === '')
8748
8927
  return 'Please enter a valid date';
8749
8928
  return simpleValidationMessage;
8750
- },
8751
- },
8929
+ }
8930
+ }
8752
8931
  };
8753
8932
  formlyConfig.validators = {
8754
8933
  ...formlyConfig.validators,
8755
- ...checkDate2Validation,
8934
+ ...checkDate2Validation
8756
8935
  };
8757
8936
  }
8758
8937
  return formlyConfig;
@@ -8799,14 +8978,21 @@ class CollectorFormComponent {
8799
8978
  case 'boolean':
8800
8979
  formlyConfig.defaultValue = fillValue ? '&check;' : '&cross;';
8801
8980
  break;
8802
- default:
8803
- if (fillValue?.name) {
8981
+ case 'object':
8982
+ // Enriched inherited dictionary format: extract fillValue for display
8983
+ if (fillValue.fillValue !== undefined) {
8984
+ formlyConfig.defaultValue = fillValue.fillValue;
8985
+ }
8986
+ else if (fillValue.name) {
8804
8987
  formlyConfig.defaultValue = fillValue.name;
8805
8988
  }
8806
8989
  else {
8807
- formlyConfig.defaultValue = fillValue;
8990
+ formlyConfig.defaultValue = JSON.stringify(fillValue);
8808
8991
  }
8809
8992
  break;
8993
+ default:
8994
+ formlyConfig.defaultValue = fillValue;
8995
+ break;
8810
8996
  }
8811
8997
  }
8812
8998
  }
@@ -8856,7 +9042,7 @@ class CollectorFormComponent {
8856
9042
  hide: (field) => {
8857
9043
  const shouldShow = this.shouldShowDependentField(parentKey, dependentValueIds, this.model);
8858
9044
  return !shouldShow;
8859
- },
9045
+ }
8860
9046
  };
8861
9047
  }
8862
9048
  }
@@ -8883,7 +9069,7 @@ class CollectorFormComponent {
8883
9069
  if (filteredValues.length > 0) {
8884
9070
  const newDictionary = {
8885
9071
  ...dictionary,
8886
- values: filteredValues,
9072
+ values: filteredValues
8887
9073
  };
8888
9074
  newDictionaries.push(newDictionary);
8889
9075
  }
@@ -9063,7 +9249,7 @@ class CollectorFormComponent {
9063
9249
  value: value,
9064
9250
  label: Utils.findValueTranslation(value.valueTranslations, currentLanguageId) || value.name,
9065
9251
  currentLanguageIso: this.currentLanguageIso,
9066
- relatedDictionariesTranslations: dictionaryControlData.relatedDictionariesTranslations,
9252
+ relatedDictionariesTranslations: dictionaryControlData.relatedDictionariesTranslations
9067
9253
  }));
9068
9254
  options.props['selectedRelatedDictionaries'] =
9069
9255
  dictionaryControlData.selectedRelatedDictionaries || [];
@@ -9134,14 +9320,14 @@ class CollectorFormComponent {
9134
9320
  currentLanguageId: currentLanguageId,
9135
9321
  required: true,
9136
9322
  attributes: {
9137
- style: this.styleObjectToStringExceptBackground(this.design[`.font-list`] || {}),
9323
+ style: this.styleObjectToStringExceptBackground(this.design[`.font-list`] || {})
9138
9324
  },
9139
9325
  options: referenceDictionary.values?.map((value) => ({
9140
9326
  value: value,
9141
9327
  label: Utils.findValueTranslation(value.valueTranslations, currentLanguageId) || value.name,
9142
- currentLanguageIso: this.currentLanguageIso,
9143
- })),
9144
- },
9328
+ currentLanguageIso: this.currentLanguageIso
9329
+ }))
9330
+ }
9145
9331
  };
9146
9332
  if (referenceDictionary.defaultValueId) {
9147
9333
  const defaultVal = this.findAndMapDefaultValue(referenceDictionary, referenceDictionary.defaultValueId);
@@ -9157,9 +9343,10 @@ class CollectorFormComponent {
9157
9343
  if (parentIndex !== -1) {
9158
9344
  const endIndex = this.findLastChildIndex(parentFieldGroup, parentIndex);
9159
9345
  const percentageToAdd = this.getExistingPercentage(parentFieldGroup, parentIndex);
9160
- newField.className = percentageToAdd === 0
9161
- ? parentDictionaryField.className
9162
- : this.getPercentageClassName(percentageToAdd);
9346
+ newField.className =
9347
+ percentageToAdd === 0
9348
+ ? parentDictionaryField.className
9349
+ : this.getPercentageClassName(percentageToAdd);
9163
9350
  parentFieldGroup.splice(endIndex + 1, 0, newField);
9164
9351
  const classNameToAdd = type === 'radio' ? ` component-radio` : ` component-data`;
9165
9352
  newField.className += classNameToAdd;
@@ -9240,12 +9427,12 @@ class CollectorFormComponent {
9240
9427
  preloadedDictionaries: this.dictionaryMap,
9241
9428
  options: childDictionary.values?.map((value) => ({
9242
9429
  value: value.id,
9243
- label: value.name,
9430
+ label: value.name
9244
9431
  })),
9245
9432
  required: true,
9246
9433
  attributes: {
9247
- style: this.styleObjectToStringExceptBackground(this.design[`.font-list`] || {}),
9248
- },
9434
+ style: this.styleObjectToStringExceptBackground(this.design[`.font-list`] || {})
9435
+ }
9249
9436
  },
9250
9437
  hooks: {
9251
9438
  onInit: (field) => {
@@ -9267,8 +9454,8 @@ class CollectorFormComponent {
9267
9454
  unsubscribe$.next();
9268
9455
  unsubscribe$.complete();
9269
9456
  };
9270
- },
9271
- },
9457
+ }
9458
+ }
9272
9459
  };
9273
9460
  const parentFieldGroup = parentDictionaryField.parent
9274
9461
  ? parentDictionaryField.parent.fieldGroup
@@ -9440,7 +9627,7 @@ class CollectorFormComponent {
9440
9627
  return buttonsConfig.map((button) => ({
9441
9628
  type: button.value.toLowerCase(),
9442
9629
  label: button.translations?.[this.currentLanguageIso] || button.value,
9443
- styleKey: `.button-${button.value.toLowerCase()}`,
9630
+ styleKey: `.button-${button.value.toLowerCase()}`
9444
9631
  }));
9445
9632
  }
9446
9633
  styleObjectToStringExceptBackground(styleObj) {
@@ -9449,17 +9636,16 @@ class CollectorFormComponent {
9449
9636
  .map(([key, value]) => `${key}: ${value}`)
9450
9637
  .join('; ');
9451
9638
  }
9452
- validateMethodApi(data) {
9453
- if (data.apiId === undefined || data.appId === undefined) {
9454
- return of(false);
9639
+ async validateMethodApi(data) {
9640
+ if (data.apiMethodId === undefined) {
9641
+ return false;
9455
9642
  }
9456
- return this.applicationDataService.validateApi(data).pipe(map((response) => {
9457
- console.log('API validation response:', response);
9458
- return !!response;
9643
+ var apiResponse = from(this.applicationDataService.validateApi(data)).pipe(map((obs) => {
9644
+ return !!obs;
9459
9645
  }), catchError((error) => {
9460
- console.error('Error validating ' + data.data, error);
9461
9646
  return of(false);
9462
9647
  }));
9648
+ return firstValueFrom(apiResponse);
9463
9649
  }
9464
9650
  /**
9465
9651
  * Public method to clear the saving after actions state
@@ -10418,7 +10604,21 @@ class FormlyParagraphComponent extends BaseFormlyStepComponent {
10418
10604
  };
10419
10605
  }
10420
10606
  get formattedLabel() {
10421
- return this.formatDateIfNeeded(this.field.defaultValue).toString();
10607
+ return this.normalizeValue(this.field.defaultValue);
10608
+ }
10609
+ normalizeValue(value) {
10610
+ if (value == null)
10611
+ return '';
10612
+ if (Array.isArray(value)) {
10613
+ return value
10614
+ .map(v => this.normalizeValue(v))
10615
+ .filter(Boolean)
10616
+ .join(', ');
10617
+ }
10618
+ if (typeof value === 'object') {
10619
+ return String(value.fillValue ?? value.value ?? value.name ?? value.label ?? '');
10620
+ }
10621
+ return this.formatDateIfNeeded(value);
10422
10622
  }
10423
10623
  formatDateIfNeeded(value) {
10424
10624
  if (!value)