@cqa-lib/cqa-ui 1.1.471 → 1.1.473

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.
@@ -40143,7 +40143,7 @@ class TestCaseDetailsEditComponent {
40143
40143
  return !!((_a = section === null || section === void 0 ? void 0 : section.items) === null || _a === void 0 ? void 0 : _a.some((i) => i.label === 'Prerequisite Case'));
40144
40144
  }
40145
40145
  ngOnInit() {
40146
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
40146
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
40147
40147
  this.editDescription = this.descriptionContent;
40148
40148
  this.editStatus = (_b = (_a = this.statusItem) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
40149
40149
  this.editPriority = (_d = (_c = this.priorityItem) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : '';
@@ -40164,7 +40164,8 @@ class TestCaseDetailsEditComponent {
40164
40164
  this.dataDrivenEnabled = !!this.getConfigItemValue('Key Flags', 'Data Driven');
40165
40165
  const enableAiSmartness = this.getConfigItemValue('AI Configuration', 'Enable AI Smartness');
40166
40166
  const defaultAiAction = this.getConfigItemValue('AI Configuration', 'Default AI Action');
40167
- const knowledgeBaseDefaultTestCase = this.getConfigItemValue('AI Configuration', 'Knowledge Base Default Test Case');
40167
+ const knowledgeBaseDefaultTestCaseRaw = this.getConfigItemValue('AI Configuration', 'Knowledge Base Default Test Case');
40168
+ const knowledgeBaseDefaultTestCase = (_v = this.resolveToOptionValue(knowledgeBaseDefaultTestCaseRaw, (_u = (_t = this.selectConfigOverrides) === null || _t === void 0 ? void 0 : _t['knowledgeBaseDefaultTestCase']) === null || _u === void 0 ? void 0 : _u.options)) !== null && _v !== void 0 ? _v : knowledgeBaseDefaultTestCaseRaw;
40168
40169
  const useAiMetadataRaw = this.getConfigItemValue('AI Configuration', 'Enable AI metadata collection');
40169
40170
  const useAiMetadata = this.normalizeBooleanSelectValue(useAiMetadataRaw);
40170
40171
  const prerequisiteCases = this.getPrerequisiteCasesFromConfig();
@@ -40263,7 +40264,7 @@ class TestCaseDetailsEditComponent {
40263
40264
  return val && String(val).trim() ? String(val) : '';
40264
40265
  }
40265
40266
  ngOnChanges(changes) {
40266
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
40267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
40267
40268
  if (changes['labels'] || changes['selectConfigOverrides']) {
40268
40269
  this._labelsSelectConfigDirty = true;
40269
40270
  if (changes['selectConfigOverrides'] && ((_a = this.editForm) === null || _a === void 0 ? void 0 : _a.get('type'))) {
@@ -40300,6 +40301,13 @@ class TestCaseDetailsEditComponent {
40300
40301
  if (defaultAiRaw)
40301
40302
  patch['defaultAiAction'] = defaultAiRaw;
40302
40303
  }
40304
+ const kbCtrl = this.editForm.get('knowledgeBaseDefaultTestCase');
40305
+ if (kbCtrl && !kbCtrl.dirty) {
40306
+ const kbRaw = this.getConfigItemValue('AI Configuration', 'Knowledge Base Default Test Case');
40307
+ const kbResolved = (_t = this.resolveToOptionValue(kbRaw, (_s = (_r = this.selectConfigOverrides) === null || _r === void 0 ? void 0 : _r['knowledgeBaseDefaultTestCase']) === null || _s === void 0 ? void 0 : _s.options)) !== null && _t !== void 0 ? _t : kbRaw;
40308
+ if (kbResolved)
40309
+ patch['knowledgeBaseDefaultTestCase'] = kbResolved;
40310
+ }
40303
40311
  if (Object.keys(patch).length) {
40304
40312
  this.editForm.patchValue(patch, { emitEvent: false });
40305
40313
  }
@@ -40308,9 +40316,9 @@ class TestCaseDetailsEditComponent {
40308
40316
  if (changes['descriptionContent'] || changes['labels'] || changes['metadataItems']) {
40309
40317
  this.editDescription = this.descriptionContent;
40310
40318
  this.editLabels = [...this.labels];
40311
- this.editStatus = (_s = (_r = this.statusItem) === null || _r === void 0 ? void 0 : _r.value) !== null && _s !== void 0 ? _s : '';
40312
- this.editPriority = (_u = (_t = this.priorityItem) === null || _t === void 0 ? void 0 : _t.value) !== null && _u !== void 0 ? _u : '';
40313
- const typeVal = (_w = (this.getConfigItemValue('Execution', 'Type') || ((_v = this.typeItem) === null || _v === void 0 ? void 0 : _v.value))) !== null && _w !== void 0 ? _w : '';
40319
+ this.editStatus = (_v = (_u = this.statusItem) === null || _u === void 0 ? void 0 : _u.value) !== null && _v !== void 0 ? _v : '';
40320
+ this.editPriority = (_x = (_w = this.priorityItem) === null || _w === void 0 ? void 0 : _w.value) !== null && _x !== void 0 ? _x : '';
40321
+ const typeVal = (_z = (this.getConfigItemValue('Execution', 'Type') || ((_y = this.typeItem) === null || _y === void 0 ? void 0 : _y.value))) !== null && _z !== void 0 ? _z : '';
40314
40322
  const statusControl = this.editForm.get('status');
40315
40323
  const priorityControl = this.editForm.get('priority');
40316
40324
  const typeControl = this.editForm.get('type');
@@ -40327,14 +40335,15 @@ class TestCaseDetailsEditComponent {
40327
40335
  if (changes['configSections'] || changes['configSectionsRow2']) {
40328
40336
  const enableAiSmartness = this.getConfigItemValue('AI Configuration', 'Enable AI Smartness');
40329
40337
  const defaultAiAction = this.getConfigItemValue('AI Configuration', 'Default AI Action');
40330
- const knowledgeBaseDefaultTestCase = this.getConfigItemValue('AI Configuration', 'Knowledge Base Default Test Case');
40338
+ const knowledgeBaseDefaultTestCaseRaw = this.getConfigItemValue('AI Configuration', 'Knowledge Base Default Test Case');
40339
+ const knowledgeBaseDefaultTestCase = (_2 = this.resolveToOptionValue(knowledgeBaseDefaultTestCaseRaw, (_1 = (_0 = this.selectConfigOverrides) === null || _0 === void 0 ? void 0 : _0['knowledgeBaseDefaultTestCase']) === null || _1 === void 0 ? void 0 : _1.options)) !== null && _2 !== void 0 ? _2 : knowledgeBaseDefaultTestCaseRaw;
40331
40340
  const prerequisiteCases = this.getPrerequisiteCasesFromConfig();
40332
- const typeRaw = (_y = (this.getConfigItemValue('Execution', 'Type') || ((_x = this.typeItem) === null || _x === void 0 ? void 0 : _x.value))) !== null && _y !== void 0 ? _y : '';
40333
- const testDataProfileRaw = (_z = this.getConfigItemValue('Execution', 'Test Data Profile')) !== null && _z !== void 0 ? _z : '';
40334
- const testDataSetRaw = this.normalizeTestDataSetRawValue((_0 = this.getConfigItemValue('Execution', 'Test Data Set')) !== null && _0 !== void 0 ? _0 : '');
40335
- const typeVal = (_3 = this.resolveToOptionValue(typeRaw, (_2 = (_1 = this.selectConfigOverrides) === null || _1 === void 0 ? void 0 : _1['type']) === null || _2 === void 0 ? void 0 : _2.options)) !== null && _3 !== void 0 ? _3 : typeRaw;
40336
- const testDataProfileVal = (_6 = this.resolveToOptionValue(testDataProfileRaw, (_5 = (_4 = this.selectConfigOverrides) === null || _4 === void 0 ? void 0 : _4['testDataProfile']) === null || _5 === void 0 ? void 0 : _5.options)) !== null && _6 !== void 0 ? _6 : testDataProfileRaw;
40337
- const testDataSetVal = (_9 = this.resolveToOptionValue(testDataSetRaw, (_8 = (_7 = this.selectConfigOverrides) === null || _7 === void 0 ? void 0 : _7['testDataSet']) === null || _8 === void 0 ? void 0 : _8.options)) !== null && _9 !== void 0 ? _9 : testDataSetRaw;
40341
+ const typeRaw = (_4 = (this.getConfigItemValue('Execution', 'Type') || ((_3 = this.typeItem) === null || _3 === void 0 ? void 0 : _3.value))) !== null && _4 !== void 0 ? _4 : '';
40342
+ const testDataProfileRaw = (_5 = this.getConfigItemValue('Execution', 'Test Data Profile')) !== null && _5 !== void 0 ? _5 : '';
40343
+ const testDataSetRaw = this.normalizeTestDataSetRawValue((_6 = this.getConfigItemValue('Execution', 'Test Data Set')) !== null && _6 !== void 0 ? _6 : '');
40344
+ const typeVal = (_9 = this.resolveToOptionValue(typeRaw, (_8 = (_7 = this.selectConfigOverrides) === null || _7 === void 0 ? void 0 : _7['type']) === null || _8 === void 0 ? void 0 : _8.options)) !== null && _9 !== void 0 ? _9 : typeRaw;
40345
+ const testDataProfileVal = (_12 = this.resolveToOptionValue(testDataProfileRaw, (_11 = (_10 = this.selectConfigOverrides) === null || _10 === void 0 ? void 0 : _10['testDataProfile']) === null || _11 === void 0 ? void 0 : _11.options)) !== null && _12 !== void 0 ? _12 : testDataProfileRaw;
40346
+ const testDataSetVal = (_15 = this.resolveToOptionValue(testDataSetRaw, (_14 = (_13 = this.selectConfigOverrides) === null || _13 === void 0 ? void 0 : _13['testDataSet']) === null || _14 === void 0 ? void 0 : _14.options)) !== null && _15 !== void 0 ? _15 : testDataSetRaw;
40338
40347
  const defaultBrowser = this.getConfigItemValue('Execution', 'Default Browser');
40339
40348
  const videoRecordingRaw = this.getConfigItemValue('Execution', 'Video Recording');
40340
40349
  const videoRecording = this.normalizeBooleanSelectValue(videoRecordingRaw);
@@ -40841,6 +40850,10 @@ class StepBuilderGroupComponent {
40841
40850
  this.searchStepGroups = new EventEmitter();
40842
40851
  this.selectedStepGroup = null;
40843
40852
  this.runtimeVariableValues = {};
40853
+ /** Tracks initial state for edit mode to detect changes */
40854
+ this.initialStepGroupIdSnapshot = null;
40855
+ this.initialRuntimeValuesSnapshot = '{}';
40856
+ this.snapshotReady = false;
40844
40857
  this.stepGroupForm = this.fb.group({
40845
40858
  stepGroupId: [null, Validators.required]
40846
40859
  });
@@ -40900,6 +40913,10 @@ class StepBuilderGroupComponent {
40900
40913
  if (foundGroup) {
40901
40914
  this.stepGroupForm.patchValue({ stepGroupId: this.initialStepGroupId });
40902
40915
  this.selectedStepGroup = foundGroup;
40916
+ // Capture snapshot for change detection (will be recaptured if runtime variables load later)
40917
+ if (this.editMode) {
40918
+ this.captureInitialSnapshot();
40919
+ }
40903
40920
  }
40904
40921
  }
40905
40922
  }
@@ -40948,6 +40965,10 @@ class StepBuilderGroupComponent {
40948
40965
  }
40949
40966
  });
40950
40967
  }
40968
+ // Capture snapshot after runtime values are initialized (for edit mode change detection)
40969
+ if (this.editMode) {
40970
+ this.captureInitialSnapshot();
40971
+ }
40951
40972
  }
40952
40973
  onRuntimeVariableChange(groupId, paramName, value) {
40953
40974
  if (!this.runtimeVariableValues[groupId]) {
@@ -40978,8 +40999,33 @@ class StepBuilderGroupComponent {
40978
40999
  onCancel() {
40979
41000
  this.cancelled.emit();
40980
41001
  }
41002
+ /** Returns true if the form has changed from its initial state (edit mode only) */
41003
+ hasChanges() {
41004
+ if (!this.editMode) {
41005
+ return true; // In create mode, always allow submission
41006
+ }
41007
+ // Until the snapshot is ready, treat as no changes (disable button)
41008
+ if (!this.snapshotReady) {
41009
+ return false;
41010
+ }
41011
+ const currentStepGroupId = this.stepGroupForm.value.stepGroupId;
41012
+ if (currentStepGroupId !== this.initialStepGroupIdSnapshot) {
41013
+ return true;
41014
+ }
41015
+ return JSON.stringify(this.runtimeVariableValues) !== this.initialRuntimeValuesSnapshot;
41016
+ }
41017
+ /** Captures the current state as the baseline for change detection */
41018
+ captureInitialSnapshot() {
41019
+ // Only capture when a valid step group is selected
41020
+ if (!this.selectedStepGroup) {
41021
+ return;
41022
+ }
41023
+ this.initialStepGroupIdSnapshot = this.stepGroupForm.value.stepGroupId || null;
41024
+ this.initialRuntimeValuesSnapshot = JSON.stringify(this.runtimeVariableValues);
41025
+ this.snapshotReady = true;
41026
+ }
40981
41027
  isFormValid() {
40982
- return this.stepGroupForm.valid && !!this.selectedStepGroup;
41028
+ return this.stepGroupForm.valid && !!this.selectedStepGroup && this.hasChanges();
40983
41029
  }
40984
41030
  }
40985
41031
  StepBuilderGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StepBuilderGroupComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });