@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.
Files changed (133) hide show
  1. package/.eslintignore +75 -0
  2. package/.eslintrc.js +84 -16
  3. package/.github/pull_request_template.md +25 -0
  4. package/.github/workflows/ci.yml +31 -0
  5. package/.github/workflows/release-package.yml +2 -3
  6. package/.husky/pre-commit +4 -0
  7. package/.lintstagedrc +5 -0
  8. package/.nvmrc +1 -0
  9. package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
  10. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
  11. package/dist/Common/Common.service.d.ts +0 -1
  12. package/dist/Common/Constants.d.ts +1 -2
  13. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  14. package/dist/Common/CustomInput/Types.d.ts +2 -1
  15. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  16. package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
  17. package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
  18. package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
  19. package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
  20. package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
  21. package/dist/Common/Dialogs/Types.d.ts +1 -1
  22. package/dist/Common/EmptyState/EmptyState.d.ts +20 -17
  23. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  24. package/dist/Common/Error.d.ts +2 -1
  25. package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
  26. package/dist/Common/Helper.d.ts +1 -10
  27. package/dist/Common/ImageTags.d.ts +1 -1
  28. package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
  29. package/dist/Common/Modals/Modal.d.ts +2 -2
  30. package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
  31. package/dist/Common/Modals/VisibleModal.d.ts +3 -3
  32. package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
  33. package/dist/Common/MultiSelectCustomization.d.ts +1 -1
  34. package/dist/Common/Policy.Types.d.ts +2 -2
  35. package/dist/Common/PopupMenu.d.ts +5 -5
  36. package/dist/Common/Progressing.d.ts +2 -2
  37. package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
  38. package/dist/Common/ResizableTextarea.d.ts +1 -1
  39. package/dist/Common/TippyCustomized.d.ts +1 -1
  40. package/dist/Common/ToastBody.d.ts +5 -5
  41. package/dist/Common/Types.d.ts +0 -64
  42. package/dist/Common/index.d.ts +0 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js +380 -2083
  45. package/package.json +19 -4
  46. package/src/Common/AddCDButton/AddCDButton.tsx +1 -2
  47. package/src/Common/Api.ts +21 -26
  48. package/src/Common/AppStatus/AppStatus.tsx +12 -12
  49. package/src/Common/AppStatus/utils.ts +6 -5
  50. package/src/Common/BreadCrumb/BreadCrumb.tsx +32 -28
  51. package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
  52. package/src/Common/BreadCrumb/Types.ts +11 -12
  53. package/src/Common/Checkbox.tsx +17 -19
  54. package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
  55. package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +0 -1
  56. package/src/Common/Common.service.ts +59 -68
  57. package/src/Common/Constants.ts +9 -10
  58. package/src/Common/CustomInput/CustomInput.tsx +22 -28
  59. package/src/Common/CustomInput/Types.ts +4 -3
  60. package/src/Common/CustomInput/index.ts +1 -1
  61. package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +15 -18
  62. package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
  63. package/src/Common/CustomTagSelector/TagDetails.tsx +9 -3
  64. package/src/Common/CustomTagSelector/TagLabelSelect.tsx +7 -9
  65. package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +31 -35
  66. package/src/Common/CustomTagSelector/TagSelector.utils.ts +2 -3
  67. package/src/Common/CustomTagSelector/Types.ts +1 -1
  68. package/src/Common/CustomTagSelector/ValidationRules.ts +18 -22
  69. package/src/Common/CustomTagSelector/index.ts +2 -2
  70. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +2 -1
  71. package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +0 -1
  72. package/src/Common/DeleteComponentModal/DeleteComponent.tsx +27 -32
  73. package/src/Common/DeleteComponentModal/types.ts +1 -1
  74. package/src/Common/DevtronProgressing/DevtronProgressing.tsx +5 -8
  75. package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
  76. package/src/Common/Dialogs/DeleteDialog.tsx +3 -5
  77. package/src/Common/Dialogs/DialogForm.tsx +31 -35
  78. package/src/Common/Dialogs/ForceDeleteDialog.tsx +13 -7
  79. package/src/Common/Dialogs/Types.ts +12 -12
  80. package/src/Common/Dialogs/index.ts +1 -1
  81. package/src/Common/Drawer/Drawer.tsx +1 -1
  82. package/src/Common/EmptyState/EmptyState.tsx +13 -17
  83. package/src/Common/EmptyState/GenericEmptyState.tsx +25 -15
  84. package/src/Common/Error.tsx +5 -5
  85. package/src/Common/ErrorScreenNotFound.tsx +9 -12
  86. package/src/Common/Grid/Grid.tsx +1 -2
  87. package/src/Common/Helper.tsx +23 -125
  88. package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
  89. package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
  90. package/src/Common/ImageTags.Types.ts +2 -3
  91. package/src/Common/ImageTags.tsx +61 -66
  92. package/src/Common/InfoColorBar/InfoColourbar.tsx +10 -5
  93. package/src/Common/Modals/Modal.tsx +3 -3
  94. package/src/Common/Modals/OpaqueModal.tsx +25 -18
  95. package/src/Common/Modals/VisibleModal.tsx +7 -3
  96. package/src/Common/Modals/VisibleModal2.tsx +20 -15
  97. package/src/Common/MultiSelectCustomization.tsx +9 -13
  98. package/src/Common/Policy.Types.ts +38 -38
  99. package/src/Common/PopupMenu.tsx +10 -9
  100. package/src/Common/Progressing.tsx +15 -18
  101. package/src/Common/RJSF/Form.tsx +0 -1
  102. package/src/Common/RJSF/common/FieldRow.tsx +0 -1
  103. package/src/Common/RJSF/config.ts +0 -1
  104. package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
  105. package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +0 -1
  106. package/src/Common/RJSF/templates/BaseInput.tsx +0 -1
  107. package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +0 -1
  108. package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +0 -1
  109. package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +1 -6
  110. package/src/Common/RJSF/templates/Description.tsx +0 -1
  111. package/src/Common/RJSF/templates/Field.tsx +14 -3
  112. package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +6 -9
  113. package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +5 -7
  114. package/src/Common/RJSF/templates/TitleField.tsx +0 -1
  115. package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +0 -1
  116. package/src/Common/RJSF/utils.ts +53 -57
  117. package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
  118. package/src/Common/RJSF/widgets/Select.tsx +0 -1
  119. package/src/Common/RadioGroup/RadioGroup.tsx +18 -23
  120. package/src/Common/RadioGroup.tsx +24 -23
  121. package/src/Common/Reload.tsx +0 -1
  122. package/src/Common/ResizableTextarea.tsx +18 -17
  123. package/src/Common/Security/ScanVulnerabilitiesTable.tsx +29 -34
  124. package/src/Common/ServerError.ts +5 -1
  125. package/src/Common/TippyCustomized.tsx +41 -38
  126. package/src/Common/ToastBody.tsx +6 -7
  127. package/src/Common/Toggle/Toggle.tsx +3 -3
  128. package/src/Common/Types.ts +12 -81
  129. package/src/Common/index.ts +0 -1
  130. package/src/custom.d.ts +7 -7
  131. package/src/index.ts +1 -1
  132. package/dist/Common/ChartVersionAndTypeSelector.d.ts +0 -4
  133. package/src/Common/ChartVersionAndTypeSelector.tsx +0 -78
@@ -1,32 +1,32 @@
1
- import React from 'react'
2
1
  import { VisibleModal2 } from '../Modals/VisibleModal2'
3
- import { ConfirmationDialogBodyType, ConfirmationDialogButtonGroupType, ConfirmationDialogIconType, ConfirmationDialogType } from './Types'
2
+ import {
3
+ ConfirmationDialogBodyType,
4
+ ConfirmationDialogButtonGroupType,
5
+ ConfirmationDialogIconType,
6
+ ConfirmationDialogType,
7
+ } from './Types'
4
8
 
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
- }
9
+ const ConfirmationDialog = ({ className = '', children }: ConfirmationDialogType) => (
10
+ <VisibleModal2 className="confirmation-dialog">
11
+ <div className={`confirmation-dialog__body ${className}`}>{children}</div>
12
+ </VisibleModal2>
13
+ )
12
14
 
13
- function Icon({ src, className = '' }: ConfirmationDialogIconType) {
14
- return <img src={src} className={`confirmation-dialog__icon ${className}`} alt="" />
15
- }
15
+ const Icon = ({ src, className = '' }: ConfirmationDialogIconType) => (
16
+ <img src={src} className={`confirmation-dialog__icon ${className}`} alt="" />
17
+ )
16
18
 
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
- }
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
+ )
26
26
 
27
- function ButtonGroup({ children }: ConfirmationDialogButtonGroupType) {
28
- return <div className="flex right confirmation-dialog__button-group">{children}</div>
29
- }
27
+ const ButtonGroup = ({ children }: ConfirmationDialogButtonGroupType) => (
28
+ <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 React from 'react'
1
+ import * as 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> } = function (props) {
7
+ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = (props) => {
8
8
  const handleDelete = (e: React.MouseEvent) => {
9
9
  if (props.shouldStopPropagation) {
10
10
  e.stopPropagation()
@@ -62,8 +62,6 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
62
62
  )
63
63
  }
64
64
 
65
- function DeleteDialogDescription(props) {
66
- return <>{props.children}</>
67
- }
65
+ const DeleteDialogDescription = (props) => <>{props.children}</>
68
66
 
69
67
  DeleteDialog.Description = DeleteDialogDescription
@@ -1,28 +1,28 @@
1
- import React, { Component, createContext } from 'react';
2
- import { VisibleModal } from '../Modals/VisibleModal';
3
- import close from '../../Assets/Icon/ic-cross.svg';
1
+ import { 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,26 +46,24 @@ export class DialogForm extends Component<DialogFormProps> {
46
46
  </button>
47
47
  </div>
48
48
  <DialogFormContext.Consumer>
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
- }}
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
+ )}
64
62
  </DialogFormContext.Consumer>
65
63
  </div>
66
64
  </VisibleModal>
67
65
  </DialogFormContext.Provider>
68
- );
66
+ )
69
67
  }
70
68
  }
71
69
 
@@ -73,14 +71,12 @@ export class DialogFormSubmit extends Component<{ tabIndex: number }> {
73
71
  render() {
74
72
  return (
75
73
  <DialogFormContext.Consumer>
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
- }}
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
+ )}
83
79
  </DialogFormContext.Consumer>
84
- );
80
+ )
85
81
  }
86
82
  }
@@ -1,15 +1,21 @@
1
- import React from 'react'
2
- import { ForceDeleteDialogType } from './Types';
3
- import { DeleteDialog } from './DeleteDialog';
1
+ import { ForceDeleteDialogType } from './Types'
2
+ import { DeleteDialog } from './DeleteDialog'
4
3
 
5
- export default function ForceDeleteDialog({ onClickDelete, closeDeleteModal, forceDeleteDialogTitle, forceDeleteDialogMessage }: ForceDeleteDialogType) {
4
+ export default function ForceDeleteDialog({
5
+ onClickDelete,
6
+ closeDeleteModal,
7
+ forceDeleteDialogTitle,
8
+ forceDeleteDialogMessage,
9
+ }: ForceDeleteDialogType) {
6
10
  return (
7
11
  <div>
8
- <DeleteDialog title={forceDeleteDialogTitle}
12
+ <DeleteDialog
13
+ title={forceDeleteDialogTitle}
9
14
  delete={onClickDelete}
10
15
  closeDelete={closeDeleteModal}
11
- deletePrefix="Force ">
12
- <DeleteDialog.Description >
16
+ deletePrefix="Force "
17
+ >
18
+ <DeleteDialog.Description>
13
19
  <p className="mt-12 mb-12 p-8 dc__break-word dc__window-bg">Error: {forceDeleteDialogMessage}</p>
14
20
  <p>Do you want to force delete?</p>
15
21
  </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 React, { useRef, useEffect } from 'react'
1
+ import { useRef, useEffect } from 'react'
2
2
  import { VisibleModal } from '../Modals/VisibleModal'
3
3
  import './Drawer.scss'
4
4
 
@@ -1,14 +1,10 @@
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
- }
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
+ )
12
8
 
13
9
  function Image({ children }) {
14
10
  return children
@@ -18,20 +14,20 @@ function Title({ children }) {
18
14
  return children
19
15
  }
20
16
 
21
- function Subtitle({ children, className }: { children: any; className?: string }) {
22
- return <p className={`subtitle ${className || ''}`}>{children}</p>
23
- }
17
+ const Subtitle = ({ children, className }: { children: any; className?: string }) => (
18
+ <p className={`subtitle ${className || ''}`}>{children}</p>
19
+ )
24
20
 
25
21
  function Button({ children }) {
26
22
  return children
27
23
  }
28
24
 
29
- const Loading: React.FC<{ text: string }> = function (props) {
30
- return <>
25
+ const Loading: React.FC<{ text: string }> = (props) => (
26
+ <>
31
27
  <Progressing className="dc__block empty-state__loader" />
32
28
  <p className="empty-state__loading-text">{props.text}</p>
33
29
  </>
34
- }
30
+ )
35
31
 
36
32
  EmptyState.Image = Image
37
33
  EmptyState.Title = Title
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
1
  import AppNotDeployed from '../../Assets/Img/app-not-deployed.png'
3
2
  import { GenericEmptyStateType, ImageType } from '../Types'
4
3
 
5
4
  import './emptyState.scss'
6
5
 
7
- function GenericEmptyState({
6
+ const GenericEmptyState = ({
8
7
  title,
9
8
  image,
10
9
  subTitle,
@@ -19,24 +18,35 @@ function GenericEmptyState({
19
18
  SvgImage,
20
19
  noImage,
21
20
  layout = 'column',
22
- contentClassName = ''
23
- }: GenericEmptyStateType): JSX.Element {
24
- const isRowLayout = layout === 'row';
25
-
21
+ contentClassName = '',
22
+ }: GenericEmptyStateType): JSX.Element => {
23
+ const isRowLayout = layout === 'row'
24
+
26
25
  return (
27
26
  <div
28
- className={`flex ${isRowLayout ? 'dc__gap-32' : 'column dc__gap-20'} empty-state ${classname ? classname : ''}`}
27
+ className={`flex ${isRowLayout ? 'dc__gap-32' : 'column dc__gap-20'} empty-state ${classname || ''}`}
29
28
  style={styles}
30
29
  data-testid="generic-empty-state"
31
30
  {...(heightToDeduct >= 0 && { style: { ...styles, height: `calc(100vh - ${heightToDeduct}px)` } })}
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}`}>
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
+ >
40
50
  <h4 className="title fw-6 cn-9 mt-0 mb-0">{title}</h4>
41
51
  {subTitle && <p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>{subTitle}</p>}
42
52
  {isButtonAvailable && renderButton()}
@@ -1,4 +1,5 @@
1
- import React, { Component } from 'react'
1
+ import { Component } from 'react'
2
+ import * as React from 'react'
2
3
  import EmptyState from './EmptyState/EmptyState'
3
4
  import notAuthorized from '../Assets/Img/ic-not-authorized.svg'
4
5
  import ErrorScreenNotFound from './ErrorScreenNotFound'
@@ -20,9 +21,7 @@ export class ErrorScreenManager extends Component<{
20
21
  case 401:
21
22
  return 'Unauthorized'
22
23
  case 403:
23
- return (
24
- <ErrorScreenNotAuthorized subtitle={this.props.subtitle} />
25
- )
24
+ return <ErrorScreenNotAuthorized subtitle={this.props.subtitle} />
26
25
  case 404:
27
26
  return <ErrorScreenNotFound />
28
27
  case 500:
@@ -35,8 +34,9 @@ export class ErrorScreenManager extends Component<{
35
34
  return <Reload className={this.props.reloadClass} />
36
35
  }
37
36
  }
37
+
38
38
  render() {
39
- let msg = this.getMessage()
39
+ const msg = this.getMessage()
40
40
  return (
41
41
  <div>
42
42
  <h1>{msg}</h1>
@@ -1,28 +1,25 @@
1
- import React from 'react'
2
- import notFound from '../Assets/Img/ic-empty-error@2x.png'
3
1
  import { useHistory } from 'react-router-dom'
2
+ import notFound from '../Assets/Img/ic-empty-error@2x.png'
4
3
  import { ERROR_EMPTY_SCREEN } from './Constants'
5
4
  import GenericEmptyState from './EmptyState/GenericEmptyState'
6
5
 
7
- function ErrorScreenNotFound() {
8
- const {push} = useHistory()
6
+ const ErrorScreenNotFound = () => {
7
+ const { push } = useHistory()
9
8
  const redirectToHome = () => {
10
9
  push('/app/list')
11
10
  }
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
- }
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
+ )
19
16
 
20
17
  return (
21
18
  <GenericEmptyState
22
19
  image={notFound}
23
20
  title={ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND}
24
21
  subTitle={ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST}
25
- isButtonAvailable={true}
22
+ isButtonAvailable
26
23
  renderButton={renderGenerateButton}
27
24
  />
28
25
  )
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { GridProps } from './types'
3
2
 
4
3
  // 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
@@ -11,7 +10,7 @@ export default function Grid({
11
10
  itemClass = '',
12
11
  children,
13
12
  }: GridProps) {
14
- const containerStyles = container ? { gap: spacing + 'px' } : {}
13
+ const containerStyles = container ? { gap: `${spacing}px` } : {}
15
14
 
16
15
  if (item) {
17
16
  const getColumnWidth = () => {