@devtron-labs/devtron-fe-common-lib 1.2.4-beta-4 → 1.2.4-beta-5

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.
Files changed (43) hide show
  1. package/dist/{@code-editor-Dl49eEEU.js → @code-editor-CTMrJ4TQ.js} +6117 -5670
  2. package/dist/{@common-rjsf-D7zjI7cT.js → @common-rjsf-CQOy6buw.js} +1 -1
  3. package/dist/Common/CIPipeline.Types.d.ts +26 -1
  4. package/dist/Common/Common.service.d.ts +1 -2
  5. package/dist/Common/Constants.d.ts +1 -0
  6. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  7. package/dist/Common/CustomTagSelector/Types.d.ts +7 -14
  8. package/dist/Common/Helper.d.ts +1 -1
  9. package/dist/Common/RJSF/Form.d.ts +1 -1
  10. package/dist/Common/Types.d.ts +42 -51
  11. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/index.d.ts +1 -0
  12. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/services.d.ts +10 -0
  13. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +2 -1
  14. package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/index.d.ts +1 -0
  15. package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/services.d.ts +11 -0
  16. package/dist/Pages/Applications/DevtronApps/Details/index.d.ts +1 -0
  17. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
  18. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
  19. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
  20. package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
  21. package/dist/Shared/Components/DynamicDataTable/types.d.ts +170 -0
  22. package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
  23. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
  24. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  25. package/dist/Shared/Components/FeatureDescription/types.d.ts +6 -34
  26. package/dist/Shared/Components/FileUpload/FileUpload.d.ts +2 -0
  27. package/dist/Shared/Components/FileUpload/index.d.ts +2 -0
  28. package/dist/Shared/Components/FileUpload/types.d.ts +8 -0
  29. package/dist/Shared/Components/SelectPicker/type.d.ts +5 -4
  30. package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
  31. package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
  32. package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
  33. package/dist/Shared/Components/index.d.ts +2 -0
  34. package/dist/Shared/Helpers.d.ts +3 -4
  35. package/dist/Shared/Services/app.types.d.ts +1 -2
  36. package/dist/Shared/constants.d.ts +0 -7
  37. package/dist/Shared/types.d.ts +36 -18
  38. package/dist/assets/@code-editor.css +1 -1
  39. package/dist/assets/ic-clear-square.e60de021.svg +1 -0
  40. package/dist/assets/ic-cloud-upload.18066e05.svg +1 -0
  41. package/dist/index.js +289 -289
  42. package/package.json +2 -2
  43. /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-Dl49eEEU.js";
5
+ import { T as y, c as H, a as J, d as w } from "./@code-editor-CTMrJ4TQ.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";
@@ -70,11 +70,30 @@ export declare enum RefVariableStageType {
70
70
  PRE_CI = "PRE_CI",
71
71
  POST_CI = "POST_CI"
72
72
  }
73
+ export interface FileProperty {
74
+ allowedExtensions: string[];
75
+ maxUploadSize: number;
76
+ }
77
+ export interface Constraint {
78
+ fileProperty: FileProperty;
79
+ }
80
+ export interface ValueConstraint {
81
+ choices: string[];
82
+ blockCustomValue: boolean;
83
+ constraint: Constraint;
84
+ }
85
+ export declare enum VariableTypeFormat {
86
+ STRING = "STRING",
87
+ NUMBER = "NUMBER",
88
+ BOOL = "BOOL",
89
+ DATE = "DATE",
90
+ FILE = "FILE"
91
+ }
73
92
  export interface VariableType {
74
93
  id: number;
75
94
  name: string;
76
95
  value: string;
77
- format: string;
96
+ format: VariableTypeFormat;
78
97
  description: string;
79
98
  defaultValue: string;
80
99
  allowEmptyValue: boolean;
@@ -83,6 +102,12 @@ export interface VariableType {
83
102
  refVariableName: string;
84
103
  refVariableStage?: RefVariableStageType;
85
104
  variableStepIndexInPlugin?: number;
105
+ fileMountDir: string;
106
+ fileReferenceId: number;
107
+ valueConstraintId: number;
108
+ valueConstraint: ValueConstraint;
109
+ isRuntimeArg: boolean;
110
+ refVariableUsed: boolean;
86
111
  }
87
112
  interface CommandArgsMap {
88
113
  command: string;
@@ -1,5 +1,5 @@
1
1
  import { RuntimeParamsAPIResponseType, RuntimeParamsListItemType } from '../Shared/types';
2
- import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, UserApprovalMetadataType } from './Types';
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>;
@@ -94,6 +94,7 @@ export declare const ROUTES: {
94
94
  USER_LIST_MIN: string;
95
95
  CONFIG_DATA: string;
96
96
  K8S_RESOURCE_LIST: string;
97
+ FILE_UPLOAD: string;
97
98
  };
98
99
  export declare enum KEY_VALUE {
99
100
  KEY = "key",
@@ -1,2 +1,2 @@
1
1
  import { ResizableTagTextAreaProps } from './Types';
2
- export declare const ResizableTagTextArea: ({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId, handleKeyDown, disabled, disableOnBlurResizeToMinHeight, }: ResizableTagTextAreaProps) => JSX.Element;
2
+ export declare const ResizableTagTextArea: ({ value, minHeight, maxHeight, dataTestId, onBlur, onFocus, refVar, dependentRef, className, disableOnBlurResizeToMinHeight, ...resProps }: ResizableTagTextAreaProps) => JSX.Element;
@@ -1,3 +1,4 @@
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 {
@@ -48,24 +49,16 @@ export interface TagLabelValueSelectorType {
48
49
  tagInputType?: KEY_VALUE;
49
50
  placeholder?: string;
50
51
  tabIndex?: number;
51
- refVar?: React.MutableRefObject<HTMLTextAreaElement>;
52
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
52
+ refVar?: MutableRefObject<HTMLTextAreaElement>;
53
+ dependentRef?: MutableRefObject<HTMLTextAreaElement>;
53
54
  noBackDrop?: boolean;
54
55
  }
55
- export interface ResizableTagTextAreaProps {
56
- className?: string;
56
+ export interface ResizableTagTextAreaProps extends Omit<DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value'> {
57
57
  minHeight?: number;
58
58
  maxHeight?: number;
59
- value?: string;
60
- onChange?: (e: any) => void;
61
- onBlur?: (e: any) => void;
62
- onFocus?: (e: any) => void;
63
- placeholder?: string;
64
- tabIndex?: number;
65
- refVar?: React.MutableRefObject<HTMLTextAreaElement>;
66
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
59
+ value: string;
60
+ refVar?: MutableRefObject<HTMLTextAreaElement>;
61
+ dependentRef?: MutableRefObject<HTMLTextAreaElement> | Record<string | number, MutableRefObject<HTMLTextAreaElement>>;
67
62
  dataTestId?: string;
68
- handleKeyDown?: any;
69
- disabled?: boolean;
70
63
  disableOnBlurResizeToMinHeight?: boolean;
71
64
  }
@@ -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): 1 | -1 | 0;
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;
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "children" | "className" | "disabled" | "id" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
@@ -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, RegistryType, RuntimePluginVariables, 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?: TippyProps['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: ApprovalRuntimeStateType;
322
+ approvalRuntimeState: number;
323
+ approvedUsersData: ApprovalUserDataType[];
332
324
  requestedUserData: ApprovalUserDataType;
333
- hasCurrentUserApproved: boolean;
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
- approvalConfigData: ApprovalConfigDataType;
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
- deploymentApprovalInfo: DeploymentApprovalInfoType;
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;
@@ -603,7 +592,7 @@ export interface CDMaterialsMetaInfo {
603
592
  * This is the ID of user that has request the material
604
593
  */
605
594
  requestedUserId: number;
606
- runtimeParams: RuntimeParamsListItemType[];
595
+ runtimeParams: RuntimePluginVariables[];
607
596
  }
608
597
  export interface ImagePromotionMaterialInfo {
609
598
  isApprovalPendingForPromotion: 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
- approvalConfigData: ApprovalConfigDataType;
828
+ userApprovalConfig?: UserApprovalConfigType;
838
829
  }
839
830
  /**
840
831
  * Search params for sorting configuration
@@ -1 +1,2 @@
1
1
  export * from './types';
2
+ export * from './services';
@@ -0,0 +1,10 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { UploadFileDTO } from '../../../../../Shared/types';
3
+ export declare const uploadCDPipelineFile: ({ file, appId, envId, allowedExtensions, maxUploadSize, abortControllerRef, }: {
4
+ file: File[];
5
+ appId: number;
6
+ envId: number;
7
+ allowedExtensions?: string[];
8
+ maxUploadSize?: number;
9
+ abortControllerRef?: MutableRefObject<AbortController>;
10
+ }) => Promise<UploadFileDTO>;
@@ -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 @@
1
+ export * from './services';
@@ -0,0 +1,11 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { UploadFileDTO } from '../../../../../Shared/types';
3
+ export declare const uploadCIPipelineFile: ({ file, appId, ciPipelineId, envId, allowedExtensions, maxUploadSize, abortControllerRef, }: {
4
+ file: File[];
5
+ appId: number;
6
+ ciPipelineId: number;
7
+ envId?: number;
8
+ allowedExtensions?: string[];
9
+ maxUploadSize?: number;
10
+ abortControllerRef?: MutableRefObject<AbortController>;
11
+ }) => Promise<UploadFileDTO>;
@@ -1,2 +1,3 @@
1
1
  export * from './AppConfigurations';
2
2
  export * from './CDPipeline';
3
+ export * from './CIPipeline';
@@ -0,0 +1,2 @@
1
+ import { DynamicDataTableProps } from './types';
2
+ export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers, ...props }: DynamicDataTableProps<K, CustomStateType>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DynamicDataTableHeaderProps } from './types';
2
+ export declare const DynamicDataTableHeader: <K extends string, CustomStateType = Record<string, unknown>>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K, CustomStateType>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DynamicDataTableRowProps } from './types';
2
+ export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, maskValue, readOnly, isDeletionNotAllowed, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './DynamicDataTable';
2
+ export * from './types';
@@ -0,0 +1,170 @@
1
+ import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
2
+ import { SortingOrder } from '../../../Common/Constants';
3
+ import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
4
+ import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
5
+ import { SelectTextAreaProps } from '../SelectTextArea';
6
+ import { FileUploadProps } from '../FileUpload';
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
+ };
23
+ export declare enum DynamicDataTableRowDataType {
24
+ TEXT = "text",
25
+ DROPDOWN = "dropdown",
26
+ SELECT_TEXT = "select-text",
27
+ BUTTON = "button",
28
+ FILE_UPLOAD = "file-upload"
29
+ }
30
+ export type DynamicDataTableCellPropsMap = {
31
+ [DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
32
+ [DynamicDataTableRowDataType.DROPDOWN]: Omit<SelectPickerProps<string, false>, 'inputId' | 'value' | 'onChange' | 'fullWidth' | 'isDisabled'>;
33
+ [DynamicDataTableRowDataType.SELECT_TEXT]: Omit<SelectTextAreaProps, 'value' | 'onChange' | 'inputId' | 'isDisabled' | 'dependentRef' | 'refVar' | 'textAreaProps'> & {
34
+ textAreaProps?: Omit<SelectTextAreaProps['textAreaProps'], 'className' | 'disableOnBlurResizeToMinHeight' | 'minHeight' | 'maxHeight'>;
35
+ };
36
+ [DynamicDataTableRowDataType.BUTTON]: Pick<DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'onClick'> & {
37
+ icon?: ReactNode;
38
+ text: string;
39
+ };
40
+ [DynamicDataTableRowDataType.FILE_UPLOAD]: Omit<FileUploadProps, 'className' | 'fileName' | 'onUpload' | 'multiple'>;
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
+ /** An optional tooltip text to show when hovering over cell. */
58
+ tooltipText?: string;
59
+ } & DynamicDataTableCellData;
60
+ };
61
+ id: string | number;
62
+ /** */
63
+ customState?: CustomStateType;
64
+ /** An optional boolean indicating if row deletion is disabled. */
65
+ disableDelete?: boolean;
66
+ };
67
+ type DynamicDataTableMask<K extends string> = {
68
+ [key in K]?: boolean;
69
+ };
70
+ type DynamicDataTableCellIcon<K extends string, CustomStateType = Record<string, unknown>> = {
71
+ [key in K]?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
72
+ };
73
+ /**
74
+ * Interface representing the properties for the dynamic data table component.
75
+ * @template K - A string representing the key type.
76
+ */
77
+ export type DynamicDataTableProps<K extends string, CustomStateType = Record<string, unknown>> = {
78
+ /**
79
+ * An array containing the headers for the data table. \
80
+ * Each header defines a column with its label, key, width, and optional settings.
81
+ */
82
+ headers: DynamicDataTableHeaderType<K>[];
83
+ /**
84
+ * An array of rows where each row contains data corresponding to the table headers.
85
+ */
86
+ rows: DynamicDataTableRowType<K, CustomStateType>[];
87
+ /** Optional configuration for sorting the table. */
88
+ sortingConfig?: {
89
+ sortBy: K;
90
+ sortOrder: SortingOrder;
91
+ handleSorting: () => void;
92
+ };
93
+ /** An optional mask to hide the values of the cell. */
94
+ maskValue?: DynamicDataTableMask<K>;
95
+ /** Optional configuration for displaying an icon in the leading position of a cell. */
96
+ leadingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
97
+ /** Optional configuration for displaying an icon in the trailing position of a cell. */
98
+ trailingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
99
+ /** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
100
+ buttonCellWrapComponent?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactElement;
101
+ /** An optional React node for a custom header component. */
102
+ headerComponent?: ReactNode;
103
+ /** When true, data addition field will not be shown. */
104
+ isAdditionNotAllowed?: boolean;
105
+ /** When true, data addition field will not be shown. */
106
+ isDeletionNotAllowed?: boolean;
107
+ /** When true, data add or update is disabled. */
108
+ readOnly?: boolean;
109
+ /** Function to handle the addition of a new row to the table. */
110
+ onRowAdd: () => void;
111
+ /**
112
+ * Function to handle changes in the table rows.
113
+ * @param row - The row that changed.
114
+ * @param headerKey - The key of the header that changed.
115
+ * @param value - The value of the cell.
116
+ * @param extraData - Additional data, such as a selected value for dropdowns.
117
+ */
118
+ onRowEdit: (row: DynamicDataTableRowType<K, CustomStateType>, headerKey: K, value: string, extraData: {
119
+ files?: File[];
120
+ selectedValue?: SelectPickerOptionType<string>;
121
+ }) => void;
122
+ /**
123
+ * Function to handle row deletions.
124
+ * @param row - The row that was deleted.
125
+ */
126
+ onRowDelete: (row: DynamicDataTableRowType<K, CustomStateType>) => void;
127
+ /** Optional configuration for rendering a custom action button in a row. */
128
+ actionButtonConfig?: {
129
+ /**
130
+ * Function to render the action button.
131
+ * @param row - The current row being rendered.
132
+ * @returns A React node representing the action button.
133
+ */
134
+ renderer: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
135
+ /**
136
+ * This represents under which header key the action button will be rendered.
137
+ */
138
+ key: K;
139
+ /**
140
+ * The width of the action button.
141
+ * @default '32px'
142
+ */
143
+ width?: string;
144
+ /**
145
+ * The position of the action button under the header key.
146
+ * @default 'start'
147
+ */
148
+ position?: 'start' | 'end';
149
+ };
150
+ /**
151
+ * Indicates whether to show errors.
152
+ */
153
+ showError?: boolean;
154
+ /**
155
+ * Function to validate the value of a table cell.
156
+ * @param value - The value to validate.
157
+ * @param key - The column key of the cell.
158
+ * @param row - The row containing the cell.
159
+ * @returns An object with a boolean indicating validity and an array of error messages.
160
+ */
161
+ validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K, CustomStateType>) => {
162
+ isValid: boolean;
163
+ errorMessages: string[];
164
+ };
165
+ };
166
+ export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
167
+ }
168
+ export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'maskValue' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
169
+ }
170
+ export {};
@@ -0,0 +1,5 @@
1
+ import { DynamicDataTableHeaderType, DynamicDataTableProps, DynamicDataTableRowDataType } from './types';
2
+ export declare const getActionButtonPosition: <K extends string, CustomStateType = Record<string, unknown>>({ headers, actionButtonConfig, }: Pick<DynamicDataTableProps<K, CustomStateType>, "headers" | "actionButtonConfig">) => number;
3
+ export declare const getHeaderGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["actionButtonConfig"], noDeleteBtn: boolean) => string;
4
+ export declare const getRowGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["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, tabsConfig, }: FeatureDescriptionModalProps) => JSX.Element;
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, tabsConfig, }: DescriptorProps) => JSX.Element;
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 BaseFeatureDescriptionModalProps {
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
- type FeatureDescriptionModalWithTabsConfig = {
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
+ }