@devtron-labs/devtron-fe-common-lib 0.0.52-beta-3 → 0.0.52-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -84
- package/.github/workflows/release-package.yml +3 -2
- package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
- package/dist/Common/Constants.d.ts +9 -1
- package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
- package/dist/Common/CustomInput/Types.d.ts +2 -2
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
- package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
- package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
- package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
- package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
- package/dist/Common/Dialogs/Types.d.ts +1 -1
- package/dist/Common/EmptyState/EmptyState.d.ts +17 -20
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
- package/dist/Common/Error.d.ts +1 -2
- package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
- package/dist/Common/Helper.d.ts +1 -1
- package/dist/Common/ImageTags.d.ts +1 -1
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
- package/dist/Common/Modals/Modal.d.ts +2 -2
- package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
- package/dist/Common/Modals/VisibleModal.d.ts +3 -3
- package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
- package/dist/Common/MultiSelectCustomization.d.ts +1 -1
- package/dist/Common/Policy.Types.d.ts +2 -2
- package/dist/Common/PopupMenu.d.ts +5 -5
- package/dist/Common/Progressing.d.ts +2 -2
- package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/Common/ResizableTextarea.d.ts +1 -1
- package/dist/Common/TippyCustomized.d.ts +1 -1
- package/dist/Common/ToastBody.d.ts +5 -5
- package/dist/Common/Types.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +376 -287
- package/package.json +2 -19
- package/src/Common/AddCDButton/AddCDButton.tsx +2 -1
- package/src/Common/Api.ts +25 -20
- package/src/Common/AppStatus/AppStatus.tsx +12 -12
- package/src/Common/AppStatus/utils.ts +5 -6
- package/src/Common/BreadCrumb/BreadCrumb.tsx +28 -32
- package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
- package/src/Common/BreadCrumb/Types.ts +12 -11
- package/src/Common/ChartVersionAndTypeSelector.tsx +1 -1
- package/src/Common/Checkbox.tsx +19 -17
- package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
- package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +1 -0
- package/src/Common/Common.service.ts +65 -60
- package/src/Common/Constants.ts +18 -9
- package/src/Common/CustomInput/CustomInput.tsx +29 -22
- package/src/Common/CustomInput/Types.ts +4 -4
- package/src/Common/CustomInput/index.ts +1 -1
- package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +18 -15
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
- package/src/Common/CustomTagSelector/TagDetails.tsx +3 -9
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +9 -7
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +35 -31
- package/src/Common/CustomTagSelector/TagSelector.utils.ts +3 -2
- package/src/Common/CustomTagSelector/Types.ts +1 -1
- package/src/Common/CustomTagSelector/ValidationRules.ts +22 -18
- package/src/Common/CustomTagSelector/index.ts +2 -2
- package/src/Common/DebouncedSearch/DebouncedSearch.tsx +1 -2
- package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +1 -0
- package/src/Common/DeleteComponentModal/DeleteComponent.tsx +32 -27
- package/src/Common/DeleteComponentModal/types.ts +1 -1
- package/src/Common/DevtronProgressing/DevtronProgressing.tsx +8 -5
- package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
- package/src/Common/Dialogs/DeleteDialog.tsx +5 -3
- package/src/Common/Dialogs/DialogForm.tsx +35 -31
- package/src/Common/Dialogs/ForceDeleteDialog.tsx +7 -13
- package/src/Common/Dialogs/Types.ts +12 -12
- package/src/Common/Dialogs/index.ts +1 -1
- package/src/Common/Drawer/Drawer.tsx +1 -1
- package/src/Common/EmptyState/EmptyState.tsx +17 -13
- package/src/Common/EmptyState/GenericEmptyState.tsx +29 -7
- package/src/Common/Error.tsx +5 -5
- package/src/Common/ErrorScreenNotFound.tsx +12 -9
- package/src/Common/Grid/Grid.tsx +2 -1
- package/src/Common/Helper.tsx +37 -36
- package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
- package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
- package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +7 -5
- package/src/Common/ImageTags.Types.ts +3 -2
- package/src/Common/ImageTags.tsx +66 -61
- package/src/Common/InfoColorBar/InfoColourbar.tsx +5 -10
- package/src/Common/Modals/Modal.tsx +3 -3
- package/src/Common/Modals/OpaqueModal.tsx +18 -25
- package/src/Common/Modals/VisibleModal.tsx +3 -7
- package/src/Common/Modals/VisibleModal2.tsx +15 -20
- package/src/Common/MultiSelectCustomization.tsx +13 -9
- package/src/Common/Policy.Types.ts +38 -38
- package/src/Common/PopupMenu.tsx +9 -10
- package/src/Common/Progressing.tsx +18 -15
- package/src/Common/RJSF/Form.tsx +1 -0
- package/src/Common/RJSF/common/FieldRow.tsx +1 -0
- package/src/Common/RJSF/config.ts +1 -0
- package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
- package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +1 -0
- package/src/Common/RJSF/templates/BaseInput.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +6 -1
- package/src/Common/RJSF/templates/Description.tsx +1 -0
- package/src/Common/RJSF/templates/Field.tsx +3 -14
- package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +9 -6
- package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +7 -5
- package/src/Common/RJSF/templates/TitleField.tsx +1 -0
- package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +1 -0
- package/src/Common/RJSF/utils.ts +57 -53
- package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
- package/src/Common/RJSF/widgets/Select.tsx +1 -0
- package/src/Common/RadioGroup/RadioGroup.tsx +23 -18
- package/src/Common/RadioGroup.tsx +23 -24
- package/src/Common/Reload.tsx +1 -0
- package/src/Common/ResizableTextarea.tsx +17 -18
- package/src/Common/Security/ScanVulnerabilitiesTable.tsx +34 -29
- package/src/Common/ServerError.ts +1 -5
- package/src/Common/TippyCustomized.tsx +38 -41
- package/src/Common/ToastBody.tsx +7 -6
- package/src/Common/Toggle/Toggle.tsx +3 -3
- package/src/Common/Types.ts +20 -19
- package/src/custom.d.ts +7 -7
- package/src/index.ts +1 -1
- package/.eslintignore +0 -79
- package/.github/pull_request_template.md +0 -25
- package/.github/workflows/ci.yml +0 -31
- package/.husky/pre-commit +0 -5
- package/.lintstagedrc +0 -3
- package/.nvmrc +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Tippy from '@tippyjs/react'
|
|
2
|
-
import { useState, useEffect } from 'react'
|
|
3
|
-
import * as React from 'react'
|
|
2
|
+
import React, { useState, useEffect } from 'react'
|
|
4
3
|
import { ConditionalWrap } from '../Helper'
|
|
5
4
|
import './radioGroup.scss'
|
|
6
5
|
|
|
@@ -29,24 +28,30 @@ interface RadioGroupComposition {
|
|
|
29
28
|
Radio?: React.FC<any>
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
const RadioGroup: React.FC<RadioGroupInterface> & RadioGroupComposition = React.memo(
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const RadioGroup: React.FC<RadioGroupInterface> & RadioGroupComposition = React.memo(function RadioGroup({
|
|
32
|
+
name,
|
|
33
|
+
onChange,
|
|
34
|
+
children,
|
|
35
|
+
className = '',
|
|
36
|
+
initialTab,
|
|
37
|
+
disabled = false,
|
|
38
|
+
dataTestId,
|
|
39
|
+
}) {
|
|
40
|
+
const [selected, select] = useState(null)
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (initialTab === selected) return
|
|
44
|
+
select(initialTab)
|
|
45
|
+
}, [initialTab])
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
47
|
+
return (
|
|
48
|
+
<RadioContext.Provider value={{ name, selected, select, disabled, onChange }}>
|
|
49
|
+
<div className={`${className} radio-group`}>{children}</div>
|
|
50
|
+
</RadioContext.Provider>
|
|
51
|
+
)
|
|
52
|
+
})
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
function Radio({
|
|
50
55
|
value,
|
|
51
56
|
children,
|
|
52
57
|
className = '',
|
|
@@ -57,7 +62,7 @@ const Radio = ({
|
|
|
57
62
|
isDisabled = false,
|
|
58
63
|
tippyClass = '',
|
|
59
64
|
dataTestId,
|
|
60
|
-
})
|
|
65
|
+
}) {
|
|
61
66
|
const { name, selected, select, disabled, onChange } = useRadioContext()
|
|
62
67
|
return (
|
|
63
68
|
<ConditionalWrap
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { Component, createContext } from 'react'
|
|
1
|
+
import React, { Component, createContext } from 'react'
|
|
2
2
|
import { RadioGroupItemProps, RadioGroupProps } from './Types'
|
|
3
|
-
|
|
4
3
|
const RadioGroupContext = createContext({ name: '', value: '', disabled: false, onChange: (event) => {} })
|
|
5
4
|
|
|
6
5
|
export class RadioGroupItem extends Component<RadioGroupItemProps> {
|
|
7
6
|
render() {
|
|
8
7
|
return (
|
|
9
8
|
<RadioGroupContext.Consumer>
|
|
10
|
-
{(context) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.props.disabled || context.disabled ? 'form__radio-item disabled' : 'form__radio-item'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
{(context) => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<label className={(this.props.disabled || context.disabled) ? 'form__radio-item disabled' : 'form__radio-item'}>
|
|
13
|
+
<input
|
|
14
|
+
type="radio"
|
|
15
|
+
className="form__checkbox"
|
|
16
|
+
name={context.name}
|
|
17
|
+
disabled={context.disabled || this.props.disabled}
|
|
18
|
+
onChange={context.onChange}
|
|
19
|
+
value={this.props.value}
|
|
20
|
+
checked={context.value === this.props.value}
|
|
21
|
+
data-testid={this.props.dataTestId}
|
|
22
|
+
/>
|
|
23
|
+
<span className="form__radio-item-content" data-testid={`${this.props.dataTestId}-span`}>
|
|
24
|
+
<span className="radio__button"></span>
|
|
25
|
+
<span className="radio__title">{this.props.children}</span>
|
|
26
|
+
</span>
|
|
27
|
+
</label>
|
|
28
|
+
</>
|
|
29
|
+
)
|
|
30
|
+
}}
|
|
32
31
|
</RadioGroupContext.Consumer>
|
|
33
32
|
)
|
|
34
33
|
}
|
package/src/Common/Reload.tsx
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react'
|
|
2
|
-
import * as React from 'react'
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
3
2
|
import { useThrottledEffect } from './Helper'
|
|
4
3
|
import { ResizableTextareaProps } from './Types'
|
|
5
4
|
|
|
6
5
|
export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) => {
|
|
6
|
+
minHeight,
|
|
7
|
+
maxHeight,
|
|
8
|
+
value,
|
|
9
|
+
onChange = null,
|
|
10
|
+
onBlur = null,
|
|
11
|
+
onFocus = null,
|
|
12
|
+
className = '',
|
|
13
|
+
placeholder = 'Enter your text here..',
|
|
14
|
+
lineHeight = 14,
|
|
15
|
+
padding = 12,
|
|
16
|
+
disabled = false,
|
|
17
|
+
dataTestId,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
21
20
|
const [text, setText] = useState('')
|
|
22
21
|
const _textRef = useRef(null)
|
|
23
22
|
|
|
@@ -49,7 +48,7 @@ export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
|
49
48
|
if (maxHeight && nextHeight > maxHeight) {
|
|
50
49
|
nextHeight = maxHeight
|
|
51
50
|
}
|
|
52
|
-
_textRef.current.style.height =
|
|
51
|
+
_textRef.current.style.height = nextHeight + 2 + 'px'
|
|
53
52
|
},
|
|
54
53
|
500,
|
|
55
54
|
[text],
|
|
@@ -71,4 +70,4 @@ export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
|
71
70
|
{...props}
|
|
72
71
|
/>
|
|
73
72
|
)
|
|
74
|
-
}
|
|
73
|
+
}
|
|
@@ -1,36 +1,39 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import { ScanVulnerabilitiesTableProps, VulnerabilityType } from '../Types'
|
|
2
3
|
import './scanVulnerabilities.css'
|
|
3
4
|
|
|
4
5
|
export default function ScanVulnerabilitiesTable({ vulnerabilities }: ScanVulnerabilitiesTableProps) {
|
|
5
|
-
const renderRow = (vulnerability: VulnerabilityType) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<td className="security-tab__cell-cve dc__cve-cell">
|
|
13
|
-
<a
|
|
14
|
-
href={`https://cve.mitre.org/cgi-bin/cvename.cgi?name=${vulnerability.name}`}
|
|
15
|
-
rel="noopener noreferrer"
|
|
16
|
-
target="_blank"
|
|
17
|
-
>
|
|
18
|
-
{vulnerability.name}
|
|
19
|
-
</a>
|
|
20
|
-
</td>
|
|
21
|
-
<td className="security-tab__cell-severity">
|
|
22
|
-
<span className={`fill-${vulnerability.severity?.toLowerCase()}`}>{vulnerability.severity}</span>
|
|
23
|
-
</td>
|
|
24
|
-
<td className="security-tab__cell-package">{vulnerability.package}</td>
|
|
25
|
-
<td className="security-tab__cell-current-ver">{vulnerability.version}</td>
|
|
26
|
-
<td className="security-tab__cell-fixed-ver">{vulnerability.fixedVersion}</td>
|
|
27
|
-
<td
|
|
28
|
-
className={`security-tab__cell-policy security-tab__cell-policy--${vulnerability.policy?.toLowerCase()}`}
|
|
6
|
+
const renderRow = (vulnerability: VulnerabilityType) => {
|
|
7
|
+
return (
|
|
8
|
+
<tr
|
|
9
|
+
className="dc__security-tab__table-row cursor"
|
|
10
|
+
onClick={(e) => {
|
|
11
|
+
window.open(`https://cve.mitre.org/cgi-bin/cvename.cgi?name=${vulnerability.name}`, '_blank')
|
|
12
|
+
}}
|
|
29
13
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
<td className="security-tab__cell-cve dc__cve-cell">
|
|
15
|
+
<a
|
|
16
|
+
href={`https://cve.mitre.org/cgi-bin/cvename.cgi?name=${vulnerability.name}`}
|
|
17
|
+
rel="noopener noreferrer"
|
|
18
|
+
target="_blank"
|
|
19
|
+
>
|
|
20
|
+
{vulnerability.name}
|
|
21
|
+
</a>
|
|
22
|
+
</td>
|
|
23
|
+
<td className="security-tab__cell-severity">
|
|
24
|
+
<span className={`fill-${vulnerability.severity?.toLowerCase()}`}>{vulnerability.severity}</span>
|
|
25
|
+
</td>
|
|
26
|
+
<td className="security-tab__cell-package">{vulnerability.package}</td>
|
|
27
|
+
<td className="security-tab__cell-current-ver">{vulnerability.version}</td>
|
|
28
|
+
<td className="security-tab__cell-fixed-ver">{vulnerability.fixedVersion}</td>
|
|
29
|
+
<td
|
|
30
|
+
className={`security-tab__cell-policy security-tab__cell-policy--${vulnerability.policy?.toLowerCase()}`}
|
|
31
|
+
>
|
|
32
|
+
{vulnerability.policy?.toLowerCase()}
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
34
37
|
|
|
35
38
|
return (
|
|
36
39
|
<table className="security-tab__table">
|
|
@@ -43,7 +46,9 @@ export default function ScanVulnerabilitiesTable({ vulnerabilities }: ScanVulner
|
|
|
43
46
|
<th className="security-cell-header security-tab__cell-fixed-ver">Fixed In Version</th>
|
|
44
47
|
<th className="security-cell-header security-tab__cell-policy">Policy</th>
|
|
45
48
|
</tr>
|
|
46
|
-
{vulnerabilities.map((vulnerability) =>
|
|
49
|
+
{vulnerabilities.map((vulnerability) => {
|
|
50
|
+
return renderRow(vulnerability)
|
|
51
|
+
})}
|
|
47
52
|
</tbody>
|
|
48
53
|
</table>
|
|
49
54
|
)
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
export class ServerError {
|
|
2
2
|
code: number
|
|
3
|
-
|
|
4
3
|
internalMessage: string | null
|
|
5
|
-
|
|
6
4
|
userMessage: string | null
|
|
7
|
-
|
|
8
5
|
moreInfo?: string | null
|
|
9
6
|
|
|
10
7
|
constructor(error) {
|
|
@@ -17,13 +14,12 @@ export class ServerError {
|
|
|
17
14
|
|
|
18
15
|
export class ServerErrors extends Error {
|
|
19
16
|
code: number
|
|
20
|
-
|
|
21
17
|
errors: ServerError[]
|
|
22
18
|
|
|
23
19
|
constructor(obj: { code: number; errors: ServerError[] }) {
|
|
24
20
|
super()
|
|
25
21
|
this.code = obj.code
|
|
26
|
-
|
|
22
|
+
let message = obj.errors.reduce((str: string, err: ServerError) => {
|
|
27
23
|
str += `${err.internalMessage || err.userMessage}`
|
|
28
24
|
return str
|
|
29
25
|
}, '')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef, useState } from 'react'
|
|
1
|
+
import React, { useRef, useState } from 'react'
|
|
2
2
|
import Tippy from '@tippyjs/react'
|
|
3
3
|
import { ReactComponent as CloseIcon } from '../Assets/Icon/ic-cross.svg'
|
|
4
4
|
import { ReactComponent as QuestionFilled } from '../Assets/Icon/ic-help.svg'
|
|
@@ -9,7 +9,7 @@ import { not } from './Helper'
|
|
|
9
9
|
|
|
10
10
|
// This component will handle some of the new tippy designs and interactions
|
|
11
11
|
// So this can be updated to support further for new features or interactions
|
|
12
|
-
export
|
|
12
|
+
export function TippyCustomized(props: TippyCustomizedProps) {
|
|
13
13
|
const tippyRef = useRef(null)
|
|
14
14
|
const [showHeadingInfo, setShowHeadingInfo] = useState(false)
|
|
15
15
|
const isWhiteTheme = props.theme === TippyTheme.white
|
|
@@ -60,46 +60,43 @@ export const TippyCustomized = (props: TippyCustomizedProps) => {
|
|
|
60
60
|
} = props
|
|
61
61
|
return (
|
|
62
62
|
<>
|
|
63
|
-
{!hideHeading &&
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</div>
|
|
83
|
-
)
|
|
84
|
-
)}
|
|
85
|
-
{heading && (
|
|
86
|
-
<span className={`fs-14 fw-6 lh-20 ${showCloseButton ? 'mr-6' : ''}`}>{heading}</span>
|
|
87
|
-
)}
|
|
88
|
-
{headingInfo && (
|
|
89
|
-
<div className="icon-dim-20 cursor" onClick={toggleHeadingInfo}>
|
|
90
|
-
<Question className="icon-dim-20" />
|
|
91
|
-
</div>
|
|
92
|
-
)}
|
|
93
|
-
{showCloseButton && (
|
|
94
|
-
<div className="icon-dim-16 ml-auto">
|
|
95
|
-
<CloseIcon
|
|
96
|
-
className={`icon-dim-16 cursor ${isWhiteTheme ? 'fcn-9' : 'fcn-0'}`}
|
|
97
|
-
onClick={closeTippy}
|
|
98
|
-
/>
|
|
63
|
+
{!hideHeading &&
|
|
64
|
+
<div
|
|
65
|
+
className={`dc__word-break dc__hyphens-auto flex left ${
|
|
66
|
+
isWhiteTheme
|
|
67
|
+
? `p-12 cn-9 ${props.noHeadingBorder ? '' : 'dc__border-bottom-n1'}`
|
|
68
|
+
: 'pt-20 pb-12 pr-20 pl-20 cn-0 top'
|
|
69
|
+
}`}
|
|
70
|
+
>
|
|
71
|
+
{iconPath ? (
|
|
72
|
+
<img
|
|
73
|
+
className={`icon-dim-${iconSize || 20} mr-6 ${iconClass || ''}`}
|
|
74
|
+
src={iconPath}
|
|
75
|
+
alt="Heading"
|
|
76
|
+
onError={onImageLoadError}
|
|
77
|
+
/>
|
|
78
|
+
) : (
|
|
79
|
+
Icon && (
|
|
80
|
+
<div className={`icon-dim-${iconSize || 20} mr-6`}>
|
|
81
|
+
<Icon className={`icon-dim-${iconSize || 20} ${iconClass || ''}`} />
|
|
99
82
|
</div>
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
83
|
+
)
|
|
84
|
+
)}
|
|
85
|
+
{heading && <span className={`fs-14 fw-6 lh-20 ${showCloseButton ? 'mr-6' : ''}`}>{heading}</span>}
|
|
86
|
+
{headingInfo && (
|
|
87
|
+
<div className="icon-dim-20 cursor" onClick={toggleHeadingInfo}>
|
|
88
|
+
<Question className="icon-dim-20" />
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
{showCloseButton && (
|
|
92
|
+
<div className="icon-dim-16 ml-auto">
|
|
93
|
+
<CloseIcon
|
|
94
|
+
className={`icon-dim-16 cursor ${isWhiteTheme ? 'fcn-9' : 'fcn-0'}`}
|
|
95
|
+
onClick={closeTippy}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</div>}
|
|
103
100
|
{showHeadingInfo && (
|
|
104
101
|
<div
|
|
105
102
|
className={`flex left top bcv-1 fs-13 fw-4 lh-20 pt-8 pb-8 ${
|
package/src/Common/ToastBody.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { toast } from 'react-toastify'
|
|
3
3
|
import { TOAST_ACCESS_DENIED } from './Constants'
|
|
4
4
|
|
|
5
|
-
export class ToastBody extends Component<{
|
|
5
|
+
export class ToastBody extends React.Component<{
|
|
6
6
|
title: string
|
|
7
7
|
subtitle?: string
|
|
8
8
|
}> {
|
|
@@ -16,7 +16,7 @@ export class ToastBody extends Component<{
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export class ToastBody3 extends Component<{
|
|
19
|
+
export class ToastBody3 extends React.Component<{
|
|
20
20
|
text: string
|
|
21
21
|
onClick: (...args) => void
|
|
22
22
|
buttonText: string
|
|
@@ -33,7 +33,7 @@ export class ToastBody3 extends Component<{
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export class ToastBodyWithButton extends Component<{
|
|
36
|
+
export class ToastBodyWithButton extends React.Component<{
|
|
37
37
|
title: string
|
|
38
38
|
subtitle?: string
|
|
39
39
|
onClick: (...args) => void
|
|
@@ -52,10 +52,11 @@ export class ToastBodyWithButton extends Component<{
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export const toastAccessDenied = (title?: string, subtitle?: string) =>
|
|
56
|
-
toast.info(
|
|
55
|
+
export const toastAccessDenied = (title?: string, subtitle?: string) => {
|
|
56
|
+
return toast.info(
|
|
57
57
|
<ToastBody title={title || TOAST_ACCESS_DENIED.TITLE} subtitle={subtitle || TOAST_ACCESS_DENIED.SUBTITLE} />,
|
|
58
58
|
{
|
|
59
59
|
className: 'devtron-toast unauthorized',
|
|
60
60
|
},
|
|
61
61
|
)
|
|
62
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { useEffectAfterMount } from '../Helper'
|
|
3
3
|
import './Toggle.scss'
|
|
4
4
|
|
|
@@ -10,10 +10,10 @@ const Toggle = ({
|
|
|
10
10
|
disabled = false,
|
|
11
11
|
dataTestId = 'handle-toggle-button',
|
|
12
12
|
Icon = null,
|
|
13
|
-
iconClass
|
|
13
|
+
iconClass= '',
|
|
14
14
|
...props
|
|
15
15
|
}) => {
|
|
16
|
-
const [active, setActive] = useState(selected)
|
|
16
|
+
const [active, setActive] = React.useState(selected)
|
|
17
17
|
|
|
18
18
|
useEffectAfterMount(() => {
|
|
19
19
|
if (typeof onSelect === 'function') {
|
package/src/Common/Types.ts
CHANGED
|
@@ -94,6 +94,7 @@ export interface GenericEmptyStateType {
|
|
|
94
94
|
imageClassName?: string
|
|
95
95
|
children?: ReactNode
|
|
96
96
|
noImage?: boolean
|
|
97
|
+
imageStyles?: CSSProperties
|
|
97
98
|
/**
|
|
98
99
|
* @default 'column'
|
|
99
100
|
*/
|
|
@@ -229,7 +230,7 @@ export enum FilterStates {
|
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
export enum MaterialDataSource {
|
|
232
|
-
EXTERNAL =
|
|
233
|
+
EXTERNAL = "ext"
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
export interface CDMaterialType {
|
|
@@ -240,7 +241,7 @@ export interface CDMaterialType {
|
|
|
240
241
|
scanEnabled: boolean
|
|
241
242
|
scanned: boolean
|
|
242
243
|
vulnerabilitiesLoading: boolean
|
|
243
|
-
lastExecution: string //
|
|
244
|
+
lastExecution: string //timestamp
|
|
244
245
|
vulnerabilities: VulnerabilityType[]
|
|
245
246
|
vulnerable: boolean
|
|
246
247
|
deployedTime: string
|
|
@@ -258,7 +259,7 @@ export interface CDMaterialType {
|
|
|
258
259
|
imageReleaseTags?: ReleaseTag[]
|
|
259
260
|
artifactStatus?: string
|
|
260
261
|
filterState: FilterStates
|
|
261
|
-
registryType?: string
|
|
262
|
+
registryType?: string;
|
|
262
263
|
imagePath?: string
|
|
263
264
|
registryName?: string
|
|
264
265
|
// Not even coming from API but required in CDMaterials for Security which makes its own api call but stores data in CDMaterials
|
|
@@ -277,12 +278,12 @@ export enum CDMaterialServiceEnum {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
export enum CDMaterialResourceQuery {
|
|
280
|
-
PENDING_APPROVAL = 'PENDING_APPROVAL'
|
|
281
|
+
PENDING_APPROVAL = 'PENDING_APPROVAL'
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
export enum CDMaterialFilterQuery {
|
|
284
285
|
RESOURCE = 'ELIGIBLE_RESOURCES',
|
|
285
|
-
ALL = 'ALL_RESOURCES'
|
|
286
|
+
ALL = 'ALL_RESOURCES'
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
export interface CDMaterialServiceQueryParams {
|
|
@@ -324,18 +325,18 @@ export interface CommonNodeAttr {
|
|
|
324
325
|
isLinkedCI?: boolean
|
|
325
326
|
isLinkedCD?: boolean
|
|
326
327
|
isJobCI?: boolean // used for Job type CI in Devtron Apps
|
|
327
|
-
environmentName?: string //
|
|
328
|
+
environmentName?: string //used for CDs
|
|
328
329
|
environmentId?: number
|
|
329
330
|
inputMaterialList?: any[]
|
|
330
|
-
rollbackMaterialList?: any[] //
|
|
331
|
-
linkedCount?: number //
|
|
331
|
+
rollbackMaterialList?: any[] //used for CDs
|
|
332
|
+
linkedCount?: number //used for CI
|
|
332
333
|
deploymentStrategy?: string
|
|
333
334
|
height: number
|
|
334
335
|
width: number
|
|
335
|
-
preNode?: CommonNodeAttr //
|
|
336
|
-
postNode?: CommonNodeAttr //
|
|
337
|
-
stageIndex?: number //
|
|
338
|
-
sourceNodes?: Array<CommonNodeAttr> //
|
|
336
|
+
preNode?: CommonNodeAttr //used for CDs
|
|
337
|
+
postNode?: CommonNodeAttr //used for CDs
|
|
338
|
+
stageIndex?: number //used for CDs
|
|
339
|
+
sourceNodes?: Array<CommonNodeAttr> //used for CI
|
|
339
340
|
downstreamNodes?: Array<CommonNodeAttr>
|
|
340
341
|
parentPipelineId?: string
|
|
341
342
|
parentPipelineType?: string
|
|
@@ -679,19 +680,19 @@ export interface CodeEditorComposition {
|
|
|
679
680
|
}
|
|
680
681
|
|
|
681
682
|
export interface CodeEditorHeaderComposition {
|
|
682
|
-
LanguageChanger?: React.FC<any
|
|
683
|
-
ThemeChanger?: React.FC<any
|
|
684
|
-
ValidationError?: React.FC<any
|
|
685
|
-
Clipboard?: React.FC<any
|
|
683
|
+
LanguageChanger?: React.FC<any>;
|
|
684
|
+
ThemeChanger?: React.FC<any>;
|
|
685
|
+
ValidationError?: React.FC<any>;
|
|
686
|
+
Clipboard?: React.FC<any>;
|
|
686
687
|
}
|
|
687
688
|
export interface CodeEditorHeaderInterface {
|
|
688
|
-
children?: any
|
|
689
|
+
children?: any;
|
|
689
690
|
className?: string
|
|
690
|
-
hideDefaultSplitHeader?: boolean
|
|
691
|
+
hideDefaultSplitHeader?: boolean;
|
|
691
692
|
}
|
|
692
693
|
|
|
693
694
|
export interface DeploymentChartVersionType {
|
|
694
|
-
chartRefId: number
|
|
695
|
+
chartRefId: number
|
|
695
696
|
chartVersion: string
|
|
696
697
|
chartType: string
|
|
697
698
|
type: number
|
package/src/custom.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare module '*.svg' {
|
|
2
|
-
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const src: string;
|
|
7
|
+
export default src;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
declare module '*.png' {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
const src: string;
|
|
12
|
+
export default src;
|
|
13
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./Common"
|
package/.eslintignore
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
.eslintrc.js
|
|
2
|
-
|
|
3
|
-
# Files with ESLint errors/warnings
|
|
4
|
-
src/Common/AddCDButton/AddCDButton.tsx
|
|
5
|
-
src/Common/AddCDButton/utils.tsx
|
|
6
|
-
src/Common/Api.ts
|
|
7
|
-
src/Common/AppStatus/AppStatus.tsx
|
|
8
|
-
src/Common/AppStatus/index.ts
|
|
9
|
-
src/Common/AppStatus/utils.ts
|
|
10
|
-
src/Common/BreadCrumb/BreadCrumb.tsx
|
|
11
|
-
src/Common/BreadCrumb/BreadcrumbStore.tsx
|
|
12
|
-
src/Common/CIPipeline.Types.ts
|
|
13
|
-
src/Common/ChartVersionAndTypeSelector.tsx
|
|
14
|
-
src/Common/Checkbox.tsx
|
|
15
|
-
src/Common/ClipboardButton/ClipboardButton.tsx
|
|
16
|
-
src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx
|
|
17
|
-
src/Common/Common.service.ts
|
|
18
|
-
src/Common/CustomInput/CustomInput.tsx
|
|
19
|
-
src/Common/CustomTagSelector/PropagateTagInfo.tsx
|
|
20
|
-
src/Common/CustomTagSelector/ResizableTagTextArea.tsx
|
|
21
|
-
src/Common/CustomTagSelector/TagDetails.tsx
|
|
22
|
-
src/Common/CustomTagSelector/TagLabelSelect.tsx
|
|
23
|
-
src/Common/CustomTagSelector/TagLabelValueSelector.tsx
|
|
24
|
-
src/Common/CustomTagSelector/TagSelector.utils.ts
|
|
25
|
-
src/Common/CustomTagSelector/ValidationRules.ts
|
|
26
|
-
src/Common/DebouncedSearch/DebouncedSearch.tsx
|
|
27
|
-
src/Common/DebouncedSearch/Utils.ts
|
|
28
|
-
src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx
|
|
29
|
-
src/Common/DeleteComponentModal/DeleteComponent.tsx
|
|
30
|
-
src/Common/DevtronProgressing/DevtronProgressing.tsx
|
|
31
|
-
src/Common/Dialogs/DeleteDialog.tsx
|
|
32
|
-
src/Common/Dialogs/DialogForm.tsx
|
|
33
|
-
src/Common/Dialogs/ForceDeleteDialog.tsx
|
|
34
|
-
src/Common/DraggableWrapper/DraggableButton.tsx
|
|
35
|
-
src/Common/DraggableWrapper/DraggableWrapper.tsx
|
|
36
|
-
src/Common/Drawer/Drawer.tsx
|
|
37
|
-
src/Common/EmptyState/EmptyState.tsx
|
|
38
|
-
src/Common/Error.tsx
|
|
39
|
-
src/Common/ErrorScreenNotFound.tsx
|
|
40
|
-
src/Common/Grid/Grid.tsx
|
|
41
|
-
src/Common/Helper.tsx
|
|
42
|
-
src/Common/Hooks/UseClickOutside/UseClickOutside.tsx
|
|
43
|
-
src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx
|
|
44
|
-
src/Common/Hooks/UseWindowSize/UseWindowSize.tsx
|
|
45
|
-
src/Common/ImageTags.tsx
|
|
46
|
-
src/Common/Modals/Modal.tsx
|
|
47
|
-
src/Common/Modals/OpaqueModal.tsx
|
|
48
|
-
src/Common/Modals/VisibleModal.tsx
|
|
49
|
-
src/Common/Modals/VisibleModal2.tsx
|
|
50
|
-
src/Common/MultiSelectCustomization.tsx
|
|
51
|
-
src/Common/PopupMenu.tsx
|
|
52
|
-
src/Common/Progressing.tsx
|
|
53
|
-
src/Common/RJSF/Form.tsx
|
|
54
|
-
src/Common/RJSF/common/FieldRow.tsx
|
|
55
|
-
src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx
|
|
56
|
-
src/Common/RJSF/templates/ArrayFieldTemplate.tsx
|
|
57
|
-
src/Common/RJSF/templates/BaseInput.tsx
|
|
58
|
-
src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx
|
|
59
|
-
src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx
|
|
60
|
-
src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx
|
|
61
|
-
src/Common/RJSF/templates/Description.tsx
|
|
62
|
-
src/Common/RJSF/templates/Field.tsx
|
|
63
|
-
src/Common/RJSF/templates/FieldErrorTemplate.tsx
|
|
64
|
-
src/Common/RJSF/templates/ObjectFieldTemplate.tsx
|
|
65
|
-
src/Common/RJSF/templates/TitleField.tsx
|
|
66
|
-
src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx
|
|
67
|
-
src/Common/RJSF/utils.ts
|
|
68
|
-
src/Common/RJSF/widgets/Checkbox.tsx
|
|
69
|
-
src/Common/RJSF/widgets/Select.tsx
|
|
70
|
-
src/Common/RadioGroup.tsx
|
|
71
|
-
src/Common/RadioGroup/RadioGroup.tsx
|
|
72
|
-
src/Common/Reload.tsx
|
|
73
|
-
src/Common/ResizableTextarea.tsx
|
|
74
|
-
src/Common/Security/ScanVulnerabilitiesTable.tsx
|
|
75
|
-
src/Common/ServerError.ts
|
|
76
|
-
src/Common/TippyCustomized.tsx
|
|
77
|
-
src/Common/ToastBody.tsx
|
|
78
|
-
src/Common/Toggle/Toggle.tsx
|
|
79
|
-
src/Common/Types.ts
|