@cqa-lib/cqa-ui 1.1.312 → 1.1.313

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.
@@ -21765,6 +21765,9 @@ class TestCaseDetailsRendererComponent {
21765
21765
  /** Update only data profile / options inputs on existing instance (avoids full recreate and losing isEditing). */
21766
21766
  updateOptionsInputs(instance) {
21767
21767
  if (isLoopStepConfig(this.step) || isConditionStepConfig(this.step) || isStepGroupConfig(this.step)) {
21768
+ const prevOptions = instance.dataProfileOptions;
21769
+ const prevHasMore = instance.hasMoreDataProfiles;
21770
+ const prevLoading = instance.isLoadingDataProfiles;
21768
21771
  instance.dataProfileOptions = this.dataProfileOptions;
21769
21772
  instance.hasMoreDataProfiles = this.hasMoreDataProfiles;
21770
21773
  instance.isLoadingDataProfiles = this.isLoadingDataProfiles;
@@ -21772,6 +21775,16 @@ class TestCaseDetailsRendererComponent {
21772
21775
  instance.addStepBetweenAbove = this.addStepBetweenAbove;
21773
21776
  instance.addStepBetweenBelow = this.addStepBetweenBelow;
21774
21777
  instance.addStepBetween = this.addStepBetween;
21778
+ // Trigger ngOnChanges so the step updates its Test Data profile select config (search/load more options).
21779
+ // Dynamically created components do not get @Input() change detection from the template.
21780
+ if (typeof instance.ngOnChanges === 'function') {
21781
+ const changes = {
21782
+ dataProfileOptions: new SimpleChange(prevOptions, this.dataProfileOptions, false),
21783
+ hasMoreDataProfiles: new SimpleChange(prevHasMore, this.hasMoreDataProfiles, false),
21784
+ isLoadingDataProfiles: new SimpleChange(prevLoading, this.isLoadingDataProfiles, false),
21785
+ };
21786
+ instance.ngOnChanges(changes);
21787
+ }
21775
21788
  }
21776
21789
  if (isLoopStepConfig(this.step)) {
21777
21790
  instance.naturalTextActionsOptions = this.naturalTextActionsOptions;
@@ -22611,7 +22624,7 @@ class TestCaseLoopStepComponent {
22611
22624
  const idStr = String(forLoopTestDataId);
22612
22625
  const alreadyInList = options.some((o) => String(o.id ?? o.value) === idStr);
22613
22626
  if (!alreadyInList) {
22614
- const displayName = this.testDataProfile || 'Selected profile';
22627
+ const displayName = this.resolveTestDataProfileName(forLoopTestDataId) || this.resolveTestDataProfileName(this.testDataProfile) || 'Selected profile';
22615
22628
  options = [{ id: forLoopTestDataId, value: forLoopTestDataId, name: displayName, label: displayName }, ...options];
22616
22629
  }
22617
22630
  }
@@ -22669,6 +22682,15 @@ class TestCaseLoopStepComponent {
22669
22682
  label: option.name
22670
22683
  }));
22671
22684
  }
22685
+ /** Resolve a data profile id/value back to the display name used by the dropdown trigger. */
22686
+ resolveTestDataProfileName(value) {
22687
+ if (value == null || value === '')
22688
+ return '';
22689
+ const match = this.dataProfileOptions.find(option => option.id === value || String(option.id) === String(value) || option.name === value);
22690
+ if (match?.name)
22691
+ return match.name;
22692
+ return typeof value === 'string' ? value : String(value);
22693
+ }
22672
22694
  /** Data length (N) of the currently selected test data profile; 0 if none selected or not found. */
22673
22695
  getSelectedProfileDataLength() {
22674
22696
  const profileId = this.editForm?.get('testDataProfile')?.value ?? this.config?.forLoopTestDataId ?? this.config?.dataMapJson?.forLoopTestDataId ?? this.config?.dataMapBean?.for_loop?.testDataId;
@@ -22971,8 +22993,9 @@ class TestCaseLoopStepComponent {
22971
22993
  this.toggleExpanded.emit({ config: this.config, expanded: this.expanded });
22972
22994
  }
22973
22995
  onTestDataProfileChange(value) {
22974
- this.testDataProfile = value;
22975
- this.testDataProfileChange.emit(value);
22996
+ const displayName = this.resolveTestDataProfileName(value);
22997
+ this.testDataProfile = displayName;
22998
+ this.testDataProfileChange.emit(displayName);
22976
22999
  }
22977
23000
  onStartStepChange(value) {
22978
23001
  this.startStep = value;