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 <nia@redhat.com>
<ng-template #redirectTpl
let-value="data.value"
+ let-row="data.row"
let-column="data.column">
+@if (column.customTemplateConfig?.customRowProperty && row[column.customTemplateConfig?.customRowProperty]) {
+ <a [routerLink]="row[column.customTemplateConfig?.customRowProperty]">{{value}}</a>
+} @else if (column.customTemplateConfig?.redirectLink) {
<a [routerLink]="column.customTemplateConfig?.redirectLink | redirectLinkResolver:value">{{value}}</a>
+} @else {
+ {{ value }}
+}
</ng-template>
// }
// 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'
}