@devtron-labs/devtron-fe-common-lib 0.0.7 → 0.0.9-beta-2
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/BreadCrumb/BreadCrumb.d.ts +1 -29
- package/dist/Common/BreadCrumb/Types.d.ts +28 -0
- package/dist/Common/CIPipeline.Types.d.ts +264 -0
- package/dist/Common/Checkbox.d.ts +1 -14
- package/dist/Common/Constants.d.ts +18 -0
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +11 -3
- package/dist/Common/CustomTagSelector/ValidationRules.d.ts +1 -1
- package/dist/Common/DeleteComponentModal/DeleteComponent.d.ts +4 -0
- package/dist/Common/DeleteComponentModal/types.d.ts +15 -0
- package/dist/Common/Dialogs/ConfirmationDialog.d.ts +5 -16
- package/dist/Common/Dialogs/DialogForm.d.ts +1 -9
- package/dist/Common/Dialogs/Types.d.ts +28 -0
- package/dist/Common/EmptyState/EmptyState.d.ts +2 -1
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +5 -0
- package/dist/Common/Error.d.ts +2 -2
- package/dist/Common/Helper.d.ts +31 -1
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +2 -15
- package/dist/Common/Modals/Modal.d.ts +2 -9
- package/dist/Common/MultiSelectCustomization.d.ts +1 -2
- package/dist/Common/PopupMenu.d.ts +4 -21
- package/dist/Common/Progressing.d.ts +4 -13
- package/dist/Common/RadioGroup/RadioGroup.d.ts +17 -0
- package/dist/Common/RadioGroup.d.ts +1 -10
- package/dist/Common/Reload.d.ts +2 -4
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +4 -0
- package/dist/Common/TippyCustomized.d.ts +2 -30
- package/dist/Common/Toggle/Toggle.d.ts +12 -0
- package/dist/Common/Types.d.ts +293 -0
- package/dist/Common/index.d.ts +7 -1
- package/dist/index.js +2472 -1948
- package/package.json +2 -2
- package/rollup.config.js +3 -3
- package/src/Assets/Icon/ic-help.svg +3 -0
- package/src/Assets/Icon/ic-info-filled.svg +7 -0
- package/src/Assets/Icon/ic-warning.svg +7 -0
- package/src/Assets/Img/app-not-deployed.png +0 -0
- package/src/Common/Api.ts +7 -1
- package/src/Common/BreadCrumb/BreadCrumb.tsx +1 -30
- package/src/Common/BreadCrumb/Types.ts +30 -0
- package/src/Common/CIPipeline.Types.ts +276 -0
- package/src/Common/Checkbox.tsx +3 -16
- package/src/Common/Constants.ts +21 -0
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +6 -4
- package/src/Common/CustomTagSelector/TagDetails.tsx +15 -2
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +7 -3
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +66 -26
- package/src/Common/CustomTagSelector/Types.ts +11 -3
- package/src/Common/CustomTagSelector/ValidationRules.ts +21 -18
- package/src/Common/DeleteComponentModal/DeleteComponent.tsx +95 -0
- package/src/Common/DeleteComponentModal/types.ts +15 -0
- package/src/Common/Dialogs/ConfirmationDialog.tsx +6 -4
- package/src/Common/Dialogs/DeleteDialog.tsx +45 -27
- package/src/Common/Dialogs/DialogForm.tsx +2 -11
- package/src/Common/Dialogs/Types.ts +29 -0
- package/src/Common/Drawer/Drawer.scss +12 -11
- package/src/Common/EmptyState/EmptyState.tsx +5 -5
- package/src/Common/EmptyState/GenericEmptyState.tsx +41 -0
- package/src/Common/EmptyState/emptyState.scss +4 -15
- package/src/Common/Error.tsx +13 -16
- package/src/Common/ErrorScreenNotFound.tsx +23 -30
- package/src/Common/Helper.tsx +258 -2
- package/src/Common/InfoColorBar/InfoColourbar.tsx +6 -18
- package/src/Common/Modals/Modal.tsx +7 -1
- package/src/Common/Modals/OpaqueModal.tsx +2 -2
- package/src/Common/Modals/VisibleModal.tsx +1 -1
- package/src/Common/Modals/VisibleModal2.tsx +1 -1
- package/src/Common/MultiSelectCustomization.tsx +3 -3
- package/src/Common/PopupMenu.tsx +23 -6
- package/src/Common/Progressing.tsx +8 -15
- package/src/Common/RadioGroup/RadioGroup.tsx +88 -0
- package/src/Common/RadioGroup/radioGroup.scss +46 -0
- package/src/Common/RadioGroup.tsx +3 -13
- package/src/Common/Reload.tsx +15 -10
- package/src/Common/Security/ScanVulnerabilitiesTable.tsx +55 -0
- package/src/Common/Security/scanVulnerabilities.css +67 -0
- package/src/Common/TippyCustomized.tsx +29 -31
- package/src/Common/Toggle/Toggle.scss +70 -0
- package/src/Common/Toggle/Toggle.tsx +38 -0
- package/src/Common/Types.ts +319 -0
- package/src/Common/index.ts +7 -1
- package/dist/27bfa7a87d0b7039.png +0 -0
- package/dist/b5d52f036bdcd3ed.png +0 -0
- package/src/Assets/Icon/ic-close.svg +0 -9
- /package/src/Assets/Img/{warning-medium.svg → delete-medium.svg} +0 -0
package/src/Common/Types.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react'
|
|
2
|
+
import { Placement } from 'tippy.js'
|
|
3
|
+
import { VariableType } from './CIPipeline.Types'
|
|
1
4
|
export interface ResponseType {
|
|
2
5
|
code: number
|
|
3
6
|
status: string
|
|
@@ -29,3 +32,319 @@ export interface Teams {
|
|
|
29
32
|
name: string
|
|
30
33
|
active: boolean
|
|
31
34
|
}
|
|
35
|
+
|
|
36
|
+
export enum CHECKBOX_VALUE {
|
|
37
|
+
CHECKED = 'CHECKED',
|
|
38
|
+
INTERMEDIATE = 'INTERMEDIATE',
|
|
39
|
+
}
|
|
40
|
+
export interface CheckboxProps {
|
|
41
|
+
onChange: (event) => void
|
|
42
|
+
isChecked: boolean
|
|
43
|
+
value: 'CHECKED' | 'INTERMEDIATE'
|
|
44
|
+
disabled?: boolean
|
|
45
|
+
tabIndex?: number
|
|
46
|
+
rootClassName?: string
|
|
47
|
+
onClick?: (event) => void
|
|
48
|
+
id?: string
|
|
49
|
+
dataTestId?: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface TippyCustomizedProps {
|
|
53
|
+
theme: TippyTheme
|
|
54
|
+
visible?: boolean
|
|
55
|
+
heading?: ReactNode | string
|
|
56
|
+
headingInfo?: string
|
|
57
|
+
infoTextHeading?: string
|
|
58
|
+
placement: Placement
|
|
59
|
+
className?: string
|
|
60
|
+
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
|
|
61
|
+
iconPath?: string
|
|
62
|
+
iconClass?: string
|
|
63
|
+
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
|
|
64
|
+
onImageLoadError?: (e) => void
|
|
65
|
+
onClose?: () => void
|
|
66
|
+
infoText?: string
|
|
67
|
+
showCloseButton?: boolean
|
|
68
|
+
arrow?: boolean
|
|
69
|
+
interactive?: boolean
|
|
70
|
+
showOnCreate?: boolean
|
|
71
|
+
trigger?: string
|
|
72
|
+
animation?: string
|
|
73
|
+
duration?: number
|
|
74
|
+
additionalContent?: ReactNode
|
|
75
|
+
documentationLink?: string
|
|
76
|
+
documentationLinkText?: string
|
|
77
|
+
children: React.ReactElement<any>
|
|
78
|
+
}
|
|
79
|
+
export interface GenericEmptyStateType {
|
|
80
|
+
title: ReactNode
|
|
81
|
+
image?
|
|
82
|
+
classname?: string
|
|
83
|
+
subTitle?: ReactNode
|
|
84
|
+
isButtonAvailable?: boolean
|
|
85
|
+
styles?: CSSProperties
|
|
86
|
+
heightToDeduct?: number
|
|
87
|
+
imageType?: string
|
|
88
|
+
renderButton?: () => JSX.Element
|
|
89
|
+
imageClassName?: string
|
|
90
|
+
children?: ReactNode
|
|
91
|
+
noImage?: boolean
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export enum ImageType {
|
|
95
|
+
Large = 'large',
|
|
96
|
+
Medium = 'medium',
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface InfoColourBarType {
|
|
100
|
+
message: React.ReactNode
|
|
101
|
+
classname: string
|
|
102
|
+
Icon
|
|
103
|
+
iconClass?: string
|
|
104
|
+
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
|
|
105
|
+
renderActionButton?: () => JSX.Element
|
|
106
|
+
linkText?: React.ReactNode
|
|
107
|
+
redirectLink?: string
|
|
108
|
+
linkOnClick?: () => void
|
|
109
|
+
linkClass?: string
|
|
110
|
+
internalLink?: boolean
|
|
111
|
+
styles?: CSSProperties
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface ReloadType {
|
|
115
|
+
reload?: (event?: any) => void
|
|
116
|
+
className?: string
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface RadioGroupItemProps {
|
|
120
|
+
value: string
|
|
121
|
+
dataTestId?: string
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface RadioGroupProps {
|
|
125
|
+
value: string
|
|
126
|
+
name: string
|
|
127
|
+
disabled?: boolean
|
|
128
|
+
onChange: (event) => void
|
|
129
|
+
className?: string
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ProgressingProps {
|
|
133
|
+
pageLoader?: boolean
|
|
134
|
+
loadingText?: string
|
|
135
|
+
size?: number
|
|
136
|
+
fullHeight?: boolean
|
|
137
|
+
theme?: 'white' | 'default'
|
|
138
|
+
styles?: React.CSSProperties
|
|
139
|
+
children?: React.ReactNode
|
|
140
|
+
fillColor?: string
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface PopupMenuType {
|
|
144
|
+
children?: any
|
|
145
|
+
onToggleCallback?: (isOpen: boolean) => void
|
|
146
|
+
autoClose?: boolean
|
|
147
|
+
autoPosition?: boolean
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface PopupMenuButtonType {
|
|
151
|
+
children?: ReactNode
|
|
152
|
+
disabled?: boolean
|
|
153
|
+
rootClassName?: string
|
|
154
|
+
tabIndex?: number
|
|
155
|
+
onHover?: boolean
|
|
156
|
+
isKebab?: boolean
|
|
157
|
+
dataTestId?: string
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface PopupMenuBodyType {
|
|
161
|
+
children?: ReactNode
|
|
162
|
+
rootClassName?: string
|
|
163
|
+
style?: React.CSSProperties
|
|
164
|
+
autoWidth?: boolean
|
|
165
|
+
preventWheelDisable?: boolean
|
|
166
|
+
noBackDrop?: boolean
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface ModalType {
|
|
170
|
+
style?: React.CSSProperties
|
|
171
|
+
children?: ReactNode
|
|
172
|
+
modal?: boolean
|
|
173
|
+
rootClassName?: string
|
|
174
|
+
onClick?: any
|
|
175
|
+
callbackRef?: (element?: any) => any
|
|
176
|
+
preventWheelDisable?: boolean
|
|
177
|
+
noBackDrop?: boolean
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export type CDModalTabType = 'SECURITY' | 'CHANGES'
|
|
181
|
+
|
|
182
|
+
export const CDModalTab = {
|
|
183
|
+
Security: <CDModalTabType>'SECURITY',
|
|
184
|
+
Changes: <CDModalTabType>'CHANGES',
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export enum DeploymentNodeType {
|
|
188
|
+
PRECD = 'PRECD',
|
|
189
|
+
CD = 'CD',
|
|
190
|
+
POSTCD = 'POSTCD',
|
|
191
|
+
APPROVAL = 'APPROVAL'
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface UserApprovalConfigType {
|
|
195
|
+
requiredCount: number
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface ApprovalUserDataType {
|
|
199
|
+
dataId: number
|
|
200
|
+
userActionTime: string
|
|
201
|
+
userComment: string
|
|
202
|
+
userEmail: string
|
|
203
|
+
userId: number
|
|
204
|
+
userResponse: number
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface UserApprovalMetadataType {
|
|
208
|
+
approvalRequestId: number
|
|
209
|
+
approvalRuntimeState: number
|
|
210
|
+
approvedUsersData: ApprovalUserDataType[]
|
|
211
|
+
requestedUserData: ApprovalUserDataType
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface CommonNodeAttr {
|
|
215
|
+
connectingCiPipelineId?: number
|
|
216
|
+
parents: string | number[] | string[]
|
|
217
|
+
x: number
|
|
218
|
+
y: number
|
|
219
|
+
title: string
|
|
220
|
+
description?: string
|
|
221
|
+
triggerType?: string
|
|
222
|
+
id: string
|
|
223
|
+
icon?: string
|
|
224
|
+
status?: string
|
|
225
|
+
isSource: boolean
|
|
226
|
+
isGitSource: boolean
|
|
227
|
+
isRoot: boolean
|
|
228
|
+
downstreams: string[]
|
|
229
|
+
type: 'CI' | 'GIT' | 'PRECD' | 'CD' | 'POSTCD' | 'WEBHOOK'
|
|
230
|
+
parentCiPipeline?: number
|
|
231
|
+
parentAppId?: number
|
|
232
|
+
url?: string
|
|
233
|
+
branch?: string
|
|
234
|
+
sourceType?: string
|
|
235
|
+
colorCode?: string
|
|
236
|
+
isExternalCI?: boolean
|
|
237
|
+
isLinkedCI?: boolean
|
|
238
|
+
environmentName?: string //used for CDs
|
|
239
|
+
environmentId?: number
|
|
240
|
+
inputMaterialList?: any[]
|
|
241
|
+
rollbackMaterialList?: any[] //used for CDs
|
|
242
|
+
linkedCount?: number //used for CI
|
|
243
|
+
deploymentStrategy?: string
|
|
244
|
+
height: number
|
|
245
|
+
width: number
|
|
246
|
+
preNode?: CommonNodeAttr //used for CDs
|
|
247
|
+
postNode?: CommonNodeAttr //used for CDs
|
|
248
|
+
stageIndex?: number //used for CDs
|
|
249
|
+
sourceNodes?: Array<CommonNodeAttr> //used for CI
|
|
250
|
+
downstreamNodes?: Array<CommonNodeAttr>
|
|
251
|
+
parentPipelineId?: string
|
|
252
|
+
parentPipelineType?: string
|
|
253
|
+
parentEnvironmentName?: string
|
|
254
|
+
isRegex?: boolean
|
|
255
|
+
regex?: string
|
|
256
|
+
primaryBranchAfterRegex?: string
|
|
257
|
+
storageConfigured?: boolean
|
|
258
|
+
deploymentAppDeleteRequest?: boolean
|
|
259
|
+
approvalUsers?: string[]
|
|
260
|
+
userApprovalConfig?: UserApprovalConfigType
|
|
261
|
+
requestedUserId?: number
|
|
262
|
+
showPluginWarning?: boolean
|
|
263
|
+
helmPackageName?: string
|
|
264
|
+
isVirtualEnvironment?: boolean
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
export interface VulnerabilityType {
|
|
269
|
+
name: string;
|
|
270
|
+
severity: "CRITICAL" | "MODERATE" | "LOW";
|
|
271
|
+
package: string;
|
|
272
|
+
version: string;
|
|
273
|
+
fixedVersion: string;
|
|
274
|
+
policy: string;
|
|
275
|
+
url?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface ScanVulnerabilitiesTableProps {
|
|
279
|
+
vulnerabilities: VulnerabilityType[];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface MaterialInfo {
|
|
283
|
+
revision: string
|
|
284
|
+
modifiedTime: string | Date
|
|
285
|
+
author: string
|
|
286
|
+
message: string
|
|
287
|
+
commitLink: string
|
|
288
|
+
tag: string
|
|
289
|
+
webhookData: string
|
|
290
|
+
branch: string
|
|
291
|
+
url?: string
|
|
292
|
+
type?: string
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface CDMaterialType {
|
|
296
|
+
index: number
|
|
297
|
+
id: string
|
|
298
|
+
materialInfo: MaterialInfo[]
|
|
299
|
+
tab: CDModalTabType
|
|
300
|
+
scanEnabled: boolean
|
|
301
|
+
scanned: boolean
|
|
302
|
+
vulnerabilitiesLoading: boolean
|
|
303
|
+
lastExecution: string //timestamp
|
|
304
|
+
vulnerabilities: VulnerabilityType[]
|
|
305
|
+
vulnerable: boolean
|
|
306
|
+
deployedTime: string
|
|
307
|
+
deployedBy?: string
|
|
308
|
+
wfrId?: number
|
|
309
|
+
buildTime: string
|
|
310
|
+
image: string
|
|
311
|
+
isSelected: boolean
|
|
312
|
+
showSourceInfo: boolean
|
|
313
|
+
latest: boolean
|
|
314
|
+
runningOnParentCd?: boolean
|
|
315
|
+
userApprovalMetadata?: UserApprovalMetadataType
|
|
316
|
+
triggeredBy?: number
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface CDMaterialResponseType {
|
|
320
|
+
approvalUsers: string[]
|
|
321
|
+
materials: any[]
|
|
322
|
+
userApprovalConfig: UserApprovalConfigType
|
|
323
|
+
requestedUserId: number
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export enum PluginRequiredStageKeys {
|
|
327
|
+
PRE_CI = 'PRE_CI',
|
|
328
|
+
POST_CI = 'POST_CI',
|
|
329
|
+
PRE_OR_POST_CI = 'PRE_OR_POST_CI'
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export enum PluginRequiredStage {
|
|
333
|
+
PRE_CI = 'preBuildStage',
|
|
334
|
+
POST_CI = 'postBuildStage',
|
|
335
|
+
PRE_OR_POST_CI = 'PRE_OR_POST_CI'
|
|
336
|
+
}
|
|
337
|
+
export interface MandatoryPluginDetailType {
|
|
338
|
+
id: number
|
|
339
|
+
name: string
|
|
340
|
+
description?: string;
|
|
341
|
+
requiredIn: PluginRequiredStage
|
|
342
|
+
applied?: boolean
|
|
343
|
+
inputVariables?: VariableType[]
|
|
344
|
+
outputVariables?: VariableType[]
|
|
345
|
+
}
|
|
346
|
+
export interface MandatoryPluginDataType {
|
|
347
|
+
pluginData: MandatoryPluginDetailType[]
|
|
348
|
+
isValidPre: boolean
|
|
349
|
+
isValidPost: boolean
|
|
350
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './Types'
|
|
|
4
4
|
export * from './Api'
|
|
5
5
|
export * from './EmptyState/EmptyState'
|
|
6
6
|
export * from './ToastBody'
|
|
7
|
-
export
|
|
7
|
+
export { default as Reload } from './Reload'
|
|
8
8
|
export * from './Error'
|
|
9
9
|
export * from './Helper'
|
|
10
10
|
export * from './Progressing'
|
|
@@ -25,3 +25,9 @@ export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
|
|
|
25
25
|
export * from './Common.service'
|
|
26
26
|
export * from './Checkbox'
|
|
27
27
|
export { default as EmptyState } from './EmptyState/EmptyState'
|
|
28
|
+
export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
|
|
29
|
+
export { default as Toggle } from './Toggle/Toggle'
|
|
30
|
+
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable'
|
|
31
|
+
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup'
|
|
32
|
+
export * from './CIPipeline.Types'
|
|
33
|
+
export { default as DeleteComponent } from './DeleteComponentModal/DeleteComponent'
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
-
<defs>
|
|
3
|
-
<path id="a" class="stroke-color" d="M18.295 5.705a.997.997 0 0 0-1.41 0L12 10.59 7.115 5.705a.997.997 0 1 0-1.41 1.41L10.59 12l-4.885 4.885a.997.997 0 1 0 1.41 1.41L12 13.41l4.885 4.885a.997.997 0 0 0 1.41-1.41L13.41 12l4.885-4.885a.997.997 0 0 0 0-1.41z"/>
|
|
4
|
-
</defs>
|
|
5
|
-
<g fill="none" fill-rule="evenodd">
|
|
6
|
-
<path d=""/>
|
|
7
|
-
<use fill="#999" xlink:href="#a"/>
|
|
8
|
-
</g>
|
|
9
|
-
</svg>
|
|
File without changes
|