From: Nizamudeen A Date: Tue, 25 Nov 2025 11:31:31 +0000 (+0530) Subject: mgr/dashboard: support custom prop for table item redirection X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f8460ae99d065c1818d560279a8f3085167b10f;p=ceph.git mgr/dashboard: support custom prop for table item redirection use an extra customTemplateConfig called `customRowProperty` where you can provide the key of the property you wish to route, instead of relying on the cell's prop itself Fixes: https://tracker.ceph.com/issues/73989 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html index 3817c24967e..82f844de5b3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html @@ -481,6 +481,13 @@ +@if (column.customTemplateConfig?.customRowProperty && row[column.customTemplateConfig?.customRowProperty]) { + {{value}} +} @else if (column.customTemplateConfig?.redirectLink) { {{value}} +} @else { + {{ value }} +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts index 622aa1fdd90..50971bb9311 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts @@ -113,6 +113,18 @@ export enum CellTemplate { // } // you can also use '::prop' in the redirectLink array to replace it with the cell value. // e.g ['dashboard', '::prop', 'details'] + // + // if you want to use some other property of the row for redirection instead of the cell value, + // you can use the 'customRowProperty' property in the customTemplateConfig to specify + // the property name. + // { + // ... + // cellTransformation: CellTemplate.redirect, + // customTemplateConfig: { + // customRowProperty: 'otherPropertyName'} + // } + // ... + // } */ redirect = 'redirect' }