Skip to content

Commit 653879b

Browse files
Illustrated Banner Component
1 parent d4fd7cb commit 653879b

File tree

18 files changed

+175
-55
lines changed

18 files changed

+175
-55
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/NoData.js';
1010
import '@ui5/webcomponents-fiori/dist/illustrations/EmptyList.js';
1111
import '@ui5/webcomponents-icons/dist/delete';
1212
import { CopyButton } from '../../Shared/CopyButton.tsx';
13-
import { NoManagedControlPlaneBanner } from '../NoManagedControlPlaneBanner.tsx';
1413
import { ControlPlaneCard } from '../ControlPlaneCard/ControlPlaneCard.tsx';
1514
import {
1615
ListWorkspacesType,
@@ -35,6 +34,9 @@ import IllustratedError from '../../Shared/IllustratedError.tsx';
3534
import { APIError } from '../../../lib/api/error.ts';
3635
import { useTranslation } from 'react-i18next';
3736
import { YamlViewButton } from '../../Yaml/YamlViewButton.tsx';
37+
import { IllustratedBanner } from '../../Ui/IllustratedBanner/IllustratedBanner.tsx';
38+
import { useFrontendConfig } from '../../../context/FrontendConfigContext.tsx';
39+
import { IllustrationName } from '../../Shared/IllustratedName.ts';
3840

3941
interface Props {
4042
projectName: string;
@@ -62,6 +64,8 @@ export function ControlPlaneListWorkspaceGridTile({
6264
const { trigger } = useApiResourceMutation<DeleteWorkspaceType>(
6365
DeleteWorkspaceResource(projectNamespace, workspaceName),
6466
);
67+
68+
const { links } = useFrontendConfig();
6569
const errorView = createErrorView(cpsError);
6670

6771
function createErrorView(error: APIError) {
@@ -148,7 +152,13 @@ export function ControlPlaneListWorkspaceGridTile({
148152
) : (
149153
<Grid defaultSpan="XL4 L4 M7 S12">
150154
{controlplanes?.length === 0 ? (
151-
<NoManagedControlPlaneBanner />
155+
<IllustratedBanner
156+
title={t('NoManagedControlPlaneBanner.titleMessage')}
157+
subtitle={t('NoManagedControlPlaneBanner.subtitleMessage')}
158+
helpButtonText={t('NoManagedControlPlaneBanner.helpButton')}
159+
illustrationName={IllustrationName.NoData}
160+
helpLink={links.COM_PAGE_GETTING_STARTED_MCP}
161+
/>
152162
) : (
153163
controlplanes?.map((cp) => (
154164
<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
@@ -77,7 +77,7 @@ export default function ProjectsList() {
7777
[],
7878
);
7979
if (error) {
80-
return <IllustratedError error={error} />;
80+
return <IllustratedError error={error.message} />;
8181
}
8282

8383
return (

0 commit comments

Comments
 (0)