]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: support custom validator messages in inline edit 65833/head
authorNizamudeen A <nia@redhat.com>
Wed, 8 Oct 2025 10:29:36 +0000 (15:59 +0530)
committerNizamudeen A <nia@redhat.com>
Thu, 9 Oct 2025 07:12:06 +0000 (12:42 +0530)
commit7ced3abd895807dc5bcf0c0f9c3bcccbe501c2e3
tree975e0d8f9b64ded73eebd08fa7b5da12e6e33c19
parentaf633b0c80ad9b2b5ead75c56dc70daf7a3efd36
mgr/dashboard: support custom validator messages in inline edit

we can add custom messages to the customTemplate like
```

        name: $localize`Name`,
        prop: 'name',
        flexGrow: 2,
        cellTemplate: this.removingStatTpl,
        cellTransformation: CellTemplate.editing,
        customTemplateConfig: {
          validators: [Validators.required, Validators.pattern(/^[A-Za-z ]+$/)],
          errorMessages: {
            required:  $localize`This field is required.`,
            pattern: $localize`The field format is invalid.`
          }
        }
      },
```

also extend support for async validator

Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts