@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtron-labs/devtron-fe-common-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9-beta-2",
|
|
4
4
|
"description": "Supporting common component library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typescript": "^4.9.4",
|
|
37
37
|
"react-toastify": "^8.2.0",
|
|
38
38
|
"@tippyjs/react": "^4.2.0",
|
|
39
|
-
"react-select": "
|
|
39
|
+
"react-select": "5.2.2",
|
|
40
40
|
"@sentry/browser": "^7.31.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
package/rollup.config.js
CHANGED
|
@@ -7,7 +7,7 @@ import del from 'rollup-plugin-delete'
|
|
|
7
7
|
import pkg from './package.json'
|
|
8
8
|
import svgr from '@svgr/rollup'
|
|
9
9
|
import url from '@rollup/plugin-url'
|
|
10
|
-
import commonjs from '@rollup/plugin-commonjs'
|
|
10
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
input: './src/index.ts',
|
|
@@ -24,8 +24,8 @@ export default {
|
|
|
24
24
|
exclude: 'node_modules/**',
|
|
25
25
|
}),
|
|
26
26
|
del({ targets: ['dist/*'] }),
|
|
27
|
-
url(),
|
|
28
|
-
svgr({ icon: true })
|
|
27
|
+
url({limit: '100000'}),
|
|
28
|
+
svgr({ icon: true })
|
|
29
29
|
],
|
|
30
30
|
external: Object.keys(pkg.peerDependencies || {}),
|
|
31
31
|
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 32 32">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<path d="M0 0h32v32H0z"/>
|
|
4
|
+
<path fill="#06C" d="M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667z"/>
|
|
5
|
+
<path fill="#FFF" d="M16 14.667c.736 0 1.333.597 1.333 1.333v5.333a1.333 1.333 0 1 1-2.666 0V16c0-.736.597-1.333 1.333-1.333zm0-5.334A1.333 1.333 0 1 1 16 12a1.333 1.333 0 0 1 0-2.667z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<path d="M0 0h32v32H0z"/>
|
|
4
|
+
<path fill="#FFCB5D" d="M18.315 5.052L29.72 25.01A2.667 2.667 0 0 1 27.405 29H4.595a2.667 2.667 0 0 1-2.315-3.99L13.685 5.052a2.667 2.667 0 0 1 4.63 0z"/>
|
|
5
|
+
<path fill="#FFF" d="M16 22.667a1.333 1.333 0 1 1 0 2.666 1.333 1.333 0 0 1 0-2.666zM16 12c.736 0 1.333.597 1.333 1.333v6.334a1.333 1.333 0 1 1-2.666 0v-6.334c0-.736.597-1.333 1.333-1.333z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
Binary file
|
package/src/Common/Api.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ServerErrors } from './ServerError'
|
|
2
|
-
import { RequestTimeout, Host } from './Constants'
|
|
2
|
+
import { RequestTimeout, Host, URLS } from './Constants'
|
|
3
3
|
import { ResponseType, APIOptions } from './Types'
|
|
4
4
|
|
|
5
5
|
const responseMessages = {
|
|
@@ -73,6 +73,11 @@ const responseMessages = {
|
|
|
73
73
|
599: 'Network connect timeout error',
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
function handleLogout() {
|
|
77
|
+
const continueParam = `${window.location.pathname.replace(process.env.PUBLIC_URL, '')}${window.location.search}`
|
|
78
|
+
window.location.href = `${window.location.origin}${process.env.PUBLIC_URL}${URLS.LOGIN_SSO}?continue=${continueParam}`
|
|
79
|
+
}
|
|
80
|
+
|
|
76
81
|
async function handleServerError(contentType, response) {
|
|
77
82
|
//Test for HTTP Status Code
|
|
78
83
|
let code: number = response.status
|
|
@@ -126,6 +131,7 @@ async function fetchAPI(
|
|
|
126
131
|
],
|
|
127
132
|
})
|
|
128
133
|
} else {
|
|
134
|
+
handleLogout()
|
|
129
135
|
return { code: 401, status: 'Unauthorized', result: [] }
|
|
130
136
|
}
|
|
131
137
|
} else if (response.status >= 300 && response.status <= 599) {
|
|
@@ -2,32 +2,9 @@ import React, { useMemo, useEffect } from 'react'
|
|
|
2
2
|
import { Link, useRouteMatch, useParams } from 'react-router-dom'
|
|
3
3
|
import { useBreadcrumbContext } from './BreadcrumbStore'
|
|
4
4
|
import { ConditionalWrap } from '../Helper'
|
|
5
|
+
import { Breadcrumb, Breadcrumbs, UseBreadcrumbOptionalProps, UseBreadcrumbState } from './Types'
|
|
5
6
|
export const BreadcrumbContext = React.createContext(null)
|
|
6
7
|
|
|
7
|
-
interface Breadcrumb {
|
|
8
|
-
to: string
|
|
9
|
-
name: string
|
|
10
|
-
className?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface UseBreadcrumbState {
|
|
14
|
-
breadcrumbs: Breadcrumb[]
|
|
15
|
-
setCrumb: (props: { [key: string]: any }) => void
|
|
16
|
-
resetCrumb: (props: string[]) => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface AdvancedAlias {
|
|
20
|
-
component: any
|
|
21
|
-
linked: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface UseBreadcrumbProps {
|
|
25
|
-
sep?: string
|
|
26
|
-
alias?: { [key: string]: AdvancedAlias | any }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type UseBreadcrumbOptionalProps = UseBreadcrumbProps | null
|
|
30
|
-
|
|
31
8
|
export function useBreadcrumb(props?: UseBreadcrumbOptionalProps, deps?: any[]): UseBreadcrumbState {
|
|
32
9
|
let sep = props?.sep || '/'
|
|
33
10
|
deps = deps || []
|
|
@@ -91,12 +68,6 @@ export function useBreadcrumb(props?: UseBreadcrumbOptionalProps, deps?: any[]):
|
|
|
91
68
|
return { breadcrumbs, setCrumb, resetCrumb }
|
|
92
69
|
}
|
|
93
70
|
|
|
94
|
-
interface Breadcrumbs {
|
|
95
|
-
breadcrumbs: Breadcrumb[]
|
|
96
|
-
sep?: string
|
|
97
|
-
className?: string
|
|
98
|
-
}
|
|
99
|
-
|
|
100
71
|
export const BreadCrumb: React.FC<Breadcrumbs> = ({
|
|
101
72
|
breadcrumbs,
|
|
102
73
|
sep = '/',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
export interface Breadcrumb {
|
|
3
|
+
to: string
|
|
4
|
+
name: string
|
|
5
|
+
className?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface UseBreadcrumbState {
|
|
9
|
+
breadcrumbs: Breadcrumb[]
|
|
10
|
+
setCrumb: (props: { [key: string]: any }) => void
|
|
11
|
+
resetCrumb: (props: string[]) => void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AdvancedAlias {
|
|
15
|
+
component: any
|
|
16
|
+
linked: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface UseBreadcrumbProps {
|
|
20
|
+
sep?: string
|
|
21
|
+
alias?: { [key: string]: AdvancedAlias | any }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Breadcrumbs {
|
|
25
|
+
breadcrumbs: Breadcrumb[]
|
|
26
|
+
sep?: string
|
|
27
|
+
className?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type UseBreadcrumbOptionalProps = UseBreadcrumbProps | null
|
|
@@ -0,0 +1,276 @@
|
|
|
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
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface ErrorObj {
|
|
241
|
+
isValid: boolean
|
|
242
|
+
message: string | null
|
|
243
|
+
}
|
|
244
|
+
export interface TaskErrorObj {
|
|
245
|
+
isValid: boolean
|
|
246
|
+
name: ErrorObj
|
|
247
|
+
inlineStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
|
|
248
|
+
pluginRefStepDetail?: { inputVariables?: ErrorObj[]; outputVariables?: ErrorObj[] }
|
|
249
|
+
}
|
|
250
|
+
export interface FormErrorObjectType {
|
|
251
|
+
name: ErrorObj
|
|
252
|
+
materials?: MaterialType[]
|
|
253
|
+
preBuildStage?: {
|
|
254
|
+
isValid: boolean
|
|
255
|
+
steps: TaskErrorObj[]
|
|
256
|
+
}
|
|
257
|
+
buildStage?: {
|
|
258
|
+
isValid: boolean
|
|
259
|
+
name: ErrorObj
|
|
260
|
+
}
|
|
261
|
+
postBuildStage?: {
|
|
262
|
+
isValid: boolean
|
|
263
|
+
steps: TaskErrorObj[]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface PluginDetailType {
|
|
268
|
+
id: number
|
|
269
|
+
name: string
|
|
270
|
+
type: string
|
|
271
|
+
description: string
|
|
272
|
+
icon: string
|
|
273
|
+
tags: string[]
|
|
274
|
+
inputVariables?: VariableType[]
|
|
275
|
+
outputVariables?: VariableType[]
|
|
276
|
+
}
|
package/src/Common/Checkbox.tsx
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react'
|
|
2
|
-
|
|
3
|
-
export enum CHECKBOX_VALUE {
|
|
4
|
-
CHECKED = 'CHECKED',
|
|
5
|
-
INTERMEDIATE = 'INTERMEDIATE',
|
|
6
|
-
}
|
|
7
|
-
export interface CheckboxProps {
|
|
8
|
-
onChange: (event) => void
|
|
9
|
-
isChecked: boolean
|
|
10
|
-
value: 'CHECKED' | 'INTERMEDIATE'
|
|
11
|
-
disabled?: boolean
|
|
12
|
-
tabIndex?: number
|
|
13
|
-
rootClassName?: string
|
|
14
|
-
onClick?: (event) => void
|
|
15
|
-
id?: string
|
|
16
|
-
}
|
|
2
|
+
import { CheckboxProps } from './Types'
|
|
17
3
|
|
|
18
4
|
/*
|
|
19
5
|
Valid States of Checkbox:
|
|
@@ -39,8 +25,9 @@ export class Checkbox extends Component<CheckboxProps> {
|
|
|
39
25
|
tabIndex={this.props.tabIndex}
|
|
40
26
|
checked={this.props.isChecked}
|
|
41
27
|
id={this.props.id}
|
|
28
|
+
data-testid={this.props.dataTestId}
|
|
42
29
|
/>
|
|
43
|
-
<span className="form__checkbox-container"></span>
|
|
30
|
+
<span className="form__checkbox-container" data-testid={`${this.props.dataTestId}-chk-span`}></span>
|
|
44
31
|
<span className={`form__checkbox-label`}>{this.props.children}</span>
|
|
45
32
|
</label>
|
|
46
33
|
</>
|
package/src/Common/Constants.ts
CHANGED
|
@@ -14,6 +14,10 @@ export const PATTERNS = {
|
|
|
14
14
|
ALPHANUMERIC_WITH_SPECIAL_CHAR: /^[A-Za-z0-9._-]+$/, // allow alphanumeric,(.) ,(-),(_)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export const URLS = {
|
|
18
|
+
LOGIN_SSO: '/login/sso',
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
export const ROUTES = {
|
|
18
22
|
PROJECT_LIST_MIN: 'team/autocomplete',
|
|
19
23
|
}
|
|
@@ -42,4 +46,21 @@ export const ERROR_EMPTY_SCREEN = {
|
|
|
42
46
|
PAGE_NOT_FOUND: 'We could not find this page',
|
|
43
47
|
PAGE_NOT_EXIST: 'This page doesn’t exist or was removed. We suggest you go back to home',
|
|
44
48
|
TAKE_BACK_HOME: 'Take me home',
|
|
49
|
+
ONLY_FOR_SUPERADMIN: 'Information on this page is available only to superadmin users.',
|
|
50
|
+
NOT_AUTHORIZED: 'Not authorized',
|
|
51
|
+
UNAUTHORIZED: 'unauthorized',
|
|
52
|
+
FORBIDDEN: 'forbidden',
|
|
53
|
+
REQUIRED_MANAGER_ACCESS:
|
|
54
|
+
'Looks like you don’t have access to information on this page. Please contact your manager to request access.',
|
|
45
55
|
}
|
|
56
|
+
export const TOKEN_COOKIE_NAME = 'argocd.token'
|
|
57
|
+
export const TriggerTypeMap = {
|
|
58
|
+
automatic: 'Auto',
|
|
59
|
+
manual: 'Manual',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const BuildStageVariable = {
|
|
63
|
+
PreBuild: 'preBuildStage',
|
|
64
|
+
Build: 'buildStage',
|
|
65
|
+
PostBuild: 'postBuildStage',
|
|
66
|
+
}
|
|
@@ -14,6 +14,7 @@ export function ResizableTagTextArea({
|
|
|
14
14
|
tabIndex,
|
|
15
15
|
refVar,
|
|
16
16
|
dependentRef,
|
|
17
|
+
dataTestId,
|
|
17
18
|
}: ResizableTagTextAreaProps) {
|
|
18
19
|
const [text, setText] = useState('')
|
|
19
20
|
|
|
@@ -28,8 +29,8 @@ export function ResizableTagTextArea({
|
|
|
28
29
|
|
|
29
30
|
const reInitHeight = () => {
|
|
30
31
|
if (document.activeElement !== refVar.current) return
|
|
31
|
-
refVar.current.style.height = '
|
|
32
|
-
dependentRef.current.style.height = '
|
|
32
|
+
refVar.current.style.height = minHeight+ 'px'
|
|
33
|
+
dependentRef.current.style.height = minHeight+ 'px'
|
|
33
34
|
let nextHeight = refVar.current.scrollHeight
|
|
34
35
|
if (nextHeight < dependentRef.current.scrollHeight) {
|
|
35
36
|
nextHeight = dependentRef.current.scrollHeight
|
|
@@ -47,8 +48,8 @@ export function ResizableTagTextArea({
|
|
|
47
48
|
useThrottledEffect(reInitHeight, 500, [text])
|
|
48
49
|
|
|
49
50
|
const handleOnBlur = (event) => {
|
|
50
|
-
refVar.current.style.height = '
|
|
51
|
-
dependentRef.current.style.height = '
|
|
51
|
+
refVar.current.style.height = minHeight+ 'px'
|
|
52
|
+
dependentRef.current.style.height = minHeight+ 'px'
|
|
52
53
|
onBlur && onBlur(event)
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -69,6 +70,7 @@ export function ResizableTagTextArea({
|
|
|
69
70
|
onBlur={handleOnBlur}
|
|
70
71
|
onFocus={handleOnFocus}
|
|
71
72
|
tabIndex={tabIndex}
|
|
73
|
+
data-testid={dataTestId}
|
|
72
74
|
/>
|
|
73
75
|
)
|
|
74
76
|
}
|
|
@@ -5,6 +5,7 @@ import { TagLabelValueSelector } from './TagLabelValueSelector'
|
|
|
5
5
|
import { KEY_VALUE } from '../Constants'
|
|
6
6
|
import { stopPropagation } from '../Helper'
|
|
7
7
|
import { TagDetailType } from './Types'
|
|
8
|
+
import { ValidationRules } from './ValidationRules'
|
|
8
9
|
|
|
9
10
|
export const TagDetails = ({
|
|
10
11
|
index,
|
|
@@ -16,6 +17,7 @@ export const TagDetails = ({
|
|
|
16
17
|
}: TagDetailType) => {
|
|
17
18
|
const keyRef = useRef(null)
|
|
18
19
|
const valueRef = useRef(null)
|
|
20
|
+
const validationRules = new ValidationRules()
|
|
19
21
|
|
|
20
22
|
const deleteTag = (e): void => {
|
|
21
23
|
stopPropagation(e)
|
|
@@ -24,13 +26,24 @@ export const TagDetails = ({
|
|
|
24
26
|
const propagateTagToResource = (): void => {
|
|
25
27
|
const _tagData = { ...tagData }
|
|
26
28
|
_tagData.propagate = !_tagData.propagate
|
|
29
|
+
if (_tagData.propagate) {
|
|
30
|
+
_tagData.isInvalidKey = _tagData.isInvalidKey || !_tagData.key
|
|
31
|
+
_tagData.isInvalidValue = _tagData.isInvalidValue || !_tagData.value
|
|
32
|
+
} else {
|
|
33
|
+
_tagData.isInvalidKey =
|
|
34
|
+
_tagData.key || _tagData.value ? !validationRules.propagateTagKey(_tagData.key).isValid : false
|
|
35
|
+
_tagData.isInvalidValue = _tagData.value
|
|
36
|
+
? !validationRules.propagateTagValue(_tagData.value, _tagData.key).isValid
|
|
37
|
+
: false
|
|
38
|
+
}
|
|
27
39
|
setTagData(index, _tagData)
|
|
28
40
|
}
|
|
29
41
|
return (
|
|
30
42
|
<div className="flexbox mb-8">
|
|
31
43
|
<div
|
|
32
|
-
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''}`}
|
|
44
|
+
className={`dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ${tagData.propagate ? 'bcn-7' : ''} ${tagData.key.startsWith("devtron.ai/") ? 'cursor-not-allowed bcn-1' : ''}`}
|
|
33
45
|
onClick={propagateTagToResource}
|
|
46
|
+
data-testid={`propagate-tag-${index}`}
|
|
34
47
|
>
|
|
35
48
|
<InjectTag className={`icon-dim-20 mt-4 ${tagData.propagate ? 'scn-0' : ''}`} />
|
|
36
49
|
</div>
|
|
@@ -55,7 +68,7 @@ export const TagDetails = ({
|
|
|
55
68
|
refVar={valueRef}
|
|
56
69
|
dependentRef={keyRef}
|
|
57
70
|
/>
|
|
58
|
-
<div className="dc__border pl-4 pr-4 dc__right-radius-4 pointer flex top" onClick={deleteTag}>
|
|
71
|
+
<div className="dc__border pl-4 pr-4 dc__right-radius-4 pointer flex top" onClick={deleteTag} data-testid={`delete-tag-${index}`}>
|
|
59
72
|
<DeleteCross className="icon-dim-20 mt-4" />
|
|
60
73
|
</div>
|
|
61
74
|
</div>
|
|
@@ -13,7 +13,11 @@ export const TagLabelSelect = ({
|
|
|
13
13
|
}: TagLabelSelectType) => {
|
|
14
14
|
const setTagData = (index, tagValue): void => {
|
|
15
15
|
const _tags = [...labelTags]
|
|
16
|
-
|
|
16
|
+
const _tagValue = tagValue
|
|
17
|
+
if(_tagValue.key.startsWith("devtron.ai/")){
|
|
18
|
+
_tagValue.propagate = false
|
|
19
|
+
}
|
|
20
|
+
_tags[index] = _tagValue
|
|
17
21
|
setLabelTags(_tags)
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -36,10 +40,10 @@ export const TagLabelSelect = ({
|
|
|
36
40
|
<PropagateTagInfo isCreateApp={isCreateApp} />
|
|
37
41
|
</div>
|
|
38
42
|
<div>
|
|
39
|
-
<div className="dc_width-max-content cb-5 fw-6 fs-13 flexbox mr-20 mb-8 cursor" onClick={addNewTag}>
|
|
43
|
+
<div className="dc_width-max-content cb-5 fw-6 fs-13 flexbox mr-20 mb-8 cursor" onClick={addNewTag} data-testid="add-tag-button">
|
|
40
44
|
<Add className="icon-dim-20 fcb-5" /> Add tag
|
|
41
45
|
</div>
|
|
42
|
-
<div className="mb-8">
|
|
46
|
+
<div className="mb-8" data-testid="tag-rows-container">
|
|
43
47
|
{labelTags?.map((tagData, index) => (
|
|
44
48
|
<TagDetails
|
|
45
49
|
key={`tag-${index}`}
|