@cqa-lib/cqa-ui 1.1.342 → 1.1.343

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.
@@ -31030,7 +31030,7 @@ class TemplateVariablesFormComponent {
31030
31030
  // Get unique test data profiles
31031
31031
  const profiles = this.getUniqueTestDataProfiles();
31032
31032
  // Create options with profile name and ID (display name with ID)
31033
- const optionsArray = profiles.map(profile => {
31033
+ let optionsArray = profiles.map(profile => {
31034
31034
  // Find the test data profile to get the ID
31035
31035
  const testDataProfile = this.parameterOptions.find((testData) => {
31036
31036
  const name = testData.name || testData.testDataName;
@@ -31081,9 +31081,26 @@ class TemplateVariablesFormComponent {
31081
31081
  }
31082
31082
  }
31083
31083
  }
31084
- // Check cache after ensuring form control is set
31084
+ // Ensure the currently selected profile is always in the options list so when the user
31085
+ // reopens the select after searching/selecting, the selected option still shows.
31086
+ const currentFormValue = variableGroup?.get('selectedTestDataProfile')?.value;
31087
+ const selectedId = variable.selectedTestDataProfileId != null ? String(variable.selectedTestDataProfileId) : (currentFormValue != null && currentFormValue !== '' ? String(currentFormValue) : null);
31088
+ if (selectedId && !optionsArray.some(opt => String(opt.id) === selectedId)) {
31089
+ const displayName = variable.selectedTestDataProfile || selectedId;
31090
+ optionsArray = [
31091
+ { id: selectedId, value: displayName, name: displayName, label: displayName },
31092
+ ...optionsArray
31093
+ ];
31094
+ }
31095
+ // Only use cache if the cached config's options include the current selection (so reopening shows selected)
31085
31096
  if (this.testDataProfileSelectConfigCache.has(cacheKey)) {
31086
- return this.testDataProfileSelectConfigCache.get(cacheKey);
31097
+ const cached = this.testDataProfileSelectConfigCache.get(cacheKey);
31098
+ const controlVal = variableGroup?.get('selectedTestDataProfile')?.value;
31099
+ const selectedInCached = controlVal == null || controlVal === '' || (cached.options || []).some((o) => String(o.id) === String(controlVal) || o.value === controlVal);
31100
+ if (selectedInCached) {
31101
+ return cached;
31102
+ }
31103
+ this.testDataProfileSelectConfigCache.delete(cacheKey);
31087
31104
  }
31088
31105
  // Check if default values are set - if so, disable the dropdown
31089
31106
  const isDisabled = this.hasDefaultTestDataSelection();
@@ -32536,7 +32553,7 @@ class StepBuilderActionComponent {
32536
32553
  metadata: this.metadata,
32537
32554
  description: this.description,
32538
32555
  templateVariables: currentTemplateVariables,
32539
- testDataList: this.buildTestDataList(currentTemplateVariables),
32556
+ // testDataList: this.buildTestDataList(currentTemplateVariables),
32540
32557
  advancedSettingsVariables: this.advancedSettingsVariables,
32541
32558
  environmentIds: environmentIds // Map of variable name to environment ID
32542
32559
  };
@@ -32576,23 +32593,27 @@ class StepBuilderActionComponent {
32576
32593
  return {
32577
32594
  testData: rawValue,
32578
32595
  testDataType: 'parameter',
32596
+ testDataKey: variable.name,
32579
32597
  ...(selectedTestDataProfileId != null && { testDataProfileId: selectedTestDataProfileId }),
32580
32598
  };
32581
32599
  }
32582
32600
  if (dataType === 'runtime') {
32583
32601
  return {
32584
32602
  testData: rawValue,
32603
+ testDataKey: variable.name,
32585
32604
  testDataType: 'runtime',
32586
32605
  };
32587
32606
  }
32588
32607
  if (dataType === 'environment') {
32589
32608
  return {
32590
32609
  testData: rawValue,
32610
+ testDataKey: variable.name,
32591
32611
  testDataType: 'environment',
32592
32612
  };
32593
32613
  }
32594
32614
  return {
32595
32615
  testData: formattedValue,
32616
+ testDataKey: variable.name,
32596
32617
  testDataType: 'raw',
32597
32618
  };
32598
32619
  }