@devtron-labs/devtron-fe-common-lib 1.2.6-beta-1 → 1.2.6-beta-2

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 (50) hide show
  1. package/dist/{@code-editor-CHJXMqhN.js → @code-editor-_onshah4.js} +5043 -5032
  2. package/dist/{@common-rjsf-CGvQ2A8o.js → @common-rjsf-D6NBS9PZ.js} +2 -2
  3. package/dist/{@framer-motion-DHY98qq3.js → @framer-motion-DFECMTRh.js} +1 -1
  4. package/dist/{@react-dates-WNnwjI5S.js → @react-dates-MalCS5BJ.js} +1 -1
  5. package/dist/{@react-select-BbR996pa.js → @react-select-B8JuvbeY.js} +50 -50
  6. package/dist/{@vendor-RU8AW1bK.js → @vendor-CPMO6uwj.js} +94 -93
  7. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +2 -1
  8. package/dist/Common/CodeEditor/types.d.ts +2 -1
  9. package/dist/Common/Common.service.d.ts +1 -2
  10. package/dist/Common/Constants.d.ts +3 -0
  11. package/dist/Common/Helper.d.ts +4 -3
  12. package/dist/Common/Markdown/MarkDown.d.ts +1 -1
  13. package/dist/Common/RJSF/index.d.ts +1 -1
  14. package/dist/Common/Types.d.ts +41 -51
  15. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/index.d.ts +2 -0
  16. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/types.d.ts +2 -0
  17. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/GUIView/utils.d.ts +6 -0
  18. package/dist/Pages/App/AppConfiguration/DeploymentTemplate/index.d.ts +1 -0
  19. package/dist/Pages/App/AppConfiguration/index.d.ts +1 -0
  20. package/dist/Pages/App/index.d.ts +1 -0
  21. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/index.d.ts +1 -0
  22. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.d.ts +3 -0
  23. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +21 -3
  24. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +2 -1
  25. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +1 -0
  26. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +7 -0
  27. package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
  28. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +2 -1
  29. package/dist/Pages/index.d.ts +1 -0
  30. package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +6 -0
  31. package/dist/Shared/Components/EnterpriseTag/EnterpriseTag.component.d.ts +2 -0
  32. package/dist/Shared/Components/EnterpriseTag/index.d.ts +1 -0
  33. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
  34. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  35. package/dist/Shared/Components/FeatureDescription/types.d.ts +6 -34
  36. package/dist/Shared/Components/index.d.ts +1 -0
  37. package/dist/Shared/Helpers.d.ts +8 -7
  38. package/dist/Shared/Hooks/useForm/useForm.d.ts +4 -0
  39. package/dist/Shared/Services/app.types.d.ts +5 -2
  40. package/dist/Shared/constants.d.ts +0 -7
  41. package/dist/Shared/types.d.ts +5 -17
  42. package/dist/assets/{ic-arrow-square-out.3d1a0d41.svg → ic-arrow-square-out.1be837ac.svg} +1 -1
  43. package/dist/assets/ic-file-code.80000c9b.svg +7 -0
  44. package/dist/assets/ic-medal.4a7e5cbc.svg +3 -0
  45. package/dist/assets/ic-stamp.526499d2.svg +7 -0
  46. package/dist/index.d.ts +2 -0
  47. package/dist/index.js +397 -396
  48. package/package.json +2 -2
  49. package/dist/assets/ic-file-code.21a1f748.svg +0 -7
  50. package/dist/assets/ic-stamp.8689f42d.svg +0 -9
@@ -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): 1 | -1 | 0;
13
+ export declare function sortCallback(key: string, a: any, b: any, isCaseSensitive?: boolean): 0 | 1 | -1;
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;
@@ -59,9 +59,10 @@ export declare const getFilteredChartVersions: (charts: any, selectedChartType:
59
59
  * @param {object} object from which we need to delete nulls in its arrays
60
60
  * @returns object after removing (in-place) the null items in arrays
61
61
  */
62
- export declare const recursivelyRemoveNullsFromArraysInObject: (object: object) => object;
62
+ export declare const recursivelyRemoveSymbolFromArraysInObject: (object: object, symbol: symbol) => object;
63
63
  /**
64
64
  * Merges the objects into one object
65
+ * Works more like Object.assign; that doesn't deep copy
65
66
  * @param {object[]} objects list of js objects
66
67
  * @returns object after the merge
67
68
  */
@@ -90,7 +91,7 @@ export declare const getRegexMatchPositions: (string: string, regex: RegExp) =>
90
91
  export declare const powerSetOfSubstringsFromStart: (strings: string[], regex: RegExp) => string[];
91
92
  export declare const convertJSONPointerToJSONPath: (pointer: string) => string;
92
93
  export declare const flatMapOfJSONPaths: (paths: string[], json: object, resultType?: JSONPathOptions["resultType"]) => string[];
93
- export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => object;
94
+ export declare const applyCompareDiffOnUneditedDocument: (uneditedDocument: object, editedDocument: object) => any;
94
95
  /**
95
96
  * Returns a debounced variant of the function
96
97
  */
@@ -1,3 +1,3 @@
1
1
  import { MarkDownProps } from './Types';
2
- declare const MarkDown: ({ setExpandableIcon, markdown, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
2
+ declare const MarkDown: ({ setExpandableIcon, markdown: markdownProp, className, breaks, disableEscapedText, ...props }: MarkDownProps) => JSX.Element;
3
3
  export default MarkDown;
@@ -1,4 +1,4 @@
1
1
  export { RJSFForm } from './Form';
2
- export * from './types';
2
+ export type * from './types';
3
3
  export { getInferredTypeFromValueType, getRedirectionProps } from './utils';
4
4
  export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants';
@@ -1,5 +1,5 @@
1
1
  import { default as React, ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
2
- import { TippyProps } from '@tippyjs/react';
2
+ import { Placement } from 'tippy.js';
3
3
  import { UserGroupDTO } from '../Pages/GlobalConfigurations';
4
4
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
5
5
  import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
@@ -65,7 +65,7 @@ export interface CheckboxProps {
65
65
  id?: string;
66
66
  dataTestId?: string;
67
67
  }
68
- export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
68
+ export interface TippyCustomizedProps {
69
69
  theme: TippyTheme;
70
70
  visible?: boolean;
71
71
  heading?: ReactNode | string;
@@ -73,7 +73,7 @@ export interface TippyCustomizedProps extends Pick<TippyProps, 'appendTo'> {
73
73
  noHeadingBorder?: boolean;
74
74
  infoTextHeading?: string;
75
75
  hideHeading?: boolean;
76
- placement?: TippyProps['placement'];
76
+ placement?: Placement;
77
77
  className?: string;
78
78
  Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
79
79
  iconPath?: string;
@@ -273,6 +273,21 @@ export declare enum ManualApprovalType {
273
273
  any = "ANY",
274
274
  notConfigured = "NOT_CONFIGURED"
275
275
  }
276
+ export interface UserGroupApproverType {
277
+ email: string;
278
+ hasAccess: boolean;
279
+ }
280
+ export interface ImageApprovalPolicyUserGroupDataType {
281
+ dataStore: Record<string, UserGroupApproverType>;
282
+ requiredCount: number;
283
+ emails: string[];
284
+ }
285
+ export interface ImageApprovalPolicyType {
286
+ isPolicyConfigured: boolean;
287
+ specificUsersData: ImageApprovalPolicyUserGroupDataType;
288
+ userGroupData: Record<string, ImageApprovalPolicyUserGroupDataType>;
289
+ validGroups: string[];
290
+ }
276
291
  export type ImageApprovalUsersInfoDTO = Record<string, Pick<UserGroupDTO, 'identifier' | 'name'>[]>;
277
292
  export interface UserApprovalConfigType {
278
293
  type: ManualApprovalType;
@@ -285,6 +300,13 @@ export interface UserApprovalConfigType {
285
300
  requiredCount: number;
286
301
  })[];
287
302
  }
303
+ export type UserApprovalConfigPayloadType = ({
304
+ type: ManualApprovalType.any;
305
+ } & Pick<UserApprovalConfigType, 'requiredCount'>) | ({
306
+ type: ManualApprovalType.specific;
307
+ } & Pick<UserApprovalConfigType, 'userGroups' | 'specificUsers'>) | {
308
+ type: ManualApprovalType.notConfigured;
309
+ };
288
310
  interface ApprovalUserDataType {
289
311
  dataId: number;
290
312
  userActionTime: string;
@@ -294,45 +316,12 @@ interface ApprovalUserDataType {
294
316
  userResponse: number;
295
317
  userGroups?: Pick<UserGroupDTO, 'identifier' | 'name'>[];
296
318
  }
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
319
  export interface UserApprovalMetadataType {
330
320
  approvalRequestId: number;
331
- approvalRuntimeState: ApprovalRuntimeStateType;
321
+ approvalRuntimeState: number;
322
+ approvedUsersData: ApprovalUserDataType[];
332
323
  requestedUserData: ApprovalUserDataType;
333
- hasCurrentUserApproved: boolean;
334
- canCurrentUserApprove: boolean;
335
- approvalConfigData: ApprovalConfigDataType;
324
+ approvalConfig?: UserApprovalConfigType;
336
325
  }
337
326
  export declare enum FilterStates {
338
327
  ALLOWED = 0,
@@ -389,6 +378,7 @@ export interface CDMaterialListModalServiceUtilProps {
389
378
  artifactId?: number;
390
379
  artifactStatus?: string;
391
380
  disableDefaultSelection?: boolean;
381
+ userApprovalConfig?: UserApprovalConfigType;
392
382
  }
393
383
  export interface CDMaterialType {
394
384
  index: number;
@@ -524,7 +514,8 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
524
514
  primaryBranchAfterRegex?: string;
525
515
  storageConfigured?: boolean;
526
516
  deploymentAppDeleteRequest?: boolean;
527
- approvalConfigData: ApprovalConfigDataType;
517
+ approvalUsers?: string[];
518
+ userApprovalConfig?: UserApprovalConfigType;
528
519
  requestedUserId?: number;
529
520
  showPluginWarning: boolean;
530
521
  helmPackageName?: string;
@@ -581,17 +572,14 @@ export interface FilterConditionsListType {
581
572
  description: string;
582
573
  conditions: FilterConditionsInfo[];
583
574
  }
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
575
  export interface CDMaterialsApprovalInfo {
576
+ approvalUsers: string[];
577
+ userApprovalConfig: UserApprovalConfigType;
593
578
  canApproverDeploy: boolean;
594
- deploymentApprovalInfo: DeploymentApprovalInfoType;
579
+ /**
580
+ * Only available incase of approvals do'nt use in cd materials or any other flow since approvalUsers are not present there
581
+ */
582
+ imageApprovalPolicyDetails: ImageApprovalPolicyType;
595
583
  }
596
584
  export interface CDMaterialsMetaInfo {
597
585
  tagsEditable: boolean;
@@ -670,6 +658,7 @@ export interface AppEnvironment {
670
658
  appStatus?: string;
671
659
  deploymentAppDeleteRequest?: boolean;
672
660
  isVirtualEnvironment?: boolean;
661
+ isProtected?: boolean;
673
662
  pipelineId?: number;
674
663
  latestCdWorkflowRunnerId?: number;
675
664
  commits?: string[];
@@ -720,6 +709,7 @@ export interface CdPipeline {
720
709
  parentPipelineType?: string;
721
710
  deploymentAppDeleteRequest?: boolean;
722
711
  deploymentAppCreated?: boolean;
712
+ userApprovalConfig?: UserApprovalConfigType;
723
713
  isVirtualEnvironment?: boolean;
724
714
  deploymentAppType: DeploymentAppTypes;
725
715
  helmPackageName?: string;
@@ -728,7 +718,6 @@ export interface CdPipeline {
728
718
  isProdEnv?: boolean;
729
719
  isGitOpsRepoNotConfigured?: boolean;
730
720
  isDeploymentBlocked?: boolean;
731
- approvalConfigData: ApprovalConfigDataType;
732
721
  }
733
722
  export interface ExternalCiConfig {
734
723
  id: number;
@@ -830,11 +819,12 @@ export interface Point {
830
819
  export interface EdgeNodeType {
831
820
  height: number;
832
821
  width: number;
822
+ userApprovalConfig?: UserApprovalConfigType;
833
823
  type?: any;
834
824
  id?: number | string;
835
825
  }
836
826
  export interface EdgeEndNodeType extends EdgeNodeType {
837
- approvalConfigData: ApprovalConfigDataType;
827
+ userApprovalConfig?: UserApprovalConfigType;
838
828
  }
839
829
  /**
840
830
  * Search params for sorting configuration
@@ -0,0 +1,2 @@
1
+ export { ViewError as GUIViewError } from './utils';
2
+ export type { ViewErrorType as GUIViewErrorType } from './types';
@@ -0,0 +1,2 @@
1
+ export interface ViewErrorType extends Record<'title' | 'subTitle', string> {
2
+ }
@@ -0,0 +1,6 @@
1
+ import { ViewErrorType } from './types';
2
+ export declare class ViewError implements ViewErrorType {
3
+ title: string;
4
+ subTitle: string;
5
+ constructor(title: string, subTitle: string);
6
+ }
@@ -0,0 +1 @@
1
+ export * from './GUIView';
@@ -0,0 +1 @@
1
+ export * from './DeploymentTemplate';
@@ -0,0 +1 @@
1
+ export * from './AppConfiguration';
@@ -0,0 +1,3 @@
1
+ import { CMSecretExternalType } from '../../../../../../Shared/index';
2
+ export declare const hasHashiOrAWS: (externalType: CMSecretExternalType) => boolean;
3
+ export declare const hasESO: (externalType: CMSecretExternalType) => boolean;
@@ -1,4 +1,5 @@
1
1
  import { DraftMetadataDTO, TemplateListType } from '../../../../../../Shared/Services';
2
+ import { ServerErrors } from '../../../../../../Common/ServerError';
2
3
  import { OverrideMergeStrategyType } from '../types';
3
4
  export type DeploymentChartOptionkind = 'base' | 'env' | 'chartVersion' | 'deployment';
4
5
  export interface DeploymentChartVersionType {
@@ -108,15 +109,15 @@ interface BaseDeploymentTemplateConfigState {
108
109
  environmentConfig?: never;
109
110
  mergeStrategy?: never;
110
111
  }
111
- interface EnvironmentOverrideDeploymentTemplateConfigState {
112
+ type EnvironmentOverrideDeploymentTemplateConfigState = {
112
113
  chartConfig?: never;
113
114
  isOverridden: boolean;
114
115
  environmentConfig: EnvironmentConfigType;
115
116
  mergeStrategy: OverrideMergeStrategyType;
116
- }
117
+ };
117
118
  export interface DeploymentTemplateConfigCommonState extends SelectedChartDetailsType {
118
119
  /**
119
- * The first ever state of the deployment template
120
+ * The first ever state of the deployment template on editor
120
121
  */
121
122
  originalTemplate: Record<string, string>;
122
123
  isAppMetricsEnabled: boolean;
@@ -126,6 +127,23 @@ export interface DeploymentTemplateConfigCommonState extends SelectedChartDetail
126
127
  latestDraft?: DraftMetadataDTO;
127
128
  editorTemplate: string;
128
129
  editorTemplateWithoutLockedKeys: string;
130
+ /**
131
+ * This final template to be applied on the deployment in string format
132
+ * In current editor, this may be null initially
133
+ */
134
+ mergedTemplate: string | null;
135
+ /**
136
+ * This final template to be applied on the deployment without locked keys in string format
137
+ * In current editor, this may be null initially
138
+ */
139
+ mergedTemplateWithoutLockedKeys: string | null;
140
+ /**
141
+ * This final template to be applied on the deployment in object format
142
+ * In current editor, this may be null initially
143
+ */
144
+ mergedTemplateObject: Record<string, string> | null;
145
+ isLoadingMergedTemplate: boolean;
146
+ mergedTemplateError: ServerErrors | null;
129
147
  }
130
148
  export type DeploymentTemplateConfigState = DeploymentTemplateConfigCommonState & (BaseDeploymentTemplateConfigState | EnvironmentOverrideDeploymentTemplateConfigState);
131
149
  type DTApplicationMetricsReadOnlyProps = {
@@ -1,2 +1,3 @@
1
- declare const OverrideStrategyTippyContent: () => JSX.Element;
1
+ import { OverrideStrategyTippyContentProps } from './types';
2
+ declare const OverrideStrategyTippyContent: ({ children }: OverrideStrategyTippyContentProps) => JSX.Element;
2
3
  export default OverrideStrategyTippyContent;
@@ -3,3 +3,4 @@ export * from './types';
3
3
  export * from './constants';
4
4
  export { default as OverrideStrategyTippyContent } from './OverrideStrategyTippyContent';
5
5
  export { getDeploymentStageTitle } from './utils';
6
+ export * from './ConfigMapSecret';
@@ -20,8 +20,15 @@ export interface ConfigToolbarPopupMenuConfigType {
20
20
  disabled?: boolean;
21
21
  icon?: ReactNode | null;
22
22
  variant?: 'default' | 'negative';
23
+ tooltipText?: string;
23
24
  }
24
25
  export declare enum ConfigToolbarPopupNodeType {
25
26
  DISCARD_DRAFT = "discardDraft",
26
27
  EDIT_HISTORY = "editHistory"
27
28
  }
29
+ export interface OverrideStrategyTippyContentProps {
30
+ /**
31
+ * Would be rendered as li conveying the information about the merge strategy
32
+ */
33
+ children?: ReactNode;
34
+ }
@@ -1,2 +1,2 @@
1
1
  import { DeploymentStageType } from '../../../../../Shared/constants';
2
- export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "deployment" | "pre-deployment" | "post-deployment" | "-";
2
+ export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "-" | "pre-deployment" | "post-deployment" | "deployment";
@@ -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;
@@ -1,3 +1,4 @@
1
1
  export * from './GlobalConfigurations';
2
2
  export * from './ResourceBrowser';
3
3
  export * from './Applications';
4
+ export * from './App';
@@ -54,6 +54,12 @@ export type CollapsibleListItem<TabType extends TabOptions = 'navLink'> = Condit
54
54
  */
55
55
  tooltipProps?: TippyProps;
56
56
  };
57
+ /**
58
+ * If `true`, clears query parameters during navigation.
59
+ *
60
+ * @default false
61
+ */
62
+ clearQueryParamsOnNavigation?: boolean;
57
63
  };
58
64
  export interface CollapsibleListConfig<TabType extends TabOptions = 'navLink'> {
59
65
  /**
@@ -0,0 +1,2 @@
1
+ declare const EnterpriseTag: () => JSX.Element;
2
+ export default EnterpriseTag;
@@ -0,0 +1 @@
1
+ export { default as EnterpriseTag } from './EnterpriseTag.component';
@@ -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
+ }
@@ -41,5 +41,6 @@ export * from './Collapse';
41
41
  export * from './Security';
42
42
  export * from './Button';
43
43
  export * from './InvalidYAMLTippy';
44
+ export * from './EnterpriseTag';
44
45
  export * from './ConfirmationModal';
45
46
  export * from './DiffViewer';
@@ -1,7 +1,8 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Pair } from 'yaml';
3
+ import { StrictRJSFSchema } from '@rjsf/utils';
3
4
  import { MaterialHistoryType } from '@Shared/Services/app.types';
4
- import { MaterialInfo, SortingOrder, UserApprovalConfigType, ApprovalConfigDataType, UserApprovalInfo } from '../Common';
5
+ import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
5
6
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
6
7
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
7
8
  interface HighlightSearchTextProps {
@@ -40,13 +41,12 @@ export declare const decode: (data: any, isEncoded?: boolean) => {};
40
41
  export declare const isTimeStringAvailable: (time: string) => boolean;
41
42
  export declare const getTimeDifference: (startTime: string, endTime: string) => string;
42
43
  export declare const getFileNameFromHeaders: (headers: Headers) => string;
43
- export declare const sanitizeUserApprovalList: (approverList: UserApprovalInfo["approverList"]) => UserApprovalInfo["approverList"];
44
- export declare const sanitizeApprovalConfigData: (approvalConfigData: ApprovalConfigDataType | null) => ApprovalConfigDataType;
44
+ export declare const sanitizeUserApprovalConfig: (userApprovalConfig: UserApprovalConfigType) => UserApprovalConfigType;
45
45
  /**
46
46
  * Manual approval is considered configured only if the type is not notConfigured
47
47
  */
48
48
  export declare const getIsManualApprovalConfigured: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
49
- export declare const getIsApprovalPolicyConfigured: (approvalConfigData: ApprovalConfigDataType) => boolean;
49
+ export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
50
50
  /**
51
51
  * @description - Function to open a new tab with the given url
52
52
  * @param url - url to be opened in new tab
@@ -67,10 +67,11 @@ export declare const getDefaultValueFromType: (value: unknown) => {};
67
67
  */
68
68
  export declare const groupArrayByObjectKey: <T extends Record<string, any>, K extends keyof T>(array: T[], key: K) => Record<string, T[]>;
69
69
  /**
70
- * @description - Function to get the lower case object
71
- * @param input - The input object
72
- * @returns Record<string, any>
70
+ * This function returns a null/zero value corresponding to @type
71
+ *
72
+ * @param type - a RJSF supported type
73
73
  */
74
+ export declare const getNullValueFromType: (type: StrictRJSFSchema["type"]) => any;
74
75
  export declare const getLowerCaseObject: (input: any) => Record<string, any>;
75
76
  /**
76
77
  * @description - Function to get the webhook date
@@ -61,6 +61,10 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
61
61
  keepTouched?: boolean;
62
62
  /** A boolean indicating whether to retain the current error state of the form fields. */
63
63
  keepErrors?: boolean;
64
+ /** A boolean indicating whether the form should check for dirty state upon reset. */
65
+ triggerDirty?: boolean;
66
+ /** A boolean indicating whether the initial values of the form should be retained after reset. If false, provided formData will become initial data. */
67
+ keepInitialValues?: boolean;
64
68
  }) => void;
65
69
  /** An object representing additional form state. */
66
70
  formState: {
@@ -1,4 +1,5 @@
1
- import { ReleaseTag, UserApprovalMetadataType } from '../../Common';
1
+ import { OverrideMergeStrategyType } from '../../Pages/Applications';
2
+ import { ReleaseTag } from '../../Common';
2
3
  interface WebhookDataType {
3
4
  id: number;
4
5
  eventActionType: string;
@@ -132,7 +133,6 @@ export interface DraftMetadataDTO {
132
133
  commentsCount: number;
133
134
  dataEncrypted: boolean;
134
135
  isAppAdmin: boolean;
135
- userApprovalMetadata: UserApprovalMetadataType;
136
136
  }
137
137
  export declare enum CMSecretExternalType {
138
138
  Internal = "",
@@ -148,9 +148,11 @@ export declare enum CMSecretExternalType {
148
148
  }
149
149
  export interface ConfigDatum {
150
150
  name: string;
151
+ mergeStrategy: OverrideMergeStrategyType;
151
152
  type: string;
152
153
  external: boolean;
153
154
  data: Record<string, any>;
155
+ patchData: Record<string, any>;
154
156
  defaultData: Record<string, any>;
155
157
  global: boolean;
156
158
  externalType: CMSecretExternalType;
@@ -173,6 +175,7 @@ export interface ConfigMapSecretDataType {
173
175
  id: number;
174
176
  appId: number;
175
177
  configData: ConfigMapSecretDataConfigDatumDTO[];
178
+ isDeletable: boolean;
176
179
  }
177
180
  export declare enum ConfigResourceType {
178
181
  ConfigMap = "ConfigMap",
@@ -417,11 +417,4 @@ export declare const ALL_RESOURCE_KIND_FILTER = "all";
417
417
  export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/newticket";
418
418
  export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
419
419
  export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
420
- export declare const TARGET_IDS: {
421
- WORKFLOW_EDITOR_CONTAINER: string;
422
- };
423
- /**
424
- * Env ID to get the data for base configuration
425
- */
426
- export declare const BASE_CONFIGURATION_ENV_ID = -1;
427
420
  export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
@@ -1,8 +1,7 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { ApprovalConfigDataType } from '../Common/Types';
3
- import { OptionType, CommonNodeAttr, ResponseType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams } from '../Common';
2
+ import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams } from '../Common';
4
3
  import { KeyValueListType } from './Components';
5
- import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants';
4
+ import { EnvironmentTypeEnum, PatchOperationType } from './constants';
6
5
  export declare enum EnvType {
7
6
  CHART = "helm_charts",
8
7
  APPLICATION = "apps"
@@ -187,7 +186,7 @@ export interface AppDetails {
187
186
  clusterName?: string;
188
187
  dockerRegistryId?: string;
189
188
  deploymentAppDeleteRequest?: boolean;
190
- isApprovalPolicyApplicable?: boolean;
189
+ userApprovalConfig?: string;
191
190
  isVirtualEnvironment?: boolean;
192
191
  imageTag?: string;
193
192
  helmPackageName?: string;
@@ -247,7 +246,7 @@ export interface WorkflowType {
247
246
  showTippy?: boolean;
248
247
  appId?: number;
249
248
  isSelected?: boolean;
250
- approvalConfiguredIdsMap?: Record<number, ApprovalConfigDataType>;
249
+ approvalConfiguredIdsMap?: Record<number, UserApprovalConfigType>;
251
250
  imageReleaseTags: string[];
252
251
  appReleaseTags?: string[];
253
252
  tagsEditable?: boolean;
@@ -404,8 +403,7 @@ export interface SeverityCount {
404
403
  export declare enum PolicyKindType {
405
404
  lockConfiguration = "lock-configuration",
406
405
  imagePromotion = "image-promotion",
407
- plugins = "plugin",
408
- approval = "approval"
406
+ plugins = "plugin"
409
407
  }
410
408
  export interface LastExecutionResultType {
411
409
  lastExecution: string;
@@ -737,16 +735,6 @@ export interface DynamicTabType extends CommonTabArgsType {
737
735
  */
738
736
  lastActiveTabId: string | null;
739
737
  }
740
- export interface ResourceApprovalPolicyConfigDTO {
741
- appId: number;
742
- envId: number;
743
- approvalConfigurations: ApprovalConfigDataType[];
744
- }
745
- export interface ResourceApprovalPolicyConfigType extends Omit<ResourceApprovalPolicyConfigDTO, 'state' | 'approvalConfigurations'> {
746
- isApprovalApplicable: boolean;
747
- approvalConfigurationMap: Record<ApprovalConfigDataType['kind'], ApprovalConfigDataType>;
748
- }
749
- export type ResourceIdToResourceApprovalPolicyConfigMapType = Record<ResourceApprovalPolicyConfigType['envId'] | typeof BASE_CONFIGURATION_ENV_ID, Pick<ResourceApprovalPolicyConfigType, 'isApprovalApplicable' | 'approvalConfigurationMap'>>;
750
738
  export interface PreventOutsideFocusProps {
751
739
  identifier: string;
752
740
  preventFocus: boolean;
@@ -15,5 +15,5 @@
15
15
  -->
16
16
 
17
17
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
18
- <path d="M13.5 6.25L13.4995 2.5005L9.75 2.5M8.99821 7.00179L13.4982 2.50179M11.5 9V13C11.5 13.1326 11.4473 13.2598 11.3536 13.3536C11.2598 13.4473 11.1326 13.5 11 13.5H3C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13V5C2.5 4.86739 2.55268 4.74021 2.64645 4.64645C2.74021 4.55268 2.86739 4.5 3 4.5H7" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <path d="M13.5 6.25L13.4995 2.5005L9.75 2.5M8.99821 7.00179L13.4982 2.50179M11.5 9V13C11.5 13.1326 11.4473 13.2598 11.3536 13.3536C11.2598 13.4473 11.1326 13.5 11 13.5H3C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13V5C2.5 4.86739 2.55268 4.74021 2.64645 4.64645C2.74021 4.55268 2.86739 4.5 3 4.5H7" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
19
19
  </svg>
@@ -0,0 +1,7 @@
1
+ <!--
2
+ - Copyright (c) 2024. Devtron Inc.
3
+ -->
4
+
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
6
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 21h13.25a.75.75 0 0 0 .75-.75v-12M15.75 3h-9a.75.75 0 0 0-.75.75v4.125M15.75 3 21 8.25M15.75 3v5.25H21M4.96 11.714 3 14.347l1.96 2.633m4.08-5.266L11 14.347 9.04 16.98" vector-effect="non-scaling-stroke"/>
7
+ </svg>