@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,7 +1,7 @@
1
- import React from 'react'
1
+ import { Component } from 'react'
2
2
  import ReactDOM from 'react-dom'
3
3
 
4
- export class VisibleModal extends React.Component<{
4
+ export class VisibleModal extends Component<{
5
5
  className: string
6
6
  parentClassName?: string
7
7
  noBackground?: boolean
@@ -46,7 +46,11 @@ export class VisibleModal extends React.Component<{
46
46
 
47
47
  render() {
48
48
  return ReactDOM.createPortal(
49
- <div className={`visible-modal__body ${this.props.className}`} onClick={this.props?.close} data-testid="visible-modal-close">
49
+ <div
50
+ className={`visible-modal__body ${this.props.className}`}
51
+ onClick={this.props?.close}
52
+ data-testid="visible-modal-close"
53
+ >
50
54
  {this.props.children}
51
55
  </div>,
52
56
  document.getElementById('visible-modal'),
@@ -1,35 +1,40 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
1
+ import { Component } from 'react'
2
+ import ReactDOM from 'react-dom'
3
3
 
4
- export class VisibleModal2 extends React.Component<{ className: string; close?: (e) => void; }> {
5
-
6
- modalRef = document.getElementById('visible-modal-2');
4
+ export class VisibleModal2 extends Component<{ className: string; close?: (e) => void }> {
5
+ modalRef = document.getElementById('visible-modal-2')
7
6
 
8
7
  constructor(props) {
9
- super(props);
10
- this.escFunction = this.escFunction.bind(this);
8
+ super(props)
9
+ this.escFunction = this.escFunction.bind(this)
11
10
  }
12
11
 
13
12
  escFunction(event) {
14
13
  if (event.keyCode === 27 && this.props.close) {
15
- this.props.close(event);
14
+ this.props.close(event)
16
15
  }
17
16
  }
18
17
 
19
18
  componentDidMount() {
20
- document.addEventListener("keydown", this.escFunction);
21
- this.modalRef.classList.add("show-with-bg");
19
+ document.addEventListener('keydown', this.escFunction)
20
+ this.modalRef.classList.add('show-with-bg')
22
21
  }
23
22
 
24
23
  componentWillUnmount() {
25
- document.removeEventListener("keydown", this.escFunction);
26
- this.modalRef.classList.remove("show-with-bg");
24
+ document.removeEventListener('keydown', this.escFunction)
25
+ this.modalRef.classList.remove('show-with-bg')
27
26
  }
28
27
 
29
28
  render() {
30
29
  return ReactDOM.createPortal(
31
- <div className={`visible-modal__body ${this.props.className}`} onClick={this.props?.close} data-testid="visible-modal2-close">
30
+ <div
31
+ className={`visible-modal__body ${this.props.className}`}
32
+ onClick={this.props?.close}
33
+ data-testid="visible-modal2-close"
34
+ >
32
35
  {this.props.children}
33
- </div>, document.getElementById('visible-modal-2'))
36
+ </div>,
37
+ document.getElementById('visible-modal-2'),
38
+ )
34
39
  }
35
- }
40
+ }
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import * as React from 'react'
2
2
  import Select, { components } from 'react-select'
3
3
  import { ReactComponent as ClearIcon } from '../Assets/Icon/ic-appstatus-cancelled.svg'
4
4
  import { ReactComponent as Check } from '../Assets/Icon/ic-check.svg'
@@ -42,7 +42,7 @@ export const MultiValueContainer = (props) => {
42
42
  const { label, value } = data
43
43
  return (
44
44
  <components.MultiValueContainer {...{ data, innerProps, selectProps }}>
45
- <div className={`flex fs-12 ml-4 cn-9`}>{label}</div>
45
+ <div className="flex fs-12 ml-4 cn-9">{label}</div>
46
46
  {children[1]}
47
47
  </components.MultiValueContainer>
48
48
  )
@@ -106,14 +106,12 @@ export const multiSelectStyles = {
106
106
  menu: (base, state) => ({
107
107
  ...base,
108
108
  }),
109
- option: (base, state) => {
110
- return {
111
- ...base,
112
- backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
113
- color: 'var(--N900)',
114
- padding: '8px 12px',
115
- }
116
- },
109
+ option: (base, state) => ({
110
+ ...base,
111
+ backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
112
+ color: 'var(--N900)',
113
+ padding: '8px 12px',
114
+ }),
117
115
  container: (base, state) => ({
118
116
  ...base,
119
117
  cursor: state.isDisabled ? 'not-allowed' : 'pointer',
@@ -143,6 +141,4 @@ export interface CustomSelect {
143
141
  formatOptionLabel?: (...args) => any
144
142
  }
145
143
 
146
- export const CustomSelect: React.FC<CustomSelect> = (props) => {
147
- return <Select {...props} />
148
- }
144
+ export const CustomSelect: React.FC<CustomSelect> = (props) => <Select {...props} />
@@ -1,63 +1,63 @@
1
- import { VariableType } from "./CIPipeline.Types"
2
- import { ResponseType } from "./Types"
1
+ import { VariableType } from './CIPipeline.Types'
2
+ import { ResponseType } from './Types'
3
3
 
4
4
  export enum ApplyPolicyToStage {
5
- PRE_CI = 'PRE_CI',
6
- POST_CI = 'POST_CI',
7
- PRE_OR_POST_CI = 'PRE_OR_POST_CI',
5
+ PRE_CI = 'PRE_CI',
6
+ POST_CI = 'POST_CI',
7
+ PRE_OR_POST_CI = 'PRE_OR_POST_CI',
8
8
  }
9
9
 
10
10
  export enum PluginRequiredStage {
11
- PRE_CI = 'preBuildStage',
12
- POST_CI = 'postBuildStage',
13
- PRE_OR_POST_CI = 'PRE_OR_POST_CI',
11
+ PRE_CI = 'preBuildStage',
12
+ POST_CI = 'postBuildStage',
13
+ PRE_OR_POST_CI = 'PRE_OR_POST_CI',
14
14
  }
15
15
 
16
16
  export interface DefinitionSourceType {
17
- projectName: string
18
- isDueToProductionEnvironment: boolean
19
- isDueToLinkedPipeline: boolean
20
- policyName: string
21
- appName?: string
22
- clusterName?: string
23
- environmentName?: string
24
- branchNames?: string[]
25
- ciPipelineName?: string
17
+ projectName: string
18
+ isDueToProductionEnvironment: boolean
19
+ isDueToLinkedPipeline: boolean
20
+ policyName: string
21
+ appName?: string
22
+ clusterName?: string
23
+ environmentName?: string
24
+ branchNames?: string[]
25
+ ciPipelineName?: string
26
26
  }
27
27
  export interface MandatoryPluginDetailType {
28
- id: number
29
- icon: string
30
- name: string
31
- description?: string
32
- requiredIn: PluginRequiredStage
33
- applied?: boolean
34
- inputVariables?: VariableType[]
35
- outputVariables?: VariableType[]
36
- definitionSources?: DefinitionSourceType[]
28
+ id: number
29
+ icon: string
30
+ name: string
31
+ description?: string
32
+ requiredIn: PluginRequiredStage
33
+ applied?: boolean
34
+ inputVariables?: VariableType[]
35
+ outputVariables?: VariableType[]
36
+ definitionSources?: DefinitionSourceType[]
37
37
  }
38
38
  export interface MandatoryPluginDataType {
39
- pluginData: MandatoryPluginDetailType[]
40
- isValidPre: boolean
41
- isValidPost: boolean
39
+ pluginData: MandatoryPluginDetailType[]
40
+ isValidPre: boolean
41
+ isValidPost: boolean
42
42
  }
43
43
 
44
44
  export enum ConsequenceAction {
45
- BLOCK = 'BLOCK',
46
- ALLOW_UNTIL_TIME = 'ALLOW_UNTIL_TIME',
47
- ALLOW_FOREVER = 'ALLOW_FOREVER',
45
+ BLOCK = 'BLOCK',
46
+ ALLOW_UNTIL_TIME = 'ALLOW_UNTIL_TIME',
47
+ ALLOW_FOREVER = 'ALLOW_FOREVER',
48
48
  }
49
49
 
50
50
  export interface ConsequenceType {
51
- action: ConsequenceAction
52
- metadataField: string
51
+ action: ConsequenceAction
52
+ metadataField: string
53
53
  }
54
54
 
55
55
  export interface BlockedStateData {
56
- isOffendingMandatoryPlugin: boolean
57
- isCITriggerBlocked: boolean
58
- ciBlockState: ConsequenceType
56
+ isOffendingMandatoryPlugin: boolean
57
+ isCITriggerBlocked: boolean
58
+ ciBlockState: ConsequenceType
59
59
  }
60
60
 
61
61
  export interface GetBlockedStateResponse extends ResponseType {
62
62
  result?: BlockedStateData
63
- }
63
+ }
@@ -1,4 +1,5 @@
1
- import React, { useEffect } from 'react'
1
+ import { useEffect } from 'react'
2
+ import * as React from 'react'
2
3
  import { Modal } from './Modals/Modal'
3
4
  import { PopupMenuBodyType, PopupMenuButtonType, PopupMenuType } from './Types'
4
5
 
@@ -12,12 +13,12 @@ function usePopupContext() {
12
13
  return context
13
14
  }
14
15
 
15
- function PopupMenu({
16
+ const PopupMenu = ({
16
17
  children = null,
17
18
  onToggleCallback = null,
18
19
  autoClose = false,
19
20
  autoPosition = false,
20
- }: PopupMenuType) {
21
+ }: PopupMenuType) => {
21
22
  const [popupPosition, setPopupPosition] = React.useState(null)
22
23
  const [opacity, setOpacity] = React.useState(0)
23
24
  const observer = React.useRef<IntersectionObserver | null>(null)
@@ -135,15 +136,15 @@ function PopupMenu({
135
136
  )
136
137
  }
137
138
 
138
- function Button({
139
+ const Button = ({
139
140
  children = null,
140
141
  disabled = false,
141
142
  rootClassName = '',
142
143
  tabIndex = 0,
143
144
  onHover = false,
144
145
  isKebab = false,
145
- dataTestId = "",
146
- }: PopupMenuButtonType) {
146
+ dataTestId = '',
147
+ }: PopupMenuButtonType) => {
147
148
  const { handleOpen, popupPosition, buttonRef, initialiseButtonWidth } = usePopupContext()
148
149
  return (
149
150
  <button
@@ -163,14 +164,14 @@ function Button({
163
164
  )
164
165
  }
165
166
 
166
- function Body({
167
+ const Body = ({
167
168
  children = null,
168
169
  rootClassName = '',
169
170
  style = {},
170
171
  autoWidth = false,
171
172
  preventWheelDisable = false,
172
173
  noBackDrop,
173
- }: PopupMenuBodyType) {
174
+ }: PopupMenuBodyType) => {
174
175
  const { handleClose, popupPosition, opacity, callbackRef, buttonWidth } = usePopupContext()
175
176
  return popupPosition ? (
176
177
  <Modal
@@ -183,7 +184,7 @@ function Body({
183
184
  ...popupPosition,
184
185
  ...style,
185
186
  ...(autoWidth ? { width: buttonWidth.current } : {}),
186
- opacity: opacity,
187
+ opacity,
187
188
  }}
188
189
  preventWheelDisable={preventWheelDisable}
189
190
  noBackDrop={noBackDrop}
@@ -1,7 +1,6 @@
1
- import React from 'react'
2
1
  import { ProgressingProps } from './Types'
3
2
 
4
- export function Progressing({ pageLoader, size, theme, styles, fillColor }: ProgressingProps): JSX.Element {
3
+ export const Progressing = ({ pageLoader, size, theme, styles, fillColor }: ProgressingProps): JSX.Element => {
5
4
  const loaderSize = size ? `${size}px` : pageLoader ? '48px' : '20px'
6
5
  return (
7
6
  <div className={`loader ${theme || 'default'}-background`} style={styles} data-testid="progressing">
@@ -29,25 +28,23 @@ export function Progressing({ pageLoader, size, theme, styles, fillColor }: Prog
29
28
  )
30
29
  }
31
30
 
32
- export function DetailsProgressing({
31
+ export const DetailsProgressing = ({
33
32
  loadingText,
34
33
  size = 24,
35
34
  fullHeight = false,
36
35
  styles,
37
36
  fillColor,
38
37
  children,
39
- }: ProgressingProps): JSX.Element {
40
- return (
41
- <div
42
- className={`details-loader bcn-0 flex column fs-14 fw-6 ${fullHeight ? 'h-100' : 'details-loader-height'}`}
43
- style={styles}
44
- data-testid="details-progressing"
45
- >
46
- <span style={{ width: `${size}px`, height: `${size}px` }}>
47
- <Progressing size={size} fillColor={fillColor} />
48
- </span>
49
- {loadingText && <span className="mt-10">{loadingText}</span>}
50
- {children}
51
- </div>
52
- )
53
- }
38
+ }: ProgressingProps): JSX.Element => (
39
+ <div
40
+ className={`details-loader bcn-0 flex column fs-14 fw-6 ${fullHeight ? 'h-100' : 'details-loader-height'}`}
41
+ style={styles}
42
+ data-testid="details-progressing"
43
+ >
44
+ <span style={{ width: `${size}px`, height: `${size}px` }}>
45
+ <Progressing size={size} fillColor={fillColor} />
46
+ </span>
47
+ {loadingText && <span className="mt-10">{loadingText}</span>}
48
+ {children}
49
+ </div>
50
+ )
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import RJSF from '@rjsf/core'
3
2
  import RJSFValidator from '@rjsf/validator-ajv8'
4
3
 
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { FieldRowProps } from './types'
3
2
  import { DEFAULT_FIELD_TITLE, DO_NOT_SHOW_LABEL } from '../constants'
4
3
 
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { RegistryWidgetsType } from '@rjsf/utils'
3
2
 
4
3
  import {
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties } from 'react'
1
+ import { CSSProperties } from 'react'
2
2
  import { ArrayFieldTemplateItemType } from '@rjsf/utils'
3
3
 
4
4
  export const ArrayFieldItemTemplate = ({
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { getTemplate, getUiOptions, ArrayFieldTemplateProps, ArrayFieldTemplateItemType } from '@rjsf/utils'
3
2
  import { FieldRowWithLabel } from '../common/FieldRow'
4
3
  import { DO_NOT_SHOW_LABEL } from '../constants'
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { getDefaultRegistry } from '@rjsf/core'
3
2
  import { BaseInputTemplateProps } from '@rjsf/utils'
4
3
  import { PLACEHOLDERS } from '../constants'
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { IconButtonProps } from '@rjsf/utils'
3
2
 
4
3
  import { ReactComponent as PlusIcon } from '../../../../Assets/Icon/ic-add.svg'
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { IconButtonProps } from '@rjsf/utils'
3
2
 
4
3
  import { ReactComponent as CrossIcon } from '../../../../Assets/Icon/ic-cross.svg'
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { getSubmitButtonOptions, SubmitButtonProps } from '@rjsf/utils'
3
2
 
4
3
  export const SubmitButton = ({ uiSchema }: SubmitButtonProps) => {
@@ -6,11 +5,7 @@ export const SubmitButton = ({ uiSchema }: SubmitButtonProps) => {
6
5
 
7
6
  return norender ? null : (
8
7
  <div className="flexbox flex-justify-end">
9
- <button
10
- type="submit"
11
- {...submitButtonProps}
12
- className={`cta ${submitButtonProps.className || ''}`}
13
- >
8
+ <button type="submit" {...submitButtonProps} className={`cta ${submitButtonProps.className || ''}`}>
14
9
  {submitText}
15
10
  </button>
16
11
  </div>
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { DescriptionFieldProps } from '@rjsf/utils'
3
2
 
4
3
  import { ReactComponent as Info } from '../../../Assets/Icon/ic-info-filled.svg'
@@ -1,10 +1,21 @@
1
- import React from 'react'
2
1
  import { FieldTemplateProps, getUiOptions, getTemplate, ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils'
3
2
  import { FieldRowWithLabel } from '../common/FieldRow'
4
3
 
5
4
  export const Field = (props: FieldTemplateProps) => {
6
- const { id, label, children, errors, hidden, required, displayLabel, registry, uiSchema, classNames, schema, description } =
7
- props
5
+ const {
6
+ id,
7
+ label,
8
+ children,
9
+ errors,
10
+ hidden,
11
+ required,
12
+ displayLabel,
13
+ registry,
14
+ uiSchema,
15
+ classNames,
16
+ schema,
17
+ description,
18
+ } = props
8
19
  const uiOptions = getUiOptions(uiSchema)
9
20
  const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate'>(
10
21
  'WrapIfAdditionalTemplate',
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { errorId, FieldErrorProps } from '@rjsf/utils'
3
2
 
4
3
  import { ReactComponent as Error } from '../../../Assets/Icon/ic-warning.svg'
@@ -11,14 +10,12 @@ export const FieldErrorTemplate = ({ errors = [], idSchema }: FieldErrorProps) =
11
10
  <span id={id}>
12
11
  {errors
13
12
  .filter((elem) => !!elem)
14
- .map((error, index: number) => {
15
- return (
16
- <span className="form__error" key={index}>
17
- <Error className="form__icon form__icon--error" />
18
- {error}
19
- </span>
20
- )
21
- })}
13
+ .map((error, index: number) => (
14
+ <span className="form__error" key={index}>
15
+ <Error className="form__icon form__icon--error" />
16
+ {error}
17
+ </span>
18
+ ))}
22
19
  </span>
23
20
  )
24
21
  )
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import {
3
2
  ObjectFieldTemplatePropertyType,
4
3
  ObjectFieldTemplateProps,
@@ -55,13 +54,12 @@ const Field = ({
55
54
  {ActionButton}
56
55
  </>
57
56
  )
58
- } else {
59
- return (
60
- <FieldRowWithLabel label={title} required={required} showLabel id={idSchema.$id}>
61
- {ActionButton}
62
- </FieldRowWithLabel>
63
- )
64
57
  }
58
+ return (
59
+ <FieldRowWithLabel label={title} required={required} showLabel id={idSchema.$id}>
60
+ {ActionButton}
61
+ </FieldRowWithLabel>
62
+ )
65
63
  }
66
64
  return (
67
65
  <>
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { TitleFieldProps } from '@rjsf/utils'
3
2
 
4
3
  export const TitleField = ({ id, title, required }: TitleFieldProps) => (
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { ADDITIONAL_PROPERTY_FLAG, WrapIfAdditionalTemplateProps } from '@rjsf/utils'
3
2
 
4
3
  import { PLACEHOLDERS } from '../constants'
@@ -13,63 +13,59 @@ export const translateString = (stringToTranslate: TranslatableString, params?:
13
13
  }
14
14
  }
15
15
 
16
- export const getCommonSelectStyle = (styleOverrides = {}) => {
17
- return {
18
- menuList: (base) => ({
19
- ...base,
20
- paddingTop: 0,
21
- paddingBottom: 0,
22
- }),
23
- control: (base, state) => ({
24
- ...base,
25
- minHeight: '32px',
26
- boxShadow: 'none',
27
- backgroundColor: 'var(--N50)',
28
- border: state.isFocused ? '1px solid var(--B500)' : '1px solid var(--N200)',
29
- cursor: 'pointer',
30
- }),
31
- option: (base, state) => ({
32
- ...base,
33
- color: 'var(--N900)',
34
- backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
35
- padding: '10px 12px',
36
- }),
37
- dropdownIndicator: (base, state) => ({
38
- ...base,
39
- color: 'var(--N400)',
40
- padding: '0 8px',
41
- transition: 'all .2s ease',
42
- transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)',
43
- }),
44
- valueContainer: (base, state) => ({
45
- ...base,
46
- padding: '0 8px',
47
- fontWeight: '400',
48
- color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color,
49
- }),
50
- loadingMessage: (base) => ({
51
- ...base,
52
- color: 'var(--N600)',
53
- }),
54
- noOptionsMessage: (base) => ({
55
- ...base,
56
- color: 'var(--N600)',
57
- }),
58
- multiValue: (base, state) => {
59
- return {
60
- ...base,
61
- border: `1px solid var(--N200)`,
62
- borderRadius: `4px`,
63
- background: 'white',
64
- height: '28px',
65
- marginRight: '8px',
66
- padding: '2px',
67
- fontSize: '12px',
68
- }
69
- },
70
- ...styleOverrides,
71
- }
72
- }
16
+ export const getCommonSelectStyle = (styleOverrides = {}) => ({
17
+ menuList: (base) => ({
18
+ ...base,
19
+ paddingTop: 0,
20
+ paddingBottom: 0,
21
+ }),
22
+ control: (base, state) => ({
23
+ ...base,
24
+ minHeight: '32px',
25
+ boxShadow: 'none',
26
+ backgroundColor: 'var(--N50)',
27
+ border: state.isFocused ? '1px solid var(--B500)' : '1px solid var(--N200)',
28
+ cursor: 'pointer',
29
+ }),
30
+ option: (base, state) => ({
31
+ ...base,
32
+ color: 'var(--N900)',
33
+ backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
34
+ padding: '10px 12px',
35
+ }),
36
+ dropdownIndicator: (base, state) => ({
37
+ ...base,
38
+ color: 'var(--N400)',
39
+ padding: '0 8px',
40
+ transition: 'all .2s ease',
41
+ transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'rotate(0deg)',
42
+ }),
43
+ valueContainer: (base, state) => ({
44
+ ...base,
45
+ padding: '0 8px',
46
+ fontWeight: '400',
47
+ color: state.selectProps.menuIsOpen ? 'var(--N500)' : base.color,
48
+ }),
49
+ loadingMessage: (base) => ({
50
+ ...base,
51
+ color: 'var(--N600)',
52
+ }),
53
+ noOptionsMessage: (base) => ({
54
+ ...base,
55
+ color: 'var(--N600)',
56
+ }),
57
+ multiValue: (base, state) => ({
58
+ ...base,
59
+ border: `1px solid var(--N200)`,
60
+ borderRadius: `4px`,
61
+ background: 'white',
62
+ height: '28px',
63
+ marginRight: '8px',
64
+ padding: '2px',
65
+ fontSize: '12px',
66
+ }),
67
+ ...styleOverrides,
68
+ })
73
69
 
74
70
  /**
75
71
  * Returns the redirection props for a url
@@ -1,6 +1,6 @@
1
- import React, { ChangeEvent } from 'react'
2
- import Toggle from '../../Toggle/Toggle'
1
+ import { ChangeEvent } from 'react'
3
2
  import { WidgetProps } from '@rjsf/utils'
3
+ import Toggle from '../../Toggle/Toggle'
4
4
 
5
5
  export const Checkbox = ({
6
6
  id,
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import isEqual from 'lodash/isEqual'
3
2
  import { WidgetProps } from '@rjsf/utils'
4
3
  import ReactSelect, { MenuListProps, components } from 'react-select'