Skip to content

Commit

Permalink
Merge branch 'main' into gh-actions-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
akucharska committed Jan 30, 2025
2 parents f79f1a4 + 83cc4ac commit 9856950
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 5 deletions.
6 changes: 5 additions & 1 deletion kyma/environments/dev/statics.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[]
[
{
"source": "extensions/statics/modules-banner.yaml"
}
]
6 changes: 5 additions & 1 deletion kyma/environments/prod/statics.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[]
[
{
"source": "extensions/statics/modules-banner.yaml"
}
]
6 changes: 5 additions & 1 deletion kyma/environments/stage/statics.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
[]
[
{
"source": "extensions/statics/modules-banner.yaml"
}
]
37 changes: 37 additions & 0 deletions kyma/extensions/statics/modules-banner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: modules-banner
namespace: kube-public
labels:
app.kubernetes.io/name: modules-banner
busola.io/extension: statics
busola.io/extension-version: '0.5'
data:
dataSources: |-
kymas:
resource:
kind: Kyma
group: operator.kyma-project.io
version: v1beta2
injections: |-
- title: Introducing Modules
name: Modules
description: Modules add functionalities to your cluster. Consume SAP BTP services, monitor your cluster, build serverless applications and more.
widget: FeaturedCard
visibility: '$count($kymas().items)>0'
source: $
id: ModulesBanner
order: 0
illustration: Modules
design: information-1
children:
- widget: ResourceButton
source: "'Add Modules'"
resource:
customUrl: kymamodules
- widget: ExternalLinkButton
link: https://help.sap.com/docs/btp/sap-business-technology-platform/kyma-s-modular-approach
targets:
- slot: banner
location: ClusterOverview
3 changes: 3 additions & 0 deletions src/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ export function Header() {
/>
))}
<MenuItem
onClick={() => {
window.open(githubLink, '_blank', 'noopener, noreferrer');
}}
text={t('common.labels.version')}
additionalText={busolaVersion}
icon="inspect"
Expand Down
12 changes: 10 additions & 2 deletions src/header/SidebarMenu/useGetBusolaVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const BUSOLA_GITHUB_LINKS = {
REPOSITORY: 'https://github.com/kyma-project/busola',
PULLS: 'https://github.com/kyma-project/busola/pull',
COMMITS: 'https://github.com/kyma-project/busola/commit',
RELEASE: 'https://github.com/kyma-project/busola/releases/tag/',
RELEASES: 'https://github.com/kyma-project/busola/releases/',
};

function createGithubLink(version: string): string {
Expand All @@ -15,11 +17,17 @@ function createGithubLink(version: string): string {
if (version !== devVersion && version !== unknownVersion) {
if (version.toString().startsWith('PR-')) {
return `${BUSOLA_GITHUB_LINKS.PULLS}/${version.slice(3)}`;
} else if (version.toString().startsWith('v20')) {
} else if (
version.toString().startsWith('v20') &&
version.toString().includes('-')
) {
return `${BUSOLA_GITHUB_LINKS.COMMITS}/${version.substring(
version.length - 8,
)}`;
}
} else if (version.toString().startsWith('v')) {
return `${BUSOLA_GITHUB_LINKS.RELEASE}/${version}`;
} else if (version.toString() === 'latest')
return `${BUSOLA_GITHUB_LINKS.RELEASES}`;
return `${BUSOLA_GITHUB_LINKS.COMMITS}/${version}`;
}
}
Expand Down

0 comments on commit 9856950

Please sign in to comment.