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

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 (124) hide show
  1. package/.eslintignore +17 -0
  2. package/.husky/pre-commit +0 -0
  3. package/.lintstagedrc +1 -1
  4. package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
  5. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
  6. package/dist/Common/Constants.d.ts +1 -1
  7. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  8. package/dist/Common/CustomInput/Types.d.ts +1 -2
  9. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  10. package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
  11. package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
  12. package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
  13. package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
  14. package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
  15. package/dist/Common/Dialogs/Types.d.ts +1 -1
  16. package/dist/Common/EmptyState/EmptyState.d.ts +17 -20
  17. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  18. package/dist/Common/Error.d.ts +1 -2
  19. package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
  20. package/dist/Common/Helper.d.ts +1 -1
  21. package/dist/Common/ImageTags.d.ts +1 -1
  22. package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
  23. package/dist/Common/Modals/Modal.d.ts +2 -2
  24. package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
  25. package/dist/Common/Modals/VisibleModal.d.ts +3 -3
  26. package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
  27. package/dist/Common/MultiSelectCustomization.d.ts +1 -1
  28. package/dist/Common/Policy.Types.d.ts +2 -2
  29. package/dist/Common/PopupMenu.d.ts +5 -5
  30. package/dist/Common/Progressing.d.ts +2 -2
  31. package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
  32. package/dist/Common/ResizableTextarea.d.ts +1 -1
  33. package/dist/Common/TippyCustomized.d.ts +1 -1
  34. package/dist/Common/ToastBody.d.ts +5 -5
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +315 -239
  37. package/package.json +1 -1
  38. package/src/Common/AddCDButton/AddCDButton.tsx +2 -1
  39. package/src/Common/Api.ts +25 -20
  40. package/src/Common/AppStatus/AppStatus.tsx +12 -12
  41. package/src/Common/AppStatus/utils.ts +5 -6
  42. package/src/Common/BreadCrumb/BreadCrumb.tsx +28 -32
  43. package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
  44. package/src/Common/BreadCrumb/Types.ts +12 -11
  45. package/src/Common/ChartVersionAndTypeSelector.tsx +1 -1
  46. package/src/Common/Checkbox.tsx +19 -17
  47. package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
  48. package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +1 -0
  49. package/src/Common/Common.service.ts +65 -60
  50. package/src/Common/Constants.ts +9 -9
  51. package/src/Common/CustomInput/CustomInput.tsx +28 -22
  52. package/src/Common/CustomInput/Types.ts +3 -4
  53. package/src/Common/CustomInput/index.ts +1 -1
  54. package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +18 -15
  55. package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
  56. package/src/Common/CustomTagSelector/TagDetails.tsx +3 -9
  57. package/src/Common/CustomTagSelector/TagLabelSelect.tsx +9 -7
  58. package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +35 -31
  59. package/src/Common/CustomTagSelector/TagSelector.utils.ts +3 -2
  60. package/src/Common/CustomTagSelector/Types.ts +1 -1
  61. package/src/Common/CustomTagSelector/ValidationRules.ts +22 -18
  62. package/src/Common/CustomTagSelector/index.ts +2 -2
  63. package/src/Common/DebouncedSearch/DebouncedSearch.tsx +1 -2
  64. package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +1 -0
  65. package/src/Common/DeleteComponentModal/DeleteComponent.tsx +32 -27
  66. package/src/Common/DeleteComponentModal/types.ts +1 -1
  67. package/src/Common/DevtronProgressing/DevtronProgressing.tsx +8 -5
  68. package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
  69. package/src/Common/Dialogs/DeleteDialog.tsx +5 -3
  70. package/src/Common/Dialogs/DialogForm.tsx +35 -31
  71. package/src/Common/Dialogs/ForceDeleteDialog.tsx +7 -13
  72. package/src/Common/Dialogs/Types.ts +12 -12
  73. package/src/Common/Dialogs/index.ts +1 -1
  74. package/src/Common/Drawer/Drawer.tsx +1 -1
  75. package/src/Common/EmptyState/EmptyState.tsx +17 -13
  76. package/src/Common/EmptyState/GenericEmptyState.tsx +15 -25
  77. package/src/Common/Error.tsx +5 -5
  78. package/src/Common/ErrorScreenNotFound.tsx +12 -9
  79. package/src/Common/Grid/Grid.tsx +2 -1
  80. package/src/Common/Helper.tsx +37 -36
  81. package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
  82. package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
  83. package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +7 -5
  84. package/src/Common/ImageTags.Types.ts +3 -2
  85. package/src/Common/ImageTags.tsx +66 -61
  86. package/src/Common/InfoColorBar/InfoColourbar.tsx +5 -10
  87. package/src/Common/Modals/Modal.tsx +3 -3
  88. package/src/Common/Modals/OpaqueModal.tsx +18 -25
  89. package/src/Common/Modals/VisibleModal.tsx +3 -7
  90. package/src/Common/Modals/VisibleModal2.tsx +15 -20
  91. package/src/Common/MultiSelectCustomization.tsx +13 -9
  92. package/src/Common/Policy.Types.ts +38 -38
  93. package/src/Common/PopupMenu.tsx +9 -10
  94. package/src/Common/Progressing.tsx +18 -15
  95. package/src/Common/RJSF/Form.tsx +1 -0
  96. package/src/Common/RJSF/common/FieldRow.tsx +1 -0
  97. package/src/Common/RJSF/config.ts +1 -0
  98. package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
  99. package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +1 -0
  100. package/src/Common/RJSF/templates/BaseInput.tsx +1 -0
  101. package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +1 -0
  102. package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +1 -0
  103. package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +6 -1
  104. package/src/Common/RJSF/templates/Description.tsx +1 -0
  105. package/src/Common/RJSF/templates/Field.tsx +3 -14
  106. package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +9 -6
  107. package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +7 -5
  108. package/src/Common/RJSF/templates/TitleField.tsx +1 -0
  109. package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +1 -0
  110. package/src/Common/RJSF/utils.ts +57 -53
  111. package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
  112. package/src/Common/RJSF/widgets/Select.tsx +1 -0
  113. package/src/Common/RadioGroup/RadioGroup.tsx +23 -18
  114. package/src/Common/RadioGroup.tsx +23 -24
  115. package/src/Common/Reload.tsx +1 -0
  116. package/src/Common/ResizableTextarea.tsx +17 -18
  117. package/src/Common/Security/ScanVulnerabilitiesTable.tsx +34 -29
  118. package/src/Common/ServerError.ts +1 -5
  119. package/src/Common/TippyCustomized.tsx +38 -41
  120. package/src/Common/ToastBody.tsx +7 -6
  121. package/src/Common/Toggle/Toggle.tsx +3 -3
  122. package/src/Common/Types.ts +19 -19
  123. package/src/custom.d.ts +7 -7
  124. package/src/index.ts +1 -1
@@ -1,7 +1,7 @@
1
- import { Component } from 'react'
1
+ import React from 'react'
2
2
  import ReactDOM from 'react-dom'
3
3
 
4
- export class VisibleModal extends Component<{
4
+ export class VisibleModal extends React.Component<{
5
5
  className: string
6
6
  parentClassName?: string
7
7
  noBackground?: boolean
@@ -46,11 +46,7 @@ export class VisibleModal extends Component<{
46
46
 
47
47
  render() {
48
48
  return ReactDOM.createPortal(
49
- <div
50
- className={`visible-modal__body ${this.props.className}`}
51
- onClick={this.props?.close}
52
- data-testid="visible-modal-close"
53
- >
49
+ <div className={`visible-modal__body ${this.props.className}`} onClick={this.props?.close} data-testid="visible-modal-close">
54
50
  {this.props.children}
55
51
  </div>,
56
52
  document.getElementById('visible-modal'),
@@ -1,40 +1,35 @@
1
- import { Component } from 'react'
2
- import ReactDOM from 'react-dom'
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
3
 
4
- export class VisibleModal2 extends Component<{ className: string; close?: (e) => void }> {
5
- modalRef = document.getElementById('visible-modal-2')
4
+ export class VisibleModal2 extends React.Component<{ className: string; close?: (e) => void; }> {
5
+
6
+ modalRef = document.getElementById('visible-modal-2');
6
7
 
7
8
  constructor(props) {
8
- super(props)
9
- this.escFunction = this.escFunction.bind(this)
9
+ super(props);
10
+ this.escFunction = this.escFunction.bind(this);
10
11
  }
11
12
 
12
13
  escFunction(event) {
13
14
  if (event.keyCode === 27 && this.props.close) {
14
- this.props.close(event)
15
+ this.props.close(event);
15
16
  }
16
17
  }
17
18
 
18
19
  componentDidMount() {
19
- document.addEventListener('keydown', this.escFunction)
20
- this.modalRef.classList.add('show-with-bg')
20
+ document.addEventListener("keydown", this.escFunction);
21
+ this.modalRef.classList.add("show-with-bg");
21
22
  }
22
23
 
23
24
  componentWillUnmount() {
24
- document.removeEventListener('keydown', this.escFunction)
25
- this.modalRef.classList.remove('show-with-bg')
25
+ document.removeEventListener("keydown", this.escFunction);
26
+ this.modalRef.classList.remove("show-with-bg");
26
27
  }
27
28
 
28
29
  render() {
29
30
  return ReactDOM.createPortal(
30
- <div
31
- className={`visible-modal__body ${this.props.className}`}
32
- onClick={this.props?.close}
33
- data-testid="visible-modal2-close"
34
- >
31
+ <div className={`visible-modal__body ${this.props.className}`} onClick={this.props?.close} data-testid="visible-modal2-close">
35
32
  {this.props.children}
36
- </div>,
37
- document.getElementById('visible-modal-2'),
38
- )
33
+ </div>, document.getElementById('visible-modal-2'))
39
34
  }
40
- }
35
+ }
@@ -1,4 +1,4 @@
1
- import * as React from 'react'
1
+ import 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,12 +106,14 @@ export const multiSelectStyles = {
106
106
  menu: (base, state) => ({
107
107
  ...base,
108
108
  }),
109
- option: (base, state) => ({
110
- ...base,
111
- backgroundColor: state.isFocused ? 'var(--N100)' : 'white',
112
- color: 'var(--N900)',
113
- padding: '8px 12px',
114
- }),
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
+ },
115
117
  container: (base, state) => ({
116
118
  ...base,
117
119
  cursor: state.isDisabled ? 'not-allowed' : 'pointer',
@@ -141,4 +143,6 @@ export interface CustomSelect {
141
143
  formatOptionLabel?: (...args) => any
142
144
  }
143
145
 
144
- export const CustomSelect: React.FC<CustomSelect> = (props) => <Select {...props} />
146
+ export const CustomSelect: React.FC<CustomSelect> = (props) => {
147
+ return <Select {...props} />
148
+ }
@@ -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,5 +1,4 @@
1
- import { useEffect } from 'react'
2
- import * as React from 'react'
1
+ import React, { useEffect } from 'react'
3
2
  import { Modal } from './Modals/Modal'
4
3
  import { PopupMenuBodyType, PopupMenuButtonType, PopupMenuType } from './Types'
5
4
 
@@ -13,12 +12,12 @@ function usePopupContext() {
13
12
  return context
14
13
  }
15
14
 
16
- const PopupMenu = ({
15
+ function PopupMenu({
17
16
  children = null,
18
17
  onToggleCallback = null,
19
18
  autoClose = false,
20
19
  autoPosition = false,
21
- }: PopupMenuType) => {
20
+ }: PopupMenuType) {
22
21
  const [popupPosition, setPopupPosition] = React.useState(null)
23
22
  const [opacity, setOpacity] = React.useState(0)
24
23
  const observer = React.useRef<IntersectionObserver | null>(null)
@@ -136,15 +135,15 @@ const PopupMenu = ({
136
135
  )
137
136
  }
138
137
 
139
- const Button = ({
138
+ function Button({
140
139
  children = null,
141
140
  disabled = false,
142
141
  rootClassName = '',
143
142
  tabIndex = 0,
144
143
  onHover = false,
145
144
  isKebab = false,
146
- dataTestId = '',
147
- }: PopupMenuButtonType) => {
145
+ dataTestId = "",
146
+ }: PopupMenuButtonType) {
148
147
  const { handleOpen, popupPosition, buttonRef, initialiseButtonWidth } = usePopupContext()
149
148
  return (
150
149
  <button
@@ -164,14 +163,14 @@ const Button = ({
164
163
  )
165
164
  }
166
165
 
167
- const Body = ({
166
+ function Body({
168
167
  children = null,
169
168
  rootClassName = '',
170
169
  style = {},
171
170
  autoWidth = false,
172
171
  preventWheelDisable = false,
173
172
  noBackDrop,
174
- }: PopupMenuBodyType) => {
173
+ }: PopupMenuBodyType) {
175
174
  const { handleClose, popupPosition, opacity, callbackRef, buttonWidth } = usePopupContext()
176
175
  return popupPosition ? (
177
176
  <Modal
@@ -184,7 +183,7 @@ const Body = ({
184
183
  ...popupPosition,
185
184
  ...style,
186
185
  ...(autoWidth ? { width: buttonWidth.current } : {}),
187
- opacity,
186
+ opacity: opacity,
188
187
  }}
189
188
  preventWheelDisable={preventWheelDisable}
190
189
  noBackDrop={noBackDrop}
@@ -1,6 +1,7 @@
1
+ import React from 'react'
1
2
  import { ProgressingProps } from './Types'
2
3
 
3
- export const Progressing = ({ pageLoader, size, theme, styles, fillColor }: ProgressingProps): JSX.Element => {
4
+ export function Progressing({ pageLoader, size, theme, styles, fillColor }: ProgressingProps): JSX.Element {
4
5
  const loaderSize = size ? `${size}px` : pageLoader ? '48px' : '20px'
5
6
  return (
6
7
  <div className={`loader ${theme || 'default'}-background`} style={styles} data-testid="progressing">
@@ -28,23 +29,25 @@ export const Progressing = ({ pageLoader, size, theme, styles, fillColor }: Prog
28
29
  )
29
30
  }
30
31
 
31
- export const DetailsProgressing = ({
32
+ export function DetailsProgressing({
32
33
  loadingText,
33
34
  size = 24,
34
35
  fullHeight = false,
35
36
  styles,
36
37
  fillColor,
37
38
  children,
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
- )
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
+ }
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import RJSF from '@rjsf/core'
2
3
  import RJSFValidator from '@rjsf/validator-ajv8'
3
4
 
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { FieldRowProps } from './types'
2
3
  import { DEFAULT_FIELD_TITLE, DO_NOT_SHOW_LABEL } from '../constants'
3
4
 
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { RegistryWidgetsType } from '@rjsf/utils'
2
3
 
3
4
  import {
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react'
1
+ import React, { CSSProperties } from 'react'
2
2
  import { ArrayFieldTemplateItemType } from '@rjsf/utils'
3
3
 
4
4
  export const ArrayFieldItemTemplate = ({
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { getTemplate, getUiOptions, ArrayFieldTemplateProps, ArrayFieldTemplateItemType } from '@rjsf/utils'
2
3
  import { FieldRowWithLabel } from '../common/FieldRow'
3
4
  import { DO_NOT_SHOW_LABEL } from '../constants'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { getDefaultRegistry } from '@rjsf/core'
2
3
  import { BaseInputTemplateProps } from '@rjsf/utils'
3
4
  import { PLACEHOLDERS } from '../constants'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { IconButtonProps } from '@rjsf/utils'
2
3
 
3
4
  import { ReactComponent as PlusIcon } from '../../../../Assets/Icon/ic-add.svg'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { IconButtonProps } from '@rjsf/utils'
2
3
 
3
4
  import { ReactComponent as CrossIcon } from '../../../../Assets/Icon/ic-cross.svg'
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { getSubmitButtonOptions, SubmitButtonProps } from '@rjsf/utils'
2
3
 
3
4
  export const SubmitButton = ({ uiSchema }: SubmitButtonProps) => {
@@ -5,7 +6,11 @@ export const SubmitButton = ({ uiSchema }: SubmitButtonProps) => {
5
6
 
6
7
  return norender ? null : (
7
8
  <div className="flexbox flex-justify-end">
8
- <button type="submit" {...submitButtonProps} className={`cta ${submitButtonProps.className || ''}`}>
9
+ <button
10
+ type="submit"
11
+ {...submitButtonProps}
12
+ className={`cta ${submitButtonProps.className || ''}`}
13
+ >
9
14
  {submitText}
10
15
  </button>
11
16
  </div>
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { DescriptionFieldProps } from '@rjsf/utils'
2
3
 
3
4
  import { ReactComponent as Info } from '../../../Assets/Icon/ic-info-filled.svg'
@@ -1,21 +1,10 @@
1
+ import React from 'react'
1
2
  import { FieldTemplateProps, getUiOptions, getTemplate, ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils'
2
3
  import { FieldRowWithLabel } from '../common/FieldRow'
3
4
 
4
5
  export const Field = (props: FieldTemplateProps) => {
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
6
+ const { id, label, children, errors, hidden, required, displayLabel, registry, uiSchema, classNames, schema, description } =
7
+ props
19
8
  const uiOptions = getUiOptions(uiSchema)
20
9
  const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate'>(
21
10
  'WrapIfAdditionalTemplate',
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { errorId, FieldErrorProps } from '@rjsf/utils'
2
3
 
3
4
  import { ReactComponent as Error } from '../../../Assets/Icon/ic-warning.svg'
@@ -10,12 +11,14 @@ export const FieldErrorTemplate = ({ errors = [], idSchema }: FieldErrorProps) =
10
11
  <span id={id}>
11
12
  {errors
12
13
  .filter((elem) => !!elem)
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
- ))}
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
+ })}
19
22
  </span>
20
23
  )
21
24
  )
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import {
2
3
  ObjectFieldTemplatePropertyType,
3
4
  ObjectFieldTemplateProps,
@@ -54,12 +55,13 @@ const Field = ({
54
55
  {ActionButton}
55
56
  </>
56
57
  )
58
+ } else {
59
+ return (
60
+ <FieldRowWithLabel label={title} required={required} showLabel id={idSchema.$id}>
61
+ {ActionButton}
62
+ </FieldRowWithLabel>
63
+ )
57
64
  }
58
- return (
59
- <FieldRowWithLabel label={title} required={required} showLabel id={idSchema.$id}>
60
- {ActionButton}
61
- </FieldRowWithLabel>
62
- )
63
65
  }
64
66
  return (
65
67
  <>
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { TitleFieldProps } from '@rjsf/utils'
2
3
 
3
4
  export const TitleField = ({ id, title, required }: TitleFieldProps) => (
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { ADDITIONAL_PROPERTY_FLAG, WrapIfAdditionalTemplateProps } from '@rjsf/utils'
2
3
 
3
4
  import { PLACEHOLDERS } from '../constants'
@@ -13,59 +13,63 @@ export const translateString = (stringToTranslate: TranslatableString, params?:
13
13
  }
14
14
  }
15
15
 
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
- })
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
+ }
69
73
 
70
74
  /**
71
75
  * Returns the redirection props for a url
@@ -1,6 +1,6 @@
1
- import { ChangeEvent } from 'react'
2
- import { WidgetProps } from '@rjsf/utils'
1
+ import React, { ChangeEvent } from 'react'
3
2
  import Toggle from '../../Toggle/Toggle'
3
+ import { WidgetProps } from '@rjsf/utils'
4
4
 
5
5
  export const Checkbox = ({
6
6
  id,
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import isEqual from 'lodash/isEqual'
2
3
  import { WidgetProps } from '@rjsf/utils'
3
4
  import ReactSelect, { MenuListProps, components } from 'react-select'