@devtron-labs/devtron-fe-common-lib 0.0.52-beta-3 → 0.0.52

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.
Files changed (129) hide show
  1. package/.eslintrc.js +16 -84
  2. package/.github/workflows/release-package.yml +3 -2
  3. package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
  4. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
  5. package/dist/Common/Constants.d.ts +1 -1
  6. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  7. package/dist/Common/CustomInput/Types.d.ts +1 -2
  8. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  9. package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
  10. package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
  11. package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
  12. package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
  13. package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
  14. package/dist/Common/Dialogs/Types.d.ts +1 -1
  15. package/dist/Common/EmptyState/EmptyState.d.ts +17 -20
  16. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  17. package/dist/Common/Error.d.ts +1 -2
  18. package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
  19. package/dist/Common/Helper.d.ts +1 -1
  20. package/dist/Common/ImageTags.d.ts +1 -1
  21. package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
  22. package/dist/Common/Modals/Modal.d.ts +2 -2
  23. package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
  24. package/dist/Common/Modals/VisibleModal.d.ts +3 -3
  25. package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
  26. package/dist/Common/MultiSelectCustomization.d.ts +1 -1
  27. package/dist/Common/Policy.Types.d.ts +2 -2
  28. package/dist/Common/PopupMenu.d.ts +5 -5
  29. package/dist/Common/Progressing.d.ts +2 -2
  30. package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
  31. package/dist/Common/ResizableTextarea.d.ts +1 -1
  32. package/dist/Common/TippyCustomized.d.ts +1 -1
  33. package/dist/Common/ToastBody.d.ts +5 -5
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.js +354 -283
  36. package/package.json +2 -19
  37. package/src/Common/AddCDButton/AddCDButton.tsx +2 -1
  38. package/src/Common/Api.ts +25 -20
  39. package/src/Common/AppStatus/AppStatus.tsx +12 -12
  40. package/src/Common/AppStatus/utils.ts +5 -6
  41. package/src/Common/BreadCrumb/BreadCrumb.tsx +28 -32
  42. package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
  43. package/src/Common/BreadCrumb/Types.ts +12 -11
  44. package/src/Common/ChartVersionAndTypeSelector.tsx +1 -1
  45. package/src/Common/Checkbox.tsx +19 -17
  46. package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
  47. package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +1 -0
  48. package/src/Common/Common.service.ts +65 -60
  49. package/src/Common/Constants.ts +9 -9
  50. package/src/Common/CustomInput/CustomInput.tsx +28 -22
  51. package/src/Common/CustomInput/Types.ts +3 -4
  52. package/src/Common/CustomInput/index.ts +1 -1
  53. package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +18 -15
  54. package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
  55. package/src/Common/CustomTagSelector/TagDetails.tsx +3 -9
  56. package/src/Common/CustomTagSelector/TagLabelSelect.tsx +9 -7
  57. package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +35 -31
  58. package/src/Common/CustomTagSelector/TagSelector.utils.ts +3 -2
  59. package/src/Common/CustomTagSelector/Types.ts +1 -1
  60. package/src/Common/CustomTagSelector/ValidationRules.ts +22 -18
  61. package/src/Common/CustomTagSelector/index.ts +2 -2
  62. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +1 -2
  63. package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +1 -0
  64. package/src/Common/DeleteComponentModal/DeleteComponent.tsx +32 -27
  65. package/src/Common/DeleteComponentModal/types.ts +1 -1
  66. package/src/Common/DevtronProgressing/DevtronProgressing.tsx +8 -5
  67. package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
  68. package/src/Common/Dialogs/DeleteDialog.tsx +5 -3
  69. package/src/Common/Dialogs/DialogForm.tsx +35 -31
  70. package/src/Common/Dialogs/ForceDeleteDialog.tsx +7 -13
  71. package/src/Common/Dialogs/Types.ts +12 -12
  72. package/src/Common/Dialogs/index.ts +1 -1
  73. package/src/Common/Drawer/Drawer.tsx +1 -1
  74. package/src/Common/EmptyState/EmptyState.tsx +17 -13
  75. package/src/Common/EmptyState/GenericEmptyState.tsx +15 -25
  76. package/src/Common/Error.tsx +5 -5
  77. package/src/Common/ErrorScreenNotFound.tsx +12 -9
  78. package/src/Common/Grid/Grid.tsx +2 -1
  79. package/src/Common/Helper.tsx +37 -36
  80. package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
  81. package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
  82. package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +7 -5
  83. package/src/Common/ImageTags.Types.ts +3 -2
  84. package/src/Common/ImageTags.tsx +66 -61
  85. package/src/Common/InfoColorBar/InfoColourbar.tsx +5 -10
  86. package/src/Common/Modals/Modal.tsx +3 -3
  87. package/src/Common/Modals/OpaqueModal.tsx +18 -25
  88. package/src/Common/Modals/VisibleModal.tsx +3 -7
  89. package/src/Common/Modals/VisibleModal2.tsx +15 -20
  90. package/src/Common/MultiSelectCustomization.tsx +13 -9
  91. package/src/Common/Policy.Types.ts +38 -38
  92. package/src/Common/PopupMenu.tsx +9 -10
  93. package/src/Common/Progressing.tsx +18 -15
  94. package/src/Common/RJSF/Form.tsx +1 -0
  95. package/src/Common/RJSF/common/FieldRow.tsx +1 -0
  96. package/src/Common/RJSF/config.ts +1 -0
  97. package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
  98. package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +1 -0
  99. package/src/Common/RJSF/templates/BaseInput.tsx +1 -0
  100. package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +1 -0
  101. package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +1 -0
  102. package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +6 -1
  103. package/src/Common/RJSF/templates/Description.tsx +1 -0
  104. package/src/Common/RJSF/templates/Field.tsx +3 -14
  105. package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +9 -6
  106. package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +7 -5
  107. package/src/Common/RJSF/templates/TitleField.tsx +1 -0
  108. package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +1 -0
  109. package/src/Common/RJSF/utils.ts +57 -53
  110. package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
  111. package/src/Common/RJSF/widgets/Select.tsx +1 -0
  112. package/src/Common/RadioGroup/RadioGroup.tsx +23 -18
  113. package/src/Common/RadioGroup.tsx +23 -24
  114. package/src/Common/Reload.tsx +1 -0
  115. package/src/Common/ResizableTextarea.tsx +17 -18
  116. package/src/Common/Security/ScanVulnerabilitiesTable.tsx +34 -29
  117. package/src/Common/ServerError.ts +1 -5
  118. package/src/Common/TippyCustomized.tsx +38 -41
  119. package/src/Common/ToastBody.tsx +7 -6
  120. package/src/Common/Toggle/Toggle.tsx +3 -3
  121. package/src/Common/Types.ts +19 -19
  122. package/src/custom.d.ts +7 -7
  123. package/src/index.ts +1 -1
  124. package/.eslintignore +0 -79
  125. package/.github/pull_request_template.md +0 -25
  126. package/.github/workflows/ci.yml +0 -31
  127. package/.husky/pre-commit +0 -5
  128. package/.lintstagedrc +0 -3
  129. 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
- ({ name, onChange, children, className = '', initialTab, disabled = false, dataTestId }) => {
34
- const [selected, select] = useState(null)
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
- useEffect(() => {
37
- if (initialTab === selected) return
38
- select(initialTab)
39
- }, [initialTab])
42
+ useEffect(() => {
43
+ if (initialTab === selected) return
44
+ select(initialTab)
45
+ }, [initialTab])
40
46
 
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
- )
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
- const Radio = ({
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
- <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
- )}
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
  }
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import loadingFailure from '../Assets/Img/ic-loading-failure.png'
2
3
  import { ReloadType } from './Types'
3
4
 
@@ -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
- 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
- }) => {
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 = `${nextHeight + 2}px`
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
- <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"
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
- {vulnerability.policy?.toLowerCase()}
31
- </td>
32
- </tr>
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) => renderRow(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
- const message = obj.errors.reduce((str: string, err: ServerError) => {
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 const TippyCustomized = (props: TippyCustomizedProps) => {
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
- <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 || ''}`} />
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
- </div>
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 ${
@@ -1,8 +1,8 @@
1
- import { Component } from 'react'
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 { useState } from 'react'
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') {
@@ -229,7 +229,7 @@ export enum FilterStates {
229
229
  }
230
230
 
231
231
  export enum MaterialDataSource {
232
- EXTERNAL = 'ext',
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
@@ -679,19 +679,19 @@ export interface CodeEditorComposition {
679
679
  }
680
680
 
681
681
  export interface CodeEditorHeaderComposition {
682
- LanguageChanger?: React.FC<any>
683
- ThemeChanger?: React.FC<any>
684
- ValidationError?: React.FC<any>
685
- Clipboard?: React.FC<any>
682
+ LanguageChanger?: React.FC<any>;
683
+ ThemeChanger?: React.FC<any>;
684
+ ValidationError?: React.FC<any>;
685
+ Clipboard?: React.FC<any>;
686
686
  }
687
687
  export interface CodeEditorHeaderInterface {
688
- children?: any
688
+ children?: any;
689
689
  className?: string
690
- hideDefaultSplitHeader?: boolean
690
+ hideDefaultSplitHeader?: boolean;
691
691
  }
692
692
 
693
693
  export interface DeploymentChartVersionType {
694
- chartRefId: number
694
+ chartRefId: number
695
695
  chartVersion: string
696
696
  chartType: string
697
697
  type: number
package/src/custom.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  declare module '*.svg' {
2
- import * as React from 'react'
2
+ import * as React from 'react';
3
3
 
4
- export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
4
+ export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
5
5
 
6
- const src: string
7
- export default src
6
+ const src: string;
7
+ export default src;
8
8
  }
9
9
 
10
10
  declare module '*.png' {
11
- const src: string
12
- export default src
13
- }
11
+ const src: string;
12
+ export default src;
13
+ }
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './Common'
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