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
7 changes: 6 additions & 1 deletion console/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ export async function fetchAllPatterns(): Promise<{
const patterns = await Promise.all(
catalog.patterns.map(async (key) => {
const pattern = await fetchPattern(key);
return { ...pattern, catalogKey: key };
const logo = pattern.logo
? /^https?:\/\//.test(pattern.logo)
? pattern.logo
: `${PATTERN_UI_CATALOG_BASE_URL}/${key}/${pattern.logo}`
: undefined;
return { ...pattern, catalogKey: key, logo };
}),
);
return {
Expand Down
5 changes: 5 additions & 0 deletions console/src/components/PatternCatalogPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
object-fit: contain;
}

.patterns-operator__pattern-logo {
max-height: 32px;
object-fit: contain;
}

.patterns-operator__card-field {
margin-bottom: 4px;
}
Expand Down
17 changes: 16 additions & 1 deletion console/src/components/PatternCatalogPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,22 @@ export default function PatternCatalogPage() {
isDisabled ? ' patterns-operator__card--disabled' : ''
}`}
>
<CardHeader>
<CardHeader
actions={
pattern.logo
? {
actions: (
<img
src={pattern.logo}
alt={`${pattern.display_name} logo`}
className="patterns-operator__pattern-logo"
/>
),
hasNoOffset: true,
}
: undefined
}
>
<Tooltip content={TIER_DESCRIPTIONS[pattern.tier] || pattern.tier}>
<Label
color={TIER_COLORS[pattern.tier] || 'grey'}
Expand Down
1 change: 1 addition & 0 deletions console/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface Pattern {
requirements?: PatternRequirements;
extra_features?: ExtraFeatures;
external_requirements?: ExternalRequirements;
logo?: string;
/** The catalog directory key used to fetch this pattern. */
catalogKey?: string;
}
Expand Down