@devtron-labs/devtron-fe-common-lib 0.0.9-beta-9 → 0.0.9-beta-10
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/CIPipeline.Types.d.ts +265 -0
- package/dist/Common/Constants.d.ts +5 -0
- package/dist/Common/Dialogs/Types.d.ts +1 -0
- package/dist/Common/Helper.d.ts +1 -0
- package/dist/Common/Policy.Types.d.ts +55 -0
- package/dist/Common/Types.d.ts +9 -3
- package/dist/Common/index.d.ts +2 -0
- package/dist/index.js +6023 -224
- package/package.json +2 -1
- package/src/Assets/Icon/ic-help.svg +3 -0
- package/src/Common/CIPipeline.Types.ts +277 -0
- package/src/Common/Constants.ts +6 -0
- package/src/Common/Dialogs/DeleteDialog.tsx +45 -27
- package/src/Common/Dialogs/Types.ts +1 -0
- package/src/Common/Helper.tsx +15 -0
- package/src/Common/Policy.Types.ts +62 -0
- package/src/Common/TippyCustomized.tsx +31 -2
- package/src/Common/Types.ts +18 -13
- package/src/Common/index.ts +2 -0
- /package/src/Assets/Img/{warning-medium.svg → delete-medium.svg} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtron-labs/devtron-fe-common-lib",
|
|
3
|
-
"version": "0.0.9-beta-
|
|
3
|
+
"version": "0.0.9-beta-10",
|
|
4
4
|
"description": "Supporting common component library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@svgr/rollup": "6.5.1",
|
|
34
34
|
"@rollup/plugin-url": "8.0.1",
|
|
35
35
|
"@rollup/plugin-commonjs": "24.0.1",
|
|
36
|
+
"moment": "^2.29.4",
|
|
36
37
|
"typescript": "^4.9.4",
|
|
37
38
|
"react-toastify": "^8.2.0",
|
|
38
39
|
"@tippyjs/react": "^4.2.0",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
+
<path fill="#767D84" fill-rule="evenodd" d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm-.205 12.868c-.615 0-1.12.505-1.12 1.12 0 .617.505 1.121 1.12 1.121.615 0 1.12-.504 1.12-1.12 0-.616-.506-1.12-1.12-1.12zM11.863 7c-1.667 0-3.197 1.187-3.196 2.527 0 .546.41.833.888.833 1.325 0 .642-1.803 2.39-1.803.82 0 1.311.438 1.311 1.175 0 1.34-2.39 1.708-2.39 3.334 0 .438.287.915.874.915.902 0 .792-.67 1.12-1.148.438-.642 2.473-1.325 2.473-3.101 0-1.927-1.721-2.732-3.47-2.732z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
export interface MaterialType {
|
|
2
|
+
name: string
|
|
3
|
+
type: string
|
|
4
|
+
value: string
|
|
5
|
+
gitMaterialId: number
|
|
6
|
+
id: number
|
|
7
|
+
isSelected: boolean
|
|
8
|
+
gitHostId: number
|
|
9
|
+
gitProviderId: number
|
|
10
|
+
regex?: string
|
|
11
|
+
isRegex: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Githost {
|
|
15
|
+
id: number
|
|
16
|
+
name: string
|
|
17
|
+
active: boolean
|
|
18
|
+
webhookSecret: string
|
|
19
|
+
webhookUrl: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface WebhookEvent {
|
|
23
|
+
id: number
|
|
24
|
+
gitHostId: number
|
|
25
|
+
name: string
|
|
26
|
+
isActive: boolean
|
|
27
|
+
selectors: WebhookEventSelectors[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface WebhookEventSelectors {
|
|
31
|
+
id: number
|
|
32
|
+
eventId: number
|
|
33
|
+
name: string
|
|
34
|
+
selector: string
|
|
35
|
+
toShowInCiFilter: boolean
|
|
36
|
+
fixValue: string
|
|
37
|
+
toShow: boolean
|
|
38
|
+
possibleValues: string
|
|
39
|
+
isActive: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface CiPipelineSourceTypeOption {
|
|
43
|
+
label: string
|
|
44
|
+
value: string
|
|
45
|
+
isDisabled: boolean
|
|
46
|
+
isSelected: boolean
|
|
47
|
+
isWebhook: boolean
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export enum RefVariableType {
|
|
51
|
+
GLOBAL = 'GLOBAL',
|
|
52
|
+
FROM_PREVIOUS_STEP = 'FROM_PREVIOUS_STEP',
|
|
53
|
+
NEW = 'NEW',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export enum PluginType {
|
|
57
|
+
INLINE = 'INLINE',
|
|
58
|
+
PLUGIN_REF = 'REF_PLUGIN',
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export enum ScriptType {
|
|
62
|
+
SHELL = 'SHELL',
|
|
63
|
+
DOCKERFILE = 'DOCKERFILE',
|
|
64
|
+
CONTAINERIMAGE = 'CONTAINER_IMAGE',
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export enum MountPath {
|
|
68
|
+
TRUE = 'Yes',
|
|
69
|
+
FALSE = 'No',
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export enum ConditionType {
|
|
73
|
+
SKIP = 'SKIP',
|
|
74
|
+
TRIGGER = 'TRIGGER',
|
|
75
|
+
PASS = 'PASS',
|
|
76
|
+
FAIL = 'FAIL',
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export enum RefVariableStageType {
|
|
80
|
+
PRE_CI = 'PRE_CI',
|
|
81
|
+
POST_CI = 'POST_CI',
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface VariableType {
|
|
85
|
+
id: number
|
|
86
|
+
name: string
|
|
87
|
+
value: string
|
|
88
|
+
format: string
|
|
89
|
+
description: string
|
|
90
|
+
defaultValue: string
|
|
91
|
+
variableType: RefVariableType
|
|
92
|
+
refVariableStepIndex: number
|
|
93
|
+
refVariableName: string
|
|
94
|
+
refVariableStage?: RefVariableStageType
|
|
95
|
+
variableStepIndexInPlugin?: number
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface CommandArgsMap {
|
|
99
|
+
command: string
|
|
100
|
+
args: string[]
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface PortMapType {
|
|
104
|
+
portOnLocal: number
|
|
105
|
+
portOnContainer: number
|
|
106
|
+
}
|
|
107
|
+
interface ConditionDetails {
|
|
108
|
+
id: number
|
|
109
|
+
conditionOnVariable: string
|
|
110
|
+
conditionOperator: string
|
|
111
|
+
conditionType: ConditionType
|
|
112
|
+
conditionalValue: string
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface InlineStepDetailType {
|
|
116
|
+
scriptType: ScriptType
|
|
117
|
+
isMountCustomScript?: boolean
|
|
118
|
+
script?: string
|
|
119
|
+
dockerFileExists?: boolean
|
|
120
|
+
mountPath?: string
|
|
121
|
+
mountCodeToContainer?: boolean
|
|
122
|
+
mountDirectoryFromHost?: boolean
|
|
123
|
+
containerImagePath?: string
|
|
124
|
+
imagePullSecret?: string
|
|
125
|
+
commandArgsMap?: CommandArgsMap[]
|
|
126
|
+
portMap?: PortMapType[]
|
|
127
|
+
mountPathMap?: {
|
|
128
|
+
filePathOnDisk: string
|
|
129
|
+
filePathOnContainer: string
|
|
130
|
+
}[]
|
|
131
|
+
inputVariables?: VariableType[]
|
|
132
|
+
outputVariables?: VariableType[]
|
|
133
|
+
conditionDetails: ConditionDetails[]
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface PluginRefStepDetailType {
|
|
137
|
+
id: number
|
|
138
|
+
pluginId: number
|
|
139
|
+
inputVariables?: VariableType[]
|
|
140
|
+
outputVariables?: VariableType[]
|
|
141
|
+
conditionDetails?: ConditionDetails[]
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface StepType {
|
|
145
|
+
id: number
|
|
146
|
+
index: number
|
|
147
|
+
name: string
|
|
148
|
+
description: string
|
|
149
|
+
stepType: PluginType
|
|
150
|
+
outputDirectoryPath: string[]
|
|
151
|
+
inlineStepDetail?: InlineStepDetailType
|
|
152
|
+
pluginRefStepDetail?: PluginRefStepDetailType
|
|
153
|
+
triggerIfParentStageFail: boolean
|
|
154
|
+
isMandatory?: boolean
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface BuildStageType {
|
|
158
|
+
id: number
|
|
159
|
+
steps: StepType[]
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export enum CIBuildType {
|
|
163
|
+
SELF_DOCKERFILE_BUILD_TYPE = 'self-dockerfile-build',
|
|
164
|
+
MANAGED_DOCKERFILE_BUILD_TYPE = 'managed-dockerfile-build',
|
|
165
|
+
BUILDPACK_BUILD_TYPE = 'buildpack-build',
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface BuildPackConfigType {
|
|
169
|
+
builderId: string
|
|
170
|
+
language: string
|
|
171
|
+
languageVersion: string
|
|
172
|
+
projectPath: string
|
|
173
|
+
builderLangEnvParam?: string
|
|
174
|
+
currentBuilderLangEnvParam?: string
|
|
175
|
+
buildPacks?: any
|
|
176
|
+
args?: Record<string, string>
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface DockerBuildConfigType {
|
|
180
|
+
dockerfileContent: string
|
|
181
|
+
dockerfileRelativePath: string
|
|
182
|
+
buildContext: string
|
|
183
|
+
dockerfilePath?: string
|
|
184
|
+
dockerfileRepository?: string
|
|
185
|
+
args?: Record<string, string>
|
|
186
|
+
targetPlatform?: any
|
|
187
|
+
language?: string
|
|
188
|
+
languageFramework?: string
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface CIBuildConfigType {
|
|
192
|
+
buildPackConfig: BuildPackConfigType
|
|
193
|
+
ciBuildType: CIBuildType
|
|
194
|
+
dockerBuildConfig: DockerBuildConfigType
|
|
195
|
+
gitMaterialId: number
|
|
196
|
+
buildContextGitMaterialId: number
|
|
197
|
+
id?: number
|
|
198
|
+
useRootBuildContext: boolean
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface DockerConfigOverrideType {
|
|
202
|
+
dockerRegistry: string
|
|
203
|
+
dockerRepository: string
|
|
204
|
+
ciBuildConfig: CIBuildConfigType
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface FormType {
|
|
208
|
+
name: string
|
|
209
|
+
args: { key: string; value: string }[]
|
|
210
|
+
materials: MaterialType[]
|
|
211
|
+
gitHost: Githost
|
|
212
|
+
webhookEvents: WebhookEvent[]
|
|
213
|
+
ciPipelineSourceTypeOptions: CiPipelineSourceTypeOption[]
|
|
214
|
+
webhookConditionList: { selectorId: number; value: string }[]
|
|
215
|
+
triggerType: string
|
|
216
|
+
scanEnabled?: boolean
|
|
217
|
+
beforeDockerBuildScripts?: {
|
|
218
|
+
id: number
|
|
219
|
+
name: string
|
|
220
|
+
outputLocation: string
|
|
221
|
+
script: string
|
|
222
|
+
isCollapsed: boolean
|
|
223
|
+
index: number
|
|
224
|
+
}[]
|
|
225
|
+
afterDockerBuildScripts?: {
|
|
226
|
+
id: number
|
|
227
|
+
name: string
|
|
228
|
+
outputLocation: string
|
|
229
|
+
script: string
|
|
230
|
+
isCollapsed: boolean
|
|
231
|
+
index: number
|
|
232
|
+
}[]
|
|
233
|
+
ciPipelineEditable: true
|
|
234
|
+
preBuildStage?: BuildStageType
|
|
235
|
+
postBuildStage?: BuildStageType
|
|
236
|
+
isDockerConfigOverridden?: boolean
|
|
237
|
+
dockerConfigOverride?: DockerConfigOverrideType
|
|
238
|
+
isOffendingMandatoryPlugin?: boolean
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface ErrorObj {
|
|
242
|
+
isValid: boolean
|
|
243
|
+
message: string | null
|
|
244
|
+
}
|
|
245
|
+
export interface TaskErrorObj {
|
|
246
|
+
isValid: boolean
|
|
247
|
+
name: ErrorObj
|
|
248
|
+
inlineStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
|
|
249
|
+
pluginRefStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
|
|
250
|
+
}
|
|
251
|
+
export interface FormErrorObjectType {
|
|
252
|
+
name: ErrorObj
|
|
253
|
+
materials?: MaterialType[]
|
|
254
|
+
preBuildStage?: {
|
|
255
|
+
isValid: boolean
|
|
256
|
+
steps: TaskErrorObj[]
|
|
257
|
+
}
|
|
258
|
+
buildStage?: {
|
|
259
|
+
isValid: boolean
|
|
260
|
+
name: ErrorObj
|
|
261
|
+
}
|
|
262
|
+
postBuildStage?: {
|
|
263
|
+
isValid: boolean
|
|
264
|
+
steps: TaskErrorObj[]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface PluginDetailType {
|
|
269
|
+
id: number
|
|
270
|
+
name: string
|
|
271
|
+
type: string
|
|
272
|
+
description: string
|
|
273
|
+
icon: string
|
|
274
|
+
tags: string[]
|
|
275
|
+
inputVariables?: VariableType[]
|
|
276
|
+
outputVariables?: VariableType[]
|
|
277
|
+
}
|
package/src/Common/Constants.ts
CHANGED
|
@@ -57,4 +57,10 @@ export const TOKEN_COOKIE_NAME = 'argocd.token'
|
|
|
57
57
|
export const TriggerTypeMap = {
|
|
58
58
|
automatic: 'Auto',
|
|
59
59
|
manual: 'Manual',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const BuildStageVariable = {
|
|
63
|
+
PreBuild: 'preBuildStage',
|
|
64
|
+
Build: 'buildStage',
|
|
65
|
+
PostBuild: 'postBuildStage',
|
|
60
66
|
}
|
|
@@ -1,35 +1,53 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import warn from '../../Assets/Img/
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import warn from '../../Assets/Img/delete-medium.svg'
|
|
3
3
|
import { Progressing } from '../Progressing'
|
|
4
|
-
import ConfirmationDialog from './ConfirmationDialog'
|
|
5
|
-
import { DeleteDialogProps } from './Types'
|
|
4
|
+
import ConfirmationDialog from './ConfirmationDialog'
|
|
5
|
+
import { DeleteDialogProps } from './Types'
|
|
6
6
|
|
|
7
7
|
export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
return (
|
|
9
|
+
<ConfirmationDialog className="confirmation-dialog__body--w-400">
|
|
10
|
+
<ConfirmationDialog.Icon src={warn} />
|
|
11
|
+
<ConfirmationDialog.Body title={props.title}>
|
|
12
|
+
<div className="fs-13 cn-7 lh-1-54 w-100">
|
|
13
|
+
{props.description ? props.description : null}
|
|
14
|
+
{props.children}
|
|
15
|
+
</div>
|
|
16
|
+
</ConfirmationDialog.Body>
|
|
17
|
+
<ConfirmationDialog.ButtonGroup>
|
|
18
|
+
<div className="flex right">
|
|
19
|
+
<button
|
|
20
|
+
type="button"
|
|
21
|
+
className="cta cancel cta-cd-delete-modal ml-16"
|
|
22
|
+
onClick={props.closeDelete}
|
|
23
|
+
disabled={props.apiCallInProgress}
|
|
24
|
+
data-testid="dialog-cancel"
|
|
25
|
+
>
|
|
26
|
+
Cancel
|
|
27
|
+
</button>
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
className="cta delete cta-cd-delete-modal ml-16"
|
|
31
|
+
onClick={() => props.delete()}
|
|
32
|
+
disabled={props.apiCallInProgress}
|
|
33
|
+
data-testid="dialog-delete"
|
|
34
|
+
>
|
|
35
|
+
{props.apiCallInProgress ? (
|
|
36
|
+
<Progressing />
|
|
37
|
+
) : (
|
|
38
|
+
`${props.deletePrefix || ''}${
|
|
39
|
+
props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete'
|
|
40
|
+
}${props.deletePostfix || ''}`
|
|
41
|
+
)}
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</ConfirmationDialog.ButtonGroup>
|
|
45
|
+
</ConfirmationDialog>
|
|
46
|
+
)
|
|
26
47
|
}
|
|
27
48
|
|
|
28
49
|
function DeleteDialogDescription(props) {
|
|
29
|
-
|
|
30
|
-
return <>
|
|
31
|
-
{props.children}
|
|
32
|
-
</>
|
|
50
|
+
return <>{props.children}</>
|
|
33
51
|
}
|
|
34
52
|
|
|
35
|
-
DeleteDialog.Description = DeleteDialogDescription
|
|
53
|
+
DeleteDialog.Description = DeleteDialogDescription
|
package/src/Common/Helper.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import * as Sentry from '@sentry/browser'
|
|
|
5
5
|
import { toastAccessDenied } from './ToastBody'
|
|
6
6
|
import { ERROR_EMPTY_SCREEN, TOKEN_COOKIE_NAME } from './Constants'
|
|
7
7
|
import { ReactComponent as FormError } from '../Assets/Icon/ic-warning.svg'
|
|
8
|
+
import moment from 'moment';
|
|
8
9
|
|
|
9
10
|
toast.configure({
|
|
10
11
|
autoClose: 3000,
|
|
@@ -331,3 +332,17 @@ export function CustomInput({
|
|
|
331
332
|
</div>
|
|
332
333
|
)
|
|
333
334
|
}
|
|
335
|
+
|
|
336
|
+
export function handleUTCTime(ts: string, isRelativeTime = false) {
|
|
337
|
+
let timestamp = "";
|
|
338
|
+
try {
|
|
339
|
+
if (ts && ts.length) {
|
|
340
|
+
let date = moment(ts);
|
|
341
|
+
if (isRelativeTime) timestamp = date.fromNow();
|
|
342
|
+
else timestamp = date.format("ddd DD MMM YYYY HH:mm:ss");
|
|
343
|
+
}
|
|
344
|
+
} catch (error) {
|
|
345
|
+
console.error("Error Parsing Date:", ts);
|
|
346
|
+
}
|
|
347
|
+
return timestamp;
|
|
348
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { VariableType } from "./CIPipeline.Types"
|
|
2
|
+
import { ResponseType } from "./Types"
|
|
3
|
+
|
|
4
|
+
export enum ApplyPolicyToStage {
|
|
5
|
+
PRE_CI = 'PRE_CI',
|
|
6
|
+
POST_CI = 'POST_CI',
|
|
7
|
+
PRE_OR_POST_CI = 'PRE_OR_POST_CI',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum PluginRequiredStage {
|
|
11
|
+
PRE_CI = 'preBuildStage',
|
|
12
|
+
POST_CI = 'postBuildStage',
|
|
13
|
+
PRE_OR_POST_CI = 'PRE_OR_POST_CI',
|
|
14
|
+
}
|
|
15
|
+
|
|
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
|
|
26
|
+
}
|
|
27
|
+
export interface MandatoryPluginDetailType {
|
|
28
|
+
id: number
|
|
29
|
+
name: string
|
|
30
|
+
description?: string
|
|
31
|
+
requiredIn: PluginRequiredStage
|
|
32
|
+
applied?: boolean
|
|
33
|
+
inputVariables?: VariableType[]
|
|
34
|
+
outputVariables?: VariableType[]
|
|
35
|
+
definitionSources?: DefinitionSourceType[]
|
|
36
|
+
}
|
|
37
|
+
export interface MandatoryPluginDataType {
|
|
38
|
+
pluginData: MandatoryPluginDetailType[]
|
|
39
|
+
isValidPre: boolean
|
|
40
|
+
isValidPost: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum ConsequenceAction {
|
|
44
|
+
BLOCK = 'BLOCK',
|
|
45
|
+
ALLOW_UNTIL_TIME = 'ALLOW_UNTIL_TIME',
|
|
46
|
+
ALLOW_FOREVER = 'ALLOW_FOREVER',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ConsequenceType {
|
|
50
|
+
action: ConsequenceAction
|
|
51
|
+
metadataField: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface BlockedStateData {
|
|
55
|
+
isOffendingMandatoryPlugin: boolean
|
|
56
|
+
isCITriggerBlocked: boolean
|
|
57
|
+
ciBlockState: ConsequenceType
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface GetBlockedStateResponse extends ResponseType {
|
|
61
|
+
result?: BlockedStateData
|
|
62
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import React, { useRef } from 'react'
|
|
1
|
+
import React, { useRef, useState } from 'react'
|
|
2
2
|
import Tippy from '@tippyjs/react'
|
|
3
3
|
import { ReactComponent as CloseIcon } from '../Assets/Icon/ic-cross.svg'
|
|
4
|
+
import { ReactComponent as QuestionFilled } from '../Assets/Icon/ic-help.svg'
|
|
5
|
+
import { ReactComponent as Question } from '../Assets/Icon/ic-help-outline.svg'
|
|
4
6
|
import 'tippy.js/animations/shift-toward-subtle.css'
|
|
5
7
|
import { TippyCustomizedProps, TippyTheme } from './Types'
|
|
8
|
+
import { not } from './Helper'
|
|
6
9
|
|
|
7
10
|
// This component will handle some of the new tippy designs and interactions
|
|
8
11
|
// So this can be updated to support further for new features or interactions
|
|
9
12
|
export function TippyCustomized(props: TippyCustomizedProps) {
|
|
10
13
|
const tippyRef = useRef(null)
|
|
14
|
+
const [showHeadingInfo, setShowHeadingInfo] = useState(false)
|
|
11
15
|
const isWhiteTheme = props.theme === TippyTheme.white
|
|
12
16
|
|
|
13
17
|
const onTippyMount = (tippyInstance) => {
|
|
@@ -24,6 +28,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
24
28
|
props.onClose()
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
setShowHeadingInfo(false)
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
const closeOnEsc = (e) => {
|
|
@@ -32,6 +37,10 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
const toggleHeadingInfo = (e) => {
|
|
41
|
+
setShowHeadingInfo(not)
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
const getTippyContent = () => {
|
|
36
45
|
const {
|
|
37
46
|
Icon,
|
|
@@ -40,6 +49,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
40
49
|
iconSize,
|
|
41
50
|
onImageLoadError,
|
|
42
51
|
heading,
|
|
52
|
+
headingInfo,
|
|
43
53
|
infoTextHeading,
|
|
44
54
|
infoText,
|
|
45
55
|
showCloseButton,
|
|
@@ -51,7 +61,9 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
51
61
|
<>
|
|
52
62
|
<div
|
|
53
63
|
className={`dc__word-break dc__hyphens-auto flex left ${
|
|
54
|
-
isWhiteTheme
|
|
64
|
+
isWhiteTheme
|
|
65
|
+
? `p-12 cn-9 ${props.noHeadingBorder ? '' : 'dc__border-bottom-n1'}`
|
|
66
|
+
: 'pt-20 pb-12 pr-20 pl-20 cn-0 top'
|
|
55
67
|
}`}
|
|
56
68
|
>
|
|
57
69
|
{iconPath ? (
|
|
@@ -69,6 +81,11 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
69
81
|
)
|
|
70
82
|
)}
|
|
71
83
|
{heading && <span className={`fs-14 fw-6 lh-20 ${showCloseButton ? 'mr-6' : ''}`}>{heading}</span>}
|
|
84
|
+
{headingInfo && (
|
|
85
|
+
<div className="icon-dim-20 cursor" onClick={toggleHeadingInfo}>
|
|
86
|
+
<Question className="icon-dim-20" />
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
72
89
|
{showCloseButton && (
|
|
73
90
|
<div className="icon-dim-16 ml-auto">
|
|
74
91
|
<CloseIcon
|
|
@@ -78,6 +95,18 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
78
95
|
</div>
|
|
79
96
|
)}
|
|
80
97
|
</div>
|
|
98
|
+
{showHeadingInfo && (
|
|
99
|
+
<div
|
|
100
|
+
className={`flex left top bcv-1 fs-13 fw-4 lh-20 pt-8 pb-8 ${
|
|
101
|
+
isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20'
|
|
102
|
+
}`}
|
|
103
|
+
>
|
|
104
|
+
<div className="icon-dim-20 mr-8">
|
|
105
|
+
<QuestionFilled className="icon-dim-20 fcv-5" />
|
|
106
|
+
</div>
|
|
107
|
+
<div className="dc__word-break dc__hyphens-auto">{headingInfo}</div>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
81
110
|
{infoTextHeading && (
|
|
82
111
|
<div
|
|
83
112
|
className={`dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ${
|
package/src/Common/Types.ts
CHANGED
|
@@ -52,6 +52,8 @@ export interface TippyCustomizedProps {
|
|
|
52
52
|
theme: TippyTheme
|
|
53
53
|
visible?: boolean
|
|
54
54
|
heading?: ReactNode | string
|
|
55
|
+
headingInfo?: ReactNode | string
|
|
56
|
+
noHeadingBorder?: boolean
|
|
55
57
|
infoTextHeading?: string
|
|
56
58
|
placement: Placement
|
|
57
59
|
className?: string
|
|
@@ -186,7 +188,7 @@ export enum DeploymentNodeType {
|
|
|
186
188
|
PRECD = 'PRECD',
|
|
187
189
|
CD = 'CD',
|
|
188
190
|
POSTCD = 'POSTCD',
|
|
189
|
-
APPROVAL = 'APPROVAL'
|
|
191
|
+
APPROVAL = 'APPROVAL',
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
export interface UserApprovalConfigType {
|
|
@@ -257,23 +259,28 @@ export interface CommonNodeAttr {
|
|
|
257
259
|
approvalUsers?: string[]
|
|
258
260
|
userApprovalConfig?: UserApprovalConfigType
|
|
259
261
|
requestedUserId?: number
|
|
262
|
+
showPluginWarning?: boolean
|
|
260
263
|
helmPackageName?: string
|
|
261
264
|
isVirtualEnvironment?: boolean
|
|
265
|
+
isCITriggerBlocked?: boolean
|
|
266
|
+
ciBlockState?: {
|
|
267
|
+
action: any,
|
|
268
|
+
metadataField: string
|
|
269
|
+
}
|
|
262
270
|
}
|
|
263
271
|
|
|
264
|
-
|
|
265
272
|
export interface VulnerabilityType {
|
|
266
|
-
name: string
|
|
267
|
-
severity:
|
|
268
|
-
package: string
|
|
269
|
-
version: string
|
|
270
|
-
fixedVersion: string
|
|
271
|
-
policy: string
|
|
272
|
-
url?: string
|
|
273
|
+
name: string
|
|
274
|
+
severity: 'CRITICAL' | 'MODERATE' | 'LOW'
|
|
275
|
+
package: string
|
|
276
|
+
version: string
|
|
277
|
+
fixedVersion: string
|
|
278
|
+
policy: string
|
|
279
|
+
url?: string
|
|
273
280
|
}
|
|
274
281
|
|
|
275
282
|
export interface ScanVulnerabilitiesTableProps {
|
|
276
|
-
vulnerabilities: VulnerabilityType[]
|
|
283
|
+
vulnerabilities: VulnerabilityType[]
|
|
277
284
|
}
|
|
278
285
|
|
|
279
286
|
export interface MaterialInfo {
|
|
@@ -318,6 +325,4 @@ export interface CDMaterialResponseType {
|
|
|
318
325
|
materials: any[]
|
|
319
326
|
userApprovalConfig: UserApprovalConfigType
|
|
320
327
|
requestedUserId: number
|
|
321
|
-
|
|
322
|
-
appReleaseTagNames: string[]
|
|
323
|
-
}
|
|
328
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -29,4 +29,6 @@ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
|
|
|
29
29
|
export { default as Toggle } from './Toggle/Toggle'
|
|
30
30
|
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable'
|
|
31
31
|
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup'
|
|
32
|
+
export * from './CIPipeline.Types'
|
|
33
|
+
export * from './Policy.Types'
|
|
32
34
|
export { default as DeleteComponent } from './DeleteComponentModal/DeleteComponent'
|
|
File without changes
|