Spaces:
Building
Building
Update flare-ui/src/app/dialogs/project-edit-dialog/project-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/project-edit-dialog/project-edit-dialog.component.ts
CHANGED
@@ -389,14 +389,28 @@ export default class ProjectEditDialogComponent implements OnInit, OnDestroy {
|
|
389 |
}
|
390 |
|
391 |
save() {
|
|
|
|
|
|
|
|
|
392 |
if (this.form.invalid || this.saving) {
|
393 |
// Mark all fields as touched to show validation errors
|
394 |
Object.keys(this.form.controls).forEach(key => {
|
395 |
-
this.form.get(key)
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
});
|
|
|
|
|
|
|
|
|
397 |
return;
|
398 |
}
|
399 |
-
|
400 |
this.saving = true;
|
401 |
|
402 |
const formValue = this.form.getRawValue(); // getRawValue to include disabled fields
|
|
|
389 |
}
|
390 |
|
391 |
save() {
|
392 |
+
console.log('Save clicked - Form valid:', this.form.valid, 'Saving:', this.saving);
|
393 |
+
console.log('Form errors:', this.form.errors);
|
394 |
+
console.log('Form value:', this.form.value);
|
395 |
+
|
396 |
if (this.form.invalid || this.saving) {
|
397 |
// Mark all fields as touched to show validation errors
|
398 |
Object.keys(this.form.controls).forEach(key => {
|
399 |
+
const control = this.form.get(key);
|
400 |
+
if (control) {
|
401 |
+
control.markAsTouched();
|
402 |
+
if (control.errors) {
|
403 |
+
console.log(`Field ${key} errors:`, control.errors);
|
404 |
+
}
|
405 |
+
}
|
406 |
});
|
407 |
+
|
408 |
+
if (this.form.invalid) {
|
409 |
+
this.showMessage('Please fill all required fields correctly', 'error');
|
410 |
+
}
|
411 |
return;
|
412 |
}
|
413 |
+
|
414 |
this.saving = true;
|
415 |
|
416 |
const formValue = this.form.getRawValue(); // getRawValue to include disabled fields
|