Skip to content

Commit 8c68f8b

Browse files
committed
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-common-lib into feat/fluxCD
2 parents f12f3ac + 472282b commit 8c68f8b

File tree

18 files changed

+707
-203
lines changed

18 files changed

+707
-203
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ module.exports = {
108108
'import/no-cycle': 'off',
109109
'import/prefer-default-export': 'off',
110110
'no-restricted-exports': 'off',
111+
'import/named': 'off'
111112
},
112113
overrides: [
113114
{

package-lock.json

Lines changed: 174 additions & 197 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
@@ -64,7 +64,6 @@
6464
"prettier": "^3.1.1",
6565
"react-ga4": "^1.4.1",
6666
"react-mde": "^11.5.0",
67-
"react-select": "5.2.2",
6867
"react-toastify": "^8.2.0",
6968
"typescript": "^4.9.4",
7069
"vite": "^4.5.3",
@@ -74,6 +73,7 @@
7473
"vite-tsconfig-paths": "^4.3.2"
7574
},
7675
"peerDependencies": {
76+
"react-select": "5.8.0",
7777
"@rjsf/core": "^5.13.3",
7878
"@rjsf/utils": "^5.13.3",
7979
"@rjsf/validator-ajv8": "^5.13.3",

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const URLS = {
5959
APP_TRIGGER: 'trigger',
6060
GLOBAL_CONFIG_DOCKER: '/global-config/docker',
6161
DEPLOYMENT_HISTORY_CONFIGURATIONS: '/configuration',
62+
GLOBAL_CONFIG_SCOPED_VARIABLES: '/global-config/scoped-variables',
6263
}
6364

6465
export const ROUTES = {

src/Common/CustomTagSelector/ResizableTagTextArea.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const ResizableTagTextArea = ({
3232
dependentRef,
3333
dataTestId,
3434
handleKeyDown,
35+
disabled,
36+
disableOnBlurResizeToMinHeight,
3537
}: ResizableTagTextAreaProps) => {
3638
const [text, setText] = useState('')
3739

@@ -41,7 +43,7 @@ export const ResizableTagTextArea = ({
4143

4244
const handleChange = (event) => {
4345
setText(event.target.value)
44-
onChange(event)
46+
onChange?.(event)
4547
}
4648

4749
const reInitHeight = () => {
@@ -69,9 +71,11 @@ export const ResizableTagTextArea = ({
6971
useThrottledEffect(reInitHeight, 500, [text])
7072

7173
const handleOnBlur = (event) => {
72-
refVar.current.style.height = `${minHeight}px`
73-
if (dependentRef) {
74-
dependentRef.current.style.height = `${minHeight}px`
74+
if (!disableOnBlurResizeToMinHeight) {
75+
refVar.current.style.height = `${minHeight}px`
76+
if (dependentRef) {
77+
dependentRef.current.style.height = `${minHeight}px`
78+
}
7579
}
7680
onBlur && onBlur(event)
7781
}
@@ -95,6 +99,7 @@ export const ResizableTagTextArea = ({
9599
tabIndex={tabIndex}
96100
data-testid={dataTestId}
97101
onKeyDown={handleKeyDown}
102+
disabled={disabled}
98103
/>
99104
)
100105
}

src/Common/CustomTagSelector/Types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,6 @@ export interface ResizableTagTextAreaProps {
8585
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
8686
dataTestId?: string
8787
handleKeyDown?: any
88+
disabled?: boolean
89+
disableOnBlurResizeToMinHeight?: boolean
8890
}

src/Common/Types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ export interface RadioInterface {
235235
showTippy?: boolean
236236
tippyContent?: any
237237
tippyPlacement?: string
238+
/**
239+
* If false would make radio group controlled
240+
*/
238241
canSelect?: boolean
239242
isDisabled?: boolean
240243
tippyClass?: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './types'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export enum ScopedVariablesFileViewType {
2+
/**
3+
* Used to show yaml editor for editing/creating variables
4+
*/
5+
YAML = 'yaml',
6+
/**
7+
* Shows the variable list view
8+
*/
9+
SAVED = 'variables',
10+
/**
11+
* Shows the variables in environment list view
12+
*/
13+
ENVIRONMENT_LIST = 'environments',
14+
}
15+
16+
export interface SavedVariablesViewParamsType {
17+
currentView: ScopedVariablesFileViewType
18+
}

src/Pages/GlobalConfigurations/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616

1717
export * from './BuildInfra'
1818
export * from './Authorization'
19+
export * from './ScopedVariables'

0 commit comments

Comments
 (0)