Skip to content

Commit 4bd22eb

Browse files
committed
feat: member card
1 parent 34bd323 commit 4bd22eb

File tree

9 files changed

+261
-59
lines changed

9 files changed

+261
-59
lines changed

public/locales/en.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"ComponentList": {
1616
"tableComponentHeader": "Name",
1717
"tableVersionHeader": "Version"
18+
},
19+
"MemberList": {
20+
1821
},
1922
"FluxList": {
2023
"tableNameHeader": "Name",
@@ -416,6 +419,12 @@
416419
"unmanaged": "Unmanaged"
417420
}
418421
},
422+
"MembersHint": {
423+
"title": "Members",
424+
"subtitle": "Manage access to your Managed Control Plane",
425+
"users": "Users",
426+
"serviceAccounts": "Service Accounts"
427+
},
419428
"ESOHint": {
420429
"title": "ESO",
421430
"subtitle": "Secure secrets with rotation",

public/members.svg

Lines changed: 21 additions & 0 deletions
Loading

src/components/BentoGrid/ComponentCard/ComponentCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const ComponentCard: React.FC<GenericHintProps & {
3535
<Card
3636
header={
3737
<CardHeader
38-
additionalText={enabled ? `v${version ?? ''}` : undefined}
38+
additionalText={enabled && version ? `v${version}` : undefined}
3939
avatar={
4040
<img
4141
src={config.iconSrc}

src/components/BentoGrid/ComponentCard/componentConfigs.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { GenericHintConfig } from '../../../types/types';
33
import {
44
calculateCrossplaneSegments,
55
calculateGitOpsSegments,
6+
calculateMembersSegments,
67
calculateVaultSegments,
78

8-
} from '../../../utils/hintsCardsRowCalculations';
9+
} from '../../../utils/componentCardCalculations';
910

1011
export const useCrossplaneHintConfig = (): GenericHintConfig => {
1112
const { t } = useTranslation();
@@ -60,8 +61,23 @@ export const useKyvernoHintConfig = (): GenericHintConfig => {
6061
subtitle: t('Hints.KyvernoHint.subtitle'),
6162
iconSrc: '/kyverno.svg',
6263
iconAlt: 'Kyverno',
63-
iconStyle: { borderRadius: '0' }, // Vault icon should not be rounded
64+
iconStyle: { borderRadius: '0' }, // Kyverno icon should not be rounded
6465
calculateSegments: (allItems, isLoading, error, enabled) =>
6566
calculateVaultSegments(allItems, isLoading, error, enabled, t),
6667
};
6768
};
69+
70+
export const useMembersHintConfig = (): GenericHintConfig => {
71+
const { t } = useTranslation();
72+
73+
return {
74+
title: t('Hints.MembersHint.title'),
75+
subtitle: t('Hints.MembersHint.subtitle'),
76+
iconSrc: '/members.svg',
77+
iconAlt: 'Members',
78+
iconStyle: { borderRadius: '0' }, // Members icon should not be rounded
79+
calculateSegments: (allItems, isLoading, error, enabled) =>
80+
calculateMembersSegments(allItems, isLoading, error, enabled, t),
81+
// calculateHoverData: (allItems, enabled) => calculateGitOpsHoverDataGeneric(allItems, enabled, t),
82+
};
83+
};

src/lib/api/types/crate/controlPlanes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,5 @@ export const ControlPlane = (
7979
): Resource<ControlPlaneType> => {
8080
return {
8181
path: `/apis/core.openmcp.cloud/v1alpha1/namespaces/project-${projectName}--ws-${workspaceName}/managedcontrolplanes/${controlPlaneName}`,
82-
jq: '{ spec: .spec | {components}, status: { conditions: [.status.conditions[] | {type: .type, status: .status, message: .message, reason: .reason, lastTransitionTime: .lastTransitionTime}], access: .status.components.authentication.access, status: .status.status }}',
83-
};
82+
jq: '{ spec: .spec | {components, authorization}, status: { conditions: [.status.conditions[] | {type: .type, status: .status, message: .message, reason: .reason, lastTransitionTime: .lastTransitionTime}], access: .status.components.authentication.access, status: .status.status }}', };
8483
};

src/spaces/mcp/pages/McpPage.module.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
99
}
1010

11+
.expandedMembersGrid {
12+
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
13+
height: 200px !important; /* Reduced height for members view without graph */
14+
}
15+
1116
.expandedCard {
1217
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
1318
border: 1px solid var(--sapObjectHeader_BorderColor) !important;
@@ -68,3 +73,48 @@
6873
transform: translateY(0);
6974
}
7075
}
76+
77+
/* Action bar styles */
78+
.actionsBar {
79+
display: flex;
80+
flex-direction: row;
81+
justify-content: space-between;
82+
gap: 0.5rem;
83+
}
84+
85+
/* Main container styles */
86+
.mainContainer {
87+
max-width: 1280px;
88+
margin: 0 auto;
89+
width: 100%;
90+
padding-top: 16px;
91+
padding-bottom: 12px;
92+
}
93+
94+
/* Card content container */
95+
.cardContentContainer {
96+
position: relative;
97+
height: 100%;
98+
}
99+
100+
/* Details panel bottom spacing */
101+
.detailsPanelBottom {
102+
height: 12px;
103+
background-color: #f5f5f5;
104+
margin-bottom: 32px;
105+
border-radius: 0 0 8px 8px;
106+
}
107+
108+
/* Table sections spacing */
109+
.tableSection {
110+
margin-top: 24px;
111+
}
112+
113+
.crossplaneTableElement {
114+
margin-top: 16px;
115+
}
116+
117+
/* First crossplane table element (no top margin) */
118+
.crossplaneTableElementFirst {
119+
margin-top: 24px;
120+
}

0 commit comments

Comments
 (0)