@devtron-labs/devtron-fe-common-lib 1.2.4-beta-4 → 1.2.4-beta-6
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-Dl49eEEU.js → @code-editor-DoW0mFjU.js} +5758 -5402
- package/dist/{@common-rjsf-D7zjI7cT.js → @common-rjsf-BkqyXvxk.js} +1 -1
- 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 +19 -14
- package/dist/Common/Helper.d.ts +3 -2
- package/dist/Common/Types.d.ts +58 -50
- 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/index.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/types.d.ts +165 -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/SelectPicker/type.d.ts +5 -4
- 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 +23 -17
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-clear-square.e60de021.svg +1 -0
- package/dist/index.js +351 -352
- package/package.json +2 -2
- /package/dist/assets/{ic-arrow-square-out.3d1a0d41.svg → ic-arrow-square-out.1be837ac.svg} +0 -0
@@ -2,7 +2,7 @@ import { j as n, J as A } from "./@vendor-RU8AW1bK.js";
|
|
2
2
|
import E, { forwardRef as $ } from "react";
|
3
3
|
import L, { getDefaultRegistry as k } from "@rjsf/core";
|
4
4
|
import D from "@rjsf/validator-ajv8";
|
5
|
-
import { T as y, c as H, a as J, d as w } from "./@code-editor-
|
5
|
+
import { T as y, c as H, a as J, d as w } from "./@code-editor-DoW0mFjU.js";
|
6
6
|
import M, { components as O } from "react-select";
|
7
7
|
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as U, ADDITIONAL_PROPERTY_FLAG as P, errorId as W, englishStringTranslator as V, TranslatableString as q, titleId as K, canExpand as Y, deepEquals as z } from "@rjsf/utils";
|
8
8
|
import { ReactComponent as G } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
@@ -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, dataTestId, onBlur, onFocus, refVar, dependentRef, className, disableOnBlurResizeToMinHeight, ...resProps }: 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
|
-
onFocus?: (e: any) => void;
|
63
|
-
placeholder?: string;
|
64
|
-
tabIndex?: number;
|
65
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
66
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
71
|
+
value: string;
|
72
|
+
refVar?: MutableRefObject<HTMLTextAreaElement>;
|
73
|
+
dependentRef?: MutableRefObject<HTMLTextAreaElement> | Record<string | number, MutableRefObject<HTMLTextAreaElement>>;
|
67
74
|
dataTestId?: string;
|
68
|
-
handleKeyDown?: any;
|
69
|
-
disabled?: boolean;
|
70
75
|
disableOnBlurResizeToMinHeight?: boolean;
|
71
76
|
}
|
package/dist/Common/Helper.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { default as React, SyntheticEvent } from 'react';
|
2
2
|
import { JSONPathOptions } from 'jsonpath-plus';
|
3
|
-
import { AsyncOptions, UseSearchString } from './Types';
|
3
|
+
import { AsyncOptions, DeploymentNodeType, UseSearchString } from './Types';
|
4
4
|
import { scrollableInterface } from '../Shared';
|
5
5
|
export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
|
6
6
|
interface ConditionalWrapper<T> {
|
@@ -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;
|
@@ -133,4 +133,5 @@ export declare const getSanitizedIframe: (iframeString: string) => string;
|
|
133
133
|
* This method adds default attributes to iframe - title, loading ="lazy", width="100%", height="100%"
|
134
134
|
*/
|
135
135
|
export declare const getIframeWithDefaultAttributes: (iframeString: string, defaultName?: string) => string;
|
136
|
+
export declare const getStageTitle: (stageType: DeploymentNodeType) => string;
|
136
137
|
export {};
|
package/dist/Common/Types.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
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
|
-
import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
|
6
|
+
import { MandatoryPluginBaseStateType, PolicyBlockInfo, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
|
6
7
|
import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.';
|
7
8
|
/**
|
8
9
|
* Generic response type object with support for overriding the result type
|
@@ -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;
|
@@ -441,6 +432,10 @@ export interface CDMaterialType {
|
|
441
432
|
* Would currently only be received in case of release
|
442
433
|
*/
|
443
434
|
appWorkflowId: number;
|
435
|
+
/**
|
436
|
+
* Denotes trigger blocking due to mandatory tags, (might be used for plugins and other features in future)
|
437
|
+
*/
|
438
|
+
deploymentBlockedState?: PolicyBlockInfo;
|
444
439
|
}
|
445
440
|
export declare enum CDMaterialServiceEnum {
|
446
441
|
ROLLBACK = "rollback",
|
@@ -477,6 +472,14 @@ export interface DownstreamNodesEnvironmentsType {
|
|
477
472
|
environmentId: number;
|
478
473
|
environmentName: string;
|
479
474
|
}
|
475
|
+
export declare enum TriggerBlockType {
|
476
|
+
MANDATORY_TAG = "mandatory-tags",
|
477
|
+
MANDATORY_PLUGIN = "mandatory-plugins"
|
478
|
+
}
|
479
|
+
export interface TriggerBlockedInfo {
|
480
|
+
blockedBy: TriggerBlockType;
|
481
|
+
blockedReason?: string;
|
482
|
+
}
|
480
483
|
export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
|
481
484
|
connectingCiPipelineId?: number;
|
482
485
|
parents: string | number[] | string[];
|
@@ -524,7 +527,8 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
|
|
524
527
|
primaryBranchAfterRegex?: string;
|
525
528
|
storageConfigured?: boolean;
|
526
529
|
deploymentAppDeleteRequest?: boolean;
|
527
|
-
|
530
|
+
approvalUsers?: string[];
|
531
|
+
userApprovalConfig?: UserApprovalConfigType;
|
528
532
|
requestedUserId?: number;
|
529
533
|
showPluginWarning: boolean;
|
530
534
|
helmPackageName?: string;
|
@@ -538,6 +542,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
|
|
538
542
|
downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
|
539
543
|
cipipelineId?: number;
|
540
544
|
isDeploymentBlocked?: boolean;
|
545
|
+
triggerBlockedInfo?: TriggerBlockedInfo;
|
541
546
|
}
|
542
547
|
export declare enum DeploymentAppTypes {
|
543
548
|
HELM = "helm",
|
@@ -581,17 +586,14 @@ export interface FilterConditionsListType {
|
|
581
586
|
description: string;
|
582
587
|
conditions: FilterConditionsInfo[];
|
583
588
|
}
|
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
589
|
export interface CDMaterialsApprovalInfo {
|
590
|
+
approvalUsers: string[];
|
591
|
+
userApprovalConfig: UserApprovalConfigType;
|
593
592
|
canApproverDeploy: boolean;
|
594
|
-
|
593
|
+
/**
|
594
|
+
* Only available incase of approvals do'nt use in cd materials or any other flow since approvalUsers are not present there
|
595
|
+
*/
|
596
|
+
imageApprovalPolicyDetails: ImageApprovalPolicyType;
|
595
597
|
}
|
596
598
|
export interface CDMaterialsMetaInfo {
|
597
599
|
tagsEditable: boolean;
|
@@ -604,6 +606,7 @@ export interface CDMaterialsMetaInfo {
|
|
604
606
|
*/
|
605
607
|
requestedUserId: number;
|
606
608
|
runtimeParams: RuntimeParamsListItemType[];
|
609
|
+
deploymentBlockedState?: PolicyBlockInfo;
|
607
610
|
}
|
608
611
|
export interface ImagePromotionMaterialInfo {
|
609
612
|
isApprovalPendingForPromotion: boolean;
|
@@ -670,6 +673,7 @@ export interface AppEnvironment {
|
|
670
673
|
appStatus?: string;
|
671
674
|
deploymentAppDeleteRequest?: boolean;
|
672
675
|
isVirtualEnvironment?: boolean;
|
676
|
+
isProtected?: boolean;
|
673
677
|
pipelineId?: number;
|
674
678
|
latestCdWorkflowRunnerId?: number;
|
675
679
|
commits?: string[];
|
@@ -696,6 +700,7 @@ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
|
|
696
700
|
triggerType: string;
|
697
701
|
name: string;
|
698
702
|
status: string;
|
703
|
+
triggerBlockedInfo?: TriggerBlockedInfo;
|
699
704
|
}
|
700
705
|
export interface CdPipeline {
|
701
706
|
id: number;
|
@@ -720,6 +725,7 @@ export interface CdPipeline {
|
|
720
725
|
parentPipelineType?: string;
|
721
726
|
deploymentAppDeleteRequest?: boolean;
|
722
727
|
deploymentAppCreated?: boolean;
|
728
|
+
userApprovalConfig?: UserApprovalConfigType;
|
723
729
|
isVirtualEnvironment?: boolean;
|
724
730
|
deploymentAppType: DeploymentAppTypes;
|
725
731
|
helmPackageName?: string;
|
@@ -728,7 +734,8 @@ export interface CdPipeline {
|
|
728
734
|
isProdEnv?: boolean;
|
729
735
|
isGitOpsRepoNotConfigured?: boolean;
|
730
736
|
isDeploymentBlocked?: boolean;
|
731
|
-
|
737
|
+
isTriggerBlocked?: boolean;
|
738
|
+
triggerBlockedInfo?: TriggerBlockedInfo;
|
732
739
|
}
|
733
740
|
export interface ExternalCiConfig {
|
734
741
|
id: number;
|
@@ -830,11 +837,12 @@ export interface Point {
|
|
830
837
|
export interface EdgeNodeType {
|
831
838
|
height: number;
|
832
839
|
width: number;
|
840
|
+
userApprovalConfig?: UserApprovalConfigType;
|
833
841
|
type?: any;
|
834
842
|
id?: number | string;
|
835
843
|
}
|
836
844
|
export interface EdgeEndNodeType extends EdgeNodeType {
|
837
|
-
|
845
|
+
userApprovalConfig?: UserApprovalConfigType;
|
838
846
|
}
|
839
847
|
/**
|
840
848
|
* 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, maskValue, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K>) => JSX.Element;
|
@@ -0,0 +1,165 @@
|
|
1
|
+
import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
|
2
|
+
import { SortingOrder } from '../../../Common/Constants';
|
3
|
+
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
4
|
+
import { InfoIconTippyProps } from '../../../Common/Types';
|
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
|
+
renderHelpTextForHeader?: () => 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, '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
|
+
};
|
63
|
+
type DynamicDataTableMask<K extends string> = {
|
64
|
+
[key in K]?: boolean;
|
65
|
+
};
|
66
|
+
type DynamicDataTableCellIcon<K extends string> = {
|
67
|
+
[key in K]?: (row: DynamicDataTableRowType<K>) => ReactNode;
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* Interface representing the properties for the dynamic data table component.
|
71
|
+
* @template K - A string representing the key type.
|
72
|
+
*/
|
73
|
+
export type DynamicDataTableProps<K extends string> = {
|
74
|
+
/**
|
75
|
+
* An array containing the headers for the data table. \
|
76
|
+
* Each header defines a column with its label, key, width, and optional settings.
|
77
|
+
*/
|
78
|
+
headers: DynamicDataTableHeaderType<K>[];
|
79
|
+
/**
|
80
|
+
* An array of rows where each row contains data corresponding to the table headers.
|
81
|
+
*/
|
82
|
+
rows: DynamicDataTableRowType<K>[];
|
83
|
+
/** Optional configuration for sorting the table. */
|
84
|
+
sortingConfig?: {
|
85
|
+
sortBy: K;
|
86
|
+
sortOrder: SortingOrder;
|
87
|
+
handleSorting: () => void;
|
88
|
+
};
|
89
|
+
/** An optional mask to hide the values of the cell. */
|
90
|
+
maskValue?: DynamicDataTableMask<K>;
|
91
|
+
/** Optional configuration for displaying an icon in the leading position of a cell. */
|
92
|
+
leadingCellIcon?: DynamicDataTableCellIcon<K>;
|
93
|
+
/** Optional configuration for displaying an icon in the trailing position of a cell. */
|
94
|
+
trailingCellIcon?: DynamicDataTableCellIcon<K>;
|
95
|
+
/** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
|
96
|
+
buttonCellWrapComponent?: (row: DynamicDataTableRowType<K>) => ReactElement;
|
97
|
+
/** An optional React node for a custom header component. */
|
98
|
+
headerComponent?: ReactNode;
|
99
|
+
/** When true, data addition field will not be shown. */
|
100
|
+
isAdditionNotAllowed?: boolean;
|
101
|
+
/** When true, data addition field will not be shown. */
|
102
|
+
isDeletionNotAllowed?: boolean;
|
103
|
+
/** When true, data add or update is disabled. */
|
104
|
+
readOnly?: boolean;
|
105
|
+
/** Function to handle the addition of a new row to the table. */
|
106
|
+
onRowAdd: () => void;
|
107
|
+
/**
|
108
|
+
* Function to handle changes in the table rows.
|
109
|
+
* @param row - The row that changed.
|
110
|
+
* @param headerKey - The key of the header that changed.
|
111
|
+
* @param value - The value of the cell.
|
112
|
+
* @param extraData - Additional data, such as a selected value for dropdowns.
|
113
|
+
*/
|
114
|
+
onRowEdit: (row: DynamicDataTableRowType<K>, headerKey: K, value: string, extraData: {
|
115
|
+
selectedValue?: SelectPickerOptionType<string>;
|
116
|
+
}) => void;
|
117
|
+
/**
|
118
|
+
* Function to handle row deletions.
|
119
|
+
* @param row - The row that was deleted.
|
120
|
+
*/
|
121
|
+
onRowDelete: (row: DynamicDataTableRowType<K>) => void;
|
122
|
+
/** Optional configuration for rendering a custom action button in a row. */
|
123
|
+
actionButtonConfig?: {
|
124
|
+
/**
|
125
|
+
* Function to render the action button.
|
126
|
+
* @param row - The current row being rendered.
|
127
|
+
* @returns A React node representing the action button.
|
128
|
+
*/
|
129
|
+
renderer: (row: DynamicDataTableRowType<K>) => ReactNode;
|
130
|
+
/**
|
131
|
+
* This represents under which header key the action button will be rendered.
|
132
|
+
*/
|
133
|
+
key: K;
|
134
|
+
/**
|
135
|
+
* The width of the action button.
|
136
|
+
* @default '32px'
|
137
|
+
*/
|
138
|
+
width?: string;
|
139
|
+
/**
|
140
|
+
* The position of the action button under the header key.
|
141
|
+
* @default 'start'
|
142
|
+
*/
|
143
|
+
position?: 'start' | 'end';
|
144
|
+
};
|
145
|
+
/**
|
146
|
+
* Indicates whether to show errors.
|
147
|
+
*/
|
148
|
+
showError?: boolean;
|
149
|
+
/**
|
150
|
+
* Function to validate the value of a table cell.
|
151
|
+
* @param value - The value to validate.
|
152
|
+
* @param key - The column key of the cell.
|
153
|
+
* @param row - The row containing the cell.
|
154
|
+
* @returns An object with a boolean indicating validity and an array of error messages.
|
155
|
+
*/
|
156
|
+
validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K>) => {
|
157
|
+
isValid: boolean;
|
158
|
+
errorMessages: string[];
|
159
|
+
};
|
160
|
+
};
|
161
|
+
export interface DynamicDataTableHeaderProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'>, Pick<InfoIconTippyProps, 'heading' | 'additionalContent'> {
|
162
|
+
}
|
163
|
+
export interface DynamicDataTableRowProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'rows' | 'headers' | 'maskValue' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
|
164
|
+
}
|
165
|
+
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
|
+
}
|
@@ -24,6 +24,10 @@ export interface SelectPickerOptionType<OptionValue = string | number> extends O
|
|
24
24
|
tooltipProps?: Omit<TooltipProps, 'alwaysShowTippyOnHover' | 'showOnTruncate' | 'shortcutKeyCombo'> | (Omit<TooltipProps, 'alwaysShowTippyOnHover' | 'showOnTruncate' | 'content'> & Required<Pick<TooltipProps, 'shortcutKeyCombo'>>);
|
25
25
|
}
|
26
26
|
type SelectProps<OptionValue, IsMulti extends boolean> = ReactSelectProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>;
|
27
|
+
export declare enum SelectPickerVariantType {
|
28
|
+
DEFAULT = "default",
|
29
|
+
BORDER_LESS = "border-less"
|
30
|
+
}
|
27
31
|
declare module 'react-select/base' {
|
28
32
|
interface Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
|
29
33
|
/**
|
@@ -55,12 +59,9 @@ declare module 'react-select/base' {
|
|
55
59
|
* @default 'true'
|
56
60
|
*/
|
57
61
|
showSelectedOptionIcon?: boolean;
|
62
|
+
variant?: SelectPickerVariantType;
|
58
63
|
}
|
59
64
|
}
|
60
|
-
export declare enum SelectPickerVariantType {
|
61
|
-
DEFAULT = "default",
|
62
|
-
BORDER_LESS = "border-less"
|
63
|
-
}
|
64
65
|
export type SelectPickerProps<OptionValue = number | string, IsMulti extends boolean = false> = Pick<SelectProps<OptionValue, IsMulti>, 'name' | 'classNamePrefix' | 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder' | 'menuPosition' | 'getOptionLabel' | 'getOptionValue' | 'isOptionSelected' | 'menuIsOpen' | 'onMenuOpen' | 'onMenuClose' | 'autoFocus' | 'onBlur' | 'onKeyDown' | 'formatOptionLabel' | 'onInputChange' | 'inputValue'> & Partial<Pick<SelectProps<OptionValue, IsMulti>, 'renderMenuListFooter' | 'shouldRenderCustomOptions' | 'renderCustomOptions' | 'icon' | 'showSelectedOptionIcon'>> & Required<Pick<SelectProps<OptionValue, IsMulti>, 'inputId'>> & Partial<Pick<CreatableProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption'>> & {
|
65
66
|
/**
|
66
67
|
* Error message for the select
|