@devtron-labs/devtron-fe-common-lib 0.0.11 → 0.0.13
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/Common.service.d.ts +10 -1
- package/dist/Common/Constants.d.ts +2 -0
- package/dist/Common/ImageTags.Types.d.ts +39 -0
- package/dist/Common/ImageTags.d.ts +4 -0
- package/dist/Common/Policy.Types.d.ts +1 -0
- package/dist/Common/Types.d.ts +32 -24
- package/dist/Common/index.d.ts +2 -0
- package/dist/index.js +557 -113
- package/package.json +1 -1
- package/src/Assets/Icon/ic-arrow-counter-clockwise.svg +5 -0
- package/src/Assets/Icon/ic-enter.svg +3 -0
- package/src/Assets/Icon/ic-error-exclamation.svg +6 -0
- package/src/Assets/Icon/ic-minus.svg +3 -0
- package/src/Assets/Icon/ic-pencil.svg +3 -0
- package/src/Common/Common.service.ts +18 -3
- package/src/Common/Constants.ts +2 -0
- package/src/Common/ImageTags.Types.ts +43 -0
- package/src/Common/ImageTags.tsx +585 -0
- package/src/Common/Policy.Types.ts +1 -0
- package/src/Common/RadioGroup/RadioGroup.tsx +23 -6
- package/src/Common/Types.ts +38 -26
- package/src/Common/index.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.74216 4.67419H1.49216V2.42419" fill="#767D84"/>
|
|
3
|
+
<path d="M3.74216 4.67419H1.49216V2.42419" stroke="#596168" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M3.08318 8.91682C3.66007 9.49371 4.39507 9.88658 5.19525 10.0457C5.99542 10.2049 6.82482 10.1232 7.57856 9.811C8.33231 9.49879 8.97654 8.97008 9.42981 8.29173C9.88307 7.61338 10.125 6.81585 10.125 6C10.125 5.18415 9.88307 4.38663 9.42981 3.70827C8.97654 3.02992 8.33231 2.50121 7.57856 2.189C6.82482 1.87679 5.99542 1.7951 5.19525 1.95426C4.39507 2.11343 3.66007 2.50629 3.08318 3.08319L1.49219 4.67418" stroke="#596168" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12.6667 4C12.4899 4 12.3203 4.07024 12.1953 4.19526C12.0703 4.32029 12.0001 4.48986 12.0001 4.66667V7.33333C12.0001 7.51014 11.9298 7.67971 11.8048 7.80474C11.6798 7.92976 11.5102 8 11.3334 8H4.94005L5.80672 7.14C5.93226 7.01446 6.00278 6.8442 6.00278 6.66667C6.00278 6.48913 5.93226 6.31887 5.80672 6.19333C5.68118 6.0678 5.51092 5.99727 5.33339 5.99727C5.15585 5.99727 4.98559 6.0678 4.86005 6.19333L2.86005 8.19333C2.79936 8.25674 2.75178 8.3315 2.72005 8.41333C2.65337 8.57564 2.65337 8.75769 2.72005 8.92C2.75178 9.00183 2.79936 9.0766 2.86005 9.14L4.86005 11.14C4.92203 11.2025 4.99576 11.2521 5.077 11.2859C5.15824 11.3198 5.24538 11.3372 5.33339 11.3372C5.42139 11.3372 5.50853 11.3198 5.58977 11.2859C5.67101 11.2521 5.74474 11.2025 5.80672 11.14C5.86921 11.078 5.9188 11.0043 5.95265 10.9231C5.98649 10.8418 6.00392 10.7547 6.00392 10.6667C6.00392 10.5787 5.98649 10.4915 5.95265 10.4103C5.9188 10.329 5.86921 10.2553 5.80672 10.1933L4.94005 9.33333H11.3334C11.8638 9.33333 12.3725 9.12262 12.7476 8.74755C13.1227 8.37247 13.3334 7.86377 13.3334 7.33333V4.66667C13.3334 4.48986 13.2631 4.32029 13.1381 4.19526C13.0131 4.07024 12.8435 4 12.6667 4Z" fill="#3B444C"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<path fill="#FFF" d="M5 5H15V15H5z"/>
|
|
4
|
+
<path fill="#F33E3E" d="M10 18.333c-4.6 0-8.333-3.733-8.333-8.333S5.4 1.667 10 1.667 18.333 5.4 18.333 10 14.6 18.333 10 18.333zm0-12.5c-.46 0-.833.373-.833.834V10c0 .46.373.833.833.833.46 0 .833-.373.833-.833V6.667c0-.46-.373-.834-.833-.834zm0 6.667c-.46 0-.833.373-.833.833 0 .46.373.834.833.834.46 0 .833-.373.833-.834 0-.46-.373-.833-.833-.833z"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
|
|
2
|
+
<path fill="#959BA1" class="fill-color" fill-rule="evenodd" d="M10.5 7.583h-7c-.322 0-.583-.26-.583-.583 0-.322.26-.583.583-.583h7c.322 0 .583.26.583.583 0 .322-.26.583-.583.583z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M10.625 4.99991L15 9.37491M7.5 16.8749H3.75C3.58424 16.8749 3.42527 16.8091 3.30806 16.6918C3.19085 16.5746 3.125 16.4157 3.125 16.2499V12.7588C3.125 12.6767 3.14117 12.5954 3.17258 12.5196C3.20398 12.4438 3.25002 12.3749 3.30806 12.3168L12.6831 2.94185C12.8003 2.82464 12.9592 2.75879 13.125 2.75879C13.2908 2.75879 13.4497 2.82464 13.5669 2.94185L17.0581 6.43296C17.1753 6.55017 17.2411 6.70915 17.2411 6.87491C17.2411 7.04067 17.1753 7.19964 17.0581 7.31685L7.5 16.8749Z" stroke="#596168" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {get, post} from './Api';
|
|
2
2
|
import { ROUTES } from './Constants'
|
|
3
3
|
import { sortCallback } from './Helper';
|
|
4
|
-
import { TeamList } from './Types';
|
|
4
|
+
import { TeamList ,ResponseType } from './Types';
|
|
5
5
|
|
|
6
6
|
export const getTeamListMin = (): Promise<TeamList> => {
|
|
7
7
|
// ignore active field
|
|
@@ -20,4 +20,19 @@ export const getTeamListMin = (): Promise<TeamList> => {
|
|
|
20
20
|
result: list,
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
|
-
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface UserRole extends ResponseType {
|
|
26
|
+
result?: {
|
|
27
|
+
roles: string[]
|
|
28
|
+
superAdmin: boolean
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getUserRole(appName?: string): Promise<UserRole> {
|
|
33
|
+
return get(`${ROUTES.USER_CHECK_ROLE}${appName ? `?appName=${appName}` : ''}`)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function setImageTags(request, pipelineId: number, artifactId: number){
|
|
37
|
+
return post(`${ROUTES.IMAGE_TAGGING}/${pipelineId}/${artifactId}`,request )
|
|
38
|
+
}
|
package/src/Common/Constants.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ReleaseTag {
|
|
2
|
+
id: number
|
|
3
|
+
tagName: string
|
|
4
|
+
appId: number
|
|
5
|
+
deleted: boolean
|
|
6
|
+
artifactId: number
|
|
7
|
+
duplicateTag: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ImageComment {
|
|
11
|
+
id: number
|
|
12
|
+
comment: string
|
|
13
|
+
artifactId: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export interface ImageTaggingContainerType {
|
|
18
|
+
ciPipelineId?: number
|
|
19
|
+
artifactId?: number
|
|
20
|
+
imageComment?: ImageComment
|
|
21
|
+
imageReleaseTags?: ReleaseTag[]
|
|
22
|
+
updateCurrentAppMaterial? : (matId:number, releaseTags?:ReleaseTag[], imageComment?:ImageComment) => void
|
|
23
|
+
appReleaseTagNames?: string[]
|
|
24
|
+
tagsEditable?: boolean
|
|
25
|
+
forceReInit?: boolean
|
|
26
|
+
setAppReleaseTagNames?: (appReleaseTags: string[]) => void
|
|
27
|
+
setTagsEditable?: (tagsEditable: boolean) => void
|
|
28
|
+
toggleCardMode?: (id: number) => void
|
|
29
|
+
hideHardDelete?: boolean
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ImageButtonType {
|
|
33
|
+
text: string
|
|
34
|
+
isSoftDeleted: boolean
|
|
35
|
+
isEditing: boolean
|
|
36
|
+
onSoftDeleteClick?: any
|
|
37
|
+
onHardDeleteClick?: any
|
|
38
|
+
tagId: number
|
|
39
|
+
softDeleteTags: any
|
|
40
|
+
isSuperAdmin: any
|
|
41
|
+
duplicateTag?: boolean
|
|
42
|
+
hideHardDelete?: boolean
|
|
43
|
+
}
|