Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export const ComponentsSelectionContainer: React.FC<ComponentsSelectionProps> =
}

if (error) {
return <IllustratedError />;
return <IllustratedError compact={true} />;
}

// Defensive: If the API returned no items, show error
if (!componentsList || componentsList.length === 0) {
return <IllustratedError title={t('componentsSelection.cannotLoad')} />;
return <IllustratedError title={t('componentsSelection.cannotLoad')} compact={true} />;
}

return <ComponentsSelection componentsList={componentsList} setComponentsList={setComponentsList} />;
Expand Down
1 change: 1 addition & 0 deletions src/components/ControlPlane/FluxList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export default function FluxList() {
<IllustratedError
details={repoErr?.message || kustomizationErr?.message || t('FluxList.undefinedError')}
title={t('FluxList.noFluxError')}
compact={true}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function ControlPlaneListWorkspaceGridTile({ projectName, workspace }: Pr
<IllustratedError
title={t('ControlPlaneListWorkspaceGridTile.permissionErrorMessage')}
details={t('ControlPlaneListWorkspaceGridTile.permissionErrorMessageSubtitle')}
compact={true}
/>
);
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Shared/IllustratedError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import IllustrationMessageType from '@ui5/webcomponents-fiori/dist/types/Illustr
interface Props {
title?: string;
details?: string;
compact?: boolean;
}

export default function IllustratedError({ title, details }: Props) {
export default function IllustratedError({ title, details, compact }: Props) {
const { t } = useTranslation();

return (
<IllustratedBanner
illustrationName={IllustrationMessageType.SimpleError}
title={title ?? t('IllustratedError.titleText')}
subtitle={details ?? t('IllustratedError.subtitleText')}
compact={compact}
/>
);
}
2 changes: 1 addition & 1 deletion src/components/Ui/IllustratedBanner/IllustratedBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const IllustratedBanner = ({
return (
<FlexBox direction="Column" alignItems="Center">
<IllustratedMessage
design={compact ? IllustrationMessageDesign.ExtraSmall : IllustrationMessageDesign.Large}
design={compact ? IllustrationMessageDesign.Small : IllustrationMessageDesign.Large}
name={illustrationName}
titleText={title}
subtitleText={subtitleText}
Expand Down
Loading