@devtron-labs/devtron-fe-common-lib 0.0.48-beta-6 → 0.0.48-beta-7
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/.eslintignore +75 -0
- package/.eslintrc.js +84 -16
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/ci.yml +31 -0
- package/.github/workflows/release-package.yml +2 -3
- package/.husky/pre-commit +4 -0
- package/.lintstagedrc +5 -0
- package/.nvmrc +1 -0
- package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
- package/dist/Common/Common.service.d.ts +0 -1
- package/dist/Common/Constants.d.ts +1 -2
- package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
- package/dist/Common/CustomInput/Types.d.ts +2 -1
- 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 +20 -17
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
- package/dist/Common/Error.d.ts +2 -1
- package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
- package/dist/Common/Helper.d.ts +1 -10
- 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 +0 -64
- package/dist/Common/index.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +380 -2083
- package/package.json +19 -4
- package/src/Common/AddCDButton/AddCDButton.tsx +1 -2
- package/src/Common/Api.ts +21 -26
- package/src/Common/AppStatus/AppStatus.tsx +12 -12
- package/src/Common/AppStatus/utils.ts +6 -5
- package/src/Common/BreadCrumb/BreadCrumb.tsx +32 -28
- package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
- package/src/Common/BreadCrumb/Types.ts +11 -12
- package/src/Common/Checkbox.tsx +17 -19
- package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
- package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +0 -1
- package/src/Common/Common.service.ts +59 -68
- package/src/Common/Constants.ts +9 -10
- package/src/Common/CustomInput/CustomInput.tsx +22 -28
- package/src/Common/CustomInput/Types.ts +4 -3
- package/src/Common/CustomInput/index.ts +1 -1
- package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +15 -18
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
- package/src/Common/CustomTagSelector/TagDetails.tsx +9 -3
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +7 -9
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +31 -35
- package/src/Common/CustomTagSelector/TagSelector.utils.ts +2 -3
- package/src/Common/CustomTagSelector/Types.ts +1 -1
- package/src/Common/CustomTagSelector/ValidationRules.ts +18 -22
- package/src/Common/CustomTagSelector/index.ts +2 -2
- package/src/Common/DebouncedSearch/DebouncedSearch.tsx +2 -1
- package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +0 -1
- package/src/Common/DeleteComponentModal/DeleteComponent.tsx +27 -32
- package/src/Common/DeleteComponentModal/types.ts +1 -1
- package/src/Common/DevtronProgressing/DevtronProgressing.tsx +5 -8
- package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
- package/src/Common/Dialogs/DeleteDialog.tsx +3 -5
- package/src/Common/Dialogs/DialogForm.tsx +31 -35
- package/src/Common/Dialogs/ForceDeleteDialog.tsx +13 -7
- 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 +13 -17
- package/src/Common/EmptyState/GenericEmptyState.tsx +25 -15
- package/src/Common/Error.tsx +5 -5
- package/src/Common/ErrorScreenNotFound.tsx +9 -12
- package/src/Common/Grid/Grid.tsx +1 -2
- package/src/Common/Helper.tsx +23 -125
- package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
- package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
- package/src/Common/ImageTags.Types.ts +2 -3
- package/src/Common/ImageTags.tsx +61 -66
- package/src/Common/InfoColorBar/InfoColourbar.tsx +10 -5
- package/src/Common/Modals/Modal.tsx +3 -3
- package/src/Common/Modals/OpaqueModal.tsx +25 -18
- package/src/Common/Modals/VisibleModal.tsx +7 -3
- package/src/Common/Modals/VisibleModal2.tsx +20 -15
- package/src/Common/MultiSelectCustomization.tsx +9 -13
- package/src/Common/Policy.Types.ts +38 -38
- package/src/Common/PopupMenu.tsx +10 -9
- package/src/Common/Progressing.tsx +15 -18
- package/src/Common/RJSF/Form.tsx +0 -1
- package/src/Common/RJSF/common/FieldRow.tsx +0 -1
- package/src/Common/RJSF/config.ts +0 -1
- package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
- package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +0 -1
- package/src/Common/RJSF/templates/BaseInput.tsx +0 -1
- package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +0 -1
- package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +0 -1
- package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +1 -6
- package/src/Common/RJSF/templates/Description.tsx +0 -1
- package/src/Common/RJSF/templates/Field.tsx +14 -3
- package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +6 -9
- package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +5 -7
- package/src/Common/RJSF/templates/TitleField.tsx +0 -1
- package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +0 -1
- package/src/Common/RJSF/utils.ts +53 -57
- package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
- package/src/Common/RJSF/widgets/Select.tsx +0 -1
- package/src/Common/RadioGroup/RadioGroup.tsx +18 -23
- package/src/Common/RadioGroup.tsx +24 -23
- package/src/Common/Reload.tsx +0 -1
- package/src/Common/ResizableTextarea.tsx +18 -17
- package/src/Common/Security/ScanVulnerabilitiesTable.tsx +29 -34
- package/src/Common/ServerError.ts +5 -1
- package/src/Common/TippyCustomized.tsx +41 -38
- package/src/Common/ToastBody.tsx +6 -7
- package/src/Common/Toggle/Toggle.tsx +3 -3
- package/src/Common/Types.ts +12 -81
- package/src/Common/index.ts +0 -1
- package/src/custom.d.ts +7 -7
- package/src/index.ts +1 -1
- package/dist/Common/ChartVersionAndTypeSelector.d.ts +0 -4
- package/src/Common/ChartVersionAndTypeSelector.tsx +0 -78
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Tippy from '@tippyjs/react'
|
|
2
|
-
import
|
|
2
|
+
import { useState, useEffect } from 'react'
|
|
3
|
+
import * as React from 'react'
|
|
3
4
|
import { ConditionalWrap } from '../Helper'
|
|
4
5
|
import './radioGroup.scss'
|
|
5
6
|
|
|
@@ -28,30 +29,24 @@ interface RadioGroupComposition {
|
|
|
28
29
|
Radio?: React.FC<any>
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const RadioGroup: React.FC<RadioGroupInterface> & RadioGroupComposition = React.memo(
|
|
32
|
-
name,
|
|
33
|
-
|
|
34
|
-
children,
|
|
35
|
-
className = '',
|
|
36
|
-
initialTab,
|
|
37
|
-
disabled = false,
|
|
38
|
-
dataTestId,
|
|
39
|
-
}) {
|
|
40
|
-
const [selected, select] = useState(null)
|
|
32
|
+
const RadioGroup: React.FC<RadioGroupInterface> & RadioGroupComposition = React.memo(
|
|
33
|
+
({ name, onChange, children, className = '', initialTab, disabled = false, dataTestId }) => {
|
|
34
|
+
const [selected, select] = useState(null)
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (initialTab === selected) return
|
|
38
|
+
select(initialTab)
|
|
39
|
+
}, [initialTab])
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
41
|
+
return (
|
|
42
|
+
<RadioContext.Provider value={{ name, selected, select, disabled, onChange }}>
|
|
43
|
+
<div className={`${className} radio-group`}>{children}</div>
|
|
44
|
+
</RadioContext.Provider>
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
)
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
const Radio = ({
|
|
55
50
|
value,
|
|
56
51
|
children,
|
|
57
52
|
className = '',
|
|
@@ -62,7 +57,7 @@ function Radio({
|
|
|
62
57
|
isDisabled = false,
|
|
63
58
|
tippyClass = '',
|
|
64
59
|
dataTestId,
|
|
65
|
-
}) {
|
|
60
|
+
}) => {
|
|
66
61
|
const { name, selected, select, disabled, onChange } = useRadioContext()
|
|
67
62
|
return (
|
|
68
63
|
<ConditionalWrap
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component, createContext } from 'react'
|
|
2
2
|
import { RadioGroupItemProps, RadioGroupProps } from './Types'
|
|
3
|
+
|
|
3
4
|
const RadioGroupContext = createContext({ name: '', value: '', disabled: false, onChange: (event) => {} })
|
|
4
5
|
|
|
5
6
|
export class RadioGroupItem extends Component<RadioGroupItemProps> {
|
|
6
7
|
render() {
|
|
7
8
|
return (
|
|
8
9
|
<RadioGroupContext.Consumer>
|
|
9
|
-
{(context) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
10
|
+
{(context) => (
|
|
11
|
+
<label
|
|
12
|
+
className={
|
|
13
|
+
this.props.disabled || context.disabled ? 'form__radio-item disabled' : 'form__radio-item'
|
|
14
|
+
}
|
|
15
|
+
>
|
|
16
|
+
<input
|
|
17
|
+
type="radio"
|
|
18
|
+
className="form__checkbox"
|
|
19
|
+
name={context.name}
|
|
20
|
+
disabled={context.disabled || this.props.disabled}
|
|
21
|
+
onChange={context.onChange}
|
|
22
|
+
value={this.props.value}
|
|
23
|
+
checked={context.value === this.props.value}
|
|
24
|
+
data-testid={this.props.dataTestId}
|
|
25
|
+
/>
|
|
26
|
+
<span className="form__radio-item-content" data-testid={`${this.props.dataTestId}-span`}>
|
|
27
|
+
<span className="radio__button" />
|
|
28
|
+
<span className="radio__title">{this.props.children}</span>
|
|
29
|
+
</span>
|
|
30
|
+
</label>
|
|
31
|
+
)}
|
|
31
32
|
</RadioGroupContext.Consumer>
|
|
32
33
|
)
|
|
33
34
|
}
|
package/src/Common/Reload.tsx
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import * as React from 'react'
|
|
2
3
|
import { useThrottledEffect } from './Helper'
|
|
3
4
|
import { ResizableTextareaProps } from './Types'
|
|
4
5
|
|
|
5
6
|
export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
minHeight,
|
|
8
|
+
maxHeight,
|
|
9
|
+
value,
|
|
10
|
+
onChange = null,
|
|
11
|
+
onBlur = null,
|
|
12
|
+
onFocus = null,
|
|
13
|
+
className = '',
|
|
14
|
+
placeholder = 'Enter your text here..',
|
|
15
|
+
lineHeight = 14,
|
|
16
|
+
padding = 12,
|
|
17
|
+
disabled = false,
|
|
18
|
+
dataTestId,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
20
21
|
const [text, setText] = useState('')
|
|
21
22
|
const _textRef = useRef(null)
|
|
22
23
|
|
|
@@ -48,7 +49,7 @@ export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
|
48
49
|
if (maxHeight && nextHeight > maxHeight) {
|
|
49
50
|
nextHeight = maxHeight
|
|
50
51
|
}
|
|
51
|
-
_textRef.current.style.height = nextHeight + 2
|
|
52
|
+
_textRef.current.style.height = `${nextHeight + 2}px`
|
|
52
53
|
},
|
|
53
54
|
500,
|
|
54
55
|
[text],
|
|
@@ -70,4 +71,4 @@ export const ResizableTextarea: React.FC<ResizableTextareaProps> = ({
|
|
|
70
71
|
{...props}
|
|
71
72
|
/>
|
|
72
73
|
)
|
|
73
|
-
}
|
|
74
|
+
}
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { ScanVulnerabilitiesTableProps, VulnerabilityType } from '../Types'
|
|
3
2
|
import './scanVulnerabilities.css'
|
|
4
3
|
|
|
5
4
|
export default function ScanVulnerabilitiesTable({ vulnerabilities }: ScanVulnerabilitiesTableProps) {
|
|
6
|
-
const renderRow = (vulnerability: VulnerabilityType) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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()}`}
|
|
5
|
+
const renderRow = (vulnerability: VulnerabilityType) => (
|
|
6
|
+
<tr
|
|
7
|
+
className="dc__security-tab__table-row cursor"
|
|
8
|
+
onClick={(e) => {
|
|
9
|
+
window.open(`https://cve.mitre.org/cgi-bin/cvename.cgi?name=${vulnerability.name}`, '_blank')
|
|
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"
|
|
31
17
|
>
|
|
32
|
-
{vulnerability.
|
|
33
|
-
</
|
|
34
|
-
</
|
|
35
|
-
|
|
36
|
-
|
|
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()}`}
|
|
29
|
+
>
|
|
30
|
+
{vulnerability.policy?.toLowerCase()}
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
)
|
|
37
34
|
|
|
38
35
|
return (
|
|
39
36
|
<table className="security-tab__table">
|
|
@@ -46,9 +43,7 @@ export default function ScanVulnerabilitiesTable({ vulnerabilities }: ScanVulner
|
|
|
46
43
|
<th className="security-cell-header security-tab__cell-fixed-ver">Fixed In Version</th>
|
|
47
44
|
<th className="security-cell-header security-tab__cell-policy">Policy</th>
|
|
48
45
|
</tr>
|
|
49
|
-
{vulnerabilities.map((vulnerability) =>
|
|
50
|
-
return renderRow(vulnerability)
|
|
51
|
-
})}
|
|
46
|
+
{vulnerabilities.map((vulnerability) => renderRow(vulnerability))}
|
|
52
47
|
</tbody>
|
|
53
48
|
</table>
|
|
54
49
|
)
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export class ServerError {
|
|
2
2
|
code: number
|
|
3
|
+
|
|
3
4
|
internalMessage: string | null
|
|
5
|
+
|
|
4
6
|
userMessage: string | null
|
|
7
|
+
|
|
5
8
|
moreInfo?: string | null
|
|
6
9
|
|
|
7
10
|
constructor(error) {
|
|
@@ -14,12 +17,13 @@ export class ServerError {
|
|
|
14
17
|
|
|
15
18
|
export class ServerErrors extends Error {
|
|
16
19
|
code: number
|
|
20
|
+
|
|
17
21
|
errors: ServerError[]
|
|
18
22
|
|
|
19
23
|
constructor(obj: { code: number; errors: ServerError[] }) {
|
|
20
24
|
super()
|
|
21
25
|
this.code = obj.code
|
|
22
|
-
|
|
26
|
+
const message = obj.errors.reduce((str: string, err: ServerError) => {
|
|
23
27
|
str += `${err.internalMessage || err.userMessage}`
|
|
24
28
|
return str
|
|
25
29
|
}, '')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { 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 const 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,43 +60,46 @@ export function 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
|
-
Icon && (
|
|
80
|
-
<div className={`icon-dim-${iconSize || 20} mr-6`}>
|
|
81
|
-
<Icon className={`icon-dim-${iconSize || 20} ${iconClass || ''}`} />
|
|
82
|
-
</div>
|
|
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}
|
|
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}
|
|
96
77
|
/>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
) : (
|
|
79
|
+
Icon && (
|
|
80
|
+
<div className={`icon-dim-${iconSize || 20} mr-6`}>
|
|
81
|
+
<Icon className={`icon-dim-${iconSize || 20} ${iconClass || ''}`} />
|
|
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
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
)}
|
|
100
103
|
{showHeadingInfo && (
|
|
101
104
|
<div
|
|
102
105
|
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 { Component } from 'react'
|
|
2
2
|
import { toast } from 'react-toastify'
|
|
3
3
|
import { TOAST_ACCESS_DENIED } from './Constants'
|
|
4
4
|
|
|
5
|
-
export class ToastBody extends
|
|
5
|
+
export class ToastBody extends Component<{
|
|
6
6
|
title: string
|
|
7
7
|
subtitle?: string
|
|
8
8
|
}> {
|
|
@@ -16,7 +16,7 @@ export class ToastBody extends React.Component<{
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export class ToastBody3 extends
|
|
19
|
+
export class ToastBody3 extends Component<{
|
|
20
20
|
text: string
|
|
21
21
|
onClick: (...args) => void
|
|
22
22
|
buttonText: string
|
|
@@ -33,7 +33,7 @@ export class ToastBody3 extends React.Component<{
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export class ToastBodyWithButton extends
|
|
36
|
+
export class ToastBodyWithButton extends Component<{
|
|
37
37
|
title: string
|
|
38
38
|
subtitle?: string
|
|
39
39
|
onClick: (...args) => void
|
|
@@ -52,11 +52,10 @@ export class ToastBodyWithButton extends React.Component<{
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export const toastAccessDenied = (title?: string, subtitle?: string) =>
|
|
56
|
-
|
|
55
|
+
export const toastAccessDenied = (title?: string, subtitle?: string) =>
|
|
56
|
+
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 { useState } 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] =
|
|
16
|
+
const [active, setActive] = useState(selected)
|
|
17
17
|
|
|
18
18
|
useEffectAfterMount(() => {
|
|
19
19
|
if (typeof onSelect === 'function') {
|
package/src/Common/Types.ts
CHANGED
|
@@ -229,7 +229,7 @@ export enum FilterStates {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
export enum MaterialDataSource {
|
|
232
|
-
EXTERNAL =
|
|
232
|
+
EXTERNAL = 'ext',
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
export interface CDMaterialType {
|
|
@@ -240,7 +240,7 @@ export interface CDMaterialType {
|
|
|
240
240
|
scanEnabled: boolean
|
|
241
241
|
scanned: boolean
|
|
242
242
|
vulnerabilitiesLoading: boolean
|
|
243
|
-
lastExecution: string //timestamp
|
|
243
|
+
lastExecution: string // timestamp
|
|
244
244
|
vulnerabilities: VulnerabilityType[]
|
|
245
245
|
vulnerable: boolean
|
|
246
246
|
deployedTime: string
|
|
@@ -258,7 +258,7 @@ export interface CDMaterialType {
|
|
|
258
258
|
imageReleaseTags?: ReleaseTag[]
|
|
259
259
|
artifactStatus?: string
|
|
260
260
|
filterState: FilterStates
|
|
261
|
-
registryType?: string
|
|
261
|
+
registryType?: string
|
|
262
262
|
imagePath?: string
|
|
263
263
|
registryName?: string
|
|
264
264
|
// Not even coming from API but required in CDMaterials for Security which makes its own api call but stores data in CDMaterials
|
|
@@ -277,12 +277,12 @@ export enum CDMaterialServiceEnum {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
export enum CDMaterialResourceQuery {
|
|
280
|
-
PENDING_APPROVAL = 'PENDING_APPROVAL'
|
|
280
|
+
PENDING_APPROVAL = 'PENDING_APPROVAL',
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
export enum CDMaterialFilterQuery {
|
|
284
284
|
RESOURCE = 'ELIGIBLE_RESOURCES',
|
|
285
|
-
ALL = 'ALL_RESOURCES'
|
|
285
|
+
ALL = 'ALL_RESOURCES',
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
export interface CDMaterialServiceQueryParams {
|
|
@@ -324,18 +324,18 @@ export interface CommonNodeAttr {
|
|
|
324
324
|
isLinkedCI?: boolean
|
|
325
325
|
isLinkedCD?: boolean
|
|
326
326
|
isJobCI?: boolean // used for Job type CI in Devtron Apps
|
|
327
|
-
environmentName?: string //used for CDs
|
|
327
|
+
environmentName?: string // used for CDs
|
|
328
328
|
environmentId?: number
|
|
329
329
|
inputMaterialList?: any[]
|
|
330
|
-
rollbackMaterialList?: any[] //used for CDs
|
|
331
|
-
linkedCount?: number //used for CI
|
|
330
|
+
rollbackMaterialList?: any[] // used for CDs
|
|
331
|
+
linkedCount?: number // used for CI
|
|
332
332
|
deploymentStrategy?: string
|
|
333
333
|
height: number
|
|
334
334
|
width: number
|
|
335
|
-
preNode?: CommonNodeAttr //used for CDs
|
|
336
|
-
postNode?: CommonNodeAttr //used for CDs
|
|
337
|
-
stageIndex?: number //used for CDs
|
|
338
|
-
sourceNodes?: Array<CommonNodeAttr> //used for CI
|
|
335
|
+
preNode?: CommonNodeAttr // used for CDs
|
|
336
|
+
postNode?: CommonNodeAttr // used for CDs
|
|
337
|
+
stageIndex?: number // used for CDs
|
|
338
|
+
sourceNodes?: Array<CommonNodeAttr> // used for CI
|
|
339
339
|
downstreamNodes?: Array<CommonNodeAttr>
|
|
340
340
|
parentPipelineId?: string
|
|
341
341
|
parentPipelineType?: string
|
|
@@ -631,75 +631,6 @@ export interface CiPipeline {
|
|
|
631
631
|
isOffendingMandatoryPlugin?: boolean
|
|
632
632
|
pipelineType?: string
|
|
633
633
|
}
|
|
634
|
-
export interface InformationBarProps {
|
|
635
|
-
text: string
|
|
636
|
-
className?: string
|
|
637
|
-
children?: React.ReactNode
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
export interface CodeEditorInterface {
|
|
641
|
-
value?: string
|
|
642
|
-
lineDecorationsWidth?: number
|
|
643
|
-
responseType?: string
|
|
644
|
-
onChange?: (string) => void
|
|
645
|
-
onBlur?: () => void
|
|
646
|
-
onFocus?: () => void
|
|
647
|
-
children?: any
|
|
648
|
-
defaultValue?: string
|
|
649
|
-
mode?: 'json' | 'yaml' | 'shell' | 'dockerfile'
|
|
650
|
-
tabSize?: number
|
|
651
|
-
readOnly?: boolean
|
|
652
|
-
noParsing?: boolean
|
|
653
|
-
minHeight?: number
|
|
654
|
-
maxHeight?: number
|
|
655
|
-
inline?: boolean
|
|
656
|
-
height?: number | string
|
|
657
|
-
shebang?: string | JSX.Element
|
|
658
|
-
diffView?: boolean
|
|
659
|
-
loading?: boolean
|
|
660
|
-
customLoader?: JSX.Element
|
|
661
|
-
theme?: string
|
|
662
|
-
original?: string
|
|
663
|
-
focus?: boolean
|
|
664
|
-
validatorSchema?: any
|
|
665
|
-
isKubernetes?: boolean
|
|
666
|
-
cleanData?: boolean
|
|
667
|
-
chartVersion?: any
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
export interface CodeEditorComposition {
|
|
671
|
-
Header?: React.FC<any>
|
|
672
|
-
LanguageChanger?: React.FC<any>
|
|
673
|
-
ThemeChanger?: React.FC<any>
|
|
674
|
-
ValidationError?: React.FC<any>
|
|
675
|
-
Clipboard?: React.FC<any>
|
|
676
|
-
Warning?: React.FC<InformationBarProps>
|
|
677
|
-
ErrorBar?: React.FC<InformationBarProps>
|
|
678
|
-
Information?: React.FC<InformationBarProps>
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
export interface CodeEditorHeaderComposition {
|
|
682
|
-
LanguageChanger?: React.FC<any>;
|
|
683
|
-
ThemeChanger?: React.FC<any>;
|
|
684
|
-
ValidationError?: React.FC<any>;
|
|
685
|
-
Clipboard?: React.FC<any>;
|
|
686
|
-
}
|
|
687
|
-
export interface CodeEditorHeaderInterface {
|
|
688
|
-
children?: any;
|
|
689
|
-
className?: string
|
|
690
|
-
hideDefaultSplitHeader?: boolean;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
export interface DeploymentChartVersionType {
|
|
694
|
-
chartRefId: number
|
|
695
|
-
chartVersion: string
|
|
696
|
-
chartType: string
|
|
697
|
-
type: number
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
export interface ChartVersionAndTypeSelectorProps {
|
|
701
|
-
setSelectedChartRefId: React.Dispatch<React.SetStateAction<number>>
|
|
702
|
-
}
|
|
703
634
|
|
|
704
635
|
export enum PipelineType {
|
|
705
636
|
CI_PIPELINE = 'CI_PIPELINE',
|
package/src/Common/index.ts
CHANGED
|
@@ -42,6 +42,5 @@ export * from './Hooks'
|
|
|
42
42
|
export { AppStatus } from './AppStatus'
|
|
43
43
|
export * from './RJSF'
|
|
44
44
|
export * from './DevtronProgressing'
|
|
45
|
-
export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector'
|
|
46
45
|
export * from './AddCDButton'
|
|
47
46
|
export * from './CustomInput'
|
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'
|