Skip to content

Commit

Permalink
Remove Monitoring and Health title from details except for Namespace …
Browse files Browse the repository at this point in the history
…Details
  • Loading branch information
akucharska committed Jun 24, 2024
1 parent 2c7bb2c commit 0b8142d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/resources/Namespaces/NamespaceDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function NamespaceDetails(props) {
() => <ResourcesUsage namespace={props.resourceName} />,
() => <NamespaceWorkloads namespace={props.resourceName} />,
]}
showCustomHealthCardsTitle={true}
>
{LimitrangesList}
{ResourceQuotasList}
Expand Down
7 changes: 6 additions & 1 deletion src/shared/components/ResourceDetails/ResourceDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ResourceDetails.propTypes = {
layoutCloseCreateUrl: PropTypes.string,
layoutNumber: PropTypes.string,
customHealthCards: PropTypes.node,
showCustomHealthCardsTitle: PropTypes.bool,
};

ResourceDetails.defaultProps = {
Expand Down Expand Up @@ -171,6 +172,7 @@ function Resource({
statusBadge,
customStatusColumns,
customHealthCards,
showCustomHealthCardsTitle,
statusConditions,
headerContent,
}) {
Expand Down Expand Up @@ -436,7 +438,10 @@ function Resource({
{resourceDetailsCard}
{resourceStatusCard && resourceStatusCard}
</div>
<ResourceHealthCard customHealthCards={customOverviewCard} />
<ResourceHealthCard
customHealthCards={customOverviewCard}
showTitle={showCustomHealthCardsTitle}
/>
</>
)}
<Suspense fallback={<Spinner />}>
Expand Down
24 changes: 13 additions & 11 deletions src/shared/components/ResourceHealthCard/ResourceHealthCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@ import { Title } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
import { spacing } from '@ui5/webcomponents-react-base';

export function ResourceHealthCard({ customHealthCards }) {
export function ResourceHealthCard({ customHealthCards, showTitle = false }) {
const { t } = useTranslation();
if (!customHealthCards?.length) return null;
return (
<>
<Title
level="H3"
style={{
...spacing.sapUiMediumMarginBegin,
...spacing.sapUiMediumMarginTopBottom,
}}
>
{t('common.headers.monitoring-and-health')}
</Title>
<div className="cluster-stats" style={spacing.sapUiTinyMarginBeginEnd}>
{showTitle && (
<Title
level="H3"
style={{
...spacing.sapUiMediumMarginBegin,
...spacing.sapUiMediumMarginTopBottom,
}}
>
{t('common.headers.monitoring-and-health')}
</Title>
)}
<div className="cluster-stats" style={spacing.sapUiTinyMargin}>
{customHealthCards}
</div>
</>
Expand Down

0 comments on commit 0b8142d

Please sign in to comment.