@devtron-labs/devtron-fe-common-lib 0.0.7 → 0.0.9
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/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -29
- package/dist/Common/BreadCrumb/Types.d.ts +28 -0
- package/dist/Common/Checkbox.d.ts +1 -14
- package/dist/Common/Constants.d.ts +13 -0
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +11 -3
- package/dist/Common/CustomTagSelector/ValidationRules.d.ts +1 -1
- package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +4 -0
- package/dist/Common/DeleteComponentModal/types.d.ts +15 -0
- package/dist/Common/Dialogs/ConfirmationDialog.d.ts +5 -16
- package/dist/Common/Dialogs/DialogForm.d.ts +1 -9
- package/dist/Common/Dialogs/Types.d.ts +27 -0
- package/dist/Common/EmptyState/EmptyState.d.ts +2 -1
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +5 -0
- package/dist/Common/Error.d.ts +2 -2
- package/dist/Common/Helper.d.ts +31 -1
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +2 -15
- package/dist/Common/Modals/Modal.d.ts +2 -9
- package/dist/Common/MultiSelectCustomization.d.ts +1 -2
- package/dist/Common/PopupMenu.d.ts +4 -21
- package/dist/Common/Progressing.d.ts +4 -13
- package/dist/Common/RadioGroup/RadioGroup.d.ts +17 -0
- package/dist/Common/RadioGroup.d.ts +1 -10
- package/dist/Common/Reload.d.ts +2 -4
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +4 -0
- package/dist/Common/TippyCustomized.d.ts +2 -30
- package/dist/Common/Toggle/Toggle.d.ts +12 -0
- package/dist/Common/Types.d.ts +266 -0
- package/dist/Common/index.d.ts +6 -1
- package/dist/index.js +2388 -1943
- package/package.json +2 -2
- package/rollup.config.js +3 -3
- package/src/Assets/Icon/ic-info-filled.svg +7 -0
- package/src/Assets/Icon/ic-warning.svg +7 -0
- package/src/Assets/Img/app-not-deployed.png +0 -0
- package/src/Common/Api.ts +7 -1
- package/src/Common/BreadCrumb/BreadCrumb.tsx +1 -30
- package/src/Common/BreadCrumb/Types.ts +30 -0
- package/src/Common/Checkbox.tsx +3 -16
- package/src/Common/Constants.ts +15 -0
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +6 -4
- package/src/Common/CustomTagSelector/TagDetails.tsx +15 -2
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +7 -3
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +66 -26
- package/src/Common/CustomTagSelector/Types.ts +11 -3
- package/src/Common/CustomTagSelector/ValidationRules.ts +21 -18
- package/src/Common/DeleteComponentModal/DeleteComponent.tsx +95 -0
- package/src/Common/DeleteComponentModal/types.ts +15 -0
- package/src/Common/Dialogs/ConfirmationDialog.tsx +6 -4
- package/src/Common/Dialogs/DeleteDialog.tsx +2 -2
- package/src/Common/Dialogs/DialogForm.tsx +2 -11
- package/src/Common/Dialogs/Types.ts +28 -0
- package/src/Common/Drawer/Drawer.scss +12 -11
- package/src/Common/EmptyState/EmptyState.tsx +5 -5
- package/src/Common/EmptyState/GenericEmptyState.tsx +41 -0
- package/src/Common/EmptyState/emptyState.scss +4 -15
- package/src/Common/Error.tsx +13 -16
- package/src/Common/ErrorScreenNotFound.tsx +23 -30
- package/src/Common/Helper.tsx +258 -2
- package/src/Common/InfoColorBar/InfoColourbar.tsx +6 -18
- package/src/Common/Modals/Modal.tsx +7 -1
- package/src/Common/Modals/OpaqueModal.tsx +2 -2
- package/src/Common/Modals/VisibleModal.tsx +1 -1
- package/src/Common/Modals/VisibleModal2.tsx +1 -1
- package/src/Common/MultiSelectCustomization.tsx +3 -3
- package/src/Common/PopupMenu.tsx +23 -6
- package/src/Common/Progressing.tsx +8 -15
- package/src/Common/RadioGroup/RadioGroup.tsx +88 -0
- package/src/Common/RadioGroup/radioGroup.scss +46 -0
- package/src/Common/RadioGroup.tsx +3 -13
- package/src/Common/Reload.tsx +15 -10
- package/src/Common/Security/ScanVulnerabilitiesTable.tsx +55 -0
- package/src/Common/Security/scanVulnerabilities.css +67 -0
- package/src/Common/TippyCustomized.tsx +3 -31
- package/src/Common/Toggle/Toggle.scss +70 -0
- package/src/Common/Toggle/Toggle.tsx +38 -0
- package/src/Common/Types.ts +290 -0
- package/src/Common/index.ts +6 -1
- package/dist/27bfa7a87d0b7039.png +0 -0
- package/dist/b5d52f036bdcd3ed.png +0 -0
- package/src/Assets/Icon/ic-close.svg +0 -9
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React, { Component, createContext } from 'react'
|
|
2
|
+
import { RadioGroupItemProps, RadioGroupProps } from './Types'
|
|
2
3
|
const RadioGroupContext = createContext({ name: '', value: '', disabled: false, onChange: (event) => {} })
|
|
3
4
|
|
|
4
|
-
export interface RadioGroupItemProps {
|
|
5
|
-
value: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
5
|
export class RadioGroupItem extends Component<RadioGroupItemProps> {
|
|
9
6
|
render() {
|
|
10
7
|
return (
|
|
@@ -21,8 +18,9 @@ export class RadioGroupItem extends Component<RadioGroupItemProps> {
|
|
|
21
18
|
onChange={context.onChange}
|
|
22
19
|
value={this.props.value}
|
|
23
20
|
checked={context.value === this.props.value}
|
|
21
|
+
data-testid={this.props.dataTestId}
|
|
24
22
|
/>
|
|
25
|
-
<span className="form__radio-item-content">
|
|
23
|
+
<span className="form__radio-item-content" data-testid={`${this.props.dataTestId}-span`}>
|
|
26
24
|
<span className="radio__button"></span>
|
|
27
25
|
<span className="radio__title">{this.props.children}</span>
|
|
28
26
|
</span>
|
|
@@ -35,14 +33,6 @@ export class RadioGroupItem extends Component<RadioGroupItemProps> {
|
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
export interface RadioGroupProps {
|
|
39
|
-
value: string
|
|
40
|
-
name: string
|
|
41
|
-
disabled?: boolean
|
|
42
|
-
onChange: (event) => void
|
|
43
|
-
className?: string
|
|
44
|
-
}
|
|
45
|
-
|
|
46
36
|
export class RadioGroup extends Component<RadioGroupProps> {
|
|
47
37
|
render() {
|
|
48
38
|
return (
|
package/src/Common/Reload.tsx
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import loadingFailure from '../Assets/Img/ic-loading-failure.png'
|
|
2
|
+
import loadingFailure from '../Assets/Img/ic-loading-failure.png'
|
|
3
|
+
import { ReloadType } from './Types'
|
|
3
4
|
|
|
4
|
-
export default function Reload({ reload
|
|
5
|
-
function refresh(e){
|
|
6
|
-
window.location.reload()
|
|
5
|
+
export default function Reload({ reload, className = '' }: ReloadType) {
|
|
6
|
+
function refresh(e) {
|
|
7
|
+
window.location.reload()
|
|
7
8
|
}
|
|
8
9
|
return (
|
|
9
|
-
<article className={`flex ${className}`}
|
|
10
|
-
<div className="flex column
|
|
11
|
-
<img src={loadingFailure} style={{
|
|
10
|
+
<article className={`flex w-100 h-100 ${className}`}>
|
|
11
|
+
<div className="flex column w-250 dc__align-center" data-testid="reload">
|
|
12
|
+
<img src={loadingFailure} style={{ height: 'auto' }} className="w-100 mb-12" alt="load-error" />
|
|
12
13
|
<h3 className="title dc__bold">Failed to load</h3>
|
|
13
|
-
<div className="dc__empty__subtitle"
|
|
14
|
-
|
|
14
|
+
<div className="dc__empty__subtitle mb-20">
|
|
15
|
+
We could not load this page. Please give us another try.
|
|
16
|
+
</div>
|
|
17
|
+
<button type="button" className="cta ghosted" onClick={typeof reload === 'function' ? reload : refresh}>
|
|
18
|
+
Retry
|
|
19
|
+
</button>
|
|
15
20
|
</div>
|
|
16
21
|
</article>
|
|
17
22
|
)
|
|
18
|
-
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ScanVulnerabilitiesTableProps, VulnerabilityType } from '../Types'
|
|
3
|
+
import './scanVulnerabilities.css'
|
|
4
|
+
|
|
5
|
+
export default function ScanVulnerabilitiesTable({ vulnerabilities }: ScanVulnerabilitiesTableProps) {
|
|
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
|
+
}}
|
|
13
|
+
>
|
|
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
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<table className="security-tab__table">
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr className="security-tab__table-header">
|
|
42
|
+
<th className="security-cell-header security-tab__cell-cve">CVE</th>
|
|
43
|
+
<th className="security-cell-header security-tab__cell-severity">Severity</th>
|
|
44
|
+
<th className="security-cell-header security-tab__cell-package">Package</th>
|
|
45
|
+
<th className="security-cell-header security-tab__cell-current-ver">Current Version</th>
|
|
46
|
+
<th className="security-cell-header security-tab__cell-fixed-ver">Fixed In Version</th>
|
|
47
|
+
<th className="security-cell-header security-tab__cell-policy">Policy</th>
|
|
48
|
+
</tr>
|
|
49
|
+
{vulnerabilities.map((vulnerability) => {
|
|
50
|
+
return renderRow(vulnerability)
|
|
51
|
+
})}
|
|
52
|
+
</tbody>
|
|
53
|
+
</table>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.modal-body--scan-details {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
background: var(--N000);
|
|
6
|
+
width: 800px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.security-tab__table {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.security-tab__table-header {
|
|
14
|
+
border-bottom: solid 1px var(--N200);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.security-cell-header {
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
line-height: 1.5;
|
|
21
|
+
letter-spacing: normal;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
color: var(--N500);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dc__security-tab__table-row {
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
font-weight: normal;
|
|
29
|
+
line-height: 1.54;
|
|
30
|
+
letter-spacing: normal;
|
|
31
|
+
color: var(--N900);
|
|
32
|
+
box-shadow: inset 0 -1px 0 0 #f5f5f5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.security-tab__cell-cve,
|
|
36
|
+
.security-tab__cell-severity,
|
|
37
|
+
.security-tab__cell-package,
|
|
38
|
+
.security-tab__cell-current-ver,
|
|
39
|
+
.security-tab__cell-fixed-ver,
|
|
40
|
+
.security-tab__cell-policy {
|
|
41
|
+
padding: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.security-tab__cell-cve {
|
|
45
|
+
padding-left: 0px;
|
|
46
|
+
text-align: left;
|
|
47
|
+
width: 20%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.security-tab__cell-policy {
|
|
51
|
+
padding-right: 0px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.security-tab__cell-policy--whitelist,
|
|
55
|
+
.security-tab__cell-policy--whitelisted {
|
|
56
|
+
color: var(--G500);
|
|
57
|
+
text-transform: capitalize;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.security-tab__cell-policy--block {
|
|
61
|
+
color: var(--R500);
|
|
62
|
+
text-transform: capitalize;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.scanned-object__results {
|
|
66
|
+
margin: 0 20px;
|
|
67
|
+
}
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
2
|
import Tippy from '@tippyjs/react'
|
|
3
|
-
import { Placement } from 'tippy.js'
|
|
4
3
|
import { ReactComponent as CloseIcon } from '../Assets/Icon/ic-cross.svg'
|
|
5
4
|
import 'tippy.js/animations/shift-toward-subtle.css'
|
|
6
|
-
import { TippyTheme } from './Types'
|
|
7
|
-
|
|
8
|
-
interface TippyCustomizedProps {
|
|
9
|
-
theme: TippyTheme
|
|
10
|
-
visible?: boolean
|
|
11
|
-
heading?: string
|
|
12
|
-
infoTextHeading?: string
|
|
13
|
-
placement: Placement
|
|
14
|
-
className?: string
|
|
15
|
-
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
|
|
16
|
-
iconPath?: string
|
|
17
|
-
iconClass?: string
|
|
18
|
-
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
|
|
19
|
-
onImageLoadError?: (e) => void
|
|
20
|
-
onClose?: () => void
|
|
21
|
-
infoText?: string
|
|
22
|
-
showCloseButton?: boolean
|
|
23
|
-
arrow?: boolean
|
|
24
|
-
interactive?: boolean
|
|
25
|
-
showOnCreate?: boolean
|
|
26
|
-
trigger?: string
|
|
27
|
-
animation?: string
|
|
28
|
-
duration?: number
|
|
29
|
-
additionalContent?: ReactNode
|
|
30
|
-
documentationLink?: string
|
|
31
|
-
documentationLinkText?: string
|
|
32
|
-
children: React.ReactElement<any>
|
|
33
|
-
}
|
|
5
|
+
import { TippyCustomizedProps, TippyTheme } from './Types'
|
|
34
6
|
|
|
35
7
|
// This component will handle some of the new tippy designs and interactions
|
|
36
8
|
// So this can be updated to support further for new features or interactions
|
|
@@ -86,7 +58,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
86
58
|
<img
|
|
87
59
|
className={`icon-dim-${iconSize || 20} mr-6 ${iconClass || ''}`}
|
|
88
60
|
src={iconPath}
|
|
89
|
-
alt=
|
|
61
|
+
alt="Heading"
|
|
90
62
|
onError={onImageLoadError}
|
|
91
63
|
/>
|
|
92
64
|
) : (
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.toggle__switch {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
|
|
7
|
+
&.disabled{
|
|
8
|
+
cursor: not-allowed;
|
|
9
|
+
.toggle__slider{
|
|
10
|
+
cursor: not-allowed;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/* Hide default HTML checkbox */
|
|
17
|
+
|
|
18
|
+
.toggle__switch input {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
width: 0;
|
|
21
|
+
height: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/* The slider */
|
|
26
|
+
|
|
27
|
+
.toggle__slider {
|
|
28
|
+
position: absolute;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
right: 0;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
background-color: #ccc;
|
|
35
|
+
transition: all .4s ease;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.toggle__slider:before {
|
|
39
|
+
position: absolute;
|
|
40
|
+
content: "";
|
|
41
|
+
height: calc( 100% - 8px);
|
|
42
|
+
width: calc( 50% - 4px);
|
|
43
|
+
left: 4px;
|
|
44
|
+
bottom: 4px;
|
|
45
|
+
background-color: white;
|
|
46
|
+
transition: all 0.4s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
input:checked+.toggle__slider {
|
|
50
|
+
background-color: var(--color);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
input:focus+.toggle__slider {
|
|
54
|
+
box-shadow: 0 0 1px var(--color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
input:checked+.toggle__slider:before {
|
|
58
|
+
transform: translateX(calc( 100%));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/* Rounded sliders */
|
|
63
|
+
|
|
64
|
+
.toggle__slider.round {
|
|
65
|
+
border-radius: 34px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.toggle__slider.round:before {
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEffectAfterMount } from '../Helper';
|
|
3
|
+
import './Toggle.scss'
|
|
4
|
+
|
|
5
|
+
const Toggle = ({selected=false, onSelect=null, color="#36b37e", rootClassName="", disabled=false, dataTestId="handle-toggle-button", ...props})=>{
|
|
6
|
+
const [active, setActive] = React.useState(selected);
|
|
7
|
+
|
|
8
|
+
useEffectAfterMount(()=>{
|
|
9
|
+
if(typeof onSelect === 'function'){
|
|
10
|
+
if(active !== selected){
|
|
11
|
+
onSelect(active)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},[active])
|
|
15
|
+
|
|
16
|
+
useEffectAfterMount(() => {
|
|
17
|
+
setActive(selected)
|
|
18
|
+
}, [selected])
|
|
19
|
+
|
|
20
|
+
function handleClick(e){
|
|
21
|
+
if(!disabled){
|
|
22
|
+
setActive(active=>!active)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<label
|
|
28
|
+
{...props}
|
|
29
|
+
className={`${rootClassName} toggle__switch ${disabled ? 'disabled' : ''}`}
|
|
30
|
+
style={{ ['--color' as any]: color }}
|
|
31
|
+
>
|
|
32
|
+
<input type="checkbox" checked={!!active} onChange={handleClick} className="toggle__input" />
|
|
33
|
+
<span className="toggle__slider round" data-testid={dataTestId}></span>
|
|
34
|
+
</label>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default Toggle
|
package/src/Common/Types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react'
|
|
2
|
+
import { Placement } from 'tippy.js'
|
|
1
3
|
export interface ResponseType {
|
|
2
4
|
code: number
|
|
3
5
|
status: string
|
|
@@ -29,3 +31,291 @@ export interface Teams {
|
|
|
29
31
|
name: string
|
|
30
32
|
active: boolean
|
|
31
33
|
}
|
|
34
|
+
|
|
35
|
+
export enum CHECKBOX_VALUE {
|
|
36
|
+
CHECKED = 'CHECKED',
|
|
37
|
+
INTERMEDIATE = 'INTERMEDIATE',
|
|
38
|
+
}
|
|
39
|
+
export interface CheckboxProps {
|
|
40
|
+
onChange: (event) => void
|
|
41
|
+
isChecked: boolean
|
|
42
|
+
value: 'CHECKED' | 'INTERMEDIATE'
|
|
43
|
+
disabled?: boolean
|
|
44
|
+
tabIndex?: number
|
|
45
|
+
rootClassName?: string
|
|
46
|
+
onClick?: (event) => void
|
|
47
|
+
id?: string
|
|
48
|
+
dataTestId?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TippyCustomizedProps {
|
|
52
|
+
theme: TippyTheme
|
|
53
|
+
visible?: boolean
|
|
54
|
+
heading?: ReactNode | string
|
|
55
|
+
infoTextHeading?: string
|
|
56
|
+
placement: Placement
|
|
57
|
+
className?: string
|
|
58
|
+
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
|
|
59
|
+
iconPath?: string
|
|
60
|
+
iconClass?: string
|
|
61
|
+
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
|
|
62
|
+
onImageLoadError?: (e) => void
|
|
63
|
+
onClose?: () => void
|
|
64
|
+
infoText?: string
|
|
65
|
+
showCloseButton?: boolean
|
|
66
|
+
arrow?: boolean
|
|
67
|
+
interactive?: boolean
|
|
68
|
+
showOnCreate?: boolean
|
|
69
|
+
trigger?: string
|
|
70
|
+
animation?: string
|
|
71
|
+
duration?: number
|
|
72
|
+
additionalContent?: ReactNode
|
|
73
|
+
documentationLink?: string
|
|
74
|
+
documentationLinkText?: string
|
|
75
|
+
children: React.ReactElement<any>
|
|
76
|
+
}
|
|
77
|
+
export interface GenericEmptyStateType {
|
|
78
|
+
title: ReactNode
|
|
79
|
+
image?
|
|
80
|
+
classname?: string
|
|
81
|
+
subTitle?: ReactNode
|
|
82
|
+
isButtonAvailable?: boolean
|
|
83
|
+
styles?: CSSProperties
|
|
84
|
+
heightToDeduct?: number
|
|
85
|
+
imageType?: string
|
|
86
|
+
renderButton?: () => JSX.Element
|
|
87
|
+
imageClassName?: string
|
|
88
|
+
children?: ReactNode
|
|
89
|
+
noImage?: boolean
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export enum ImageType {
|
|
93
|
+
Large = 'large',
|
|
94
|
+
Medium = 'medium',
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface InfoColourBarType {
|
|
98
|
+
message: React.ReactNode
|
|
99
|
+
classname: string
|
|
100
|
+
Icon
|
|
101
|
+
iconClass?: string
|
|
102
|
+
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
|
|
103
|
+
renderActionButton?: () => JSX.Element
|
|
104
|
+
linkText?: React.ReactNode
|
|
105
|
+
redirectLink?: string
|
|
106
|
+
linkOnClick?: () => void
|
|
107
|
+
linkClass?: string
|
|
108
|
+
internalLink?: boolean
|
|
109
|
+
styles?: CSSProperties
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ReloadType {
|
|
113
|
+
reload?: (event?: any) => void
|
|
114
|
+
className?: string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface RadioGroupItemProps {
|
|
118
|
+
value: string
|
|
119
|
+
dataTestId?: string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface RadioGroupProps {
|
|
123
|
+
value: string
|
|
124
|
+
name: string
|
|
125
|
+
disabled?: boolean
|
|
126
|
+
onChange: (event) => void
|
|
127
|
+
className?: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ProgressingProps {
|
|
131
|
+
pageLoader?: boolean
|
|
132
|
+
loadingText?: string
|
|
133
|
+
size?: number
|
|
134
|
+
fullHeight?: boolean
|
|
135
|
+
theme?: 'white' | 'default'
|
|
136
|
+
styles?: React.CSSProperties
|
|
137
|
+
children?: React.ReactNode
|
|
138
|
+
fillColor?: string
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface PopupMenuType {
|
|
142
|
+
children?: any
|
|
143
|
+
onToggleCallback?: (isOpen: boolean) => void
|
|
144
|
+
autoClose?: boolean
|
|
145
|
+
autoPosition?: boolean
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface PopupMenuButtonType {
|
|
149
|
+
children?: ReactNode
|
|
150
|
+
disabled?: boolean
|
|
151
|
+
rootClassName?: string
|
|
152
|
+
tabIndex?: number
|
|
153
|
+
onHover?: boolean
|
|
154
|
+
isKebab?: boolean
|
|
155
|
+
dataTestId?: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface PopupMenuBodyType {
|
|
159
|
+
children?: ReactNode
|
|
160
|
+
rootClassName?: string
|
|
161
|
+
style?: React.CSSProperties
|
|
162
|
+
autoWidth?: boolean
|
|
163
|
+
preventWheelDisable?: boolean
|
|
164
|
+
noBackDrop?: boolean
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface ModalType {
|
|
168
|
+
style?: React.CSSProperties
|
|
169
|
+
children?: ReactNode
|
|
170
|
+
modal?: boolean
|
|
171
|
+
rootClassName?: string
|
|
172
|
+
onClick?: any
|
|
173
|
+
callbackRef?: (element?: any) => any
|
|
174
|
+
preventWheelDisable?: boolean
|
|
175
|
+
noBackDrop?: boolean
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type CDModalTabType = 'SECURITY' | 'CHANGES'
|
|
179
|
+
|
|
180
|
+
export const CDModalTab = {
|
|
181
|
+
Security: <CDModalTabType>'SECURITY',
|
|
182
|
+
Changes: <CDModalTabType>'CHANGES',
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export enum DeploymentNodeType {
|
|
186
|
+
PRECD = 'PRECD',
|
|
187
|
+
CD = 'CD',
|
|
188
|
+
POSTCD = 'POSTCD',
|
|
189
|
+
APPROVAL = 'APPROVAL'
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface UserApprovalConfigType {
|
|
193
|
+
requiredCount: number
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface ApprovalUserDataType {
|
|
197
|
+
dataId: number
|
|
198
|
+
userActionTime: string
|
|
199
|
+
userComment: string
|
|
200
|
+
userEmail: string
|
|
201
|
+
userId: number
|
|
202
|
+
userResponse: number
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface UserApprovalMetadataType {
|
|
206
|
+
approvalRequestId: number
|
|
207
|
+
approvalRuntimeState: number
|
|
208
|
+
approvedUsersData: ApprovalUserDataType[]
|
|
209
|
+
requestedUserData: ApprovalUserDataType
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface CommonNodeAttr {
|
|
213
|
+
connectingCiPipelineId?: number
|
|
214
|
+
parents: string | number[] | string[]
|
|
215
|
+
x: number
|
|
216
|
+
y: number
|
|
217
|
+
title: string
|
|
218
|
+
description?: string
|
|
219
|
+
triggerType?: string
|
|
220
|
+
id: string
|
|
221
|
+
icon?: string
|
|
222
|
+
status?: string
|
|
223
|
+
isSource: boolean
|
|
224
|
+
isGitSource: boolean
|
|
225
|
+
isRoot: boolean
|
|
226
|
+
downstreams: string[]
|
|
227
|
+
type: 'CI' | 'GIT' | 'PRECD' | 'CD' | 'POSTCD' | 'WEBHOOK'
|
|
228
|
+
parentCiPipeline?: number
|
|
229
|
+
parentAppId?: number
|
|
230
|
+
url?: string
|
|
231
|
+
branch?: string
|
|
232
|
+
sourceType?: string
|
|
233
|
+
colorCode?: string
|
|
234
|
+
isExternalCI?: boolean
|
|
235
|
+
isLinkedCI?: boolean
|
|
236
|
+
environmentName?: string //used for CDs
|
|
237
|
+
environmentId?: number
|
|
238
|
+
inputMaterialList?: any[]
|
|
239
|
+
rollbackMaterialList?: any[] //used for CDs
|
|
240
|
+
linkedCount?: number //used for CI
|
|
241
|
+
deploymentStrategy?: string
|
|
242
|
+
height: number
|
|
243
|
+
width: number
|
|
244
|
+
preNode?: CommonNodeAttr //used for CDs
|
|
245
|
+
postNode?: CommonNodeAttr //used for CDs
|
|
246
|
+
stageIndex?: number //used for CDs
|
|
247
|
+
sourceNodes?: Array<CommonNodeAttr> //used for CI
|
|
248
|
+
downstreamNodes?: Array<CommonNodeAttr>
|
|
249
|
+
parentPipelineId?: string
|
|
250
|
+
parentPipelineType?: string
|
|
251
|
+
parentEnvironmentName?: string
|
|
252
|
+
isRegex?: boolean
|
|
253
|
+
regex?: string
|
|
254
|
+
primaryBranchAfterRegex?: string
|
|
255
|
+
storageConfigured?: boolean
|
|
256
|
+
deploymentAppDeleteRequest?: boolean
|
|
257
|
+
approvalUsers?: string[]
|
|
258
|
+
userApprovalConfig?: UserApprovalConfigType
|
|
259
|
+
requestedUserId?: number
|
|
260
|
+
helmPackageName?: string
|
|
261
|
+
isVirtualEnvironment?: boolean
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
export interface VulnerabilityType {
|
|
266
|
+
name: string;
|
|
267
|
+
severity: "CRITICAL" | "MODERATE" | "LOW";
|
|
268
|
+
package: string;
|
|
269
|
+
version: string;
|
|
270
|
+
fixedVersion: string;
|
|
271
|
+
policy: string;
|
|
272
|
+
url?: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface ScanVulnerabilitiesTableProps {
|
|
276
|
+
vulnerabilities: VulnerabilityType[];
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface MaterialInfo {
|
|
280
|
+
revision: string
|
|
281
|
+
modifiedTime: string | Date
|
|
282
|
+
author: string
|
|
283
|
+
message: string
|
|
284
|
+
commitLink: string
|
|
285
|
+
tag: string
|
|
286
|
+
webhookData: string
|
|
287
|
+
branch: string
|
|
288
|
+
url?: string
|
|
289
|
+
type?: string
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface CDMaterialType {
|
|
293
|
+
index: number
|
|
294
|
+
id: string
|
|
295
|
+
materialInfo: MaterialInfo[]
|
|
296
|
+
tab: CDModalTabType
|
|
297
|
+
scanEnabled: boolean
|
|
298
|
+
scanned: boolean
|
|
299
|
+
vulnerabilitiesLoading: boolean
|
|
300
|
+
lastExecution: string //timestamp
|
|
301
|
+
vulnerabilities: VulnerabilityType[]
|
|
302
|
+
vulnerable: boolean
|
|
303
|
+
deployedTime: string
|
|
304
|
+
deployedBy?: string
|
|
305
|
+
wfrId?: number
|
|
306
|
+
buildTime: string
|
|
307
|
+
image: string
|
|
308
|
+
isSelected: boolean
|
|
309
|
+
showSourceInfo: boolean
|
|
310
|
+
latest: boolean
|
|
311
|
+
runningOnParentCd?: boolean
|
|
312
|
+
userApprovalMetadata?: UserApprovalMetadataType
|
|
313
|
+
triggeredBy?: number
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface CDMaterialResponseType {
|
|
317
|
+
approvalUsers: string[]
|
|
318
|
+
materials: any[]
|
|
319
|
+
userApprovalConfig: UserApprovalConfigType
|
|
320
|
+
requestedUserId: number
|
|
321
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './Types'
|
|
|
4
4
|
export * from './Api'
|
|
5
5
|
export * from './EmptyState/EmptyState'
|
|
6
6
|
export * from './ToastBody'
|
|
7
|
-
export
|
|
7
|
+
export { default as Reload } from './Reload'
|
|
8
8
|
export * from './Error'
|
|
9
9
|
export * from './Helper'
|
|
10
10
|
export * from './Progressing'
|
|
@@ -25,3 +25,8 @@ export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
|
|
|
25
25
|
export * from './Common.service'
|
|
26
26
|
export * from './Checkbox'
|
|
27
27
|
export { default as EmptyState } from './EmptyState/EmptyState'
|
|
28
|
+
export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
|
|
29
|
+
export { default as Toggle } from './Toggle/Toggle'
|
|
30
|
+
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable'
|
|
31
|
+
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup'
|
|
32
|
+
export { default as DeleteComponent } from './DeleteComponentModal/DeleteComponent'
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
-
<defs>
|
|
3
|
-
<path id="a" class="stroke-color" d="M18.295 5.705a.997.997 0 0 0-1.41 0L12 10.59 7.115 5.705a.997.997 0 1 0-1.41 1.41L10.59 12l-4.885 4.885a.997.997 0 1 0 1.41 1.41L12 13.41l4.885 4.885a.997.997 0 0 0 1.41-1.41L13.41 12l4.885-4.885a.997.997 0 0 0 0-1.41z"/>
|
|
4
|
-
</defs>
|
|
5
|
-
<g fill="none" fill-rule="evenodd">
|
|
6
|
-
<path d=""/>
|
|
7
|
-
<use fill="#999" xlink:href="#a"/>
|
|
8
|
-
</g>
|
|
9
|
-
</svg>
|