@devtron-labs/devtron-fe-common-lib 0.0.52-beta-3 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +16 -84
- package/.github/workflows/release-package.yml +3 -2
- package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +2 -2
- package/dist/Common/Constants.d.ts +1 -1
- package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
- package/dist/Common/CustomInput/Types.d.ts +1 -2
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +1 -1
- package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +1 -1
- package/dist/Common/Dialogs/ConfirmationDialog.d.ts +6 -6
- package/dist/Common/Dialogs/DeleteDialog.d.ts +1 -1
- package/dist/Common/Dialogs/ForceDeleteDialog.d.ts +1 -1
- package/dist/Common/Dialogs/Types.d.ts +1 -1
- package/dist/Common/EmptyState/EmptyState.d.ts +17 -20
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
- package/dist/Common/Error.d.ts +1 -2
- package/dist/Common/ErrorScreenNotFound.d.ts +1 -1
- package/dist/Common/Helper.d.ts +1 -1
- package/dist/Common/ImageTags.d.ts +1 -1
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +1 -1
- package/dist/Common/Modals/Modal.d.ts +2 -2
- package/dist/Common/Modals/OpaqueModal.d.ts +3 -3
- package/dist/Common/Modals/VisibleModal.d.ts +3 -3
- package/dist/Common/Modals/VisibleModal2.d.ts +3 -3
- package/dist/Common/MultiSelectCustomization.d.ts +1 -1
- package/dist/Common/Policy.Types.d.ts +2 -2
- package/dist/Common/PopupMenu.d.ts +5 -5
- package/dist/Common/Progressing.d.ts +2 -2
- package/dist/Common/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/Common/ResizableTextarea.d.ts +1 -1
- package/dist/Common/TippyCustomized.d.ts +1 -1
- package/dist/Common/ToastBody.d.ts +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +354 -283
- package/package.json +2 -19
- package/src/Common/AddCDButton/AddCDButton.tsx +2 -1
- package/src/Common/Api.ts +25 -20
- package/src/Common/AppStatus/AppStatus.tsx +12 -12
- package/src/Common/AppStatus/utils.ts +5 -6
- package/src/Common/BreadCrumb/BreadCrumb.tsx +28 -32
- package/src/Common/BreadCrumb/BreadcrumbStore.tsx +2 -2
- package/src/Common/BreadCrumb/Types.ts +12 -11
- package/src/Common/ChartVersionAndTypeSelector.tsx +1 -1
- package/src/Common/Checkbox.tsx +19 -17
- package/src/Common/ClipboardButton/ClipboardButton.tsx +1 -1
- package/src/Common/ClipboardButton/__tests__/ClipboardButton.test.tsx +1 -0
- package/src/Common/Common.service.ts +65 -60
- package/src/Common/Constants.ts +9 -9
- package/src/Common/CustomInput/CustomInput.tsx +28 -22
- package/src/Common/CustomInput/Types.ts +3 -4
- package/src/Common/CustomInput/index.ts +1 -1
- package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +18 -15
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +9 -9
- package/src/Common/CustomTagSelector/TagDetails.tsx +3 -9
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +9 -7
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +35 -31
- package/src/Common/CustomTagSelector/TagSelector.utils.ts +3 -2
- package/src/Common/CustomTagSelector/Types.ts +1 -1
- package/src/Common/CustomTagSelector/ValidationRules.ts +22 -18
- package/src/Common/CustomTagSelector/index.ts +2 -2
- package/src/Common/DebouncedSearch/DebouncedSearch.tsx +1 -2
- package/src/Common/DebouncedSearch/__tests__/DebouncedSearch.test.tsx +1 -0
- package/src/Common/DeleteComponentModal/DeleteComponent.tsx +32 -27
- package/src/Common/DeleteComponentModal/types.ts +1 -1
- package/src/Common/DevtronProgressing/DevtronProgressing.tsx +8 -5
- package/src/Common/Dialogs/ConfirmationDialog.tsx +24 -24
- package/src/Common/Dialogs/DeleteDialog.tsx +5 -3
- package/src/Common/Dialogs/DialogForm.tsx +35 -31
- package/src/Common/Dialogs/ForceDeleteDialog.tsx +7 -13
- package/src/Common/Dialogs/Types.ts +12 -12
- package/src/Common/Dialogs/index.ts +1 -1
- package/src/Common/Drawer/Drawer.tsx +1 -1
- package/src/Common/EmptyState/EmptyState.tsx +17 -13
- package/src/Common/EmptyState/GenericEmptyState.tsx +15 -25
- package/src/Common/Error.tsx +5 -5
- package/src/Common/ErrorScreenNotFound.tsx +12 -9
- package/src/Common/Grid/Grid.tsx +2 -1
- package/src/Common/Helper.tsx +37 -36
- package/src/Common/Hooks/UseClickOutside/UseClickOutside.tsx +1 -1
- package/src/Common/Hooks/UseSuperAdmin/UseSuperAdmin.tsx +1 -1
- package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +7 -5
- package/src/Common/ImageTags.Types.ts +3 -2
- package/src/Common/ImageTags.tsx +66 -61
- package/src/Common/InfoColorBar/InfoColourbar.tsx +5 -10
- package/src/Common/Modals/Modal.tsx +3 -3
- package/src/Common/Modals/OpaqueModal.tsx +18 -25
- package/src/Common/Modals/VisibleModal.tsx +3 -7
- package/src/Common/Modals/VisibleModal2.tsx +15 -20
- package/src/Common/MultiSelectCustomization.tsx +13 -9
- package/src/Common/Policy.Types.ts +38 -38
- package/src/Common/PopupMenu.tsx +9 -10
- package/src/Common/Progressing.tsx +18 -15
- package/src/Common/RJSF/Form.tsx +1 -0
- package/src/Common/RJSF/common/FieldRow.tsx +1 -0
- package/src/Common/RJSF/config.ts +1 -0
- package/src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx +1 -1
- package/src/Common/RJSF/templates/ArrayFieldTemplate.tsx +1 -0
- package/src/Common/RJSF/templates/BaseInput.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/AddButton.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/RemoveButton.tsx +1 -0
- package/src/Common/RJSF/templates/ButtonTemplates/SubmitButton.tsx +6 -1
- package/src/Common/RJSF/templates/Description.tsx +1 -0
- package/src/Common/RJSF/templates/Field.tsx +3 -14
- package/src/Common/RJSF/templates/FieldErrorTemplate.tsx +9 -6
- package/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +7 -5
- package/src/Common/RJSF/templates/TitleField.tsx +1 -0
- package/src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx +1 -0
- package/src/Common/RJSF/utils.ts +57 -53
- package/src/Common/RJSF/widgets/Checkbox.tsx +2 -2
- package/src/Common/RJSF/widgets/Select.tsx +1 -0
- package/src/Common/RadioGroup/RadioGroup.tsx +23 -18
- package/src/Common/RadioGroup.tsx +23 -24
- package/src/Common/Reload.tsx +1 -0
- package/src/Common/ResizableTextarea.tsx +17 -18
- package/src/Common/Security/ScanVulnerabilitiesTable.tsx +34 -29
- package/src/Common/ServerError.ts +1 -5
- package/src/Common/TippyCustomized.tsx +38 -41
- package/src/Common/ToastBody.tsx +7 -6
- package/src/Common/Toggle/Toggle.tsx +3 -3
- package/src/Common/Types.ts +19 -19
- package/src/custom.d.ts +7 -7
- package/src/index.ts +1 -1
- package/.eslintignore +0 -79
- package/.github/pull_request_template.md +0 -25
- package/.github/workflows/ci.yml +0 -31
- package/.husky/pre-commit +0 -5
- package/.lintstagedrc +0 -3
- package/.nvmrc +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
-
|
|
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(
|
|
20
|
-
this.modalRef.classList.add(
|
|
20
|
+
document.addEventListener("keydown", this.escFunction);
|
|
21
|
+
this.modalRef.classList.add("show-with-bg");
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
componentWillUnmount() {
|
|
24
|
-
document.removeEventListener(
|
|
25
|
-
this.modalRef.classList.remove(
|
|
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
|
|
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=
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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) =>
|
|
146
|
+
export const CustomSelect: React.FC<CustomSelect> = (props) => {
|
|
147
|
+
return <Select {...props} />
|
|
148
|
+
}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { VariableType } from
|
|
2
|
-
import { ResponseType } from
|
|
1
|
+
import { VariableType } from "./CIPipeline.Types"
|
|
2
|
+
import { ResponseType } from "./Types"
|
|
3
3
|
|
|
4
4
|
export enum ApplyPolicyToStage {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
pluginData: MandatoryPluginDetailType[]
|
|
40
|
+
isValidPre: boolean
|
|
41
|
+
isValidPost: boolean
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export enum ConsequenceAction {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
52
|
-
|
|
51
|
+
action: ConsequenceAction
|
|
52
|
+
metadataField: string
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export interface BlockedStateData {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
}
|
package/src/Common/PopupMenu.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
}
|
package/src/Common/RJSF/Form.tsx
CHANGED
|
@@ -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
|
|
9
|
+
<button
|
|
10
|
+
type="submit"
|
|
11
|
+
{...submitButtonProps}
|
|
12
|
+
className={`cta ${submitButtonProps.className || ''}`}
|
|
13
|
+
>
|
|
9
14
|
{submitText}
|
|
10
15
|
</button>
|
|
11
16
|
</div>
|
|
@@ -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
|
-
|
|
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
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
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
|
<>
|
package/src/Common/RJSF/utils.ts
CHANGED
|
@@ -13,59 +13,63 @@ export const translateString = (stringToTranslate: TranslatableString, params?:
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const getCommonSelectStyle = (styleOverrides = {}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|