From 75e33bc12cd1c77c3a0b15b1c0612daa957494c8 Mon Sep 17 00:00:00 2001 From: MariaAga Date: Thu, 11 Jul 2024 18:56:42 +0100 Subject: [PATCH] Fixes #37645 - Tab title missing in tableindexpage --- .../react_app/components/HostsIndex/index.js | 12 ++++++-- .../PF4/TableIndexPage/TableIndexPage.js | 29 ++++++++++++------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/webpack/assets/javascripts/react_app/components/HostsIndex/index.js b/webpack/assets/javascripts/react_app/components/HostsIndex/index.js index ea721b2c8d8..73f7de2482d 100644 --- a/webpack/assets/javascripts/react_app/components/HostsIndex/index.js +++ b/webpack/assets/javascripts/react_app/components/HostsIndex/index.js @@ -14,6 +14,8 @@ import { Button, Split, SplitItem, + TextContent, + Text, } from '@patternfly/react-core'; import { UndoIcon } from '@patternfly/react-icons'; import { useForemanModal } from '../ForemanModal/ForemanModalHooks'; @@ -325,7 +327,11 @@ const HostsIndex = () => { justifyContent={{ default: 'justifyContentSpaceBetween' }} > -

{__('Hosts')}

+ + + {__('Hosts')} + +
@@ -368,8 +374,8 @@ const HostsIndex = () => { } {customToolbarItems} - an array of custom toolbar items to be displayed @param {boolean} {exportable} - whether or not to show export button @param {boolean} {hasHelpPage} - whether or not to show documentation button -@param {string}{headerText} - the header text for the page -@param {string}{header} - header node; default is {headerText} +@param {React.ReactNode}{customHeader} - a custom header to be rendered instead of the default header +@param {string}{headerText} - DEPRECATED - the header text for the page +@param {string}{header} -the header text for the page and the title @param {boolean} {isDeleteable} - whether or not entries can be deleted @param {boolean} {searchable} - whether or not the table can be searched @param {React.ReactNode} {selectionToolbar} - Pass in the SelectAll toolbar, if desired @@ -93,6 +94,7 @@ const TableIndexPage = ({ customToolbarItems, exportable, hasHelpPage, + customHeader, headerText, header, isDeleteable, @@ -196,9 +198,12 @@ const TableIndexPage = ({ ...customActionButtons, ].filter(item => item); + header = headerText || header; return (
- {headerText} + + {header} + {breadcrumbOptions && ( @@ -208,11 +213,13 @@ const TableIndexPage = ({ variant={PageSectionVariants.light} className="table-title-section" > - - - {header ?? {headerText}} - - + {customHeader || ( + + + {header} + + + )} {beforeToolbarComponent}