Skip to content

Commit 96ddc7f

Browse files
committed
chore: version bump
1 parent 18aa6d6 commit 96ddc7f

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.5.8-beta-3",
3+
"version": "0.5.8-beta-4",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Common.service.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ const getImageApprovalPolicyDetailsFromMaterialResult = (cdMaterialsResult): Ima
250250
const validGroups = userApprovalConfig.userGroups.map((group) => group.identifier)
251251

252252
// Have moved from Object.keys(imageApprovalUsersInfo) to approvalUsers since backend is not filtering out the users without approval
253-
// TODO: This check should be on BE. Need to remove this once BE is updated
253+
// TODO: This check should be on BE. Need to remove this once BE is updated
254254
const usersList = approvalUsers.filter((user) => user !== DefaultUserKey.system)
255255
const groupIdentifierToUsersMap = usersList.reduce(
256256
(acc, user) => {
@@ -512,21 +512,18 @@ export function getWebhookEventsForEventId(eventId: string | number) {
512512
return get(URL)
513513
}
514514

515+
/**
516+
*
517+
* @param gitUrl Git URL of the repository
518+
* @param branchName Branch name
519+
* @returns URL to the branch in the Git repository
520+
*/
515521
export const getGitBranchUrl = (gitUrl: string, branchName: string): string | null => {
516522
if (!gitUrl) return null
517-
518523
const trimmedGitUrl = gitUrl.trim().replace(/\/$/, '') // Remove any trailing slash
519-
520-
switch (true) {
521-
case trimmedGitUrl.includes(GitProviderType.GITLAB):
522-
return `${trimmedGitUrl}/-/tree/${branchName}`
523-
case trimmedGitUrl.includes(GitProviderType.GITHUB):
524-
return `${trimmedGitUrl}/tree/${branchName}`
525-
case trimmedGitUrl.includes(GitProviderType.BITBUCKET):
526-
return `${trimmedGitUrl}/branch/${branchName}`
527-
case trimmedGitUrl.includes(GitProviderType.AZURE):
528-
return `${trimmedGitUrl}/src/branch/${branchName}`
529-
default:
530-
return null
531-
}
532-
}
524+
if (trimmedGitUrl.includes(GitProviderType.GITLAB)) return `${trimmedGitUrl}/-/tree/${branchName}`
525+
else if (trimmedGitUrl.includes(GitProviderType.GITHUB)) return `${trimmedGitUrl}/tree/${branchName}`
526+
else if (trimmedGitUrl.includes(GitProviderType.BITBUCKET)) return `${trimmedGitUrl}/branch/${branchName}`
527+
else if (trimmedGitUrl.includes(GitProviderType.AZURE)) return `${trimmedGitUrl}/src/branch/${branchName}`
528+
return null
529+
}

0 commit comments

Comments
 (0)