@devtron-labs/devtron-fe-common-lib 1.3.0-beta-2 → 1.3.0-beta-4

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 (36) hide show
  1. package/dist/{@code-editor-CyrbR7OU.js → @code-editor-DNwiBMPM.js} +4650 -4714
  2. package/dist/{@common-rjsf-7t0xRouC.js → @common-rjsf-BFncpuNt.js} +1 -1
  3. package/dist/{@monaco-editor-DukJFc0i.js → @monaco-editor-CVagbUeH.js} +28153 -27951
  4. package/dist/Common/CIPipeline.Types.d.ts +5 -0
  5. package/dist/Common/Common.service.d.ts +2 -1
  6. package/dist/Common/Constants.d.ts +0 -1
  7. package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +2 -0
  8. package/dist/Common/CustomTagSelector/TagSelector.utils.d.ts +12 -0
  9. package/dist/Common/CustomTagSelector/Types.d.ts +14 -12
  10. package/dist/Common/CustomTagSelector/index.d.ts +1 -1
  11. package/dist/Common/Helper.d.ts +2 -3
  12. package/dist/Common/Types.d.ts +53 -60
  13. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +1 -2
  14. package/dist/Shared/Components/DynamicDataTable/types.d.ts +0 -2
  15. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
  16. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  17. package/dist/Shared/Components/FeatureDescription/types.d.ts +34 -6
  18. package/dist/Shared/Components/SelectPicker/type.d.ts +1 -1
  19. package/dist/Shared/Components/index.d.ts +0 -1
  20. package/dist/Shared/Helpers.d.ts +4 -3
  21. package/dist/Shared/Services/app.types.d.ts +8 -1
  22. package/dist/Shared/constants.d.ts +7 -0
  23. package/dist/Shared/types.d.ts +17 -23
  24. package/dist/assets/@code-editor.css +1 -1
  25. package/dist/assets/{ic-arrow-square-out.1be837ac.svg → ic-arrow-square-out.3d1a0d41.svg} +1 -1
  26. package/dist/assets/ic-check-circle-dots.6229180e.svg +4 -0
  27. package/dist/assets/{ic-edit-file.a782640f.svg → ic-edit-file.aea811d8.svg} +3 -3
  28. package/dist/index.js +571 -571
  29. package/package.json +3 -3
  30. package/dist/Common/CustomTagSelector/tags.utils.d.ts +0 -13
  31. package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +0 -3
  32. package/dist/Shared/Components/TagsKeyValueTable/constants.d.ts +0 -4
  33. package/dist/Shared/Components/TagsKeyValueTable/index.d.ts +0 -4
  34. package/dist/Shared/Components/TagsKeyValueTable/types.d.ts +0 -12
  35. package/dist/Shared/Components/TagsKeyValueTable/utils.d.ts +0 -3
  36. package/dist/assets/ic-stamp.526499d2.svg +0 -7
@@ -71,9 +71,14 @@ export declare enum RefVariableStageType {
71
71
  PRE_CI = "PRE_CI",
72
72
  POST_CI = "POST_CI"
73
73
  }
74
+ export declare enum FilePropertyTypeSizeUnit {
75
+ KB = "KB",
76
+ MB = "MB"
77
+ }
74
78
  export interface FilePropertyType {
75
79
  allowedExtensions: string[];
76
80
  maxUploadSize: number;
81
+ sizeUnit: FilePropertyTypeSizeUnit;
77
82
  }
78
83
  export interface ConstraintType {
79
84
  fileProperty: FilePropertyType;
@@ -1,6 +1,6 @@
1
1
  import { MutableRefObject } from 'react';
2
2
  import { RuntimeParamsAPIResponseType, RuntimePluginVariables } from '../Shared/types';
3
- import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, GlobalVariableOptionType } from './Types';
3
+ import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, UserApprovalMetadataType, GlobalVariableOptionType } from './Types';
4
4
  import { ApiResourceType } from '../Pages';
5
5
  export declare const getTeamListMin: () => Promise<TeamList>;
6
6
  interface UserRole extends ResponseType {
@@ -16,6 +16,7 @@ export declare const SourceTypeMap: {
16
16
  };
17
17
  export declare function getUserRole(appName?: string): Promise<UserRole>;
18
18
  export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
19
+ export declare const sanitizeUserApprovalMetadata: (userApprovalMetadata: UserApprovalMetadataType) => UserApprovalMetadataType;
19
20
  export declare const parseRuntimeParams: (response: RuntimeParamsAPIResponseType) => RuntimePluginVariables[];
20
21
  export declare const processCDMaterialServiceResponse: (cdMaterialsResult: any, stage: DeploymentNodeType, offset: number, filter: CDMaterialFilterQuery, disableDefaultSelection?: boolean) => CDMaterialResponseType;
21
22
  export declare const genericCDMaterialsService: (serviceType: CDMaterialServiceEnum, cdMaterialID: number, stage: DeploymentNodeType, signal: AbortSignal, queryParams?: CDMaterialServiceQueryParams) => Promise<CDMaterialResponseType>;
@@ -13,7 +13,6 @@ export declare const DOCUMENTATION: {
13
13
  GLOBAL_CONFIG_BUILD_INFRA: string;
14
14
  };
15
15
  export declare const PATTERNS: {
16
- STRING: RegExp;
17
16
  DECIMAL_NUMBERS: RegExp;
18
17
  NATURAL_NUMBERS: RegExp;
19
18
  KUBERNETES_KEY_PREFIX: RegExp;
@@ -0,0 +1,2 @@
1
+ import { TagLabelSelectType } from './Types';
2
+ export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex, hidePropagateTag }: TagLabelSelectType) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ export declare const baseSelectStyles: {
2
+ control: (base: any, state: any) => any;
3
+ singleValue: (base: any, state: any) => any;
4
+ placeholder: (base: any, state: any) => any;
5
+ option: (base: any, state: any) => any;
6
+ dropdownIndicator: (styles: any) => any;
7
+ valueContainer: (base: any, state: any) => any;
8
+ indicatorsContainer: (base: any, state: any) => any;
9
+ menu: (base: any, state: any) => any;
10
+ };
11
+ export declare const validateKubernetesKey: (key: string) => void;
12
+ export declare const validateKubernetesValue: (value: string) => void;
@@ -5,16 +5,6 @@ export interface SuggestedTagOptionType extends OptionType {
5
5
  description: string;
6
6
  propagate: boolean;
7
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
- }
18
8
  export interface TagType {
19
9
  id?: number;
20
10
  key: string;
@@ -26,8 +16,20 @@ export interface TagType {
26
16
  isInvalidValue?: boolean;
27
17
  isSuggested?: boolean;
28
18
  isPropagateDisabled?: boolean;
29
- deploymentPolicy?: DeploymentPolicy;
30
- valueConstraint?: VariableValueConstraintTypes;
19
+ }
20
+ export interface TagErrorType {
21
+ isValid: boolean;
22
+ messages: string[];
23
+ }
24
+ export interface TagLabelSelectType {
25
+ isCreateApp?: boolean;
26
+ labelTags: TagType[];
27
+ setLabelTags: (tagList: TagType[]) => void;
28
+ tabIndex?: number;
29
+ selectedProjectId?: number;
30
+ suggestedTagsOptions?: SuggestedTagOptionType[];
31
+ reloadProjectTags?: boolean;
32
+ hidePropagateTag?: boolean;
31
33
  }
32
34
  export interface TagDetailType {
33
35
  index: number;
@@ -1,6 +1,6 @@
1
1
  export { default as PropagateTagInfo } from './PropagateTagInfo';
2
2
  export * from './TagDetails';
3
+ export * from './TagLabelSelect';
3
4
  export * from './TagLabelValueSelector';
4
5
  export * from './ResizableTagTextArea';
5
6
  export * from './Types';
6
- export { validateTagKeyValue, validateTagValue } from './tags.utils';
@@ -1,6 +1,6 @@
1
1
  import { default as React, SyntheticEvent } from 'react';
2
2
  import { JSONPathOptions } from 'jsonpath-plus';
3
- import { AsyncOptions, DeploymentNodeType, UseSearchString } from './Types';
3
+ import { AsyncOptions, UseSearchString } from './Types';
4
4
  import { scrollableInterface } from '../Shared';
5
5
  import * as Sentry from '@sentry/browser';
6
6
  export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
@@ -10,7 +10,7 @@ interface ConditionalWrapper<T> {
10
10
  children: T;
11
11
  }
12
12
  export declare const ConditionalWrap: React.FC<ConditionalWrapper<any>>;
13
- export declare function sortCallback(key: string, a: any, b: any, isCaseSensitive?: boolean): 0 | 1 | -1;
13
+ export declare function sortCallback(key: string, a: any, b: any, isCaseSensitive?: boolean): 1 | -1 | 0;
14
14
  export declare const stopPropagation: (event: any) => void;
15
15
  export declare const preventDefault: (event: SyntheticEvent) => void;
16
16
  export declare function useThrottledEffect(callback: any, delay: any, deps?: any[]): void;
@@ -135,6 +135,5 @@ export declare const getSanitizedIframe: (iframeString: string) => string;
135
135
  * This method adds default attributes to iframe - title, loading ="lazy", width="100%", height="100%"
136
136
  */
137
137
  export declare const getIframeWithDefaultAttributes: (iframeString: string, defaultName?: string) => string;
138
- export declare const getStageTitle: (stageType: DeploymentNodeType) => string;
139
138
  export declare const getGoLangFormattedDateWithTimezone: (dateFormat: string) => string;
140
139
  export {};
@@ -1,9 +1,8 @@
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';
4
3
  import { UserGroupDTO } from '../Pages/GlobalConfigurations';
5
4
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
6
- import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo } from '../Shared';
5
+ import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity } from '../Shared';
7
6
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, RefVariableType, SortingOrder, TaskErrorObj, VariableTypeFormat } from '.';
8
7
  /**
9
8
  * Generic response type object with support for overriding the result type
@@ -74,7 +73,7 @@ export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
74
73
  noHeadingBorder?: boolean;
75
74
  infoTextHeading?: string;
76
75
  hideHeading?: boolean;
77
- placement?: Placement;
76
+ placement?: TippyProps['placement'];
78
77
  className?: string;
79
78
  Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
80
79
  iconPath?: string;
@@ -275,21 +274,6 @@ export declare enum ManualApprovalType {
275
274
  any = "ANY",
276
275
  notConfigured = "NOT_CONFIGURED"
277
276
  }
278
- export interface UserGroupApproverType {
279
- email: string;
280
- hasAccess: boolean;
281
- }
282
- export interface ImageApprovalPolicyUserGroupDataType {
283
- dataStore: Record<string, UserGroupApproverType>;
284
- requiredCount: number;
285
- emails: string[];
286
- }
287
- export interface ImageApprovalPolicyType {
288
- isPolicyConfigured: boolean;
289
- specificUsersData: ImageApprovalPolicyUserGroupDataType;
290
- userGroupData: Record<string, ImageApprovalPolicyUserGroupDataType>;
291
- validGroups: string[];
292
- }
293
277
  export type ImageApprovalUsersInfoDTO = Record<string, Pick<UserGroupDTO, 'identifier' | 'name'>[]>;
294
278
  export interface UserApprovalConfigType {
295
279
  type: ManualApprovalType;
@@ -302,13 +286,6 @@ export interface UserApprovalConfigType {
302
286
  requiredCount: number;
303
287
  })[];
304
288
  }
305
- export type UserApprovalConfigPayloadType = ({
306
- type: ManualApprovalType.any;
307
- } & Pick<UserApprovalConfigType, 'requiredCount'>) | ({
308
- type: ManualApprovalType.specific;
309
- } & Pick<UserApprovalConfigType, 'userGroups' | 'specificUsers'>) | {
310
- type: ManualApprovalType.notConfigured;
311
- };
312
289
  interface ApprovalUserDataType {
313
290
  dataId: number;
314
291
  userActionTime: string;
@@ -318,12 +295,45 @@ interface ApprovalUserDataType {
318
295
  userResponse: number;
319
296
  userGroups?: Pick<UserGroupDTO, 'identifier' | 'name'>[];
320
297
  }
298
+ export interface UserApprovalInfo {
299
+ requiredCount: number;
300
+ currentCount: number;
301
+ approverList: {
302
+ hasApproved: boolean;
303
+ canApprove: boolean;
304
+ identifier: string;
305
+ }[];
306
+ }
307
+ export declare enum ApprovalConfigDataKindType {
308
+ configMap = "configuration/config-map",
309
+ configSecret = "configuration/config-secret",
310
+ deploymentTemplate = "configuration/deployment-template",
311
+ deploymentTrigger = "approval/deployment"
312
+ }
313
+ export interface ApprovalConfigDataType extends Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> {
314
+ kind: ApprovalConfigDataKindType | null;
315
+ anyUserApprovedInfo: UserApprovalInfo;
316
+ specificUsersApprovedInfo: UserApprovalInfo;
317
+ userGroupsApprovedInfo: Pick<UserApprovalInfo, 'currentCount' | 'requiredCount'> & {
318
+ userGroups: (UserApprovalInfo & {
319
+ groupIdentifier: UserGroupDTO['identifier'];
320
+ groupName: UserGroupDTO['name'];
321
+ })[];
322
+ };
323
+ }
324
+ export declare enum ApprovalRuntimeStateType {
325
+ init = 0,
326
+ requested = 1,
327
+ approved = 2,
328
+ consumed = 3
329
+ }
321
330
  export interface UserApprovalMetadataType {
322
331
  approvalRequestId: number;
323
- approvalRuntimeState: number;
324
- approvedUsersData: ApprovalUserDataType[];
332
+ approvalRuntimeState: ApprovalRuntimeStateType;
325
333
  requestedUserData: ApprovalUserDataType;
326
- approvalConfig?: UserApprovalConfigType;
334
+ hasCurrentUserApproved: boolean;
335
+ canCurrentUserApprove: boolean;
336
+ approvalConfigData: ApprovalConfigDataType;
327
337
  }
328
338
  export declare enum FilterStates {
329
339
  ALLOWED = 0,
@@ -380,7 +390,6 @@ export interface CDMaterialListModalServiceUtilProps {
380
390
  artifactId?: number;
381
391
  artifactStatus?: string;
382
392
  disableDefaultSelection?: boolean;
383
- userApprovalConfig?: UserApprovalConfigType;
384
393
  }
385
394
  export interface CDMaterialType {
386
395
  index: number;
@@ -433,10 +442,6 @@ export interface CDMaterialType {
433
442
  * Would currently only be received in case of release
434
443
  */
435
444
  appWorkflowId: number;
436
- /**
437
- * Denotes trigger blocking due to mandatory tags, (might be used for plugins and other features in future)
438
- */
439
- deploymentBlockedState?: PolicyBlockInfo;
440
445
  }
441
446
  export declare enum CDMaterialServiceEnum {
442
447
  ROLLBACK = "rollback",
@@ -473,15 +478,6 @@ export interface DownstreamNodesEnvironmentsType {
473
478
  environmentId: number;
474
479
  environmentName: string;
475
480
  }
476
- export declare enum TriggerBlockType {
477
- MANDATORY_TAG = "mandatory-tags",
478
- MANDATORY_PLUGIN = "mandatory-plugins",
479
- SECURITY_SCAN = "security-scan"
480
- }
481
- export interface TriggerBlockedInfo {
482
- blockedBy: TriggerBlockType;
483
- blockedReason?: string;
484
- }
485
481
  export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
486
482
  connectingCiPipelineId?: number;
487
483
  parents: string | number[] | string[];
@@ -529,8 +525,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
529
525
  primaryBranchAfterRegex?: string;
530
526
  storageConfigured?: boolean;
531
527
  deploymentAppDeleteRequest?: boolean;
532
- approvalUsers?: string[];
533
- userApprovalConfig?: UserApprovalConfigType;
528
+ approvalConfigData: ApprovalConfigDataType;
534
529
  requestedUserId?: number;
535
530
  showPluginWarning: boolean;
536
531
  helmPackageName?: string;
@@ -544,7 +539,6 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
544
539
  downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
545
540
  cipipelineId?: number;
546
541
  isDeploymentBlocked?: boolean;
547
- triggerBlockedInfo?: TriggerBlockedInfo;
548
542
  }
549
543
  export declare enum DeploymentAppTypes {
550
544
  HELM = "helm",
@@ -588,14 +582,17 @@ export interface FilterConditionsListType {
588
582
  description: string;
589
583
  conditions: FilterConditionsInfo[];
590
584
  }
585
+ export interface DeploymentApprovalInfoType {
586
+ eligibleApprovers: {
587
+ specificUsers: Pick<UserApprovalInfo, 'approverList'>;
588
+ anyUsers: Pick<UserApprovalInfo, 'approverList'>;
589
+ userGroups: (Pick<ApprovalConfigDataType['userGroupsApprovedInfo']['userGroups'][number], 'groupIdentifier' | 'groupName'> & Pick<UserApprovalInfo, 'approverList'>)[];
590
+ };
591
+ approvalConfigData: ApprovalConfigDataType;
592
+ }
591
593
  export interface CDMaterialsApprovalInfo {
592
- approvalUsers: string[];
593
- userApprovalConfig: UserApprovalConfigType;
594
594
  canApproverDeploy: boolean;
595
- /**
596
- * Only available incase of approvals do'nt use in cd materials or any other flow since approvalUsers are not present there
597
- */
598
- imageApprovalPolicyDetails: ImageApprovalPolicyType;
595
+ deploymentApprovalInfo: DeploymentApprovalInfoType;
599
596
  }
600
597
  export interface CDMaterialsMetaInfo {
601
598
  tagsEditable: boolean;
@@ -607,7 +604,6 @@ export interface CDMaterialsMetaInfo {
607
604
  * This is the ID of user that has request the material
608
605
  */
609
606
  requestedUserId: number;
610
- deploymentBlockedState?: PolicyBlockInfo;
611
607
  runtimeParams: RuntimePluginVariables[];
612
608
  }
613
609
  export interface ImagePromotionMaterialInfo {
@@ -675,7 +671,6 @@ export interface AppEnvironment {
675
671
  appStatus?: string;
676
672
  deploymentAppDeleteRequest?: boolean;
677
673
  isVirtualEnvironment?: boolean;
678
- isProtected?: boolean;
679
674
  pipelineId?: number;
680
675
  latestCdWorkflowRunnerId?: number;
681
676
  commits?: string[];
@@ -686,7 +681,7 @@ export interface Strategy {
686
681
  config: any;
687
682
  default?: boolean;
688
683
  }
689
- export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
684
+ export interface CDStage {
690
685
  status: string;
691
686
  name: string;
692
687
  triggerType: 'AUTOMATIC' | 'MANUAL';
@@ -696,14 +691,14 @@ export interface CDStageConfigMapSecretNames {
696
691
  configMaps: any[];
697
692
  secrets: any[];
698
693
  }
699
- export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
694
+ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
700
695
  isValid: boolean;
701
696
  steps: TaskErrorObj[];
702
697
  triggerType: string;
703
698
  name: string;
704
699
  status: string;
705
700
  }
706
- export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
701
+ export interface CdPipeline {
707
702
  id: number;
708
703
  environmentId: number;
709
704
  environmentName?: string;
@@ -726,7 +721,6 @@ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlocked
726
721
  parentPipelineType?: string;
727
722
  deploymentAppDeleteRequest?: boolean;
728
723
  deploymentAppCreated?: boolean;
729
- userApprovalConfig?: UserApprovalConfigType;
730
724
  isVirtualEnvironment?: boolean;
731
725
  deploymentAppType: DeploymentAppTypes;
732
726
  helmPackageName?: string;
@@ -735,7 +729,7 @@ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlocked
735
729
  isProdEnv?: boolean;
736
730
  isGitOpsRepoNotConfigured?: boolean;
737
731
  isDeploymentBlocked?: boolean;
738
- isTriggerBlocked?: boolean;
732
+ approvalConfigData: ApprovalConfigDataType;
739
733
  }
740
734
  export interface ExternalCiConfig {
741
735
  id: number;
@@ -837,12 +831,11 @@ export interface Point {
837
831
  export interface EdgeNodeType {
838
832
  height: number;
839
833
  width: number;
840
- userApprovalConfig?: UserApprovalConfigType;
841
834
  type?: any;
842
835
  id?: number | string;
843
836
  }
844
837
  export interface EdgeEndNodeType extends EdgeNodeType {
845
- userApprovalConfig?: UserApprovalConfigType;
838
+ approvalConfigData: ApprovalConfigDataType;
846
839
  }
847
840
  /**
848
841
  * Search params for sorting configuration
@@ -1,5 +1,5 @@
1
1
  import { BuildStageType, FormType } from '../../../../../Common/CIPipeline.Types';
2
- import { DeploymentAppTypes, UserApprovalConfigType } from '../../../../../Common/Types';
2
+ import { DeploymentAppTypes } from '../../../../../Common/Types';
3
3
  import { DeploymentStrategy } from '../../../../../Shared/Components';
4
4
  import { EnvListMinDTO } from '../../../../../Shared/types';
5
5
  interface ConfigSecretType {
@@ -53,7 +53,6 @@ export interface CDFormType {
53
53
  secrets: ConfigSecretType[];
54
54
  };
55
55
  requiredApprovals: string;
56
- userApprovalConfig?: UserApprovalConfigType;
57
56
  isClusterCdActive: boolean;
58
57
  deploymentAppCreated: boolean;
59
58
  clusterId: string;
@@ -20,8 +20,6 @@ export type DynamicDataTableHeaderType<K extends string> = {
20
20
  isSortable?: boolean;
21
21
  /** An optional boolean to control the visibility of the column. */
22
22
  isHidden?: boolean;
23
- /** An optional boolean to show the column */
24
- renderAdditionalContent?: () => ReactNode;
25
23
  };
26
24
  export declare enum DynamicDataTableRowDataType {
27
25
  TEXT = "text",
@@ -1,2 +1,2 @@
1
1
  import { FeatureDescriptionModalProps } from './types';
2
- export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, }: FeatureDescriptionModalProps) => JSX.Element;
2
+ export declare const FeatureDescriptionModal: ({ title, renderDescriptionContent, closeModalText, docLink, closeModal, imageVariant, SVGImage, imageStyles, tabsConfig, }: 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, }: DescriptorProps) => JSX.Element;
2
+ declare const FeatureTitleWithInfo: ({ additionalContainerClasses, breadCrumbs, children, iconClassName, title, renderDescriptionContent, closeModalText, docLink, SVGImage, showInfoIconTippy, docLinkText, dataTestId, additionalContent, showInfoIcon, tabsConfig, }: DescriptorProps) => JSX.Element;
3
3
  export default FeatureTitleWithInfo;
@@ -1,17 +1,44 @@
1
1
  import { default as React, ReactNode } from 'react';
2
2
  import { ImageType } from '../../../Common';
3
3
  import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
4
- export interface FeatureDescriptionModalProps {
5
- title: string;
4
+ interface BaseFeatureDescriptionModalProps {
6
5
  renderDescriptionContent?: () => ReactNode;
7
- closeModalText?: string;
8
6
  docLink?: string;
9
- closeModal?: () => void;
10
7
  imageVariant?: ImageType;
11
8
  SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
12
9
  imageStyles?: React.CSSProperties;
13
10
  }
14
- export interface DescriptorProps extends FeatureDescriptionModalProps {
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)) & {
15
42
  breadCrumbs?: Breadcrumb[];
16
43
  additionalContainerClasses?: string;
17
44
  iconClassName?: string;
@@ -26,4 +53,5 @@ export interface DescriptorProps extends FeatureDescriptionModalProps {
26
53
  * @default false
27
54
  */
28
55
  showInfoIcon?: boolean;
29
- }
56
+ };
57
+ export {};
@@ -61,7 +61,7 @@ export declare enum SelectPickerVariantType {
61
61
  DEFAULT = "default",
62
62
  BORDER_LESS = "border-less"
63
63
  }
64
- 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' | 'formatCreateLabel'>> & {
64
+ 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' | 'formatCreateLabel' | 'menuPortalTarget'>> & {
65
65
  /**
66
66
  * Error message for the select
67
67
  */
@@ -46,5 +46,4 @@ export * from './EnterpriseTag';
46
46
  export * from './ConfirmationModal';
47
47
  export * from './DiffViewer';
48
48
  export * from './DynamicDataTable';
49
- export * from './TagsKeyValueTable';
50
49
  export * from './FileUpload';
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { Pair } from 'yaml';
3
3
  import { StrictRJSFSchema } from '@rjsf/utils';
4
4
  import { MaterialHistoryType } from '@Shared/Services/app.types';
5
- import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
5
+ import { MaterialInfo, SortingOrder, UserApprovalConfigType, ApprovalConfigDataType, UserApprovalInfo } from '../Common';
6
6
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
7
7
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
8
8
  interface HighlightSearchTextProps {
@@ -41,12 +41,13 @@ export declare const decode: (data: any, isEncoded?: boolean) => {};
41
41
  export declare const isTimeStringAvailable: (time: string) => boolean;
42
42
  export declare const getTimeDifference: (startTime: string, endTime: string) => string;
43
43
  export declare const getFileNameFromHeaders: (headers: Headers) => string;
44
- export declare const sanitizeUserApprovalConfig: (userApprovalConfig: UserApprovalConfigType) => UserApprovalConfigType;
44
+ export declare const sanitizeUserApprovalList: (approverList: UserApprovalInfo["approverList"]) => UserApprovalInfo["approverList"];
45
+ export declare const sanitizeApprovalConfigData: (approvalConfigData: ApprovalConfigDataType | null) => ApprovalConfigDataType;
45
46
  /**
46
47
  * Manual approval is considered configured only if the type is not notConfigured
47
48
  */
48
49
  export declare const getIsManualApprovalConfigured: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
49
- export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
50
+ export declare const getIsApprovalPolicyConfigured: (approvalConfigData: ApprovalConfigDataType) => boolean;
50
51
  /**
51
52
  * @description - Function to open a new tab with the given url
52
53
  * @param url - url to be opened in new tab
@@ -1,5 +1,5 @@
1
1
  import { OverrideMergeStrategyType } from '../../Pages/Applications';
2
- import { ReleaseTag } from '../../Common';
2
+ import { ReleaseTag, UserApprovalMetadataType } from '../../Common';
3
3
  interface WebhookDataType {
4
4
  id: number;
5
5
  eventActionType: string;
@@ -133,6 +133,13 @@ export interface DraftMetadataDTO {
133
133
  commentsCount: number;
134
134
  dataEncrypted: boolean;
135
135
  isAppAdmin: boolean;
136
+ userApprovalMetadata: UserApprovalMetadataType;
137
+ /**
138
+ * User id of the user who has requested the data
139
+ *
140
+ * This would be the id of the user whose token is sent in the cookie
141
+ */
142
+ requestedUserId: number;
136
143
  }
137
144
  export declare enum CMSecretExternalType {
138
145
  Internal = "",
@@ -417,4 +417,11 @@ export declare const ALL_RESOURCE_KIND_FILTER = "all";
417
417
  export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/newticket";
418
418
  export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
419
419
  export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
420
+ export declare const TARGET_IDS: {
421
+ WORKFLOW_EDITOR_CONTAINER: string;
422
+ };
423
+ /**
424
+ * Env ID to get the data for base configuration
425
+ */
426
+ export declare const BASE_CONFIGURATION_ENV_ID = -1;
420
427
  export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
@@ -1,6 +1,7 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
3
- import { EnvironmentTypeEnum, PatchOperationType } from './constants';
2
+ import { ApprovalConfigDataType } from '../Common/Types';
3
+ import { OptionType, CommonNodeAttr, ResponseType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
4
+ import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants';
4
5
  export declare enum EnvType {
5
6
  CHART = "helm_charts",
6
7
  APPLICATION = "apps"
@@ -185,7 +186,7 @@ export interface AppDetails {
185
186
  clusterName?: string;
186
187
  dockerRegistryId?: string;
187
188
  deploymentAppDeleteRequest?: boolean;
188
- userApprovalConfig?: string;
189
+ isApprovalPolicyApplicable?: boolean;
189
190
  isVirtualEnvironment?: boolean;
190
191
  imageTag?: string;
191
192
  helmPackageName?: string;
@@ -245,7 +246,7 @@ export interface WorkflowType {
245
246
  showTippy?: boolean;
246
247
  appId?: number;
247
248
  isSelected?: boolean;
248
- approvalConfiguredIdsMap?: Record<number, UserApprovalConfigType>;
249
+ approvalConfiguredIdsMap?: Record<number, ApprovalConfigDataType>;
249
250
  imageReleaseTags: string[];
250
251
  appReleaseTags?: string[];
251
252
  tagsEditable?: boolean;
@@ -418,7 +419,8 @@ export interface SeverityCount {
418
419
  export declare enum PolicyKindType {
419
420
  lockConfiguration = "lock-configuration",
420
421
  imagePromotion = "image-promotion",
421
- plugins = "plugin"
422
+ plugins = "plugin",
423
+ approval = "approval"
422
424
  }
423
425
  export interface LastExecutionResultType {
424
426
  lastExecution: string;
@@ -748,28 +750,20 @@ export interface DynamicTabType extends CommonTabArgsType {
748
750
  */
749
751
  lastActiveTabId: string | null;
750
752
  }
753
+ export interface ResourceApprovalPolicyConfigDTO {
754
+ appId: number;
755
+ envId: number;
756
+ approvalConfigurations: ApprovalConfigDataType[];
757
+ }
758
+ export interface ResourceApprovalPolicyConfigType extends Omit<ResourceApprovalPolicyConfigDTO, 'state' | 'approvalConfigurations'> {
759
+ isApprovalApplicable: boolean;
760
+ approvalConfigurationMap: Record<ApprovalConfigDataType['kind'], ApprovalConfigDataType>;
761
+ }
762
+ export type ResourceIdToResourceApprovalPolicyConfigMapType = Record<ResourceApprovalPolicyConfigType['envId'] | typeof BASE_CONFIGURATION_ENV_ID, Pick<ResourceApprovalPolicyConfigType, 'isApprovalApplicable' | 'approvalConfigurationMap'>>;
751
763
  export interface PreventOutsideFocusProps {
752
764
  identifier: string;
753
765
  preventFocus: boolean;
754
766
  }
755
- export interface PolicyBlockInfo {
756
- isBlocked: boolean;
757
- blockedBy: TriggerBlockType;
758
- reason: string;
759
- }
760
- export interface PipelineStageBlockInfo {
761
- node: PolicyBlockInfo;
762
- pre: PolicyBlockInfo;
763
- post: PolicyBlockInfo;
764
- }
765
- export interface PolicyConsequencesDTO {
766
- cd: PipelineStageBlockInfo;
767
- ci: PipelineStageBlockInfo;
768
- }
769
- export interface GetPolicyConsequencesProps {
770
- appId: number;
771
- envId: number;
772
- }
773
767
  export interface UploadFileDTO {
774
768
  id: number;
775
769
  name: string;