From 0c1d26244e38ebf2593afd8571c5d723968ba853 Mon Sep 17 00:00:00 2001 From: Naman Munet Date: Thu, 9 Oct 2025 16:28:11 +0530 Subject: [PATCH] mgr/dashboard: support templates in table component title fixes: https://tracker.ceph.com/issues/73456 Signed-off-by: Naman Munet --- .../app/shared/datatable/table/table.component.html | 6 +++++- .../app/shared/datatable/table/table.component.ts | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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 849f02be658ce..ebc32bf79fbe7 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 @@ -4,7 +4,11 @@

- {{headerTitle}} + @if (isHeaderTitleString) { + {{ headerTitle }} + } @else { + + }

; + isHeaderTitleString = false; + @Input() - headerTitle: string; + set headerTitle(value: string | TemplateRef) { + this._headerTitle = value; + this.isHeaderTitleString = typeof value === 'string'; + } + @Input() headerDescription: string; // This is the array with the items to be shown. @@ -293,6 +300,9 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr return this.selectionType === 'single'; } + get headerTitle(): string | TemplateRef { + return this._headerTitle; + } /** * Controls if all checkboxes are viewed as selected. */ -- 2.39.5