Skip to content

Commit 25ead2f

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/pipeline-deploy-config-diff-revamp
2 parents a7bcf5f + d1f5f71 commit 25ead2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+450
-409
lines changed

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.3.22-beta-3",
3+
"version": "4.0.2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -83,18 +83,18 @@
8383
"react-dom": "^17.0.2",
8484
"react-draggable": "^4.4.5",
8585
"react-ga4": "^1.4.1",
86+
"react-keybind": "^0.9.4",
8687
"react-mde": "^11.5.0",
8788
"react-router": "^5.3.0",
8889
"react-router-dom": "^5.3.0",
8990
"react-select": "5.8.0",
90-
"react-keybind": "^0.9.4",
9191
"rxjs": "^7.8.1",
9292
"yaml": "^2.4.1"
9393
},
9494
"dependencies": {
9595
"@types/react-dates": "^21.8.6",
9696
"ansi_up": "^5.2.1",
97-
"dayjs": "^1.11.12",
97+
"dayjs": "^1.11.13",
9898
"fast-json-patch": "^3.1.1",
9999
"jsonpath-plus": "^9.0.0",
100100
"react-dates": "^21.8.0",
Lines changed: 19 additions & 0 deletions
Loading

src/Assets/Icon/ic-close.svg

Lines changed: 2 additions & 2 deletions
Loading

src/Assets/Icon/ic-expand.svg

Lines changed: 1 addition & 1 deletion
Loading

src/Common/ChartVersionAndTypeSelector.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React, { useEffect, useState } from 'react'
18-
import ReactSelect from 'react-select'
17+
import { useEffect, useState } from 'react'
1918
import { fetchChartTemplateVersions } from './Common.service'
2019
import { ChartVersionAndTypeSelectorProps, DeploymentChartVersionType } from './Types'
21-
import { customStyles, getFilteredChartVersions, showError } from './Helper'
20+
import { getFilteredChartVersions, showError } from './Helper'
21+
import { SelectPicker, SelectPickerVariantType } from '@Shared/Components'
2222

2323
// @TODO: Generalize this component to be used in CodeEditor as Chart selector toolbar
2424
// when the Code Editor is moved to the fe-common-lib
@@ -71,20 +71,23 @@ const ChartVersionAndTypeSelector = ({ setSelectedChartRefId }: ChartVersionAndT
7171
<div className="flex">
7272
<div className="chart-type-options flex" data-testid="chart-type-options">
7373
<span className="cn-7 mr-4">Chart Type</span>
74-
<ReactSelect
74+
<SelectPicker
75+
inputId='chart-type-select'
76+
label='Chart Type'
7577
value={selectedChartType ?? chartTypeOptions[0]}
7678
options={chartTypeOptions}
7779
onChange={handleChartTypeChange}
78-
styles={customStyles}
80+
variant={SelectPickerVariantType.BORDER_LESS}
7981
/>
8082
</div>
8183
<div className="chart-version-options flex" data-testid="chart-version-options">
82-
<span className="cn-7 mr-4">Chart Version</span>
83-
<ReactSelect
84+
<span className="cn-7 mr-4">Chart Version</span>
85+
<SelectPicker
86+
inputId='chart-version-select'
8487
value={selectedChartVersion ?? chartVersionOptions[0]}
8588
options={chartVersionOptions}
8689
onChange={handleChartVersionChange}
87-
styles={customStyles}
90+
variant={SelectPickerVariantType.BORDER_LESS}
8891
/>
8992
</div>
9093
</div>

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ function useCodeEditorContext() {
5454
return context
5555
}
5656

57-
/**
58-
* TODO: can be removed with this new merge into react-monaco-editor :)
59-
* see: https://github.com/react-monaco-editor/react-monaco-editor/pull/955
60-
* */
61-
const _onChange = {
62-
onChange: null,
63-
}
64-
6557
const INITIAL_HEIGHT_WHEN_DYNAMIC_HEIGHT = 100
6658

6759
const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.memo(
@@ -107,6 +99,12 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
10799
const [contentHeight, setContentHeight] = useState(
108100
adjustEditorHeightToContent ? INITIAL_HEIGHT_WHEN_DYNAMIC_HEIGHT : height,
109101
)
102+
/**
103+
* TODO: can be removed with this new merge into react-monaco-editor :)
104+
* see: https://github.com/react-monaco-editor/react-monaco-editor/pull/955
105+
* */
106+
const onChangeRef = useRef(onChange)
107+
onChangeRef.current = onChange
110108
monaco.editor.defineTheme(CodeEditorThemesKeys.vsDarkDT, {
111109
base: 'vs-dark',
112110
inherit: true,
@@ -257,14 +255,9 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
257255
editorRef.current.layout()
258256
}, [width, windowHeight])
259257

260-
/**
261-
* NOTE: Please see @_onChange variable
262-
*/
263-
_onChange.onChange = onChange
264-
265258
const setCode = (value: string) => {
266259
dispatch({ type: 'setCode', value })
267-
_onChange.onChange?.(value)
260+
onChangeRef.current?.(value)
268261
}
269262

270263
useEffect(() => {

src/Common/RJSF/widgets/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const DropdownIndicator = (props) => (
3535
</components.DropdownIndicator>
3636
)
3737

38-
export const Select = (props: WidgetProps) => {
38+
export const SelectWidget = (props: WidgetProps) => {
3939
const {
4040
id,
4141
multiple = false,

src/Common/RJSF/widgets/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
*/
1616

1717
export { Checkbox as CheckboxWidget } from './Checkbox'
18-
export { Select as SelectWidget } from './Select'
18+
export { SelectWidget } from './Select'

src/Common/Types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,6 @@ export interface VulnerabilityType {
639639
url?: string
640640
}
641641

642-
export interface ScanVulnerabilitiesTableProps {
643-
vulnerabilities: VulnerabilityType[]
644-
hidePolicy?: boolean
645-
shouldStick?: boolean
646-
}
647-
648642
export interface MaterialInfo {
649643
revision: string
650644
modifiedTime: string | Date

0 commit comments

Comments
 (0)