From: Nizamudeen A Date: Thu, 16 Oct 2025 05:35:32 +0000 (+0530) Subject: mgr/dashboard: fix generic form submit validator for inline edit X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F65973%2Fhead;p=ceph.git mgr/dashboard: fix generic form submit validator for inline edit currently the validation error is being applied generically to the parent formgroup which will set the whole form into an error state when one of the inline editing is failing on a validation. So just changing that to a single control. Fixes: https://tracker.ceph.com/issues/73558 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 86c105ec64b7..dd811aad36ee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -1425,15 +1425,19 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr } saveCellItem(row: any, colProp: string) { - if (this.formGroup?.invalid) { - this.formGroup.setErrors({ cdSubmitButton: true }); + const key = `${row[this.identifier]}-${colProp}`; + const control = this.formGroup.get(key); + + if (control?.invalid) { + control.setErrors({ cdSubmitButton: true, ...control.errors }); return; } + this.editSubmitAction.emit({ state: this.editStates[row[this.identifier]], row: row }); - this.editingCells.delete(`${row[this.identifier]}-${colProp}`); + this.editingCells.delete(key); delete this.editStates[row[this.identifier]][colProp]; }