From 50a011b6ca58f2fd599186678e09adae17c2c3bc Mon Sep 17 00:00:00 2001 From: Arun Date: Tue, 14 Jul 2026 13:37:47 +0530 Subject: [PATCH 1/3] feat: add Bitbucket Cloud authentication mode selector and related utilities --- .../gitOps/BitbucketCloudAuthSelector.tsx | 23 +++ src/components/gitOps/GitOpsConfiguration.tsx | 191 +++++++++++------- src/components/gitOps/constants.ts | 10 +- src/components/gitOps/gitops.type.ts | 5 + src/components/gitOps/utils.ts | 47 +++++ 5 files changed, 202 insertions(+), 74 deletions(-) create mode 100644 src/components/gitOps/BitbucketCloudAuthSelector.tsx diff --git a/src/components/gitOps/BitbucketCloudAuthSelector.tsx b/src/components/gitOps/BitbucketCloudAuthSelector.tsx new file mode 100644 index 0000000000..b122ff85fd --- /dev/null +++ b/src/components/gitOps/BitbucketCloudAuthSelector.tsx @@ -0,0 +1,23 @@ +import { RadioGroup, RadioGroupItem } from '@devtron-labs/devtron-fe-common-lib' +import type { BitbucketCloudAuthSelectorProps } from './gitops.type' +import { BITBUCKET_CLOUD_AUTH_MODE_OPTIONS } from './constants' + +const BitbucketCloudAuthSelector = ({ + authMode, + handleAuthModeChange, +}: BitbucketCloudAuthSelectorProps) => ( + + {BITBUCKET_CLOUD_AUTH_MODE_OPTIONS.map((option) => ( + + {option.label} + + ))} + +) + +export default BitbucketCloudAuthSelector diff --git a/src/components/gitOps/GitOpsConfiguration.tsx b/src/components/gitOps/GitOpsConfiguration.tsx index 5036d69e51..ddfb9cd2fd 100644 --- a/src/components/gitOps/GitOpsConfiguration.tsx +++ b/src/components/gitOps/GitOpsConfiguration.tsx @@ -35,6 +35,7 @@ import { PasswordField, DocLink, DocLinkProps, + Textarea, } from '@devtron-labs/devtron-fe-common-lib' import { TLSConnectionFormActionType, @@ -68,12 +69,19 @@ import { LinkAndLabelSpec, DefaultErrorFields, PROVIDER_DOC_LINK_MAP, + UNABLE_TO_DELETE_WARNING, } from './constants' -import { getGitOpsLabelText } from './utils' +import { + getGitAccessPasswordInputLabel, + getGitOpsLabelText, + getGitAccessUsernameInputPlaceholder, + getGitAccessUsernameInputLabel, +} from './utils' import { GitProvider } from '@Components/common/GitTabs/constants' import { GitProviderType } from '@Components/common/GitTabs/types' import { GitProviderTab } from '@Components/common/GitTabs/GitProviderTab' import UpdateConfirmationDialog from './UpdateConfirmationDialog' +import BitbucketCloudAuthSelector from './BitbucketCloudAuthSelector' const OtherGitOpsForm = importComponentFromFELibrary('OtherGitOpsForm', null, 'function') const BitBucketDCCredentials = importComponentFromFELibrary('BitBucketDCCredentials', null, 'function') @@ -342,7 +350,12 @@ class GitOpsConfiguration extends Component ) + const renderGitAccessCredentials = () => { + if (BitBucketDCCredentials && this.state.form.provider === 'BITBUCKET_DC') { + return ( +
+ +
+ ) + } + + return ( +
+ {this.state.form.provider === GitProvider.BITBUCKET_CLOUD && ( + + )} + {this.state.form.provider === GitProvider.BITBUCKET_CLOUD && + this.state.form.authMode === GitOpsAuthModeType.ACCESS_TOKEN ? ( +