@devtron-labs/devtron-fe-common-lib 0.0.48-beta-11 → 0.0.49

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 (127) 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 +2 -2
  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 +338 -266
  36. package/package.json +2 -19
  37. package/src/Common/AddCDButton/AddCDButton.tsx +2 -1
  38. package/src/Common/Api.ts +29 -22
  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/Checkbox.tsx +19 -17
  45. package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
  46. package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +1 -0
  47. package/src/Common/Common.service.ts +64 -59
  48. package/src/Common/Constants.ts +11 -11
  49. package/src/Common/CustomInput/CustomInput.tsx +28 -22
  50. package/src/Common/CustomInput/Types.ts +3 -4
  51. package/src/Common/CustomInput/index.ts +1 -1
  52. package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +18 -15
  53. package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
  54. package/src/Common/CustomTagSelector/TagDetails.tsx +3 -9
  55. package/src/Common/CustomTagSelector/TagLabelSelect.tsx +9 -7
  56. package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +35 -31
  57. package/src/Common/CustomTagSelector/TagSelector.utils.ts +3 -2
  58. package/src/Common/CustomTagSelector/Types.ts +1 -1
  59. package/src/Common/CustomTagSelector/ValidationRules.ts +22 -18
  60. package/src/Common/CustomTagSelector/index.ts +2 -2
  61. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +1 -2
  62. package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +1 -0
  63. package/src/Common/DeleteComponentModal/DeleteComponent.tsx +32 -27
  64. package/src/Common/DeleteComponentModal/types.ts +1 -1
  65. package/src/Common/DevtronProgressing/DevtronProgressing.tsx +8 -5
  66. package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
  67. package/src/Common/Dialogs/DeleteDialog.tsx +5 -3
  68. package/src/Common/Dialogs/DialogForm.tsx +35 -31
  69. package/src/Common/Dialogs/ForceDeleteDialog.tsx +7 -13
  70. package/src/Common/Dialogs/Types.ts +12 -12
  71. package/src/Common/Dialogs/index.ts +1 -1
  72. package/src/Common/Drawer/Drawer.tsx +1 -1
  73. package/src/Common/EmptyState/EmptyState.tsx +17 -13
  74. package/src/Common/EmptyState/GenericEmptyState.tsx +15 -25
  75. package/src/Common/Error.tsx +5 -5
  76. package/src/Common/ErrorScreenNotFound.tsx +12 -9
  77. package/src/Common/Grid/Grid.tsx +2 -1
  78. package/src/Common/Helper.tsx +24 -23
  79. package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
  80. package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
  81. package/src/Common/ImageTags.Types.ts +3 -2
  82. package/src/Common/ImageTags.tsx +66 -61
  83. package/src/Common/InfoColorBar/InfoColourbar.tsx +5 -10
  84. package/src/Common/Modals/Modal.tsx +3 -3
  85. package/src/Common/Modals/OpaqueModal.tsx +18 -25
  86. package/src/Common/Modals/VisibleModal.tsx +3 -7
  87. package/src/Common/Modals/VisibleModal2.tsx +15 -20
  88. package/src/Common/MultiSelectCustomization.tsx +13 -9
  89. package/src/Common/Policy.Types.ts +38 -38
  90. package/src/Common/PopupMenu.tsx +9 -10
  91. package/src/Common/Progressing.tsx +18 -15
  92. package/src/Common/RJSF/Form.tsx +1 -0
  93. package/src/Common/RJSF/common/FieldRow.tsx +1 -0
  94. package/src/Common/RJSF/config.ts +1 -0
  95. package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
  96. package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +1 -0
  97. package/src/Common/RJSF/templates/BaseInput.tsx +1 -0
  98. package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +1 -0
  99. package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +1 -0
  100. package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +6 -1
  101. package/src/Common/RJSF/templates/Description.tsx +1 -0
  102. package/src/Common/RJSF/templates/Field.tsx +3 -14
  103. package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +9 -6
  104. package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +7 -5
  105. package/src/Common/RJSF/templates/TitleField.tsx +1 -0
  106. package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +1 -0
  107. package/src/Common/RJSF/utils.ts +57 -53
  108. package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
  109. package/src/Common/RJSF/widgets/Select.tsx +1 -0
  110. package/src/Common/RadioGroup/RadioGroup.tsx +23 -18
  111. package/src/Common/RadioGroup.tsx +23 -24
  112. package/src/Common/Reload.tsx +1 -0
  113. package/src/Common/ResizableTextarea.tsx +17 -18
  114. package/src/Common/Security/ScanVulnerabilitiesTable.tsx +34 -29
  115. package/src/Common/ServerError.ts +1 -5
  116. package/src/Common/TippyCustomized.tsx +38 -41
  117. package/src/Common/ToastBody.tsx +7 -6
  118. package/src/Common/Toggle/Toggle.tsx +3 -3
  119. package/src/Common/Types.ts +12 -12
  120. package/src/custom.d.ts +7 -7
  121. package/src/index.ts +1 -1
  122. package/.eslintignore +0 -75
  123. package/.github/pull_request_template.md +0 -25
  124. package/.github/workflows/ci.yml +0 -31
  125. package/.husky/pre-commit +0 -5
  126. package/.lintstagedrc +0 -3
  127. package/.nvmrc +0 -1
@@ -1,32 +1,32 @@
1
+ import React from 'react'
1
2
  import { VisibleModal2 } from '../Modals/VisibleModal2'
2
- import {
3
- ConfirmationDialogBodyType,
4
- ConfirmationDialogButtonGroupType,
5
- ConfirmationDialogIconType,
6
- ConfirmationDialogType,
7
- } from './Types'
3
+ import { ConfirmationDialogBodyType, ConfirmationDialogButtonGroupType, ConfirmationDialogIconType, ConfirmationDialogType } from './Types'
8
4
 
9
- const ConfirmationDialog = ({ className = '', children }: ConfirmationDialogType) => (
10
- <VisibleModal2 className="confirmation-dialog">
11
- <div className={`confirmation-dialog__body ${className}`}>{children}</div>
12
- </VisibleModal2>
13
- )
5
+ function ConfirmationDialog({ className = '', children }: ConfirmationDialogType) {
6
+ return (
7
+ <VisibleModal2 className="confirmation-dialog">
8
+ <div className={`confirmation-dialog__body ${className}`}>{children}</div>
9
+ </VisibleModal2>
10
+ )
11
+ }
14
12
 
15
- const Icon = ({ src, className = '' }: ConfirmationDialogIconType) => (
16
- <img src={src} className={`confirmation-dialog__icon ${className}`} alt="" />
17
- )
13
+ function Icon({ src, className = '' }: ConfirmationDialogIconType) {
14
+ return <img src={src} className={`confirmation-dialog__icon ${className}`} alt="" />
15
+ }
18
16
 
19
- const Body = ({ title, subtitle = null, children = null }: ConfirmationDialogBodyType) => (
20
- <div className="flex left column ">
21
- <h3 className="confirmation-dialog__title lh-1-5 dc__break-word w-100">{title}</h3>
22
- {subtitle && <div className="confirmation-dialog__subtitle">{subtitle}</div>}
23
- {children}
24
- </div>
25
- )
17
+ function Body({ title, subtitle = null, children = null }: ConfirmationDialogBodyType) {
18
+ return (
19
+ <div className="flex left column ">
20
+ <h3 className="confirmation-dialog__title lh-1-5 dc__break-word w-100">{title}</h3>
21
+ {subtitle && <div className="confirmation-dialog__subtitle">{subtitle}</div>}
22
+ {children}
23
+ </div>
24
+ )
25
+ }
26
26
 
27
- const ButtonGroup = ({ children }: ConfirmationDialogButtonGroupType) => (
28
- <div className="flex right confirmation-dialog__button-group">{children}</div>
29
- )
27
+ function ButtonGroup({ children }: ConfirmationDialogButtonGroupType) {
28
+ return <div className="flex right confirmation-dialog__button-group">{children}</div>
29
+ }
30
30
 
31
31
  ConfirmationDialog.Icon = Icon
32
32
  ConfirmationDialog.Body = Body
@@ -1,10 +1,10 @@
1
- import * as React from 'react'
1
+ import React from 'react'
2
2
  import warn from '../../Assets/Img/delete-medium.svg'
3
3
  import { Progressing } from '../Progressing'
4
4
  import ConfirmationDialog from './ConfirmationDialog'
5
5
  import { DeleteDialogProps } from './Types'
6
6
 
7
- export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = (props) => {
7
+ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
8
8
  const handleDelete = (e: React.MouseEvent) => {
9
9
  if (props.shouldStopPropagation) {
10
10
  e.stopPropagation()
@@ -62,6 +62,8 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
62
62
  )
63
63
  }
64
64
 
65
- const DeleteDialogDescription = (props) => <>{props.children}</>
65
+ function DeleteDialogDescription(props) {
66
+ return <>{props.children}</>
67
+ }
66
68
 
67
69
  DeleteDialog.Description = DeleteDialogDescription
@@ -1,28 +1,28 @@
1
- import { Component, createContext } from 'react'
2
- import { VisibleModal } from '../Modals/VisibleModal'
3
- import close from '../../Assets/Icon/ic-cross.svg'
1
+ import React, { Component, createContext } from 'react';
2
+ import { VisibleModal } from '../Modals/VisibleModal';
3
+ import close from '../../Assets/Icon/ic-cross.svg';
4
4
  import { Progressing } from '../Progressing'
5
- import { DialogFormProps } from './Types'
6
- // TODO: may not need context
7
- const DialogFormContext = createContext({ title: '', isLoading: false, close: (event) => {}, onSave: (event) => {} })
5
+ import { DialogFormProps } from './Types';
6
+ //TODO: may not need context
7
+ const DialogFormContext = createContext({ title: '', isLoading: false, close: (event) => {}, onSave: (event) => {} });
8
8
 
9
9
  export class DialogForm extends Component<DialogFormProps> {
10
10
  constructor(props) {
11
- super(props)
12
- this.escFunction = this.escFunction.bind(this)
11
+ super(props);
12
+ this.escFunction = this.escFunction.bind(this);
13
13
  }
14
14
 
15
15
  componentDidMount() {
16
- document.addEventListener('keydown', this.escFunction)
16
+ document.addEventListener('keydown', this.escFunction);
17
17
  }
18
18
 
19
19
  componentWillUnmount() {
20
- document.removeEventListener('keydown', this.escFunction)
20
+ document.removeEventListener('keydown', this.escFunction);
21
21
  }
22
22
 
23
23
  escFunction(event) {
24
24
  if (event.keyCode === 27 && this.props.closeOnESC) {
25
- this.props.close(event)
25
+ this.props.close(event);
26
26
  }
27
27
  }
28
28
 
@@ -46,24 +46,26 @@ export class DialogForm extends Component<DialogFormProps> {
46
46
  </button>
47
47
  </div>
48
48
  <DialogFormContext.Consumer>
49
- {(context) => (
50
- <form
51
- noValidate
52
- onSubmit={(e) => {
53
- e.preventDefault()
54
- if (!context.isLoading) {
55
- context.onSave(e)
56
- }
57
- }}
58
- >
59
- {this.props.children}
60
- </form>
61
- )}
49
+ {(context) => {
50
+ return (
51
+ <form
52
+ noValidate
53
+ onSubmit={(e) => {
54
+ e.preventDefault();
55
+ if (!context.isLoading) {
56
+ context.onSave(e);
57
+ }
58
+ }}
59
+ >
60
+ {this.props.children}
61
+ </form>
62
+ );
63
+ }}
62
64
  </DialogFormContext.Consumer>
63
65
  </div>
64
66
  </VisibleModal>
65
67
  </DialogFormContext.Provider>
66
- )
68
+ );
67
69
  }
68
70
  }
69
71
 
@@ -71,12 +73,14 @@ export class DialogFormSubmit extends Component<{ tabIndex: number }> {
71
73
  render() {
72
74
  return (
73
75
  <DialogFormContext.Consumer>
74
- {(context) => (
75
- <button type="submit" className="cta dc__align-right" tabIndex={this.props.tabIndex}>
76
- {context.isLoading ? <Progressing /> : this.props.children}
77
- </button>
78
- )}
76
+ {(context) => {
77
+ return (
78
+ <button type="submit" className="cta dc__align-right" tabIndex={this.props.tabIndex}>
79
+ {context.isLoading ? <Progressing /> : this.props.children}
80
+ </button>
81
+ );
82
+ }}
79
83
  </DialogFormContext.Consumer>
80
- )
84
+ );
81
85
  }
82
86
  }
@@ -1,21 +1,15 @@
1
- import { ForceDeleteDialogType } from './Types'
2
- import { DeleteDialog } from './DeleteDialog'
1
+ import React from 'react'
2
+ import { ForceDeleteDialogType } from './Types';
3
+ import { DeleteDialog } from './DeleteDialog';
3
4
 
4
- export default function ForceDeleteDialog({
5
- onClickDelete,
6
- closeDeleteModal,
7
- forceDeleteDialogTitle,
8
- forceDeleteDialogMessage,
9
- }: ForceDeleteDialogType) {
5
+ export default function ForceDeleteDialog({ onClickDelete, closeDeleteModal, forceDeleteDialogTitle, forceDeleteDialogMessage }: ForceDeleteDialogType) {
10
6
  return (
11
7
  <div>
12
- <DeleteDialog
13
- title={forceDeleteDialogTitle}
8
+ <DeleteDialog title={forceDeleteDialogTitle}
14
9
  delete={onClickDelete}
15
10
  closeDelete={closeDeleteModal}
16
- deletePrefix="Force "
17
- >
18
- <DeleteDialog.Description>
11
+ deletePrefix="Force ">
12
+ <DeleteDialog.Description >
19
13
  <p className="mt-12 mb-12 p-8 dc__break-word dc__window-bg">Error: {forceDeleteDialogMessage}</p>
20
14
  <p>Do you want to force delete?</p>
21
15
  </DeleteDialog.Description>
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react'
1
+ import { ReactNode } from "react"
2
2
 
3
3
  export interface DeleteDialogProps {
4
4
  title: string
@@ -15,10 +15,10 @@ export interface DeleteDialogProps {
15
15
  }
16
16
 
17
17
  export interface ForceDeleteDialogType {
18
- onClickDelete: () => void
19
- closeDeleteModal: () => void
20
- forceDeleteDialogTitle: string
21
- forceDeleteDialogMessage: string
18
+ onClickDelete: () => void
19
+ closeDeleteModal: () => void
20
+ forceDeleteDialogTitle: string
21
+ forceDeleteDialogMessage: string
22
22
  }
23
23
  export interface ConfirmationDialogType {
24
24
  className?: string
@@ -37,11 +37,11 @@ export interface ConfirmationDialogButtonGroupType {
37
37
  children: any
38
38
  }
39
39
  export interface DialogFormProps {
40
- className: string
41
- title: string
42
- isLoading: boolean
43
- closeOnESC?: boolean
44
- close: (event) => void
45
- onSave: (event) => void
46
- headerClassName?: string
40
+ className: string;
41
+ title: string;
42
+ isLoading: boolean;
43
+ closeOnESC?: boolean;
44
+ close: (event) => void;
45
+ onSave: (event) => void;
46
+ headerClassName?: string;
47
47
  }
@@ -1,4 +1,4 @@
1
1
  export { default as ConfirmationDialog } from './ConfirmationDialog'
2
2
  export * from './DeleteDialog'
3
3
  export * from './DialogForm'
4
- export { default as ForceDeleteDialog } from './ForceDeleteDialog'
4
+ export { default as ForceDeleteDialog } from './ForceDeleteDialog'
@@ -1,4 +1,4 @@
1
- import { useRef, useEffect } from 'react'
1
+ import React, { useRef, useEffect } from 'react'
2
2
  import { VisibleModal } from '../Modals/VisibleModal'
3
3
  import './Drawer.scss'
4
4
 
@@ -1,10 +1,14 @@
1
- import * as React from 'react'
2
- import './emptyState.scss'
3
- import { ReactComponent as Progressing } from '../../Assets/Icon/ic-progressing.svg'
4
-
5
- const EmptyState = ({ children, className = '' }) => (
6
- <div className={`flex column empty-state w-100 h-100 ${className}`}>{children}</div>
7
- )
1
+ import React from 'react'
2
+ import './emptyState.scss';
3
+ import { ReactComponent as Progressing } from '../../Assets/Icon/ic-progressing.svg';
4
+
5
+ function EmptyState({ children, className = '' }) {
6
+ return (
7
+ <div className={`flex column empty-state w-100 h-100 ${className}`}>
8
+ {children}
9
+ </div>
10
+ )
11
+ }
8
12
 
9
13
  function Image({ children }) {
10
14
  return children
@@ -14,20 +18,20 @@ function Title({ children }) {
14
18
  return children
15
19
  }
16
20
 
17
- const Subtitle = ({ children, className }: { children: any; className?: string }) => (
18
- <p className={`subtitle ${className || ''}`}>{children}</p>
19
- )
21
+ function Subtitle({ children, className }: { children: any; className?: string }) {
22
+ return <p className={`subtitle ${className || ''}`}>{children}</p>
23
+ }
20
24
 
21
25
  function Button({ children }) {
22
26
  return children
23
27
  }
24
28
 
25
- const Loading: React.FC<{ text: string }> = (props) => (
26
- <>
29
+ const Loading: React.FC<{ text: string }> = function (props) {
30
+ return <>
27
31
  <Progressing className="dc__block empty-state__loader" />
28
32
  <p className="empty-state__loading-text">{props.text}</p>
29
33
  </>
30
- )
34
+ }
31
35
 
32
36
  EmptyState.Image = Image
33
37
  EmptyState.Title = Title
@@ -1,9 +1,10 @@
1
+ import React from 'react';
1
2
  import AppNotDeployed from '../../Assets/Img/app-not-deployed.png'
2
3
  import { GenericEmptyStateType, ImageType } from '../Types'
3
4
 
4
5
  import './emptyState.scss'
5
6
 
6
- const GenericEmptyState = ({
7
+ function GenericEmptyState({
7
8
  title,
8
9
  image,
9
10
  subTitle,
@@ -18,35 +19,24 @@ const GenericEmptyState = ({
18
19
  SvgImage,
19
20
  noImage,
20
21
  layout = 'column',
21
- contentClassName = '',
22
- }: GenericEmptyStateType): JSX.Element => {
23
- const isRowLayout = layout === 'row'
24
-
22
+ contentClassName = ''
23
+ }: GenericEmptyStateType): JSX.Element {
24
+ const isRowLayout = layout === 'row';
25
+
25
26
  return (
26
27
  <div
27
- className={`flex ${isRowLayout ? 'dc__gap-32' : 'column dc__gap-20'} empty-state ${classname || ''}`}
28
+ className={`flex ${isRowLayout ? 'dc__gap-32' : 'column dc__gap-20'} empty-state ${classname ? classname : ''}`}
28
29
  style={styles}
29
30
  data-testid="generic-empty-state"
30
31
  {...(heightToDeduct >= 0 && { style: { ...styles, height: `calc(100vh - ${heightToDeduct}px)` } })}
31
- >
32
- {!SvgImage ? (
33
- !noImage && (
34
- <img
35
- className={imageClassName || ''}
36
- src={image || AppNotDeployed}
37
- width={imageType === ImageType.Medium ? '200' : '250'}
38
- height={imageType === ImageType.Medium ? '160' : '200'}
39
- alt="empty-state"
40
- />
41
- )
42
- ) : (
43
- <SvgImage />
44
- )}
45
- <div
46
- className={`flex column dc__gap-10 dc__mxw-300 ${
47
- isRowLayout ? 'dc__align-start' : ''
48
- } ${contentClassName}`}
49
- >
32
+ >
33
+ {!SvgImage ? !noImage && <img className={imageClassName ? imageClassName : ''}
34
+ src={image || AppNotDeployed}
35
+ width={imageType === ImageType.Medium ? '200' : '250'}
36
+ height={imageType === ImageType.Medium ? '160' : '200'}
37
+ alt="empty-state"
38
+ /> : <SvgImage />}
39
+ <div className={`flex column dc__gap-10 dc__mxw-300 ${isRowLayout ? 'dc__align-start' : ''} ${contentClassName}`}>
50
40
  <h4 className="title fw-6 cn-9 mt-0 mb-0">{title}</h4>
51
41
  {subTitle && <p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>{subTitle}</p>}
52
42
  {isButtonAvailable && renderButton()}
@@ -1,5 +1,4 @@
1
- import { Component } from 'react'
2
- import * as React from 'react'
1
+ import React, { Component } from 'react'
3
2
  import EmptyState from './EmptyState/EmptyState'
4
3
  import notAuthorized from '../Assets/Img/ic-not-authorized.svg'
5
4
  import ErrorScreenNotFound from './ErrorScreenNotFound'
@@ -21,7 +20,9 @@ export class ErrorScreenManager extends Component<{
21
20
  case 401:
22
21
  return 'Unauthorized'
23
22
  case 403:
24
- return <ErrorScreenNotAuthorized subtitle={this.props.subtitle} />
23
+ return (
24
+ <ErrorScreenNotAuthorized subtitle={this.props.subtitle} />
25
+ )
25
26
  case 404:
26
27
  return <ErrorScreenNotFound />
27
28
  case 500:
@@ -34,9 +35,8 @@ export class ErrorScreenManager extends Component<{
34
35
  return <Reload className={this.props.reloadClass} />
35
36
  }
36
37
  }
37
-
38
38
  render() {
39
- const msg = this.getMessage()
39
+ let msg = this.getMessage()
40
40
  return (
41
41
  <div>
42
42
  <h1>{msg}</h1>
@@ -1,25 +1,28 @@
1
- import { useHistory } from 'react-router-dom'
1
+ import React from 'react'
2
2
  import notFound from '../Assets/Img/ic-empty-error@2x.png'
3
+ import { useHistory } from 'react-router-dom'
3
4
  import { ERROR_EMPTY_SCREEN } from './Constants'
4
5
  import GenericEmptyState from './EmptyState/GenericEmptyState'
5
6
 
6
- const ErrorScreenNotFound = () => {
7
- const { push } = useHistory()
7
+ function ErrorScreenNotFound() {
8
+ const {push} = useHistory()
8
9
  const redirectToHome = () => {
9
10
  push('/app/list')
10
11
  }
11
- const renderGenerateButton = () => (
12
- <button className="flex cta h-32" onClick={redirectToHome} data-testid="empty-screen-take-me-home">
13
- {ERROR_EMPTY_SCREEN.TAKE_BACK_HOME}
14
- </button>
15
- )
12
+ const renderGenerateButton = () => {
13
+ return (
14
+ <button className="flex cta h-32" onClick={redirectToHome} data-testid="empty-screen-take-me-home">
15
+ {ERROR_EMPTY_SCREEN.TAKE_BACK_HOME}
16
+ </button>
17
+ )
18
+ }
16
19
 
17
20
  return (
18
21
  <GenericEmptyState
19
22
  image={notFound}
20
23
  title={ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND}
21
24
  subTitle={ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST}
22
- isButtonAvailable
25
+ isButtonAvailable={true}
23
26
  renderButton={renderGenerateButton}
24
27
  />
25
28
  )
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { GridProps } from './types'
2
3
 
3
4
  // This is meant to be a reusable component that will provide a grid like dynamic layout where xs is the number of columns out of 12 that the item will take up
@@ -10,7 +11,7 @@ export default function Grid({
10
11
  itemClass = '',
11
12
  children,
12
13
  }: GridProps) {
13
- const containerStyles = container ? { gap: `${spacing}px` } : {}
14
+ const containerStyles = container ? { gap: spacing + 'px' } : {}
14
15
 
15
16
  if (item) {
16
17
  const getColumnWidth = () => {
@@ -1,7 +1,6 @@
1
1
  import * as Sentry from '@sentry/browser'
2
2
  import moment from 'moment'
3
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
4
- import * as React from 'react'
3
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
5
4
  import { useLocation } from 'react-router-dom'
6
5
  import { toast } from 'react-toastify'
7
6
  import { ERROR_EMPTY_SCREEN, TOKEN_COOKIE_NAME } from './Constants'
@@ -78,19 +77,16 @@ export const stopPropagation = (event): void => {
78
77
  }
79
78
 
80
79
  export function useThrottledEffect(callback, delay, deps = []) {
81
- // function will be executed only once in a given time interval.
80
+ //function will be executed only once in a given time interval.
82
81
  const lastRan = useRef(Date.now())
83
82
 
84
83
  useEffect(() => {
85
- const handler = setTimeout(
86
- () => {
87
- if (Date.now() - lastRan.current >= delay) {
88
- callback()
89
- lastRan.current = Date.now()
90
- }
91
- },
92
- delay - (Date.now() - lastRan.current),
93
- )
84
+ const handler = setTimeout(function () {
85
+ if (Date.now() - lastRan.current >= delay) {
86
+ callback()
87
+ lastRan.current = Date.now()
88
+ }
89
+ }, delay - (Date.now() - lastRan.current))
94
90
 
95
91
  return () => {
96
92
  clearTimeout(handler)
@@ -119,7 +115,7 @@ export function getRandomColor(email: string): string {
119
115
  return colors[sum % colors.length]
120
116
  }
121
117
 
122
- export const getAlphabetIcon = (str: string, rootClassName: string = '') => {
118
+ export const getAlphabetIcon = (str: string, rootClassName: string = "") => {
123
119
  if (!str) return null
124
120
  return (
125
121
  <span
@@ -131,7 +127,9 @@ export const getAlphabetIcon = (str: string, rootClassName: string = '') => {
131
127
  )
132
128
  }
133
129
 
134
- export const getEmptyArrayOfLength = (length: number) => Array.from({ length })
130
+ export const getEmptyArrayOfLength = (length: number) => {
131
+ return Array.from({ length })
132
+ }
135
133
 
136
134
  export function noop(...args): any {}
137
135
 
@@ -155,7 +153,7 @@ export function getCookie(sKey) {
155
153
  }
156
154
  return (
157
155
  document.cookie.replace(
158
- new RegExp(`(?:(?:^|.*;)\\s*${sKey.replace(/[\-\.\+\*]/g, '\\$&')}\\s*\\=\\s*([^;]*).*$)|^.*$`),
156
+ new RegExp('(?:(?:^|.*;)\\s*' + sKey.replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=\\s*([^;]*).*$)|^.*$'),
159
157
  '$1',
160
158
  ) || null
161
159
  )
@@ -198,7 +196,7 @@ export function useForm(stateSchema, validationSchema = {}, callback) {
198
196
  // in every re-render in component
199
197
  const validateState = useCallback(
200
198
  (state) => {
201
- // check errors in all fields
199
+ //check errors in all fields
202
200
  const hasErrorInState = Object.keys(validationSchema).some((key) => {
203
201
  const isInputFieldRequired = validationSchema[key].required
204
202
  const stateValue = state[key].value // state value
@@ -225,7 +223,7 @@ export function useForm(stateSchema, validationSchema = {}, callback) {
225
223
  }
226
224
 
227
225
  // single validator
228
- const _validator = validationSchema[name].validator
226
+ let _validator = validationSchema[name].validator
229
227
  if (_validator && typeof _validator === 'object') {
230
228
  if (!_validateSingleValidator(_validator, value)) {
231
229
  return _validator.error
@@ -233,9 +231,9 @@ export function useForm(stateSchema, validationSchema = {}, callback) {
233
231
  }
234
232
 
235
233
  // multiple validators
236
- const _validators = validationSchema[name].validators
234
+ let _validators = validationSchema[name].validators
237
235
  if (_validators && typeof _validators === 'object' && Array.isArray(_validators)) {
238
- const errors = []
236
+ let errors = []
239
237
  _validators.forEach((_validator) => {
240
238
  if (!_validateSingleValidator(_validator, value)) {
241
239
  errors.push(_validator.error)
@@ -254,7 +252,7 @@ export function useForm(stateSchema, validationSchema = {}, callback) {
254
252
  setIsDirty(true)
255
253
 
256
254
  const { name, value } = event.target
257
- const error = validateField(name, value)
255
+ let error = validateField(name, value)
258
256
  setState((prevState) => ({
259
257
  ...prevState,
260
258
  [name]: { value, error },
@@ -282,7 +280,7 @@ export function handleUTCTime(ts: string, isRelativeTime = false) {
282
280
  let timestamp = ''
283
281
  try {
284
282
  if (ts && ts.length) {
285
- const date = moment(ts)
283
+ let date = moment(ts)
286
284
  if (isRelativeTime) timestamp = date.fromNow()
287
285
  else timestamp = date.format('ddd DD MMM YYYY HH:mm:ss')
288
286
  }
@@ -366,7 +364,9 @@ export function useAsync<T>(
366
364
  dependencies: dependencyArray,
367
365
  })
368
366
  const mounted = useRef(true)
369
- const dependencies: any[] = useMemo(() => [...dependencyArray, shouldRun], [...dependencyArray, shouldRun])
367
+ const dependencies: any[] = useMemo(() => {
368
+ return [...dependencyArray, shouldRun]
369
+ }, [...dependencyArray, shouldRun])
370
370
 
371
371
  const reload = () => {
372
372
  async function call() {
@@ -432,8 +432,9 @@ export function useAsync<T>(
432
432
  export const processDeployedTime = (lastDeployed, isArgoInstalled) => {
433
433
  if (lastDeployed) {
434
434
  return handleUTCTime(lastDeployed, true)
435
+ } else {
436
+ return isArgoInstalled ? '' : 'Not deployed'
435
437
  }
436
- return isArgoInstalled ? '' : 'Not deployed'
437
438
  }
438
439
 
439
440
  /**
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react'
1
+ import React, { useEffect } from 'react'
2
2
 
3
3
  export const useClickOutside = (ref: any, callback: () => void) => {
4
4
  useEffect(() => {
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import { getUserRole } from '../../Common.service'
3
3
  import { useSuperAdminType } from './types'
4
4
  import { showError } from '../../Helper'
@@ -13,12 +13,13 @@ export interface ImageComment {
13
13
  artifactId: number
14
14
  }
15
15
 
16
+
16
17
  export interface ImageTaggingContainerType {
17
18
  ciPipelineId?: number
18
19
  artifactId?: number
19
20
  imageComment?: ImageComment
20
21
  imageReleaseTags?: ReleaseTag[]
21
- updateCurrentAppMaterial?: (matId: number, releaseTags?: ReleaseTag[], imageComment?: ImageComment) => void
22
+ updateCurrentAppMaterial? : (matId:number, releaseTags?:ReleaseTag[], imageComment?:ImageComment) => void
22
23
  appReleaseTagNames?: string[]
23
24
  tagsEditable?: boolean
24
25
  forceReInit?: boolean
@@ -40,4 +41,4 @@ export interface ImageButtonType {
40
41
  isSuperAdmin: any
41
42
  duplicateTag?: boolean
42
43
  hideHardDelete?: boolean
43
- }
44
+ }