cat-qw-lib 0.43.27 → 0.43.28
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/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -678,6 +678,7 @@ class BaseControlComponent {
|
|
|
678
678
|
.pipe(takeUntil(this.destroy$))
|
|
679
679
|
.subscribe((res) => {
|
|
680
680
|
if (res) {
|
|
681
|
+
console.log("1 => isNavigating", res);
|
|
681
682
|
this.checkUnsavedChanges();
|
|
682
683
|
}
|
|
683
684
|
});
|
|
@@ -717,16 +718,22 @@ class BaseControlComponent {
|
|
|
717
718
|
return this.record[this.attributeModel.name];
|
|
718
719
|
}
|
|
719
720
|
checkUnsavedChanges() {
|
|
721
|
+
console.log("2 checkUnSavedCall");
|
|
720
722
|
const hasChanges = JSON.stringify(this.initialRecord) !== JSON.stringify(this.record);
|
|
721
|
-
console.log("
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
723
|
+
console.log("3 hasChanges", hasChanges);
|
|
724
|
+
this.formStateService.selectIsFormSaved().subscribe((res) => {
|
|
725
|
+
console.log("4 isSaved", res);
|
|
726
|
+
if (res) {
|
|
727
|
+
console.log("5 set confirmation false", res);
|
|
728
|
+
this.formStateService.setShowConfirmation(false);
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
if (!res && hasChanges) {
|
|
732
|
+
console.log("6 set confirmation true", res);
|
|
733
|
+
this.formStateService.setShowConfirmation(true);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
});
|
|
730
737
|
}
|
|
731
738
|
ngOnDestroy() {
|
|
732
739
|
this.destroy$.next();
|
|
@@ -1419,7 +1426,9 @@ class BaseFormComponent {
|
|
|
1419
1426
|
console.log('Record created:', response);
|
|
1420
1427
|
this.record = {};
|
|
1421
1428
|
this.baseStore?.setIsApiValidated(null);
|
|
1429
|
+
console.log("1 baseForm");
|
|
1422
1430
|
this.formStateService.setIsFormSaved(true);
|
|
1431
|
+
console.log("2 baseForm");
|
|
1423
1432
|
this.onFormNavigate.emit(response);
|
|
1424
1433
|
},
|
|
1425
1434
|
error: (error) => {
|