@cqa-lib/cqa-ui 1.1.276 → 1.1.277

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.
@@ -21861,7 +21861,14 @@ class TestCaseDetailsRendererComponent {
21861
21861
  const editInDepthSub = instance.editInDepth.subscribe((v) => {
21862
21862
  // If child component emits an object with step, use it; otherwise use current step and index
21863
21863
  if (v != null && typeof v === 'object' && 'step' in v) {
21864
- this.editInDepth.emit({ step: v.step, index: v.index ?? this.index });
21864
+ const payload = {
21865
+ step: v.step,
21866
+ index: v.index ?? this.index,
21867
+ };
21868
+ if (v.templateOverride) {
21869
+ payload.templateOverride = v.templateOverride;
21870
+ }
21871
+ this.editInDepth.emit(payload);
21865
21872
  }
21866
21873
  else {
21867
21874
  this.editInDepth.emit({ step: this.step, index: this.index });
@@ -22415,8 +22422,8 @@ class TestCaseLoopStepComponent {
22415
22422
  this.cdr.detectChanges();
22416
22423
  }
22417
22424
  // Auto-open Edit In depth when user selects a condition from the autocomplete.
22418
- // Defer to next tick so autocomplete dropdown can close and event propagation completes.
22419
- setTimeout(() => this.onEditInDepth(), 100);
22425
+ // Pass fullTemplate so the modal shows the newly selected template, not the old step template.
22426
+ setTimeout(() => this.onEditInDepth(fullTemplate), 100);
22420
22427
  }
22421
22428
  buildTemplateVariablesForm() {
22422
22429
  if (!this.templateVariablesForm) {
@@ -23049,10 +23056,17 @@ class TestCaseLoopStepComponent {
23049
23056
  }
23050
23057
  this.isEditing = false;
23051
23058
  }
23052
- onEditInDepth() {
23059
+ onEditInDepth(templateOverride) {
23053
23060
  this.moreOptions.emit();
23054
23061
  const index = typeof this.stepNumber === 'number' ? this.stepNumber : (typeof this.stepNumber === 'string' ? parseInt(this.stepNumber, 10) : 0);
23055
- this.editInDepth.emit({ step: this.config, index: isNaN(index) ? 0 : index });
23062
+ const payload = {
23063
+ step: this.config,
23064
+ index: isNaN(index) ? 0 : index,
23065
+ };
23066
+ if (templateOverride) {
23067
+ payload.templateOverride = templateOverride;
23068
+ }
23069
+ this.editInDepth.emit(payload);
23056
23070
  }
23057
23071
  onLink() {
23058
23072
  // Not used in loop step, but needed for recursive step groups
@@ -23485,7 +23499,11 @@ class TestCaseConditionStepComponent {
23485
23499
  // If template not in option, try to find from naturalTextActionsOptions by matching naturalText
23486
23500
  let fullTemplate = matchingTemplate;
23487
23501
  if (!fullTemplate || !fullTemplate.variables) {
23488
- const matchingOption = this.naturalTextActionsOptions.find((opt) => opt.naturalText === option.value || opt.name === option.value || opt.value === option.value);
23502
+ const optVal = (option.value ?? '').toString().trim();
23503
+ const matchingOption = this.naturalTextActionsOptions.find((opt) => {
23504
+ const n = (opt.naturalText ?? opt.name ?? opt.value ?? '').toString().trim();
23505
+ return n === optVal || (opt.template && opt.template.naturalText?.toString().trim() === optVal);
23506
+ });
23489
23507
  // Use template property from option if available, otherwise use the option itself
23490
23508
  fullTemplate = matchingOption?.template || matchingOption;
23491
23509
  }
@@ -23518,8 +23536,10 @@ class TestCaseConditionStepComponent {
23518
23536
  this.cdr.detectChanges();
23519
23537
  }
23520
23538
  // Auto-open Edit In depth when user selects a condition from the autocomplete.
23521
- // Defer to next tick so autocomplete dropdown can close and event propagation completes.
23522
- setTimeout(() => this.onEditInDepth(), 100);
23539
+ // Pass the selected template so the modal shows the newly selected template, not the old step template.
23540
+ // Prefer selectedTemplate (validated), then fullTemplate, then option.template (from autocomplete)
23541
+ const templateToPass = this.selectedTemplate || fullTemplate || option.template;
23542
+ setTimeout(() => this.onEditInDepth(templateToPass), 100);
23523
23543
  }
23524
23544
  buildTemplateVariablesForm() {
23525
23545
  if (!this.templateVariablesForm) {
@@ -23585,8 +23605,8 @@ class TestCaseConditionStepComponent {
23585
23605
  this.cdr.detectChanges();
23586
23606
  }
23587
23607
  // Auto-open Edit In depth when user selects a condition from the ELSE IF autocomplete.
23588
- // Defer to next tick so autocomplete dropdown can close and event propagation completes.
23589
- setTimeout(() => this.onEditInDepth(), 100);
23608
+ // Pass fullTemplate so the modal shows the newly selected template, not the old step template.
23609
+ setTimeout(() => this.onEditInDepth(fullTemplate), 100);
23590
23610
  }
23591
23611
  buildElseTemplateVariablesForm(branch) {
23592
23612
  if (!branch.templateVariablesForm) {
@@ -24032,10 +24052,17 @@ class TestCaseConditionStepComponent {
24032
24052
  this.stepUpdate.emit(updatedConfig);
24033
24053
  this.editContext = null;
24034
24054
  }
24035
- onEditInDepth() {
24055
+ onEditInDepth(templateOverride) {
24036
24056
  this.moreOptions.emit();
24037
24057
  const index = typeof this.stepNumber === 'number' ? this.stepNumber : (typeof this.stepNumber === 'string' ? parseInt(this.stepNumber, 10) : 0);
24038
- this.editInDepth.emit({ step: this.config, index: isNaN(index) ? 0 : index });
24058
+ const payload = {
24059
+ step: this.config,
24060
+ index: isNaN(index) ? 0 : index,
24061
+ };
24062
+ if (templateOverride) {
24063
+ payload.templateOverride = templateOverride;
24064
+ }
24065
+ this.editInDepth.emit(payload);
24039
24066
  }
24040
24067
  onLink() {
24041
24068
  // Not used in condition step, but needed for recursive step groups