@devtron-labs/devtron-fe-common-lib 0.0.45-beta-23 → 0.0.45-beta-25
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/dist/Common/AddCDButton/AddCDButton.d.ts +3 -0
- package/dist/Common/AddCDButton/index.d.ts +2 -0
- package/dist/Common/AddCDButton/types.d.ts +26 -0
- package/dist/Common/AddCDButton/utils.d.ts +2 -0
- package/dist/Common/Dialogs/Types.d.ts +1 -0
- package/dist/Common/Helper.d.ts +16 -0
- package/dist/Common/Types.d.ts +47 -0
- package/dist/Common/index.d.ts +1 -1
- package/dist/index.js +188 -142
- package/package.json +1 -1
- package/src/Common/AddCDButton/AddCDButton.tsx +67 -0
- package/src/Common/AddCDButton/index.ts +2 -0
- package/src/Common/AddCDButton/types.ts +38 -0
- package/src/Common/AddCDButton/utils.tsx +35 -0
- package/src/Common/Dialogs/DeleteDialog.tsx +1 -1
- package/src/Common/Dialogs/Types.ts +1 -0
- package/src/Common/Helper.tsx +59 -0
- package/src/Common/Types.ts +57 -1
- package/src/Common/index.ts +1 -1
- package/dist/Common/CustomInput/CustomInput.d.ts +0 -3
- package/dist/Common/CustomInput/Types.d.ts +0 -30
- package/dist/Common/CustomInput/index.d.ts +0 -2
- package/src/Common/CustomInput/CustomInput.tsx +0 -128
- package/src/Common/CustomInput/Types.ts +0 -31
- package/src/Common/CustomInput/index.ts +0 -2
package/package.json
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Tippy from '@tippyjs/react'
|
|
3
|
+
import { AddCDButtonProps, TooltipContentProps } from './types'
|
|
4
|
+
import { AddCDPositions } from '../Types'
|
|
5
|
+
|
|
6
|
+
function TooltipContent({ tooltipContent }: TooltipContentProps) {
|
|
7
|
+
if (tooltipContent) {
|
|
8
|
+
return (
|
|
9
|
+
<div className="dc__white-space-pre-wrap">
|
|
10
|
+
<p className="m-0 cn-0 fs-12 fw-6 lh-18">Click to add</p>
|
|
11
|
+
|
|
12
|
+
{tooltipContent}
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return <div className="dc__white-space-pre-wrap">Click to add here</div>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function AddCDButton({
|
|
21
|
+
position,
|
|
22
|
+
addCDButtons,
|
|
23
|
+
endNode,
|
|
24
|
+
startNode,
|
|
25
|
+
handleAddCD,
|
|
26
|
+
tooltipContent,
|
|
27
|
+
}: Readonly<AddCDButtonProps>) {
|
|
28
|
+
const referenceNode = position === AddCDPositions.RIGHT ? endNode : startNode
|
|
29
|
+
const handleAddCDClick = () => {
|
|
30
|
+
handleAddCD(position)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (addCDButtons?.includes(position)) {
|
|
34
|
+
return (
|
|
35
|
+
<Tippy
|
|
36
|
+
placement="top"
|
|
37
|
+
content={<TooltipContent tooltipContent={tooltipContent} />}
|
|
38
|
+
className="default-tt"
|
|
39
|
+
arrow={false}
|
|
40
|
+
>
|
|
41
|
+
<svg
|
|
42
|
+
x={referenceNode.x + (position === AddCDPositions.RIGHT ? -20 - 5 : referenceNode.width + 5)}
|
|
43
|
+
// Here 10 is the height of the button / 2
|
|
44
|
+
y={referenceNode.y + referenceNode.height / 2 - 10}
|
|
45
|
+
width="20"
|
|
46
|
+
height="20"
|
|
47
|
+
viewBox="0 0 20 20"
|
|
48
|
+
fill="none"
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
data-testid={`add-cd-to-${position}`}
|
|
51
|
+
onClick={handleAddCDClick}
|
|
52
|
+
>
|
|
53
|
+
<rect width="20" height="20" rx="10" fill="#664BEE" className="add-cd-edge-btn" />
|
|
54
|
+
<path
|
|
55
|
+
d="M6.5 10H13.5M10 6.5V13.5"
|
|
56
|
+
stroke="white"
|
|
57
|
+
strokeWidth="1.5"
|
|
58
|
+
strokeLinecap="round"
|
|
59
|
+
strokeLinejoin="round"
|
|
60
|
+
/>
|
|
61
|
+
</svg>
|
|
62
|
+
</Tippy>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return null
|
|
67
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AddCDPositions, AddPipelineType, EdgeEndNodeType, EdgeNodeType, Point } from '../Types'
|
|
2
|
+
|
|
3
|
+
export interface AddCDButtonProps {
|
|
4
|
+
position: AddCDPositions
|
|
5
|
+
addCDButtons: AddCDPositions[]
|
|
6
|
+
endNode: Point & EdgeEndNodeType
|
|
7
|
+
startNode: Point & EdgeNodeType
|
|
8
|
+
handleAddCD: (position: AddCDPositions) => void
|
|
9
|
+
tooltipContent?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface HandleAddCD {
|
|
13
|
+
position: AddCDPositions
|
|
14
|
+
handleCDSelect: (
|
|
15
|
+
workflowId: number | string,
|
|
16
|
+
ciPipelineId: number | string,
|
|
17
|
+
parentPipelineType: string,
|
|
18
|
+
parentPipelineId: number | string,
|
|
19
|
+
isWebhookCD?: boolean,
|
|
20
|
+
childPipelineId?: number | string,
|
|
21
|
+
addType?: AddPipelineType,
|
|
22
|
+
) => void
|
|
23
|
+
startNode: EdgeNodeType
|
|
24
|
+
endNode: EdgeEndNodeType
|
|
25
|
+
workflowId: number | string
|
|
26
|
+
ciPipelineId: number | string
|
|
27
|
+
isWebhookCD: boolean
|
|
28
|
+
isParallelEdge: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetPipelineType {
|
|
32
|
+
isWebhookCD: boolean
|
|
33
|
+
startNode: EdgeNodeType
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TooltipContentProps {
|
|
37
|
+
tooltipContent?: string
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AddCDPositions, AddPipelineType, PipelineType, WorkflowNodeType } from '../Types'
|
|
2
|
+
import { HandleAddCD, GetPipelineType } from './types'
|
|
3
|
+
|
|
4
|
+
const getPipelineType = ({ isWebhookCD, startNode }: GetPipelineType) => {
|
|
5
|
+
if (isWebhookCD) {
|
|
6
|
+
return PipelineType.WEBHOOK
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (startNode.type === WorkflowNodeType.CI) {
|
|
10
|
+
return PipelineType.CI_PIPELINE
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return PipelineType.CD_PIPELINE
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const handleAddCD = ({
|
|
17
|
+
position,
|
|
18
|
+
handleCDSelect,
|
|
19
|
+
startNode,
|
|
20
|
+
endNode,
|
|
21
|
+
workflowId,
|
|
22
|
+
ciPipelineId,
|
|
23
|
+
isWebhookCD,
|
|
24
|
+
isParallelEdge,
|
|
25
|
+
}: HandleAddCD) => {
|
|
26
|
+
if (!handleCDSelect) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
const pipelineType = getPipelineType({ isWebhookCD, startNode })
|
|
30
|
+
const addPipelineType =
|
|
31
|
+
isParallelEdge && position === AddCDPositions.RIGHT ? AddPipelineType.PARALLEL : AddPipelineType.SEQUENTIAL
|
|
32
|
+
const endNodeId = !isParallelEdge && position === AddCDPositions.RIGHT ? endNode.id : null
|
|
33
|
+
|
|
34
|
+
handleCDSelect(workflowId, ciPipelineId, pipelineType, startNode.id, isWebhookCD, endNodeId, addPipelineType)
|
|
35
|
+
}
|
|
@@ -45,7 +45,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
|
|
|
45
45
|
type="button"
|
|
46
46
|
className="cta delete cta-cd-delete-modal ml-16"
|
|
47
47
|
onClick={handleDelete}
|
|
48
|
-
disabled={props.apiCallInProgress}
|
|
48
|
+
disabled={props.apiCallInProgress || props.disabled}
|
|
49
49
|
data-testid="dialog-delete"
|
|
50
50
|
>
|
|
51
51
|
{props.apiCallInProgress ? (
|
package/src/Common/Helper.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import moment from 'moment'
|
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
4
4
|
import { useLocation } from 'react-router-dom'
|
|
5
5
|
import { toast } from 'react-toastify'
|
|
6
|
+
import { ReactComponent as FormError } from '../Assets/Icon/ic-warning.svg'
|
|
6
7
|
import { ERROR_EMPTY_SCREEN, TOKEN_COOKIE_NAME } from './Constants'
|
|
7
8
|
import { ServerErrors } from './ServerError'
|
|
8
9
|
import { toastAccessDenied } from './ToastBody'
|
|
@@ -276,6 +277,64 @@ export function useForm(stateSchema, validationSchema = {}, callback) {
|
|
|
276
277
|
return { state, disable, handleOnChange, handleOnSubmit }
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
function handleError(error: any): any[] {
|
|
281
|
+
if (!error) {
|
|
282
|
+
return []
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (!Array.isArray(error)) {
|
|
286
|
+
return [error]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return error
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function CustomInput({
|
|
293
|
+
name,
|
|
294
|
+
value,
|
|
295
|
+
error,
|
|
296
|
+
onChange,
|
|
297
|
+
onBlur = (e) => {},
|
|
298
|
+
onFocus = (e) => {},
|
|
299
|
+
label,
|
|
300
|
+
type = 'text',
|
|
301
|
+
disabled = false,
|
|
302
|
+
autoComplete = 'off',
|
|
303
|
+
labelClassName = '',
|
|
304
|
+
placeholder = '',
|
|
305
|
+
tabIndex = 1,
|
|
306
|
+
dataTestid = '',
|
|
307
|
+
}) {
|
|
308
|
+
return (
|
|
309
|
+
<div className="flex column left top">
|
|
310
|
+
<label className={`form__label ${labelClassName}`}>{label}</label>
|
|
311
|
+
<input
|
|
312
|
+
data-testid={dataTestid}
|
|
313
|
+
type={type}
|
|
314
|
+
name={name}
|
|
315
|
+
autoComplete="off"
|
|
316
|
+
className="form__input"
|
|
317
|
+
onChange={(e) => {
|
|
318
|
+
e.persist()
|
|
319
|
+
onChange(e)
|
|
320
|
+
}}
|
|
321
|
+
onBlur={onBlur}
|
|
322
|
+
onFocus={onFocus}
|
|
323
|
+
placeholder={placeholder}
|
|
324
|
+
value={value}
|
|
325
|
+
disabled={disabled}
|
|
326
|
+
tabIndex={tabIndex}
|
|
327
|
+
/>
|
|
328
|
+
{handleError(error).map((err) => (
|
|
329
|
+
<div className="form__error" key={err}>
|
|
330
|
+
<FormError className="form__icon form__icon--error" />
|
|
331
|
+
{err}
|
|
332
|
+
</div>
|
|
333
|
+
))}
|
|
334
|
+
</div>
|
|
335
|
+
)
|
|
336
|
+
}
|
|
337
|
+
|
|
279
338
|
export function handleUTCTime(ts: string, isRelativeTime = false) {
|
|
280
339
|
let timestamp = ''
|
|
281
340
|
try {
|
package/src/Common/Types.ts
CHANGED
|
@@ -293,6 +293,11 @@ export interface CDMaterialServiceQueryParams {
|
|
|
293
293
|
filter?: CDMaterialFilterQuery
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
export interface DownstreamNodesEnvironmentsType {
|
|
297
|
+
environmentId: number
|
|
298
|
+
environmentName: string
|
|
299
|
+
}
|
|
300
|
+
|
|
296
301
|
export interface CommonNodeAttr {
|
|
297
302
|
connectingCiPipelineId?: number
|
|
298
303
|
parents: string | number[] | string[]
|
|
@@ -354,6 +359,9 @@ export interface CommonNodeAttr {
|
|
|
354
359
|
}
|
|
355
360
|
appReleaseTagNames?: string[]
|
|
356
361
|
tagsEditable?: boolean
|
|
362
|
+
deploymentAppCreated?: boolean
|
|
363
|
+
isLast?: boolean
|
|
364
|
+
downstreamEnvironments?: DownstreamNodesEnvironmentsType[]
|
|
357
365
|
}
|
|
358
366
|
|
|
359
367
|
export enum DeploymentAppTypes {
|
|
@@ -622,4 +630,52 @@ export interface CiPipeline {
|
|
|
622
630
|
}
|
|
623
631
|
isOffendingMandatoryPlugin?: boolean
|
|
624
632
|
pipelineType?: string
|
|
625
|
-
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export enum PipelineType {
|
|
636
|
+
CI_PIPELINE = 'CI_PIPELINE',
|
|
637
|
+
CD_PIPELINE = 'CD_PIPELINE',
|
|
638
|
+
WEBHOOK = 'WEBHOOK',
|
|
639
|
+
LINKED_CD = 'LINKED_CD',
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export enum WorkflowNodeType {
|
|
643
|
+
GIT = 'GIT',
|
|
644
|
+
CI = 'CI',
|
|
645
|
+
WEBHOOK = 'WEBHOOK',
|
|
646
|
+
PRE_CD = 'PRECD',
|
|
647
|
+
CD = 'CD',
|
|
648
|
+
POST_CD = 'POSTCD',
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export enum AddCDPositions {
|
|
652
|
+
LEFT = 'left',
|
|
653
|
+
RIGHT = 'right',
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export interface SelectedNode {
|
|
657
|
+
nodeType: WorkflowNodeType
|
|
658
|
+
id: string
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export enum AddPipelineType {
|
|
662
|
+
SEQUENTIAL = 'SEQUENTIAL',
|
|
663
|
+
PARALLEL = 'PARALLEL',
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export interface Point {
|
|
667
|
+
x: number
|
|
668
|
+
y: number
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface EdgeNodeType {
|
|
672
|
+
height: number
|
|
673
|
+
width: number
|
|
674
|
+
userApprovalConfig?: UserApprovalConfigType
|
|
675
|
+
type?: any
|
|
676
|
+
id?: number | string
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export interface EdgeEndNodeType extends EdgeNodeType {
|
|
680
|
+
userApprovalConfig?: UserApprovalConfigType
|
|
681
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CustomInputProps } from './Types';
|
|
3
|
-
export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, showLink, linkText, link, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown }: CustomInputProps): JSX.Element;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { HTMLInputTypeAttribute, LegacyRef } from "react";
|
|
2
|
-
export interface CustomInputProps {
|
|
3
|
-
name: string;
|
|
4
|
-
value: string | number;
|
|
5
|
-
onChange: (e: any) => void;
|
|
6
|
-
onFocus?: (e: any) => void;
|
|
7
|
-
autoComplete?: string;
|
|
8
|
-
label?: React.ReactNode;
|
|
9
|
-
labelClassName?: string;
|
|
10
|
-
type?: HTMLInputTypeAttribute;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
tabIndex?: number;
|
|
14
|
-
dataTestid?: string;
|
|
15
|
-
isRequiredField?: boolean;
|
|
16
|
-
autoFocus?: boolean;
|
|
17
|
-
rootClassName?: string;
|
|
18
|
-
showLink?: boolean;
|
|
19
|
-
link?: string;
|
|
20
|
-
linkText?: string;
|
|
21
|
-
error?: string[] | string;
|
|
22
|
-
helperText?: string;
|
|
23
|
-
handleOnBlur?: (e: any) => void;
|
|
24
|
-
readOnly?: boolean;
|
|
25
|
-
noTrim?: boolean;
|
|
26
|
-
ref?: LegacyRef<HTMLInputElement>;
|
|
27
|
-
onKeyPress?: (e: any) => void;
|
|
28
|
-
defaultValue?: string | number | ReadonlyArray<string> | undefined;
|
|
29
|
-
onKeyDown?: (e: any) => void;
|
|
30
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { CustomInputProps } from './Types'
|
|
2
|
-
import { ReactComponent as Info } from '../../Assets/Icon/ic-info-filled.svg'
|
|
3
|
-
import { ReactComponent as FormError } from '../../Assets/Icon/ic-warning.svg'
|
|
4
|
-
|
|
5
|
-
export function CustomInput({
|
|
6
|
-
name,
|
|
7
|
-
value,
|
|
8
|
-
error,
|
|
9
|
-
onChange,
|
|
10
|
-
onFocus = (e) => {},
|
|
11
|
-
label = '',
|
|
12
|
-
type = 'text',
|
|
13
|
-
disabled = false,
|
|
14
|
-
labelClassName = '',
|
|
15
|
-
placeholder = '',
|
|
16
|
-
tabIndex = 1,
|
|
17
|
-
dataTestid = '',
|
|
18
|
-
isRequiredField = false,
|
|
19
|
-
autoFocus = false,
|
|
20
|
-
rootClassName = '',
|
|
21
|
-
autoComplete = 'off',
|
|
22
|
-
showLink = false,
|
|
23
|
-
linkText = '',
|
|
24
|
-
link = '',
|
|
25
|
-
helperText = '',
|
|
26
|
-
handleOnBlur,
|
|
27
|
-
readOnly = false,
|
|
28
|
-
noTrim = false,
|
|
29
|
-
ref,
|
|
30
|
-
onKeyPress,
|
|
31
|
-
defaultValue,
|
|
32
|
-
onKeyDown
|
|
33
|
-
}: CustomInputProps) {
|
|
34
|
-
const renderLabelHelperText = () => {
|
|
35
|
-
return (
|
|
36
|
-
<span>
|
|
37
|
-
<a target="_blank" href={link} className="cursor fs-13 onlink ml-4">
|
|
38
|
-
{linkText}
|
|
39
|
-
</a>
|
|
40
|
-
</span>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function handleError(error: any): any[] {
|
|
45
|
-
if (!error) {
|
|
46
|
-
return []
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!Array.isArray(error)) {
|
|
50
|
-
return [error]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return error
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const onBlur = (event) => {
|
|
57
|
-
//NOTE: This is to prevent the input from being trimmed when the user do not want to trim the input
|
|
58
|
-
if (!noTrim) {
|
|
59
|
-
event.stopPropagation()
|
|
60
|
-
event.target.value = event.target.value?.trim()
|
|
61
|
-
onChange(event)
|
|
62
|
-
}
|
|
63
|
-
if (typeof handleOnBlur === 'function') {
|
|
64
|
-
handleOnBlur(event)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const renderFormError = () => {
|
|
69
|
-
if (error?.length > 0) {
|
|
70
|
-
if (typeof error === 'object') {
|
|
71
|
-
return handleError(error).map((err: string) => (
|
|
72
|
-
<div className="form__error" key={err}>
|
|
73
|
-
<FormError className="form__icon form__icon--error" />
|
|
74
|
-
{err}
|
|
75
|
-
</div>
|
|
76
|
-
))
|
|
77
|
-
}
|
|
78
|
-
return (
|
|
79
|
-
<div className="form__error">
|
|
80
|
-
<FormError className="form__icon form__icon--error" />
|
|
81
|
-
{error}
|
|
82
|
-
</div>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<div className="flex column left top">
|
|
89
|
-
{label && (
|
|
90
|
-
<label className={`form__label ${labelClassName}`} data-testid={`label-${dataTestid}`}>
|
|
91
|
-
<span className={`${isRequiredField ? 'dc__required-field' : ''}`}>{label}</span>
|
|
92
|
-
{showLink && renderLabelHelperText()}
|
|
93
|
-
</label>
|
|
94
|
-
)}
|
|
95
|
-
<input
|
|
96
|
-
data-testid={dataTestid}
|
|
97
|
-
type={type}
|
|
98
|
-
name={name}
|
|
99
|
-
autoComplete={autoComplete}
|
|
100
|
-
className={`form__input ${rootClassName}`}
|
|
101
|
-
onChange={(e) => {
|
|
102
|
-
e.persist()
|
|
103
|
-
onChange(e)
|
|
104
|
-
}}
|
|
105
|
-
onBlur={onBlur}
|
|
106
|
-
onFocus={onFocus}
|
|
107
|
-
placeholder={placeholder}
|
|
108
|
-
value={value}
|
|
109
|
-
disabled={disabled}
|
|
110
|
-
tabIndex={tabIndex}
|
|
111
|
-
autoFocus={autoFocus}
|
|
112
|
-
readOnly={readOnly}
|
|
113
|
-
ref={ref}
|
|
114
|
-
onKeyPress={onKeyPress}
|
|
115
|
-
defaultValue={defaultValue}
|
|
116
|
-
onKeyDown={onKeyDown}
|
|
117
|
-
/>
|
|
118
|
-
|
|
119
|
-
{renderFormError()}
|
|
120
|
-
{helperText && (
|
|
121
|
-
<div className="form__text-field-info">
|
|
122
|
-
<Info className="form__icon form__icon--info" />
|
|
123
|
-
<p className="sentence-case">{helperText}</p>
|
|
124
|
-
</div>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { HTMLInputTypeAttribute, LegacyRef } from "react"
|
|
2
|
-
|
|
3
|
-
export interface CustomInputProps {
|
|
4
|
-
name: string
|
|
5
|
-
value: string | number
|
|
6
|
-
onChange: (e: any) => void
|
|
7
|
-
onFocus?: (e: any) => void
|
|
8
|
-
autoComplete?: string
|
|
9
|
-
label?: React.ReactNode
|
|
10
|
-
labelClassName?: string
|
|
11
|
-
type?: HTMLInputTypeAttribute
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
placeholder?: string
|
|
14
|
-
tabIndex?: number
|
|
15
|
-
dataTestid?: string
|
|
16
|
-
isRequiredField?: boolean
|
|
17
|
-
autoFocus?: boolean
|
|
18
|
-
rootClassName?: string
|
|
19
|
-
showLink?: boolean
|
|
20
|
-
link?: string
|
|
21
|
-
linkText?: string
|
|
22
|
-
error?: string[] | string
|
|
23
|
-
helperText?: string;
|
|
24
|
-
handleOnBlur?: (e) => void
|
|
25
|
-
readOnly?: boolean
|
|
26
|
-
noTrim?: boolean
|
|
27
|
-
ref?: LegacyRef<HTMLInputElement>
|
|
28
|
-
onKeyPress?: (e) => void
|
|
29
|
-
defaultValue?: string | number | ReadonlyArray<string> | undefined;
|
|
30
|
-
onKeyDown?: (e) => void
|
|
31
|
-
}
|