Skip to content

Commit ef4d137

Browse files
committed
Polishing and consistency with console
Signed-off-by: Keith Chong <[email protected]>
1 parent 24608cf commit ef4d137

File tree

2 files changed

+42
-11
lines changed

2 files changed

+42
-11
lines changed

src/gitops/components/shared/DetailsPageHeader/DetailsPageHeader.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { isApplicationRefreshing } from '@gitops/utils/gitops';
99
import { useGitOpsTranslation } from '@gitops/utils/hooks/useGitOpsTranslation';
1010
import { Action, K8sModel, K8sResourceCommon } from '@openshift-console/dynamic-plugin-sdk';
1111
import {
12+
ActionList,
13+
ActionListGroup,
14+
ActionListItem,
1215
Breadcrumb,
1316
BreadcrumbItem,
1417
Flex,
@@ -45,7 +48,7 @@ const DetailsPageTitle: React.FC<DetailsPageTitleProps> = ({ breadcrumb, childre
4548
</div>
4649
);
4750

48-
type ApplicationPageTitleProps = {
51+
type DetailsPageHeaderProps = {
4952
obj: K8sResourceCommon;
5053
model: K8sModel;
5154
name: string;
@@ -55,7 +58,7 @@ type ApplicationPageTitleProps = {
5558
iconTitle: string;
5659
};
5760

58-
const DetailsPageHeader: React.FC<ApplicationPageTitleProps> = ({
61+
const DetailsPageHeader: React.FC<DetailsPageHeaderProps> = ({
5962
obj,
6063
model,
6164
name,
@@ -80,12 +83,12 @@ const DetailsPageHeader: React.FC<ApplicationPageTitleProps> = ({
8083
Argo CD {t(model.labelPlural)}
8184
</Link>
8285
</BreadcrumbItem>
83-
<BreadcrumbItem>Argo CD {t(model.labelPlural + ' Details')}</BreadcrumbItem>
86+
<BreadcrumbItem>Argo CD {t(model.labelPlural + ' details')}</BreadcrumbItem>
8487
</Breadcrumb>
8588
}
8689
>
8790
<PaneHeading>
88-
<Title headingLevel="h1">
91+
<Title headingLevel="h1" className="details-page-header">
8992
<span
9093
className="co-m-resource-icon co-m-resource-icon--lg argocd-resource-icon"
9194
title={iconTitle}
@@ -96,14 +99,23 @@ const DetailsPageHeader: React.FC<ApplicationPageTitleProps> = ({
9699
{name ?? obj?.metadata?.name}{' '}
97100
{isApplicationRefreshing(obj) ? <Spinner size="md" /> : <span></span>}
98101
</span>
99-
<span style={{ marginLeft: '10px', marginBottom: '3px' }}>
102+
<span
103+
className="details-page-header__item"
104+
style={{ marginLeft: '10px', marginBottom: '5px' }}
105+
>
100106
<DevPreviewBadge />
101107
</span>
102108
</Title>
103-
<div className="co-actions">
104-
<FavoriteButton defaultName={name ?? obj?.metadata?.name} />
105-
<ActionsDropdown actions={actions} isKebabToggle={false} />
106-
</div>
109+
<ActionList className="co-actions">
110+
<ActionListGroup>
111+
<ActionListItem>
112+
<FavoriteButton defaultName={name ?? obj?.metadata?.name} />
113+
</ActionListItem>
114+
<ActionListItem>
115+
<ActionsDropdown actions={actions} isKebabToggle={false} />
116+
</ActionListItem>
117+
</ActionListGroup>
118+
</ActionList>
107119
</PaneHeading>
108120
</DetailsPageTitle>
109121
</div>

src/gitops/components/shared/DetailsPageHeader/details-page-header.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,31 @@
33
color: white !important;
44
}
55

6+
$co-button-height: calc(
7+
var(--pf-t--global--font--size--body--default) * var(--pf-t--global--font--line-height--body) +
8+
var(--pf-t--global--spacer--control--vertical--default) * 2
9+
);
10+
611
.co-actions {
12+
// ensure all actions are of the same height regardless of content
13+
min-height: $co-button-height;
14+
15+
> .pf-v6-c-action-list__group {
16+
// remove extra spacing when a component is rendered but has no children
17+
> div:empty {
18+
display: none;
19+
}
20+
}
21+
}
22+
23+
.details-page-header {
724
display: flex;
825
align-items: center;
9-
gap: var(--pf-v6-global--spacer--sm);
26+
&__item {
27+
padding-left: '16px';
28+
margin-left: '16px';
29+
}
1030
}
11-
1231
.details-page-title {
1332
padding-block-start: var(--pf-t--global--spacer--sm);
1433
}

0 commit comments

Comments
 (0)