@cqa-lib/cqa-ui 1.1.518 → 1.1.519
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.
|
@@ -43713,11 +43713,18 @@ class StepBuilderGroupComponent {
|
|
|
43713
43713
|
if (this.initialStepGroupId) {
|
|
43714
43714
|
const foundGroup = this.stepGroupOptions.find(opt => opt.id === this.initialStepGroupId);
|
|
43715
43715
|
if (foundGroup) {
|
|
43716
|
-
|
|
43717
|
-
|
|
43718
|
-
//
|
|
43719
|
-
|
|
43720
|
-
|
|
43716
|
+
// Only patch the form to the initial value if the user hasn't picked a
|
|
43717
|
+
// different option yet. Subsequent stepGroupOptions changes (e.g. the
|
|
43718
|
+
// refetch dynamic-select fires on every dropdown reopen) must NOT
|
|
43719
|
+
// clobber a user-modified selection.
|
|
43720
|
+
const currentFormValue = this.stepGroupForm.value.stepGroupId;
|
|
43721
|
+
if (currentFormValue == null || currentFormValue === this.initialStepGroupId) {
|
|
43722
|
+
this.stepGroupForm.patchValue({ stepGroupId: this.initialStepGroupId });
|
|
43723
|
+
this.selectedStepGroup = foundGroup;
|
|
43724
|
+
// Capture snapshot for change detection (will be recaptured if runtime variables load later)
|
|
43725
|
+
if (this.editMode) {
|
|
43726
|
+
this.captureInitialSnapshot();
|
|
43727
|
+
}
|
|
43721
43728
|
}
|
|
43722
43729
|
}
|
|
43723
43730
|
}
|
|
@@ -43823,7 +43830,16 @@ class StepBuilderGroupComponent {
|
|
|
43823
43830
|
if (!this.selectedStepGroup) {
|
|
43824
43831
|
return;
|
|
43825
43832
|
}
|
|
43826
|
-
|
|
43833
|
+
// Re-capture is only valid while the form still points at the original
|
|
43834
|
+
// initialStepGroupId — that covers the "runtime vars arrived after the
|
|
43835
|
+
// initial selection was patched" case. Once the user picks a different
|
|
43836
|
+
// group, keep the original baseline so `hasChanges()` stays true and the
|
|
43837
|
+
// Update button remains enabled.
|
|
43838
|
+
const currentStepGroupId = this.stepGroupForm.value.stepGroupId;
|
|
43839
|
+
if (this.snapshotReady && currentStepGroupId !== this.initialStepGroupId) {
|
|
43840
|
+
return;
|
|
43841
|
+
}
|
|
43842
|
+
this.initialStepGroupIdSnapshot = currentStepGroupId || null;
|
|
43827
43843
|
this.initialRuntimeValuesSnapshot = JSON.stringify(this.runtimeVariableValues);
|
|
43828
43844
|
this.snapshotReady = true;
|
|
43829
43845
|
}
|