@cqa-lib/cqa-ui 1.1.398 → 1.1.400
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/step-builder/template-variables-form/template-variables-form.component.mjs +21 -16
- package/esm2020/lib/test-case-details/condition-step/condition-step.component.mjs +31 -6
- package/esm2020/lib/test-case-details/test-case-step.models.mjs +1 -1
- package/fesm2015/cqa-lib-cqa-ui.mjs +50 -25
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +50 -20
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/test-case-details/condition-step/condition-step.component.d.ts +5 -0
- package/lib/test-case-details/test-case-step.models.d.ts +6 -0
- package/package.json +1 -1
|
@@ -25138,7 +25138,8 @@ class TestCaseConditionStepComponent {
|
|
|
25138
25138
|
}
|
|
25139
25139
|
buildElseIfBranch(index) {
|
|
25140
25140
|
// Initialize ELSE IF form with empty values or from existing ELSE IF branch if available
|
|
25141
|
-
|
|
25141
|
+
// Use getAllBranchesFlat to include chained nextBranch ELSE IFs
|
|
25142
|
+
const elseIfBranches = this.getAllBranchesFlat().filter(b => b.type === 'else-if');
|
|
25142
25143
|
const branchIndex = index !== undefined ? index : elseIfBranches.length;
|
|
25143
25144
|
const elseIfBranch = elseIfBranches[branchIndex];
|
|
25144
25145
|
const elseCondition = elseIfBranch?.action || '';
|
|
@@ -25466,8 +25467,25 @@ class TestCaseConditionStepComponent {
|
|
|
25466
25467
|
}
|
|
25467
25468
|
/** Count and summarize condition branches using their display step numbers.
|
|
25468
25469
|
* Example: IF + 2x ELSE IF + ELSE → "Steps 6-9 (4 steps)". */
|
|
25470
|
+
/**
|
|
25471
|
+
* Returns a flat list of all branches including those chained via nextBranch.
|
|
25472
|
+
* Used for counting, badge display, and summary when the condition uses a chained structure.
|
|
25473
|
+
*/
|
|
25474
|
+
getAllBranchesFlat() {
|
|
25475
|
+
const result = [];
|
|
25476
|
+
const traverse = (branches) => {
|
|
25477
|
+
for (const b of branches) {
|
|
25478
|
+
result.push(b);
|
|
25479
|
+
if (b.nextBranch)
|
|
25480
|
+
traverse([b.nextBranch]);
|
|
25481
|
+
}
|
|
25482
|
+
};
|
|
25483
|
+
traverse(this.branches || []);
|
|
25484
|
+
return result;
|
|
25485
|
+
}
|
|
25469
25486
|
getStepsSummary() {
|
|
25470
|
-
const
|
|
25487
|
+
const allBranches = this.getAllBranchesFlat();
|
|
25488
|
+
const branchCount = allBranches.length;
|
|
25471
25489
|
if (branchCount === 0) {
|
|
25472
25490
|
return '0 steps';
|
|
25473
25491
|
}
|
|
@@ -25481,7 +25499,8 @@ class TestCaseConditionStepComponent {
|
|
|
25481
25499
|
/** Branch type badges for step row: IF, ELSE IF (with count if multiple), ELSE */
|
|
25482
25500
|
getBranchTypeBadges() {
|
|
25483
25501
|
const badges = [];
|
|
25484
|
-
const
|
|
25502
|
+
const allBranches = this.getAllBranchesFlat();
|
|
25503
|
+
const elseIfCount = allBranches.filter(b => b.type === 'else-if').length;
|
|
25485
25504
|
const hasElse = this.hasElseBranch;
|
|
25486
25505
|
badges.push({ label: 'IF', type: 'if', badgeClass: 'cqa-bg-[#0DBD7D1A] cqa-text-[#0D542B] cqa-border cqa-border-solid cqa-border-[#0DBD7D]' });
|
|
25487
25506
|
if (elseIfCount > 0) {
|
|
@@ -25700,7 +25719,7 @@ class TestCaseConditionStepComponent {
|
|
|
25700
25719
|
}
|
|
25701
25720
|
/** True when condition already has an ELSE branch (disables Add ELSE IF / Add ELSE). */
|
|
25702
25721
|
get hasElseBranch() {
|
|
25703
|
-
return this.
|
|
25722
|
+
return this.getAllBranchesFlat().some(b => b.type === 'else');
|
|
25704
25723
|
}
|
|
25705
25724
|
onOpenExternal() {
|
|
25706
25725
|
// Not used in condition step, but needed for recursive step groups
|
|
@@ -25908,6 +25927,7 @@ class TestCaseConditionStepComponent {
|
|
|
25908
25927
|
let updatedConfig;
|
|
25909
25928
|
if (isEditingElseIfBranch && branchForEdit && branchForEdit.id != null) {
|
|
25910
25929
|
// Editing existing ELSE IF branch: target that branch's step ID and send raw condition so backend updates the branch only.
|
|
25930
|
+
// Any new ELSE IF added here chains off this specific ELSE IF (handled by step-list since updatedConfig.id = this branch's id).
|
|
25911
25931
|
updatedConfig = {
|
|
25912
25932
|
...updatedConfigBase,
|
|
25913
25933
|
id: String(branchForEdit.id),
|
|
@@ -25917,10 +25937,15 @@ class TestCaseConditionStepComponent {
|
|
|
25917
25937
|
};
|
|
25918
25938
|
}
|
|
25919
25939
|
else {
|
|
25920
|
-
// IF condition edit (step row or IF branch row): use formatted condition for display
|
|
25940
|
+
// IF condition edit (step row or IF branch row): use formatted condition for display.
|
|
25941
|
+
// When editing from the IF TRUE branch row (branchIndex === 0), any new ELSE IFs must be
|
|
25942
|
+
// inserted directly after the IF branch — not at the end of the chain.
|
|
25943
|
+
// Pass insertAfterBranchId so step-list knows the exact insertion point.
|
|
25944
|
+
const isEditingIfBranchRow = isEditingBranchRow && branchForEdit?.type === 'if' && branchForEdit.id != null;
|
|
25921
25945
|
updatedConfig = {
|
|
25922
25946
|
...updatedConfigBase,
|
|
25923
25947
|
condition: this.condition,
|
|
25948
|
+
...(isEditingIfBranchRow && { insertAfterBranchId: String(branchForEdit.id) }),
|
|
25924
25949
|
};
|
|
25925
25950
|
}
|
|
25926
25951
|
// Emit individual change event
|
|
@@ -31420,24 +31445,29 @@ class TemplateVariablesFormComponent {
|
|
|
31420
31445
|
if (variable.selectedTestDataProfileId != null) {
|
|
31421
31446
|
profileToUse = this.parameterOptions.find((testData) => testData.id === variable.selectedTestDataProfileId);
|
|
31422
31447
|
if (profileToUse && profileToUse.data && profileToUse.data.length > 0) {
|
|
31423
|
-
//
|
|
31424
|
-
|
|
31425
|
-
|
|
31426
|
-
|
|
31427
|
-
|
|
31428
|
-
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31432
|
-
|
|
31448
|
+
// If defaultTestDataStartIndex is provided, use it directly
|
|
31449
|
+
if (this.defaultTestDataStartIndex != null && profileToUse.data.length > this.defaultTestDataStartIndex) {
|
|
31450
|
+
dataSetToUse = profileToUse.data[this.defaultTestDataStartIndex];
|
|
31451
|
+
}
|
|
31452
|
+
else {
|
|
31453
|
+
// Find the data set that contains the parameter value
|
|
31454
|
+
const paramName = rawValue;
|
|
31455
|
+
if (paramName && paramName.trim()) {
|
|
31456
|
+
// Search through all data sets to find the one containing this parameter
|
|
31457
|
+
for (const dataSet of profileToUse.data) {
|
|
31458
|
+
if (dataSet && dataSet.data) {
|
|
31459
|
+
// Check if this data set has the parameter
|
|
31460
|
+
if (dataSet.data.hasOwnProperty(paramName)) {
|
|
31461
|
+
dataSetToUse = dataSet;
|
|
31462
|
+
break;
|
|
31463
|
+
}
|
|
31433
31464
|
}
|
|
31434
31465
|
}
|
|
31435
31466
|
}
|
|
31436
|
-
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
dataSetToUse = profileToUse.data[0];
|
|
31467
|
+
// If not found by parameter name, use first data set as fallback
|
|
31468
|
+
if (!dataSetToUse && profileToUse.data.length > 0) {
|
|
31469
|
+
dataSetToUse = profileToUse.data[0];
|
|
31470
|
+
}
|
|
31441
31471
|
}
|
|
31442
31472
|
}
|
|
31443
31473
|
}
|