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
2 changes: 1 addition & 1 deletion .github/workflows/pull-integration-cluster-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-integration-namespace-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-kyma-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-smoke-test-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-smoke-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
# - uses: ./.github/actions/rebase
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
8 changes: 8 additions & 0 deletions src/components/KymaModules/KymaModulesAddModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export default function KymaModulesAddModule({
],
docsUrl:
module.metadata.annotations['operator.kyma-project.io/doc-url'],
icon: {
link: module.spec?.info?.icons[0]?.link,
name: module.spec?.info?.icons[0]?.name,
},
isMetaRelease: false,
});
} else if (existingModule) {
Expand Down Expand Up @@ -130,6 +134,10 @@ export default function KymaModulesAddModule({
},
],
docsUrl: module.spec.info.documentation,
icon: {
link: module.spec?.info?.icons[0]?.link,
name: module.spec?.info?.icons[0]?.name,
},
});
} else {
acc
Expand Down
2 changes: 2 additions & 0 deletions src/components/KymaModules/KymaModulesAddModule.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
}

.settings-panel {
width: 350px;

&::part(header) {
font-family: var(--sapFontFamily);
font-size: var(--sapFontSize);
Expand Down
37 changes: 36 additions & 1 deletion src/components/KymaModules/ModulesCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ import '@ui5/webcomponents/dist/features/InputElementsFormSupport.js';
import { ExternalLink } from 'shared/components/ExternalLink/ExternalLink';
import { useTranslation } from 'react-i18next';
import { spacing } from '@ui5/webcomponents-react-base';
import { useEffect, useState } from 'react';

async function isImageAvailable(url) {
try {
const response = await fetch(url, { method: 'HEAD' });
return response.ok;
} catch (error) {
return false;
}
}
async function getImageSrc(module) {
const defaultImage = '/assets/sap-logo.svg';
const iconLink = module.icon.link;

if (iconLink && (await isImageAvailable(iconLink))) {
return iconLink;
} else {
return defaultImage;
}
}

export default function ModulesCard({
module,
Expand All @@ -26,6 +46,15 @@ export default function ModulesCard({
checkIfStatusModuleIsBeta,
}) {
const { t } = useTranslation();
const [imageSrc, setImageSrc] = useState('');

useEffect(() => {
async function checkImage() {
const src = await getImageSrc(module);
setImageSrc(src);
}
checkImage();
}, [module]);

return (
<Card key={module.name} className="addModuleCard">
Expand All @@ -52,7 +81,13 @@ export default function ModulesCard({
: t('kyma-modules.no-version')}
</Text>
</div>
<img className="avatar" alt="SAP" src="\assets\sap-logo.svg" />
{imageSrc !== '' && (
<img
className="avatar"
alt={module.icon.name ? module.icon.name : 'SAP'}
src={imageSrc}
/>
)}
</StandardListItem>
<div className="content">
{module.docsUrl && (
Expand Down
Loading