Skip to content

Commit 4ac2424

Browse files
Illustrated Banner Component
1 parent 189f275 commit 4ac2424

File tree

18 files changed

+175
-54
lines changed

18 files changed

+175
-54
lines changed

public/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"IntelligentBreadcrumbs": {
7676
"homeLabel": "Home"
7777
},
78+
"MCPContext": {
79+
"errorMessage": "An unknown error occurred"
80+
},
7881
"NotInLuigiView": {
7982
"titleMessage": "Opened outside of Hyperspace Portal",
8083
"subtitleMessage": "Looks like this page is not opened inside of the Hyperspace Portal. Contact admins for help."

src/components/ControlPlane/FluxList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function FluxList() {
4444
if (repoErr || kustomizationErr) {
4545
return (
4646
<IllustratedError
47-
error={repoErr || kustomizationErr}
47+
error={repoErr.message || kustomizationErr.message}
4848
title={t('FluxList.noFluxError')}
4949
/>
5050
);

src/components/ControlPlane/ManagedResources.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function ManagedResources() {
109109
<>
110110
<Title level="H4">{t('ManagedResources.header')}</Title>
111111

112-
{error && <IllustratedError error={error} />}
112+
{error && <IllustratedError error={error.message} />}
113113

114114
{!error && (
115115
<AnalyticalTable

src/components/ControlPlane/Providers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function Providers() {
105105
<>
106106
<Title level="H4">{t('Providers.headerProviders')}</Title>
107107

108-
{error && <IllustratedError error={error} />}
108+
{error && <IllustratedError error={error.message} />}
109109

110110
{!error && (
111111
<AnalyticalTable

src/components/ControlPlanes/List/ControlPlaneListAllWorkspaces.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function ControlPlaneListAllWorkspaces({ projectName }: Props) {
2727
return <Loading />;
2828
}
2929
if (error) {
30-
return <IllustratedError error={error} />;
30+
return <IllustratedError error={error.message} />;
3131
}
3232

3333
return (

src/components/ControlPlanes/List/ControlPlaneListWorkspaceGridTile.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import '@ui5/webcomponents-fiori/dist/illustrations/EmptyList.js';
1010
import '@ui5/webcomponents-icons/dist/delete';
1111
import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
1212
import { CopyButton } from '../../Shared/CopyButton.tsx';
13-
import { NoManagedControlPlaneBanner } from '../NoManagedControlPlaneBanner.tsx';
1413
import { ControlPlaneCard } from '../ControlPlaneCard/ControlPlaneCard.tsx';
1514
import {
1615
ListWorkspacesType,
@@ -34,6 +33,9 @@ import { ListControlPlanes } from '../../../lib/api/types/crate/controlPlanes.ts
3433
import IllustratedError from '../../Shared/IllustratedError.tsx';
3534
import { APIError } from '../../../lib/api/error.ts';
3635
import { useTranslation } from 'react-i18next';
36+
import { IllustratedBanner } from '../../Ui/IllustratedBanner/IllustratedBanner.tsx';
37+
import { useFrontendConfig } from '../../../context/FrontendConfigContext.tsx';
38+
import { IllustrationName } from '../../Shared/IllustratedName.ts';
3739

3840
interface Props {
3941
projectName: string;
@@ -61,6 +63,8 @@ export function ControlPlaneListWorkspaceGridTile({
6163
const { trigger } = useApiResourceMutation<DeleteWorkspaceType>(
6264
DeleteWorkspaceResource(projectNamespace, workspaceName),
6365
);
66+
67+
const { links } = useFrontendConfig();
6468
const errorView = createErrorView(cpsError);
6569

6670
function createErrorView(error: APIError) {
@@ -139,7 +143,13 @@ export function ControlPlaneListWorkspaceGridTile({
139143
) : (
140144
<Grid defaultSpan="XL4 L4 M7 S12">
141145
{controlplanes?.length === 0 ? (
142-
<NoManagedControlPlaneBanner />
146+
<IllustratedBanner
147+
title={t('NoManagedControlPlaneBanner.titleMessage')}
148+
subtitle={t('NoManagedControlPlaneBanner.subtitleMessage')}
149+
helpButtonText={t('NoManagedControlPlaneBanner.helpButton')}
150+
illustrationName={IllustrationName.NoData}
151+
helpLink={links.COM_PAGE_GETTING_STARTED_MCP}
152+
/>
143153
) : (
144154
controlplanes?.map((cp) => (
145155
<ControlPlaneCard

src/components/ControlPlanes/NoManagedControlPlaneBanner.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/components/Projects/ProjectChooser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function ProjectChooser({ currentProjectName }: Props) {
1414
const navigate = useLuigiNavigate();
1515

1616
if (error) {
17-
return <IllustratedError error={error} />;
17+
return <IllustratedError error={error.message} />;
1818
}
1919

2020
return (

src/components/Projects/ProjectsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function ProjectsList() {
1616
refreshInterval: 3000,
1717
});
1818
if (error) {
19-
return <IllustratedError error={error} />;
19+
return <IllustratedError error={error.message} />;
2020
}
2121

2222
return (

0 commit comments

Comments
 (0)