@devtron-labs/devtron-fe-common-lib 1.2.5-beta-8 → 1.2.5-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/{@code-editor-DWIb_Iyh.js → @code-editor-MY03NTMb.js} +6192 -5853
- package/dist/{@common-rjsf-U4GTT51r.js → @common-rjsf-DMi1V3Rm.js} +2 -2
- package/dist/{@framer-motion-DHY98qq3.js → @framer-motion-ttHHVvcU.js} +1 -1
- package/dist/{@react-dates-WNnwjI5S.js → @react-dates-BYL_9BKq.js} +20 -20
- package/dist/{@react-select-BbR996pa.js → @react-select-C2X4wjQ5.js} +1 -1
- package/dist/{@vendor-RU8AW1bK.js → @vendor-qw62fvSw.js} +3909 -3948
- package/dist/Common/Common.service.d.ts +1 -2
- package/dist/Common/Constants.d.ts +1 -0
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +20 -15
- package/dist/Common/Helper.d.ts +1 -1
- package/dist/Common/Types.d.ts +40 -49
- package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +2 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/constants.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/types.d.ts +162 -0
- package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
- package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/types.d.ts +6 -34
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
- package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
- package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
- package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/Helpers.d.ts +3 -4
- package/dist/Shared/Services/app.types.d.ts +1 -2
- package/dist/Shared/constants.d.ts +0 -7
- package/dist/Shared/types.d.ts +5 -17
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-clear-square.e60de021.svg +1 -0
- package/dist/index.js +435 -438
- package/package.json +2 -2
- /package/dist/assets/{ic-arrow-square-out.3d1a0d41.svg → ic-arrow-square-out.1be837ac.svg} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { RuntimeParamsAPIResponseType, RuntimeParamsListItemType } from '../Shared/types';
|
2
|
-
import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse
|
2
|
+
import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse } from './Types';
|
3
3
|
import { ApiResourceType } from '../Pages';
|
4
4
|
export declare const getTeamListMin: () => Promise<TeamList>;
|
5
5
|
interface UserRole extends ResponseType {
|
@@ -15,7 +15,6 @@ export declare const SourceTypeMap: {
|
|
15
15
|
};
|
16
16
|
export declare function getUserRole(appName?: string): Promise<UserRole>;
|
17
17
|
export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
|
18
|
-
export declare const sanitizeUserApprovalMetadata: (userApprovalMetadata: UserApprovalMetadataType) => UserApprovalMetadataType;
|
19
18
|
export declare const parseRuntimeParams: (response: RuntimeParamsAPIResponseType) => RuntimeParamsListItemType[];
|
20
19
|
export declare const processCDMaterialServiceResponse: (cdMaterialsResult: any, stage: DeploymentNodeType, offset: number, filter: CDMaterialFilterQuery, disableDefaultSelection?: boolean) => CDMaterialResponseType;
|
21
20
|
export declare const genericCDMaterialsService: (serviceType: CDMaterialServiceEnum, cdMaterialID: number, stage: DeploymentNodeType, signal: AbortSignal, queryParams?: CDMaterialServiceQueryParams) => Promise<CDMaterialResponseType>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { ResizableTagTextAreaProps } from './Types';
|
2
|
-
export declare const ResizableTagTextArea: ({
|
2
|
+
export declare const ResizableTagTextArea: ({ value, minHeight, maxHeight, onBlur, onFocus, refVar, dependentRef, dependentRefs, className, disableOnBlurResizeToMinHeight, id, ...restProps }: ResizableTagTextAreaProps) => JSX.Element;
|
@@ -1,9 +1,20 @@
|
|
1
|
+
import { DetailedHTMLProps, MutableRefObject, TextareaHTMLAttributes } from 'react';
|
1
2
|
import { KEY_VALUE } from '../Constants';
|
2
3
|
import { OptionType } from '../Types';
|
3
4
|
export interface SuggestedTagOptionType extends OptionType {
|
4
5
|
description: string;
|
5
6
|
propagate: boolean;
|
6
7
|
}
|
8
|
+
export declare enum DeploymentPolicy {
|
9
|
+
ALLOW = "allow",
|
10
|
+
BLOCK = "block",
|
11
|
+
BLOCK_PROD = "block-prod",
|
12
|
+
BLOCK_NON_PROD = "block-non-prod"
|
13
|
+
}
|
14
|
+
export interface VariableValueConstraintTypes {
|
15
|
+
choices?: string[];
|
16
|
+
blockCustomValue?: boolean;
|
17
|
+
}
|
7
18
|
export interface TagType {
|
8
19
|
id?: number;
|
9
20
|
key: string;
|
@@ -15,6 +26,8 @@ export interface TagType {
|
|
15
26
|
isInvalidValue?: boolean;
|
16
27
|
isSuggested?: boolean;
|
17
28
|
isPropagateDisabled?: boolean;
|
29
|
+
deploymentPolicy?: DeploymentPolicy;
|
30
|
+
valueConstraint?: VariableValueConstraintTypes;
|
18
31
|
}
|
19
32
|
export interface TagErrorType {
|
20
33
|
isValid: boolean;
|
@@ -48,24 +61,16 @@ export interface TagLabelValueSelectorType {
|
|
48
61
|
tagInputType?: KEY_VALUE;
|
49
62
|
placeholder?: string;
|
50
63
|
tabIndex?: number;
|
51
|
-
refVar?:
|
52
|
-
dependentRef?:
|
64
|
+
refVar?: MutableRefObject<HTMLTextAreaElement>;
|
65
|
+
dependentRef?: MutableRefObject<HTMLTextAreaElement>;
|
53
66
|
noBackDrop?: boolean;
|
54
67
|
}
|
55
|
-
export interface ResizableTagTextAreaProps {
|
56
|
-
className?: string;
|
68
|
+
export interface ResizableTagTextAreaProps extends Omit<DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value'> {
|
57
69
|
minHeight?: number;
|
58
70
|
maxHeight?: number;
|
59
|
-
value
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
placeholder?: string;
|
64
|
-
tabIndex?: number;
|
65
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
66
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
67
|
-
dataTestId?: string;
|
68
|
-
handleKeyDown?: any;
|
69
|
-
disabled?: boolean;
|
71
|
+
value: string;
|
72
|
+
refVar?: MutableRefObject<HTMLTextAreaElement>;
|
73
|
+
dependentRef?: MutableRefObject<HTMLTextAreaElement>;
|
74
|
+
dependentRefs?: Record<string | number, MutableRefObject<HTMLTextAreaElement>>;
|
70
75
|
disableOnBlurResizeToMinHeight?: boolean;
|
71
76
|
}
|
package/dist/Common/Helper.d.ts
CHANGED
@@ -9,7 +9,7 @@ interface ConditionalWrapper<T> {
|
|
9
9
|
children: T;
|
10
10
|
}
|
11
11
|
export declare const ConditionalWrap: React.FC<ConditionalWrapper<any>>;
|
12
|
-
export declare function sortCallback(key: string, a: any, b: any, isCaseSensitive?: boolean):
|
12
|
+
export declare function sortCallback(key: string, a: any, b: any, isCaseSensitive?: boolean): 0 | 1 | -1;
|
13
13
|
export declare const stopPropagation: (event: any) => void;
|
14
14
|
export declare const preventDefault: (event: SyntheticEvent) => void;
|
15
15
|
export declare function useThrottledEffect(callback: any, delay: any, deps?: any[]): void;
|
package/dist/Common/Types.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { default as React, ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
|
2
2
|
import { TippyProps } from '@tippyjs/react';
|
3
|
+
import { Placement } from 'tippy.js';
|
3
4
|
import { UserGroupDTO } from '../Pages/GlobalConfigurations';
|
4
5
|
import { ImageComment, ReleaseTag } from './ImageTags.Types';
|
5
6
|
import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
|
@@ -73,7 +74,7 @@ export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
|
|
73
74
|
noHeadingBorder?: boolean;
|
74
75
|
infoTextHeading?: string;
|
75
76
|
hideHeading?: boolean;
|
76
|
-
placement?:
|
77
|
+
placement?: Placement;
|
77
78
|
className?: string;
|
78
79
|
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
79
80
|
iconPath?: string;
|
@@ -273,6 +274,21 @@ export declare enum ManualApprovalType {
|
|
273
274
|
any = "ANY",
|
274
275
|
notConfigured = "NOT_CONFIGURED"
|
275
276
|
}
|
277
|
+
export interface UserGroupApproverType {
|
278
|
+
email: string;
|
279
|
+
hasAccess: boolean;
|
280
|
+
}
|
281
|
+
export interface ImageApprovalPolicyUserGroupDataType {
|
282
|
+
dataStore: Record<string, UserGroupApproverType>;
|
283
|
+
requiredCount: number;
|
284
|
+
emails: string[];
|
285
|
+
}
|
286
|
+
export interface ImageApprovalPolicyType {
|
287
|
+
isPolicyConfigured: boolean;
|
288
|
+
specificUsersData: ImageApprovalPolicyUserGroupDataType;
|
289
|
+
userGroupData: Record<string, ImageApprovalPolicyUserGroupDataType>;
|
290
|
+
validGroups: string[];
|
291
|
+
}
|
276
292
|
export type ImageApprovalUsersInfoDTO = Record<string, Pick<UserGroupDTO, 'identifier' | 'name'>[]>;
|
277
293
|
export interface UserApprovalConfigType {
|
278
294
|
type: ManualApprovalType;
|
@@ -285,6 +301,13 @@ export interface UserApprovalConfigType {
|
|
285
301
|
requiredCount: number;
|
286
302
|
})[];
|
287
303
|
}
|
304
|
+
export type UserApprovalConfigPayloadType = ({
|
305
|
+
type: ManualApprovalType.any;
|
306
|
+
} & Pick<UserApprovalConfigType, 'requiredCount'>) | ({
|
307
|
+
type: ManualApprovalType.specific;
|
308
|
+
} & Pick<UserApprovalConfigType, 'userGroups' | 'specificUsers'>) | {
|
309
|
+
type: ManualApprovalType.notConfigured;
|
310
|
+
};
|
288
311
|
interface ApprovalUserDataType {
|
289
312
|
dataId: number;
|
290
313
|
userActionTime: string;
|
@@ -294,45 +317,12 @@ interface ApprovalUserDataType {
|
|
294
317
|
userResponse: number;
|
295
318
|
userGroups?: Pick<UserGroupDTO, 'identifier' | 'name'>[];
|
296
319
|
}
|
297
|
-
export interface UserApprovalInfo {
|
298
|
-
requiredCount: number;
|
299
|
-
currentCount: number;
|
300
|
-
approverList: {
|
301
|
-
hasApproved: boolean;
|
302
|
-
canApprove: boolean;
|
303
|
-
identifier: string;
|
304
|
-
}[];
|
305
|
-
}
|
306
|
-
export declare enum ApprovalConfigDataKindType {
|
307
|
-
configMap = "configuration/config-map",
|
308
|
-
configSecret = "configuration/config-secret",
|
309
|
-
deploymentTemplate = "configuration/deployment-template",
|
310
|
-
deploymentTrigger = "approval/deployment"
|
311
|
-
}
|
312
|
-
export interface ApprovalConfigDataType extends Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> {
|
313
|
-
kind: ApprovalConfigDataKindType | null;
|
314
|
-
anyUserApprovedInfo: UserApprovalInfo;
|
315
|
-
specificUsersApprovedInfo: UserApprovalInfo;
|
316
|
-
userGroupsApprovedInfo: Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> & {
|
317
|
-
userGroups: (UserApprovalInfo & {
|
318
|
-
groupIdentifier: UserGroupDTO['identifier'];
|
319
|
-
groupName: UserGroupDTO['name'];
|
320
|
-
})[];
|
321
|
-
};
|
322
|
-
}
|
323
|
-
export declare enum ApprovalRuntimeStateType {
|
324
|
-
init = 0,
|
325
|
-
requested = 1,
|
326
|
-
approved = 2,
|
327
|
-
consumed = 3
|
328
|
-
}
|
329
320
|
export interface UserApprovalMetadataType {
|
330
321
|
approvalRequestId: number;
|
331
|
-
approvalRuntimeState:
|
322
|
+
approvalRuntimeState: number;
|
323
|
+
approvedUsersData: ApprovalUserDataType[];
|
332
324
|
requestedUserData: ApprovalUserDataType;
|
333
|
-
|
334
|
-
canCurrentUserApprove: boolean;
|
335
|
-
approvalConfigData: ApprovalConfigDataType;
|
325
|
+
approvalConfig?: UserApprovalConfigType;
|
336
326
|
}
|
337
327
|
export declare enum FilterStates {
|
338
328
|
ALLOWED = 0,
|
@@ -389,6 +379,7 @@ export interface CDMaterialListModalServiceUtilProps {
|
|
389
379
|
artifactId?: number;
|
390
380
|
artifactStatus?: string;
|
391
381
|
disableDefaultSelection?: boolean;
|
382
|
+
userApprovalConfig?: UserApprovalConfigType;
|
392
383
|
}
|
393
384
|
export interface CDMaterialType {
|
394
385
|
index: number;
|
@@ -524,7 +515,8 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
|
|
524
515
|
primaryBranchAfterRegex?: string;
|
525
516
|
storageConfigured?: boolean;
|
526
517
|
deploymentAppDeleteRequest?: boolean;
|
527
|
-
|
518
|
+
approvalUsers?: string[];
|
519
|
+
userApprovalConfig?: UserApprovalConfigType;
|
528
520
|
requestedUserId?: number;
|
529
521
|
showPluginWarning: boolean;
|
530
522
|
helmPackageName?: string;
|
@@ -581,17 +573,14 @@ export interface FilterConditionsListType {
|
|
581
573
|
description: string;
|
582
574
|
conditions: FilterConditionsInfo[];
|
583
575
|
}
|
584
|
-
export interface DeploymentApprovalInfoType {
|
585
|
-
eligibleApprovers: {
|
586
|
-
specificUsers: Pick<UserApprovalInfo, 'approverList'>;
|
587
|
-
anyUsers: Pick<UserApprovalInfo, 'approverList'>;
|
588
|
-
userGroups: (Pick<ApprovalConfigDataType['userGroupsApprovedInfo']['userGroups'][number], 'groupIdentifier' | 'groupName'> & Pick<UserApprovalInfo, 'approverList'>)[];
|
589
|
-
};
|
590
|
-
approvalConfigData: ApprovalConfigDataType;
|
591
|
-
}
|
592
576
|
export interface CDMaterialsApprovalInfo {
|
577
|
+
approvalUsers: string[];
|
578
|
+
userApprovalConfig: UserApprovalConfigType;
|
593
579
|
canApproverDeploy: boolean;
|
594
|
-
|
580
|
+
/**
|
581
|
+
* Only available incase of approvals do'nt use in cd materials or any other flow since approvalUsers are not present there
|
582
|
+
*/
|
583
|
+
imageApprovalPolicyDetails: ImageApprovalPolicyType;
|
595
584
|
}
|
596
585
|
export interface CDMaterialsMetaInfo {
|
597
586
|
tagsEditable: boolean;
|
@@ -670,6 +659,7 @@ export interface AppEnvironment {
|
|
670
659
|
appStatus?: string;
|
671
660
|
deploymentAppDeleteRequest?: boolean;
|
672
661
|
isVirtualEnvironment?: boolean;
|
662
|
+
isProtected?: boolean;
|
673
663
|
pipelineId?: number;
|
674
664
|
latestCdWorkflowRunnerId?: number;
|
675
665
|
commits?: string[];
|
@@ -720,6 +710,7 @@ export interface CdPipeline {
|
|
720
710
|
parentPipelineType?: string;
|
721
711
|
deploymentAppDeleteRequest?: boolean;
|
722
712
|
deploymentAppCreated?: boolean;
|
713
|
+
userApprovalConfig?: UserApprovalConfigType;
|
723
714
|
isVirtualEnvironment?: boolean;
|
724
715
|
deploymentAppType: DeploymentAppTypes;
|
725
716
|
helmPackageName?: string;
|
@@ -728,7 +719,6 @@ export interface CdPipeline {
|
|
728
719
|
isProdEnv?: boolean;
|
729
720
|
isGitOpsRepoNotConfigured?: boolean;
|
730
721
|
isDeploymentBlocked?: boolean;
|
731
|
-
approvalConfigData: ApprovalConfigDataType;
|
732
722
|
}
|
733
723
|
export interface ExternalCiConfig {
|
734
724
|
id: number;
|
@@ -830,11 +820,12 @@ export interface Point {
|
|
830
820
|
export interface EdgeNodeType {
|
831
821
|
height: number;
|
832
822
|
width: number;
|
823
|
+
userApprovalConfig?: UserApprovalConfigType;
|
833
824
|
type?: any;
|
834
825
|
id?: number | string;
|
835
826
|
}
|
836
827
|
export interface EdgeEndNodeType extends EdgeNodeType {
|
837
|
-
|
828
|
+
userApprovalConfig?: UserApprovalConfigType;
|
838
829
|
}
|
839
830
|
/**
|
840
831
|
* Search params for sorting configuration
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BuildStageType, FormType } from '../../../../../Common/CIPipeline.Types';
|
2
|
-
import { DeploymentAppTypes } from '../../../../../Common/Types';
|
2
|
+
import { DeploymentAppTypes, UserApprovalConfigType } from '../../../../../Common/Types';
|
3
3
|
import { DeploymentStrategy } from '../../../../../Shared/Components';
|
4
4
|
import { EnvListMinDTO } from '../../../../../Shared/types';
|
5
5
|
interface ConfigSecretType {
|
@@ -53,6 +53,7 @@ export interface CDFormType {
|
|
53
53
|
secrets: ConfigSecretType[];
|
54
54
|
};
|
55
55
|
requiredApprovals: string;
|
56
|
+
userApprovalConfig?: UserApprovalConfigType;
|
56
57
|
isClusterCdActive: boolean;
|
57
58
|
deploymentAppCreated: boolean;
|
58
59
|
clusterId: string;
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { DynamicDataTableHeaderProps } from './types';
|
2
|
+
export declare const DynamicDataTableHeader: <K extends string>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K>) => JSX.Element;
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { DynamicDataTableRowProps } from './types';
|
2
|
+
export declare const DynamicDataTableRow: <K extends string>({ rows, headers, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K>) => JSX.Element;
|
@@ -0,0 +1,162 @@
|
|
1
|
+
import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
|
2
|
+
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
|
+
import { InfoIconTippyProps } from '../../../Common/Types';
|
4
|
+
import { UseStateFiltersReturnType } from '../../../Common/Hooks';
|
5
|
+
import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
|
6
|
+
import { SelectTextAreaProps } from '../SelectTextArea';
|
7
|
+
/**
|
8
|
+
* Interface representing header for a dynamic data table.
|
9
|
+
* @template K - A string representing the key type.
|
10
|
+
*/
|
11
|
+
export type DynamicDataTableHeaderType<K extends string> = {
|
12
|
+
/** The display label of the header, shown in the table's column header. */
|
13
|
+
label: string;
|
14
|
+
/** The unique key associated with the header, used to map the column to data fields. */
|
15
|
+
key: K;
|
16
|
+
/** The width of the column, defined as a CSS string (e.g., "100px", "10%", "1fr", or "auto"). */
|
17
|
+
width: string;
|
18
|
+
/** An optional boolean indicating whether the column is sortable. */
|
19
|
+
isSortable?: boolean;
|
20
|
+
/** An optional boolean to control the visibility of the column. */
|
21
|
+
isHidden?: boolean;
|
22
|
+
/** An optional boolean to show the column */
|
23
|
+
renderAdditionalContent?: () => ReactNode;
|
24
|
+
};
|
25
|
+
export declare enum DynamicDataTableRowDataType {
|
26
|
+
TEXT = "text",
|
27
|
+
DROPDOWN = "dropdown",
|
28
|
+
SELECT_TEXT = "select-text",
|
29
|
+
BUTTON = "button"
|
30
|
+
}
|
31
|
+
export type DynamicDataTableCellPropsMap = {
|
32
|
+
[DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'id' | 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
|
33
|
+
[DynamicDataTableRowDataType.DROPDOWN]: Omit<SelectPickerProps<string, false>, 'inputId' | 'value' | 'onChange' | 'fullWidth' | 'isDisabled'>;
|
34
|
+
[DynamicDataTableRowDataType.SELECT_TEXT]: Omit<SelectTextAreaProps, 'value' | 'onChange' | 'inputId' | 'isDisabled' | 'dependentRef' | 'refVar' | 'textAreaProps'> & {
|
35
|
+
textAreaProps?: Omit<SelectTextAreaProps['textAreaProps'], 'className' | 'disableOnBlurResizeToMinHeight' | 'minHeight' | 'maxHeight'>;
|
36
|
+
};
|
37
|
+
[DynamicDataTableRowDataType.BUTTON]: Pick<DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'onClick'> & {
|
38
|
+
icon?: ReactNode;
|
39
|
+
text: string;
|
40
|
+
};
|
41
|
+
};
|
42
|
+
type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
|
43
|
+
type: T;
|
44
|
+
props: DynamicDataTableCellPropsMap[T];
|
45
|
+
} : never;
|
46
|
+
/**
|
47
|
+
* Type representing a key-value row.
|
48
|
+
* @template K - A string representing the key type.
|
49
|
+
*/
|
50
|
+
export type DynamicDataTableRowType<K extends string, CustomStateType = Record<string, unknown>> = {
|
51
|
+
data: {
|
52
|
+
[key in K]: {
|
53
|
+
value: string;
|
54
|
+
disabled?: boolean;
|
55
|
+
/** An optional boolean indicating if an asterisk should be shown. */
|
56
|
+
required?: boolean;
|
57
|
+
} & DynamicDataTableCellData;
|
58
|
+
};
|
59
|
+
id: string | number;
|
60
|
+
/** */
|
61
|
+
customState?: CustomStateType;
|
62
|
+
/** An optional boolean indicating if row deletion is disabled. */
|
63
|
+
disableDelete?: boolean;
|
64
|
+
};
|
65
|
+
/**
|
66
|
+
* Represents the validation state of a cell in a dynamic data table.
|
67
|
+
*/
|
68
|
+
export type DynamicDataTableCellValidationState = {
|
69
|
+
isValid: boolean;
|
70
|
+
errorMessages: string[];
|
71
|
+
};
|
72
|
+
/**
|
73
|
+
* Defines the structure of validation errors for a cell.
|
74
|
+
*
|
75
|
+
* `K` represents the column `key` of the cell (i.e., the column identifiers).
|
76
|
+
*/
|
77
|
+
export type DynamicDataTableCellErrorType<K extends string> = {
|
78
|
+
[rowId: string | number]: Partial<Record<K, DynamicDataTableCellValidationState>>;
|
79
|
+
};
|
80
|
+
type DynamicDataTableCellIcon<K extends string> = {
|
81
|
+
[key in K]?: (row: DynamicDataTableRowType<K>) => ReactNode;
|
82
|
+
};
|
83
|
+
/**
|
84
|
+
* Interface representing the properties for the dynamic data table component.
|
85
|
+
* @template K - A string representing the key type.
|
86
|
+
*/
|
87
|
+
export type DynamicDataTableProps<K extends string> = {
|
88
|
+
/**
|
89
|
+
* An array containing the headers for the data table. \
|
90
|
+
* Each header defines a column with its label, key, width, and optional settings.
|
91
|
+
*/
|
92
|
+
headers: DynamicDataTableHeaderType<K>[];
|
93
|
+
/**
|
94
|
+
* An array of rows where each row contains data corresponding to the table headers.
|
95
|
+
*/
|
96
|
+
rows: DynamicDataTableRowType<K>[];
|
97
|
+
/** Optional configuration for sorting the table. */
|
98
|
+
sortingConfig?: Pick<UseStateFiltersReturnType<K>, 'sortBy' | 'sortOrder' | 'handleSorting'>;
|
99
|
+
/** Optional configuration for displaying an icon in the leading position of a cell. */
|
100
|
+
leadingCellIcon?: DynamicDataTableCellIcon<K>;
|
101
|
+
/** Optional configuration for displaying an icon in the trailing position of a cell. */
|
102
|
+
trailingCellIcon?: DynamicDataTableCellIcon<K>;
|
103
|
+
/** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
|
104
|
+
buttonCellWrapComponent?: (row: DynamicDataTableRowType<K>) => ReactElement;
|
105
|
+
/** An optional React node for a custom header component. */
|
106
|
+
headerComponent?: ReactNode;
|
107
|
+
/** When true, data addition field will not be shown. */
|
108
|
+
isAdditionNotAllowed?: boolean;
|
109
|
+
/** When true, data addition field will not be shown. */
|
110
|
+
isDeletionNotAllowed?: boolean;
|
111
|
+
/** When true, data add or update is disabled. */
|
112
|
+
readOnly?: boolean;
|
113
|
+
/** Function to handle the addition of a new row to the table. */
|
114
|
+
onRowAdd: () => void;
|
115
|
+
/**
|
116
|
+
* Function to handle changes in the table rows.
|
117
|
+
* @param row - The row that changed.
|
118
|
+
* @param headerKey - The key of the header that changed.
|
119
|
+
* @param value - The value of the cell.
|
120
|
+
* @param extraData - Additional data, such as a selected value for dropdowns.
|
121
|
+
*/
|
122
|
+
onRowEdit: (row: DynamicDataTableRowType<K>, headerKey: K, value: string, extraData: {
|
123
|
+
selectedValue?: SelectPickerOptionType<string>;
|
124
|
+
}) => void;
|
125
|
+
/**
|
126
|
+
* Function to handle row deletions.
|
127
|
+
* @param row - The row that was deleted.
|
128
|
+
*/
|
129
|
+
onRowDelete: (row: DynamicDataTableRowType<K>) => void;
|
130
|
+
/** Optional configuration for rendering a custom action button in a row. */
|
131
|
+
actionButtonConfig?: {
|
132
|
+
/**
|
133
|
+
* Function to render the action button.
|
134
|
+
* @param row - The current row being rendered.
|
135
|
+
* @returns A React node representing the action button.
|
136
|
+
*/
|
137
|
+
renderer: (row: DynamicDataTableRowType<K>) => ReactNode;
|
138
|
+
/**
|
139
|
+
* This represents under which header key the action button will be rendered.
|
140
|
+
*/
|
141
|
+
key: K;
|
142
|
+
/**
|
143
|
+
* The width of the action button.
|
144
|
+
* @default '33px'
|
145
|
+
*/
|
146
|
+
width?: string;
|
147
|
+
/**
|
148
|
+
* The position of the action button under the header key.
|
149
|
+
* @default 'start'
|
150
|
+
*/
|
151
|
+
position?: 'start' | 'end';
|
152
|
+
};
|
153
|
+
/**
|
154
|
+
* Validation state for a specific cell in a dynamic data table.
|
155
|
+
*/
|
156
|
+
cellError?: DynamicDataTableCellErrorType<K>;
|
157
|
+
};
|
158
|
+
export interface DynamicDataTableHeaderProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'>, Pick<InfoIconTippyProps, 'heading' | 'additionalContent'> {
|
159
|
+
}
|
160
|
+
export interface DynamicDataTableRowProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
|
161
|
+
}
|
162
|
+
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { DynamicDataTableHeaderType, DynamicDataTableProps, DynamicDataTableRowDataType } from './types';
|
2
|
+
export declare const getActionButtonPosition: <K extends string>({ headers, actionButtonConfig, }: Pick<DynamicDataTableProps<K>, "headers" | "actionButtonConfig">) => number;
|
3
|
+
export declare const getHeaderGridTemplateColumn: <K extends string>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K>["actionButtonConfig"], noDeleteBtn: boolean) => string;
|
4
|
+
export declare const getRowGridTemplateColumn: <K extends string>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K>["actionButtonConfig"], noDeleteBtn: boolean) => string;
|
5
|
+
export declare const rowTypeHasInputField: (type: DynamicDataTableRowDataType) => boolean;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { FeatureDescriptionModalProps } from './types';
|
2
|
-
export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles,
|
2
|
+
export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, }: FeatureDescriptionModalProps) => JSX.Element;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { DescriptorProps } from './types';
|
2
|
-
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, showInfoIconTippy, docLinkText, dataTestId, additionalContent, showInfoIcon,
|
2
|
+
declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, showInfoIconTippy, docLinkText, dataTestId, additionalContent, showInfoIcon, }: DescriptorProps) => JSX.Element;
|
3
3
|
export default FeatureTitleWithInfo;
|
@@ -1,44 +1,17 @@
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
2
2
|
import { ImageType } from '../../../Common';
|
3
3
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
4
|
-
interface
|
4
|
+
export interface FeatureDescriptionModalProps {
|
5
|
+
title: string;
|
5
6
|
renderDescriptionContent?: () => ReactNode;
|
7
|
+
closeModalText?: string;
|
6
8
|
docLink?: string;
|
9
|
+
closeModal?: () => void;
|
7
10
|
imageVariant?: ImageType;
|
8
11
|
SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
9
12
|
imageStyles?: React.CSSProperties;
|
10
13
|
}
|
11
|
-
|
12
|
-
/**
|
13
|
-
* If provided, tabs are shown and have higher precedence over normal modal
|
14
|
-
*/
|
15
|
-
tabsConfig: ({
|
16
|
-
/**
|
17
|
-
* Unique id of the tab
|
18
|
-
*/
|
19
|
-
id: string;
|
20
|
-
/**
|
21
|
-
* Title for the tab
|
22
|
-
*/
|
23
|
-
title: string;
|
24
|
-
} & BaseFeatureDescriptionModalProps)[];
|
25
|
-
} & {
|
26
|
-
renderDescriptionContent?: never;
|
27
|
-
docLink?: never;
|
28
|
-
imageVariant?: never;
|
29
|
-
SVGImage?: never;
|
30
|
-
imageStyles?: never;
|
31
|
-
};
|
32
|
-
export type FeatureDescriptionModalProps = {
|
33
|
-
title: string;
|
34
|
-
closeModalText?: string;
|
35
|
-
closeModal?: () => void;
|
36
|
-
} & ((BaseFeatureDescriptionModalProps & {
|
37
|
-
tabsConfig?: never;
|
38
|
-
}) | FeatureDescriptionModalWithTabsConfig);
|
39
|
-
export type DescriptorProps = ((Omit<FeatureDescriptionModalProps, 'tabsConfig'> & {
|
40
|
-
tabsConfig?: never;
|
41
|
-
}) | (Pick<FeatureDescriptionModalProps, 'title' | 'closeModalText' | 'closeModal'> & FeatureDescriptionModalWithTabsConfig)) & {
|
14
|
+
export interface DescriptorProps extends FeatureDescriptionModalProps {
|
42
15
|
breadCrumbs?: Breadcrumb[];
|
43
16
|
additionalContainerClasses?: string;
|
44
17
|
iconClassName?: string;
|
@@ -53,5 +26,4 @@ export type DescriptorProps = ((Omit<FeatureDescriptionModalProps, 'tabsConfig'>
|
|
53
26
|
* @default false
|
54
27
|
*/
|
55
28
|
showInfoIcon?: boolean;
|
56
|
-
}
|
57
|
-
export {};
|
29
|
+
}
|
@@ -18,7 +18,7 @@ export interface KeyValueHeader<K extends string> {
|
|
18
18
|
*/
|
19
19
|
export type KeyValueRow<K extends string> = {
|
20
20
|
data: {
|
21
|
-
[key in K]: Pick<ResizableTagTextAreaProps, 'value' | '
|
21
|
+
[key in K]: Pick<ResizableTagTextAreaProps, 'value' | 'disabled' | 'tabIndex'> & {
|
22
22
|
/** An optional boolean indicating if an asterisk should be shown. */
|
23
23
|
required?: boolean;
|
24
24
|
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
|
+
import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
|
4
|
+
export type SelectTextAreaProps = Pick<SelectPickerProps<string, false>, 'inputId' | 'options'> & Pick<ResizableTagTextAreaProps, 'refVar' | 'dependentRefs'> & {
|
5
|
+
value: string;
|
6
|
+
Icon?: ReactElement;
|
7
|
+
onChange?: (selectedValue: SelectPickerOptionType<string>) => void;
|
8
|
+
disabled?: boolean;
|
9
|
+
placeholder?: string;
|
10
|
+
textAreaProps?: Omit<ResizableTagTextAreaProps, 'refVar' | 'dependentRef' | 'id' | 'value' | 'onChange' | 'placeholder' | 'disabled'>;
|
11
|
+
selectPickerProps?: Omit<SelectPickerProps<string, false>, 'inputId' | 'options' | 'isDisabled' | 'onChange' | 'variant' | 'value' | 'placeholder' | 'fullWidth' | 'selectRef' | 'onCreateOption' | 'isMulti'>;
|
12
|
+
};
|
package/dist/Shared/Helpers.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
import { Pair } from 'yaml';
|
3
3
|
import { MaterialHistoryType } from '@Shared/Services/app.types';
|
4
|
-
import { MaterialInfo, SortingOrder, UserApprovalConfigType
|
4
|
+
import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
|
5
5
|
import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
|
6
6
|
import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
|
7
7
|
interface HighlightSearchTextProps {
|
@@ -40,13 +40,12 @@ export declare const decode: (data: any, isEncoded?: boolean) => {};
|
|
40
40
|
export declare const isTimeStringAvailable: (time: string) => boolean;
|
41
41
|
export declare const getTimeDifference: (startTime: string, endTime: string) => string;
|
42
42
|
export declare const getFileNameFromHeaders: (headers: Headers) => string;
|
43
|
-
export declare const
|
44
|
-
export declare const sanitizeApprovalConfigData: (approvalConfigData: ApprovalConfigDataType | null) => ApprovalConfigDataType;
|
43
|
+
export declare const sanitizeUserApprovalConfig: (userApprovalConfig: UserApprovalConfigType) => UserApprovalConfigType;
|
45
44
|
/**
|
46
45
|
* Manual approval is considered configured only if the type is not notConfigured
|
47
46
|
*/
|
48
47
|
export declare const getIsManualApprovalConfigured: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
|
49
|
-
export declare const
|
48
|
+
export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
|
50
49
|
/**
|
51
50
|
* @description - Function to open a new tab with the given url
|
52
51
|
* @param url - url to be opened in new tab
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ReleaseTag
|
1
|
+
import { ReleaseTag } from '../../Common';
|
2
2
|
interface WebhookDataType {
|
3
3
|
id: number;
|
4
4
|
eventActionType: string;
|
@@ -132,7 +132,6 @@ export interface DraftMetadataDTO {
|
|
132
132
|
commentsCount: number;
|
133
133
|
dataEncrypted: boolean;
|
134
134
|
isAppAdmin: boolean;
|
135
|
-
userApprovalMetadata: UserApprovalMetadataType;
|
136
135
|
}
|
137
136
|
export declare enum CMSecretExternalType {
|
138
137
|
Internal = "",
|
@@ -417,11 +417,4 @@ export declare const ALL_RESOURCE_KIND_FILTER = "all";
|
|
417
417
|
export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/newticket";
|
418
418
|
export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
|
419
419
|
export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
|
420
|
-
export declare const TARGET_IDS: {
|
421
|
-
WORKFLOW_EDITOR_CONTAINER: string;
|
422
|
-
};
|
423
|
-
/**
|
424
|
-
* Env ID to get the data for base configuration
|
425
|
-
*/
|
426
|
-
export declare const BASE_CONFIGURATION_ENV_ID = -1;
|
427
420
|
export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
|