From 59bc0a0b3e90f626da0723edef154e18228129a0 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 16 Oct 2025 11:05:32 +0530 Subject: [PATCH] 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 --- .../src/app/shared/datatable/table/table.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 86c105ec64b..dd811aad36e 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]; } -- 2.39.5