Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8c2299e
chore: modified chart registry icon method
shivani170 Aug 12, 2025
98d29d2
chore: removed commented code
shivani170 Aug 12, 2025
260d86c
chore: removed commented code
shivani170 Aug 12, 2025
40df938
Merge branch 'develop' into feat/git-icon-replacement
shivani170 Aug 12, 2025
b81dffc
chore: removed commented code
shivani170 Aug 13, 2025
ca2acd1
feat: add support for freemium license
arunjaindev Aug 13, 2025
ce0bf97
chore: version bump
arunjaindev Aug 13, 2025
d2e9fbb
chore: add css for mail button casing
arunjaindev Aug 13, 2025
6118d11
feat: add module limits in freemium
arunjaindev Aug 14, 2025
4945840
feat: handle license card expiry states for freemium
arunjaindev Aug 14, 2025
a917009
Merge branch 'develop' into feat/git-icon-replacement
shivani170 Aug 18, 2025
2efce0d
chore: version bump
shivani170 Aug 18, 2025
be3125a
chore:added support for gitea & aws code commit
shivani170 Aug 18, 2025
7efb428
feat: add icon for upgrade to ent
arunjaindev Aug 19, 2025
88bb630
Merge pull request #855 from devtron-labs/feat/freemium
arunjaindev Aug 19, 2025
cc66907
fix: do not check expiry for freemium
arunjaindev Aug 19, 2025
62c58ef
chore: update logic
arunjaindev Aug 19, 2025
ac8d45c
Merge pull request #859 from devtron-labs/fix/freemium-license
arunjaindev Aug 19, 2025
1f77dd3
feat: edit devtron reviews
arunjaindev Aug 19, 2025
e9decf4
chore: delete icon
arunjaindev Aug 19, 2025
fab7807
Merge branch 'main' into fix/freemium-license
arunjaindev Aug 19, 2025
7c60b88
chore: add contact sales link
arunjaindev Aug 19, 2025
82ada88
Merge branch 'fix/freemium-license' of https://github.com/devtron-lab…
arunjaindev Aug 19, 2025
2477c44
chore: remove lazy loading from login image
arunjaindev Aug 19, 2025
5783766
Merge pull request #860 from devtron-labs/fix/freemium-license
arunjaindev Aug 19, 2025
c0e84ff
feat: update freemium messaging and error messaging
arunjaindev Aug 20, 2025
798f55c
chore: edit gap in buttons
arunjaindev Aug 20, 2025
c46d2af
Merge pull request #861 from devtron-labs/feat/freemium-messaging
arunjaindev Aug 20, 2025
e1a058d
chore: version bump
shivani170 Aug 21, 2025
8acbfe3
chore: modified registry icon method by removing if chain
shivani170 Aug 21, 2025
01cd14d
chore: fix for type
shivani170 Aug 21, 2025
51a0f11
chore: version bump
shivani170 Aug 21, 2025
7f44c95
chore: icon replaced
shivani170 Aug 21, 2025
9af46db
Merge branch 'main' into feat/git-icon-replacement
shivani170 Aug 21, 2025
7aa64bd
chore: version bump
shivani170 Aug 21, 2025
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.19.0-pre-5",
"version": "1.19.0-beta-8",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
10 changes: 10 additions & 0 deletions src/Assets/IconV2/ic-aws-codecommit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Common/CIPipeline.Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface MaterialType {
gitProviderId: number
regex?: string
isRegex: boolean
url: string
}

export interface Githost {
Expand Down
10 changes: 8 additions & 2 deletions src/Shared/Components/CICDHistory/Artifacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { useParams } from 'react-router-dom'

import { ReactComponent as Down } from '@Icons/ic-arrow-forward.svg'
import { ReactComponent as OpenInNew } from '@Icons/ic-arrow-out.svg'
import docker from '@Icons/ic-docker.svg'
import { ReactComponent as Download } from '@Icons/ic-download.svg'
import folder from '@Icons/ic-folder.svg'
import { ReactComponent as ICHelpOutline } from '@Icons/ic-help.svg'
Expand All @@ -30,6 +29,7 @@ import { useDownload } from '@Shared/Hooks'
import { ClipboardButton, extractImage, GenericEmptyState, ImageTagsContainer, useGetUserRoles } from '../../../Common'
import { EMPTY_STATE_STATUS } from '../../constants'
import { DocLink } from '../DocLink'
import { RegistryIcon } from '../RegistryIcon'
import { TargetPlatformBadgeList } from '../TargetPlatforms'
import { TERMINAL_STATUS_MAP } from './constants'
import { ArtifactType, CIListItemType } from './types'
Expand Down Expand Up @@ -62,6 +62,7 @@ export const CIListItem = ({
renderCIListHeader,
targetPlatforms,
isDeploymentWithoutApproval,
artifact,
}: CIListItemType) => {
const showCIListHeader =
!!renderCIListHeader &&
Expand Down Expand Up @@ -99,7 +100,11 @@ export const CIListItem = ({
>
<div className="flex left dc__gap-12">
<div className="bcn-1 flex br-4 icon-dim-40">
<img src={type === 'report' ? folder : docker} className="icon-dim-20" alt="type" />
{type === 'report' ? (
<img src={folder} width={20} height={20} alt="type" />
) : (
<RegistryIcon registryUrl={artifact} />
)}
</div>
{children}
</div>
Expand Down Expand Up @@ -228,6 +233,7 @@ const Artifacts = ({
isSuperAdmin={isSuperAdmin}
renderCIListHeader={renderCIListHeader}
targetPlatforms={targetPlatforms}
artifact={artifact}
>
<div className="flex column left hover-trigger">
<div className="cn-9 fs-14 flex left" data-testid="artifact-text-visibility">
Expand Down
1 change: 1 addition & 0 deletions src/Shared/Components/CICDHistory/History.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export const GitChanges = ({
renderCIListHeader={renderCIListHeader}
targetPlatforms={targetPlatforms}
isDeploymentWithoutApproval={isDeploymentWithoutApproval}
artifact={artifact}
>
<div className="flex column left hover-trigger">
<div className="cn-9 fs-14 flex left">
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/CICDHistory/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export type CIListItemType = Pick<History, 'promotionApprovalMetadata' | 'isDepl
tagsEditable: boolean
hideImageTaggingHardDelete: boolean
isSuperAdmin: boolean
artifact: string
}
| {
type: 'report'
Expand All @@ -448,6 +449,7 @@ export type CIListItemType = Pick<History, 'promotionApprovalMetadata' | 'isDepl
tagsEditable?: never
hideImageTaggingHardDelete?: never
isSuperAdmin?: never
artifact?: never
}
)

Expand Down
10 changes: 10 additions & 0 deletions src/Shared/Components/GitProviderIcon/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import { IconName } from '../Icon'

export const isAWSCodeCommitURL = (url: string = ''): boolean =>
url.includes('git-codecommit.') && url.includes('.amazonaws.com')

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
.amazonaws.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

Copilot Autofix

AI 2 months ago

To fix the problem, we should parse the input URL and check the host component to ensure it matches the expected AWS CodeCommit host pattern. Specifically, AWS CodeCommit URLs have hosts like git-codecommit.<region>.amazonaws.com. We should use the standard URL class to parse the URL and then use a regular expression or string checks to verify that the host matches the expected pattern. This change should be made in the isAWSCodeCommitURL function in src/Shared/Components/GitProviderIcon/utils.ts. No external dependencies are needed, as the URL class is available in modern JavaScript/TypeScript environments.

Suggested changeset 1
src/Shared/Components/GitProviderIcon/utils.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/Shared/Components/GitProviderIcon/utils.ts b/src/Shared/Components/GitProviderIcon/utils.ts
--- a/src/Shared/Components/GitProviderIcon/utils.ts
+++ b/src/Shared/Components/GitProviderIcon/utils.ts
@@ -18,8 +18,16 @@
 
 import { IconName } from '../Icon'
 
-export const isAWSCodeCommitURL = (url: string = ''): boolean =>
-    url.includes('git-codecommit.') && url.includes('.amazonaws.com')
+export const isAWSCodeCommitURL = (url: string = ''): boolean => {
+    try {
+        const { host } = new URL(url);
+        // AWS CodeCommit hosts are like: git-codecommit.<region>.amazonaws.com
+        // This regex matches hosts starting with git-codecommit., followed by region, ending with .amazonaws.com
+        return /^git-codecommit\.[a-z0-9-]+\.amazonaws\.com$/i.test(host);
+    } catch {
+        return false;
+    }
+}
 
 export const getGitIconName = (repoUrl: string): IconName => {
     if (repoUrl.includes(GitProviderType.GITHUB)) {
EOF
@@ -18,8 +18,16 @@

import { IconName } from '../Icon'

export const isAWSCodeCommitURL = (url: string = ''): boolean =>
url.includes('git-codecommit.') && url.includes('.amazonaws.com')
export const isAWSCodeCommitURL = (url: string = ''): boolean => {
try {
const { host } = new URL(url);
// AWS CodeCommit hosts are like: git-codecommit.<region>.amazonaws.com
// This regex matches hosts starting with git-codecommit., followed by region, ending with .amazonaws.com
return /^git-codecommit\.[a-z0-9-]+\.amazonaws\.com$/i.test(host);
} catch {
return false;
}
}

export const getGitIconName = (repoUrl: string): IconName => {
if (repoUrl.includes(GitProviderType.GITHUB)) {
Copilot is powered by AI and may make mistakes. Always verify output.

export const getGitIconName = (repoUrl: string): IconName => {
if (repoUrl.includes(GitProviderType.GITHUB)) {
return 'ic-github'
Expand All @@ -28,5 +31,12 @@
if (repoUrl.includes(GitProviderType.BITBUCKET)) {
return 'ic-bitbucket'
}
if (repoUrl.includes(GitProviderType.AZURE)) {
return 'ic-azure'
}
if (isAWSCodeCommitURL(repoUrl)) {
return 'ic-aws-codecommit'
}

return 'ic-git'
}
2 changes: 2 additions & 0 deletions src/Shared/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ReactComponent as ICArrowsClockwise } from '@IconsV2/ic-arrows-clockwis
import { ReactComponent as ICArrowsLeftRight } from '@IconsV2/ic-arrows-left-right.svg'
import { ReactComponent as ICAsterisk } from '@IconsV2/ic-asterisk.svg'
import { ReactComponent as ICAther } from '@IconsV2/ic-ather.svg'
import { ReactComponent as ICAwsCodecommit } from '@IconsV2/ic-aws-codecommit.svg'
import { ReactComponent as ICAzure } from '@IconsV2/ic-azure.svg'
import { ReactComponent as ICAzureAks } from '@IconsV2/ic-azure-aks.svg'
import { ReactComponent as ICBgCluster } from '@IconsV2/ic-bg-cluster.svg'
Expand Down Expand Up @@ -253,6 +254,7 @@ export const iconMap = {
'ic-arrows-left-right': ICArrowsLeftRight,
'ic-asterisk': ICAsterisk,
'ic-ather': ICAther,
'ic-aws-codecommit': ICAwsCodecommit,
'ic-azure-aks': ICAzureAks,
'ic-azure': ICAzure,
'ic-bg-cluster': ICBgCluster,
Expand Down
32 changes: 30 additions & 2 deletions src/Shared/Components/RegistryIcon/RegistryIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ const registryIconMap: Record<RegistryType, IconName> = {
[RegistryType.OTHER]: 'ic-container-registry',
}

export const RegistryIcon = ({ registryType, size = 20 }: RegistryIconProps) => (
<Icon name={registryIconMap[registryType] || 'ic-container-registry'} size={size} color={null} />
const getRegistryUrlIconName = (registryUrl: string): IconName => {
if (!registryUrl) return 'ic-container-registry'

const registryTypesToCheck: RegistryType[] = [
RegistryType.ECR,
RegistryType.GCR,
RegistryType.DOCKER_HUB,
RegistryType.DOCKER,
RegistryType.QUAY,
RegistryType.GITLAB,
RegistryType.GITHUB,
RegistryType.BITBUCKET,
RegistryType.ACR,
RegistryType.ARTIFACT_REGISTRY,
]

const matchedType = registryTypesToCheck.find((type) => registryUrl.includes(type))

if (!matchedType) return 'ic-container-registry'

// Special case for Docker/DockerHub
return matchedType === RegistryType.DOCKER ? registryIconMap[RegistryType.DOCKER_HUB] : registryIconMap[matchedType]
}

export const RegistryIcon = ({ registryType, size = 20, registryUrl }: RegistryIconProps) => (
<Icon
name={registryType ? registryIconMap[registryType] : getRegistryUrlIconName(registryUrl)}
size={size}
color={null}
/>
)
33 changes: 25 additions & 8 deletions src/Shared/Components/RegistryIcon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,28 @@ import { RegistryType } from '@Shared/types'

import { IconsProps } from '../Icon'

export interface RegistryIconProps {
registryType: RegistryType
/**
* The size of the icon in pixels.
* @default 20
*/
size?: IconsProps['size']
}
export type RegistryIconProps =
| {
registryType?: RegistryType
/**
* The size of the icon in pixels.
* @default 20
*/
size?: IconsProps['size']
/**
* The registry URL to determine the icon.
*/
registryUrl?: never
}
| {
registryType?: never
/**
* The size of the icon in pixels.
* @default 20
*/
size?: IconsProps['size']
/**
* The registry URL to determine the icon.
*/
registryUrl: string
}