@devtron-labs/devtron-fe-common-lib 1.2.5-beta-8 → 1.2.5-beta-9

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 (38) hide show
  1. package/dist/{@code-editor-DWIb_Iyh.js → @code-editor-Bxuub3Gm.js} +6411 -5940
  2. package/dist/{@common-rjsf-U4GTT51r.js → @common-rjsf-MgIsP6qj.js} +1 -1
  3. package/dist/Common/Common.service.d.ts +1 -2
  4. package/dist/Common/Constants.d.ts +1 -0
  5. package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
  6. package/dist/Common/CustomTagSelector/Types.d.ts +20 -15
  7. package/dist/Common/Helper.d.ts +3 -2
  8. package/dist/Common/Types.d.ts +59 -53
  9. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +2 -1
  10. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
  11. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
  12. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
  13. package/dist/Shared/Components/DynamicDataTable/constants.d.ts +2 -0
  14. package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
  15. package/dist/Shared/Components/DynamicDataTable/types.d.ts +157 -0
  16. package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
  17. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
  18. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  19. package/dist/Shared/Components/FeatureDescription/types.d.ts +6 -34
  20. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
  21. package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
  22. package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
  23. package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
  24. package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +3 -0
  25. package/dist/Shared/Components/TagsKeyValueTable/constants.d.ts +4 -0
  26. package/dist/Shared/Components/TagsKeyValueTable/index.d.ts +3 -0
  27. package/dist/Shared/Components/TagsKeyValueTable/types.d.ts +9 -0
  28. package/dist/Shared/Components/TagsKeyValueTable/utils.d.ts +3 -0
  29. package/dist/Shared/Components/index.d.ts +2 -0
  30. package/dist/Shared/Helpers.d.ts +3 -4
  31. package/dist/Shared/Services/app.types.d.ts +1 -2
  32. package/dist/Shared/constants.d.ts +0 -7
  33. package/dist/Shared/types.d.ts +23 -17
  34. package/dist/assets/@code-editor.css +1 -1
  35. package/dist/assets/ic-clear-square.e60de021.svg +1 -0
  36. package/dist/index.js +455 -454
  37. package/package.json +2 -2
  38. /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-DWIb_Iyh.js";
5
+ import { T as y, c as H, a as J, d as w } from "./@code-editor-Bxuub3Gm.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, 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>;
@@ -12,6 +12,7 @@ export declare const DOCUMENTATION: {
12
12
  GLOBAL_CONFIG_BUILD_INFRA: string;
13
13
  };
14
14
  export declare const PATTERNS: {
15
+ STRING: RegExp;
15
16
  KUBERNETES_KEY_PREFIX: RegExp;
16
17
  KUBERNETES_KEY_NAME: RegExp;
17
18
  START_END_ALPHANUMERIC: RegExp;
@@ -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, 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?: React.MutableRefObject<HTMLTextAreaElement>;
52
- dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
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?: 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>;
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
  }
@@ -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): 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;
@@ -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 {};
@@ -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?: 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;
@@ -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
- approvalConfigData: ApprovalConfigDataType;
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
- deploymentApprovalInfo: DeploymentApprovalInfoType;
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[];
@@ -680,7 +684,7 @@ export interface Strategy {
680
684
  config: any;
681
685
  default?: boolean;
682
686
  }
683
- export interface CDStage {
687
+ export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
684
688
  status: string;
685
689
  name: string;
686
690
  triggerType: 'AUTOMATIC' | 'MANUAL';
@@ -690,14 +694,14 @@ export interface CDStageConfigMapSecretNames {
690
694
  configMaps: any[];
691
695
  secrets: any[];
692
696
  }
693
- export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
697
+ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
694
698
  isValid: boolean;
695
699
  steps: TaskErrorObj[];
696
700
  triggerType: string;
697
701
  name: string;
698
702
  status: string;
699
703
  }
700
- export interface CdPipeline {
704
+ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
701
705
  id: number;
702
706
  environmentId: number;
703
707
  environmentName?: string;
@@ -720,6 +724,7 @@ export interface CdPipeline {
720
724
  parentPipelineType?: string;
721
725
  deploymentAppDeleteRequest?: boolean;
722
726
  deploymentAppCreated?: boolean;
727
+ userApprovalConfig?: UserApprovalConfigType;
723
728
  isVirtualEnvironment?: boolean;
724
729
  deploymentAppType: DeploymentAppTypes;
725
730
  helmPackageName?: string;
@@ -728,7 +733,7 @@ export interface CdPipeline {
728
733
  isProdEnv?: boolean;
729
734
  isGitOpsRepoNotConfigured?: boolean;
730
735
  isDeploymentBlocked?: boolean;
731
- approvalConfigData: ApprovalConfigDataType;
736
+ isTriggerBlocked?: boolean;
732
737
  }
733
738
  export interface ExternalCiConfig {
734
739
  id: number;
@@ -830,11 +835,12 @@ export interface Point {
830
835
  export interface EdgeNodeType {
831
836
  height: number;
832
837
  width: number;
838
+ userApprovalConfig?: UserApprovalConfigType;
833
839
  type?: any;
834
840
  id?: number | string;
835
841
  }
836
842
  export interface EdgeEndNodeType extends EdgeNodeType {
837
- approvalConfigData: ApprovalConfigDataType;
843
+ userApprovalConfig?: UserApprovalConfigType;
838
844
  }
839
845
  /**
840
846
  * 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 { DynamicDataTableProps } from './types';
2
+ export declare const DynamicDataTable: <K extends string>({ headers, ...props }: DynamicDataTableProps<K>) => JSX.Element;
@@ -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, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const ACTION_BUTTON_DEFAULT_WIDTH = "33px";
2
+ export declare const DELETE_BUTTON_WIDTH = "33px";
@@ -0,0 +1,2 @@
1
+ export * from './DynamicDataTable';
2
+ export * from './types';
@@ -0,0 +1,157 @@
1
+ import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
2
+ import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
3
+ import { UseStateFiltersReturnType } from '../../../Common/Hooks';
4
+ import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
5
+ import { SelectTextAreaProps } from '../SelectTextArea';
6
+ /**
7
+ * Interface representing header for a dynamic data table.
8
+ * @template K - A string representing the key type.
9
+ */
10
+ export type DynamicDataTableHeaderType<K extends string> = {
11
+ /** The display label of the header, shown in the table's column header. */
12
+ label: string;
13
+ /** The unique key associated with the header, used to map the column to data fields. */
14
+ key: K;
15
+ /** The width of the column, defined as a CSS string (e.g., "100px", "10%", "1fr", or "auto"). */
16
+ width: string;
17
+ /** An optional boolean indicating whether the column is sortable. */
18
+ isSortable?: boolean;
19
+ /** An optional boolean to control the visibility of the column. */
20
+ isHidden?: boolean;
21
+ /** An optional boolean to show the column */
22
+ renderAdditionalContent?: () => ReactNode;
23
+ };
24
+ export declare enum DynamicDataTableRowDataType {
25
+ TEXT = "text",
26
+ DROPDOWN = "dropdown",
27
+ SELECT_TEXT = "select-text",
28
+ BUTTON = "button"
29
+ }
30
+ export type DynamicDataTableCellPropsMap = {
31
+ [DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'id' | '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
+ };
41
+ type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
42
+ type: T;
43
+ props: DynamicDataTableCellPropsMap[T];
44
+ } : never;
45
+ /**
46
+ * Type representing a key-value row.
47
+ * @template K - A string representing the key type.
48
+ */
49
+ export type DynamicDataTableRowType<K extends string, CustomStateType = Record<string, unknown>> = {
50
+ data: {
51
+ [key in K]: {
52
+ value: string;
53
+ disabled?: boolean;
54
+ /** An optional boolean indicating if an asterisk should be shown. */
55
+ required?: boolean;
56
+ } & DynamicDataTableCellData;
57
+ };
58
+ id: string | number;
59
+ /** */
60
+ customState?: CustomStateType;
61
+ /** An optional boolean indicating if row deletion is disabled. */
62
+ disableDelete?: boolean;
63
+ };
64
+ type DynamicDataTableCellIcon<K extends string> = {
65
+ [key in K]?: (row: DynamicDataTableRowType<K>) => ReactNode;
66
+ };
67
+ /**
68
+ * Interface representing the properties for the dynamic data table component.
69
+ * @template K - A string representing the key type.
70
+ */
71
+ export type DynamicDataTableProps<K extends string> = {
72
+ /**
73
+ * An array containing the headers for the data table. \
74
+ * Each header defines a column with its label, key, width, and optional settings.
75
+ */
76
+ headers: DynamicDataTableHeaderType<K>[];
77
+ /**
78
+ * An array of rows where each row contains data corresponding to the table headers.
79
+ */
80
+ rows: DynamicDataTableRowType<K>[];
81
+ /** Optional configuration for sorting the table. */
82
+ sortingConfig?: Pick<UseStateFiltersReturnType<K>, 'sortBy' | 'sortOrder' | 'handleSorting'>;
83
+ /** Optional configuration for displaying an icon in the leading position of a cell. */
84
+ leadingCellIcon?: DynamicDataTableCellIcon<K>;
85
+ /** Optional configuration for displaying an icon in the trailing position of a cell. */
86
+ trailingCellIcon?: DynamicDataTableCellIcon<K>;
87
+ /** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
88
+ buttonCellWrapComponent?: (row: DynamicDataTableRowType<K>) => ReactElement;
89
+ /** An optional React node for a custom header component. */
90
+ headerComponent?: ReactNode;
91
+ /** When true, data addition field will not be shown. */
92
+ isAdditionNotAllowed?: boolean;
93
+ /** When true, data addition field will not be shown. */
94
+ isDeletionNotAllowed?: boolean;
95
+ /** When true, data add or update is disabled. */
96
+ readOnly?: boolean;
97
+ /** Function to handle the addition of a new row to the table. */
98
+ onRowAdd: () => void;
99
+ /**
100
+ * Function to handle changes in the table rows.
101
+ * @param row - The row that changed.
102
+ * @param headerKey - The key of the header that changed.
103
+ * @param value - The value of the cell.
104
+ * @param extraData - Additional data, such as a selected value for dropdowns.
105
+ */
106
+ onRowEdit: (row: DynamicDataTableRowType<K>, headerKey: K, value: string, extraData: {
107
+ selectedValue?: SelectPickerOptionType<string>;
108
+ }) => void;
109
+ /**
110
+ * Function to handle row deletions.
111
+ * @param row - The row that was deleted.
112
+ */
113
+ onRowDelete: (row: DynamicDataTableRowType<K>) => void;
114
+ /** Optional configuration for rendering a custom action button in a row. */
115
+ actionButtonConfig?: {
116
+ /**
117
+ * Function to render the action button.
118
+ * @param row - The current row being rendered.
119
+ * @returns A React node representing the action button.
120
+ */
121
+ renderer: (row: DynamicDataTableRowType<K>) => ReactNode;
122
+ /**
123
+ * This represents under which header key the action button will be rendered.
124
+ */
125
+ key: K;
126
+ /**
127
+ * The width of the action button.
128
+ * @default '33px'
129
+ */
130
+ width?: string;
131
+ /**
132
+ * The position of the action button under the header key.
133
+ * @default 'start'
134
+ */
135
+ position?: 'start' | 'end';
136
+ };
137
+ /**
138
+ * Indicates whether to show errors.
139
+ */
140
+ showError?: boolean;
141
+ /**
142
+ * Function to validate the value of a table cell.
143
+ * @param value - The value to validate.
144
+ * @param key - The column key of the cell.
145
+ * @param row - The row containing the cell.
146
+ * @returns An object with a boolean indicating validity and an array of error messages.
147
+ */
148
+ validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K>) => {
149
+ isValid: boolean;
150
+ errorMessages: string[];
151
+ };
152
+ };
153
+ export interface DynamicDataTableHeaderProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
154
+ }
155
+ export interface DynamicDataTableRowProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
156
+ }
157
+ 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, 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
+ }
@@ -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' | 'dataTestId' | 'disabled' | 'tabIndex'> & {
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,2 @@
1
+ import { SelectTextAreaProps } from './types';
2
+ export declare const SelectTextArea: ({ value, Icon, onChange, options, inputId, placeholder, refVar, dependentRefs, disabled, selectPickerProps, textAreaProps, }: SelectTextAreaProps) => JSX.Element;