@cqa-lib/cqa-ui 1.1.315 → 1.1.316
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.
- package/esm2020/lib/test-case-details/loop-step/loop-step.component.mjs +49 -27
- package/fesm2015/cqa-lib-cqa-ui.mjs +61 -38
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +48 -26
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/test-case-details/loop-step/loop-step.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -22284,7 +22284,7 @@ class TestCaseLoopStepComponent {
|
|
|
22284
22284
|
this.stepNumber = this.config.stepNumber;
|
|
22285
22285
|
this.condition = this.config.condition;
|
|
22286
22286
|
this.maxIterations = this.config.maxIterations;
|
|
22287
|
-
this.testDataProfile = this.
|
|
22287
|
+
this.testDataProfile = this.getStoredTestDataProfileLabel();
|
|
22288
22288
|
this.startStep = this.config.startStep;
|
|
22289
22289
|
this.endStep = this.config.endStep;
|
|
22290
22290
|
this.nestedSteps = this.config.nestedSteps || [];
|
|
@@ -22297,6 +22297,7 @@ class TestCaseLoopStepComponent {
|
|
|
22297
22297
|
ngOnChanges(changes) {
|
|
22298
22298
|
if (changes['config'] && this.config) {
|
|
22299
22299
|
this.selected = this.config.selected || false;
|
|
22300
|
+
this.testDataProfile = this.getStoredTestDataProfileLabel();
|
|
22300
22301
|
if (this.loopType === 'while') {
|
|
22301
22302
|
this.rebuildWhileConditionFromNaturalTextAction();
|
|
22302
22303
|
}
|
|
@@ -22343,6 +22344,10 @@ class TestCaseLoopStepComponent {
|
|
|
22343
22344
|
}
|
|
22344
22345
|
/** Test Data Profile dropdown value: prefer forLoopTestDataId from config (or dataMapJson/dataMapBean). Use option.id when options loaded so type matches select. */
|
|
22345
22346
|
getTestDataProfileFormValue() {
|
|
22347
|
+
const currentFormValue = this.editForm?.get('testDataProfile')?.value;
|
|
22348
|
+
if (currentFormValue !== null && currentFormValue !== undefined && currentFormValue !== '') {
|
|
22349
|
+
return currentFormValue;
|
|
22350
|
+
}
|
|
22346
22351
|
const cfg = this.config;
|
|
22347
22352
|
const idFromConfig = cfg?.forLoopTestDataId ?? cfg?.dataMapJson?.forLoopTestDataId ?? cfg?.dataMapBean?.for_loop?.testDataId;
|
|
22348
22353
|
// When we have options, resolve by id so form value matches option.id (strict equality in dynamic-select)
|
|
@@ -22367,6 +22372,9 @@ class TestCaseLoopStepComponent {
|
|
|
22367
22372
|
}
|
|
22368
22373
|
/** Loop Start dropdown value: prefer forLoopStartIndex from config (or dataMapJson/dataMapBean), else startStep */
|
|
22369
22374
|
getLoopStartFormValue() {
|
|
22375
|
+
const currentFormValue = this.editForm?.get('startStep')?.value;
|
|
22376
|
+
if (currentFormValue !== null && currentFormValue !== undefined)
|
|
22377
|
+
return Number(currentFormValue);
|
|
22370
22378
|
const cfg = this.config;
|
|
22371
22379
|
const v = cfg?.forLoopStartIndex ?? cfg?.dataMapJson?.forLoopStartIndex ?? cfg?.dataMapBean?.for_loop?.startIndex;
|
|
22372
22380
|
if (v != null)
|
|
@@ -22375,6 +22383,9 @@ class TestCaseLoopStepComponent {
|
|
|
22375
22383
|
}
|
|
22376
22384
|
/** Loop End dropdown value: prefer forLoopEndIndex from config (or dataMapJson/dataMapBean), else endStep */
|
|
22377
22385
|
getLoopEndFormValue() {
|
|
22386
|
+
const currentFormValue = this.editForm?.get('endStep')?.value;
|
|
22387
|
+
if (currentFormValue !== null && currentFormValue !== undefined)
|
|
22388
|
+
return Number(currentFormValue);
|
|
22378
22389
|
const cfg = this.config;
|
|
22379
22390
|
const v = cfg?.forLoopEndIndex ?? cfg?.dataMapJson?.forLoopEndIndex ?? cfg?.dataMapBean?.for_loop?.endIndex;
|
|
22380
22391
|
if (v != null)
|
|
@@ -22632,13 +22643,14 @@ class TestCaseLoopStepComponent {
|
|
|
22632
22643
|
const cfg = this.config;
|
|
22633
22644
|
const forLoopTestDataId = cfg?.forLoopTestDataId ?? cfg?.dataMapJson?.forLoopTestDataId ?? cfg?.dataMapBean?.for_loop?.testDataId;
|
|
22634
22645
|
const selectedVal = this.loopType === 'for' ? this.getTestDataProfileFormValue() : undefined;
|
|
22635
|
-
//
|
|
22636
|
-
|
|
22637
|
-
|
|
22646
|
+
// Keep the selected profile visible by label even when server-search replaces the option list.
|
|
22647
|
+
const selectedProfileId = selectedVal ?? forLoopTestDataId;
|
|
22648
|
+
if (this.loopType === 'for' && selectedProfileId != null && selectedProfileId !== '') {
|
|
22649
|
+
const idStr = String(selectedProfileId);
|
|
22638
22650
|
const alreadyInList = options.some((o) => String(o.id ?? o.value) === idStr);
|
|
22639
22651
|
if (!alreadyInList) {
|
|
22640
|
-
const displayName = this.resolveTestDataProfileName(
|
|
22641
|
-
options = [{ id:
|
|
22652
|
+
const displayName = this.resolveTestDataProfileName(selectedProfileId) || this.resolveTestDataProfileName(this.testDataProfile) || 'Selected profile';
|
|
22653
|
+
options = [{ id: selectedProfileId, value: selectedProfileId, name: displayName, label: displayName }, ...options];
|
|
22642
22654
|
}
|
|
22643
22655
|
}
|
|
22644
22656
|
this.testDataProfileSelectConfig = {
|
|
@@ -22695,6 +22707,26 @@ class TestCaseLoopStepComponent {
|
|
|
22695
22707
|
label: option.name
|
|
22696
22708
|
}));
|
|
22697
22709
|
}
|
|
22710
|
+
/** Best-known persisted label for the selected test data profile, even when current search results exclude it. */
|
|
22711
|
+
getStoredTestDataProfileLabel() {
|
|
22712
|
+
const candidates = [
|
|
22713
|
+
this.testDataProfile,
|
|
22714
|
+
this.config?.testDataProfile,
|
|
22715
|
+
this.config?.testData?.name,
|
|
22716
|
+
this.config?.action,
|
|
22717
|
+
];
|
|
22718
|
+
for (const candidate of candidates) {
|
|
22719
|
+
const value = candidate != null ? String(candidate).trim() : '';
|
|
22720
|
+
if (!value)
|
|
22721
|
+
continue;
|
|
22722
|
+
if (value === 'Test Data profile')
|
|
22723
|
+
continue;
|
|
22724
|
+
if (/^\d+$/.test(value))
|
|
22725
|
+
continue;
|
|
22726
|
+
return value;
|
|
22727
|
+
}
|
|
22728
|
+
return '';
|
|
22729
|
+
}
|
|
22698
22730
|
/** Resolve a data profile id/value back to the display name used by the dropdown trigger. */
|
|
22699
22731
|
resolveTestDataProfileName(value) {
|
|
22700
22732
|
if (value == null || value === '')
|
|
@@ -22702,6 +22734,9 @@ class TestCaseLoopStepComponent {
|
|
|
22702
22734
|
const match = this.dataProfileOptions.find(option => option.id === value || String(option.id) === String(value) || option.name === value);
|
|
22703
22735
|
if (match?.name)
|
|
22704
22736
|
return match.name;
|
|
22737
|
+
const storedLabel = this.getStoredTestDataProfileLabel();
|
|
22738
|
+
if (storedLabel)
|
|
22739
|
+
return storedLabel;
|
|
22705
22740
|
return typeof value === 'string' ? value : String(value);
|
|
22706
22741
|
}
|
|
22707
22742
|
/** Data length (N) of the currently selected test data profile; 0 if none selected or not found. */
|
|
@@ -22750,32 +22785,19 @@ class TestCaseLoopStepComponent {
|
|
|
22750
22785
|
};
|
|
22751
22786
|
return [...this.getLoopStepSelectOptions(), endOption];
|
|
22752
22787
|
}
|
|
22753
|
-
/** Handle data profile selection: update display
|
|
22788
|
+
/** Handle data profile selection: update display and reset start/end like the old UI. */
|
|
22754
22789
|
onDataProfileChange(profileId) {
|
|
22755
22790
|
this.onTestDataProfileChange(profileId);
|
|
22756
22791
|
if (this.loopType !== 'for')
|
|
22757
22792
|
return;
|
|
22758
|
-
const
|
|
22759
|
-
|
|
22760
|
-
return;
|
|
22761
|
-
const options = this.getLoopStepOptions();
|
|
22762
|
-
const maxVal = options.length > 0 ? options[options.length - 1] : 1;
|
|
22763
|
-
let startVal = this.editForm?.get('startStep')?.value ?? this.startStep;
|
|
22764
|
-
let endVal = this.editForm?.get('endStep')?.value ?? this.endStep;
|
|
22765
|
-
if (startVal != null && startVal > maxVal)
|
|
22766
|
-
startVal = maxVal;
|
|
22767
|
-
if (endVal != null && endVal > maxVal)
|
|
22768
|
-
endVal = maxVal;
|
|
22769
|
-
if (startVal != null && endVal != null && startVal > endVal)
|
|
22770
|
-
endVal = startVal;
|
|
22793
|
+
const startVal = TestCaseLoopStepComponent.LOOP_INDEX_START;
|
|
22794
|
+
const endVal = TestCaseLoopStepComponent.LOOP_INDEX_END;
|
|
22771
22795
|
if (this.editForm) {
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
if (endVal != null)
|
|
22775
|
-
this.editForm.get('endStep')?.setValue(endVal);
|
|
22796
|
+
this.editForm.get('startStep')?.setValue(startVal);
|
|
22797
|
+
this.editForm.get('endStep')?.setValue(endVal);
|
|
22776
22798
|
}
|
|
22777
|
-
this.startStep = startVal
|
|
22778
|
-
this.endStep = endVal
|
|
22799
|
+
this.startStep = startVal;
|
|
22800
|
+
this.endStep = endVal;
|
|
22779
22801
|
this.updateStartEndStepSelectConfigsSelectedValues();
|
|
22780
22802
|
this.cdr.detectChanges();
|
|
22781
22803
|
}
|