Skip to content

Commit 978e8f6

Browse files
committed
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-common-lib into feat/fluxCD
2 parents 60bb0bd + d2e305c commit 978e8f6

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

src/Shared/Helpers.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ export const useIntersection = (
207207
}
208208
export const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined
209209

210+
export const handleDisableSubmitOnEnter = (event: React.KeyboardEvent<HTMLFormElement>) => {
211+
const isTextArea = event.target instanceof HTMLTextAreaElement
212+
213+
if (event.key === 'Enter' && !isTextArea) {
214+
event.preventDefault()
215+
}
216+
}
217+
210218
export const getKeyToBooleanMapFromArray = <T extends string | number>(arr: T[] = []) =>
211219
arr.reduce<Record<T, boolean>>(
212220
(acc, key) => {

src/Shared/constants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const ModuleNameMap = {
5353
// TODO: Convert to object later if more formats arise
5454
export const DATE_TIME_FORMAT_STRING = 'ddd DD MMM YYYY HH:mm:ss'
5555
export const API_TOKEN_PREFIX = 'API-TOKEN:'
56+
export const DEFAULT_SECRET_PLACEHOLDER = '••••••••'
5657

5758
export enum PatchOperationType {
5859
replace = 'replace',

src/Shared/types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,32 @@ export enum AggregationKeys {
489489

490490
export type AggregationKeysType = keyof typeof AggregationKeys
491491

492+
export enum GitOpsAuthModeType {
493+
SSH = 'SSH',
494+
PASSWORD = 'PASSWORD',
495+
SSH_AND_PASSWORD = 'PAT_AND_SSH',
496+
}
497+
498+
export interface BaseGitOpsType {
499+
authMode: GitOpsAuthModeType
500+
sshKey: string
501+
sshHost: string
502+
username: string
503+
token: string
504+
}
505+
506+
export type GitOpsFieldKeyType =
507+
| 'host'
508+
| 'username'
509+
| 'token'
510+
| 'gitHubOrgId'
511+
| 'azureProjectName'
512+
| 'gitLabGroupId'
513+
| 'bitBucketWorkspaceId'
514+
| 'bitBucketProjectKey'
515+
| 'sshHost'
516+
| 'sshKey'
517+
492518
export interface AppInfoListType {
493519
application: string
494520
appStatus: string

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export interface customEnv {
6969
ENABLE_RESOURCE_SCAN?: boolean
7070
FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: boolean
7171
ENABLE_RESOURCE_SCAN_V2?: boolean
72-
ENABLE_GITOPS_BITBUCKET_SOURCE: boolean
7372
HIDE_RESOURCE_WATCHER?: boolean
7473
ORGANIZATION_NAME: string
7574
FEATURE_EXTERNAL_FLUX_CD_ENABLE: boolean

0 commit comments

Comments
 (0)