@devtron-labs/devtron-fe-common-lib 1.2.4-beta-1 → 1.2.4-beta-3

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.
@@ -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-BKoUBsdS.js";
5
+ import { T as y, c as H, a as J, d as w } from "./@code-editor-DT9fzrvW.js";
6
6
  import M, { components as O } from "react-select";
7
7
  import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as U, ADDITIONAL_PROPERTY_FLAG as P, errorId as W, englishStringTranslator as V, TranslatableString as q, titleId as K, canExpand as Y, deepEquals as z } from "@rjsf/utils";
8
8
  import { ReactComponent as G } from "./assets/ic-chevron-down.fc70d7a7.svg";
@@ -70,30 +70,11 @@ export declare enum RefVariableStageType {
70
70
  PRE_CI = "PRE_CI",
71
71
  POST_CI = "POST_CI"
72
72
  }
73
- export interface FileProperty {
74
- allowedExtensions: string[];
75
- maxUploadSize: number;
76
- }
77
- export interface Constraint {
78
- fileProperty: FileProperty;
79
- }
80
- export interface ValueConstraint {
81
- choices: string[];
82
- blockCustomValue: boolean;
83
- constraint: Constraint;
84
- }
85
- export declare enum VariableTypeFormat {
86
- STRING = "STRING",
87
- NUMBER = "NUMBER",
88
- BOOL = "BOOL",
89
- DATE = "DATE",
90
- FILE = "FILE"
91
- }
92
73
  export interface VariableType {
93
74
  id: number;
94
75
  name: string;
95
76
  value: string;
96
- format: VariableTypeFormat;
77
+ format: string;
97
78
  description: string;
98
79
  defaultValue: string;
99
80
  allowEmptyValue: boolean;
@@ -102,12 +83,6 @@ export interface VariableType {
102
83
  refVariableName: string;
103
84
  refVariableStage?: RefVariableStageType;
104
85
  variableStepIndexInPlugin?: number;
105
- fileMountDir: string;
106
- fileReferenceId: number;
107
- valueConstraintId: number;
108
- valueConstraint: ValueConstraint;
109
- isRuntimeArg: boolean;
110
- refVariableUsed: boolean;
111
86
  }
112
87
  interface CommandArgsMap {
113
88
  command: string;
@@ -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;
@@ -5,6 +5,16 @@ 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
+ }
8
18
  export interface TagType {
9
19
  id?: number;
10
20
  key: string;
@@ -16,6 +26,8 @@ export interface TagType {
16
26
  isInvalidValue?: boolean;
17
27
  isSuggested?: boolean;
18
28
  isPropagateDisabled?: boolean;
29
+ deploymentPolicy?: DeploymentPolicy;
30
+ valueConstraint?: VariableValueConstraintTypes;
19
31
  }
20
32
  export interface TagErrorType {
21
33
  isValid: boolean;
@@ -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> {
@@ -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 {};
@@ -3,7 +3,7 @@ import { TippyProps } from '@tippyjs/react';
3
3
  import { Placement } from 'tippy.js';
4
4
  import { UserGroupDTO } from '../Pages/GlobalConfigurations';
5
5
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
6
- import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
6
+ import { MandatoryPluginBaseStateType, PolicyBlockInfo, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared';
7
7
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.';
8
8
  /**
9
9
  * Generic response type object with support for overriding the result type
@@ -432,6 +432,10 @@ export interface CDMaterialType {
432
432
  * Would currently only be received in case of release
433
433
  */
434
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;
435
439
  }
436
440
  export declare enum CDMaterialServiceEnum {
437
441
  ROLLBACK = "rollback",
@@ -468,6 +472,14 @@ export interface DownstreamNodesEnvironmentsType {
468
472
  environmentId: number;
469
473
  environmentName: string;
470
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
+ }
471
483
  export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
472
484
  connectingCiPipelineId?: number;
473
485
  parents: string | number[] | string[];
@@ -530,6 +542,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
530
542
  downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
531
543
  cipipelineId?: number;
532
544
  isDeploymentBlocked?: boolean;
545
+ triggerBlockedInfo?: TriggerBlockedInfo;
533
546
  }
534
547
  export declare enum DeploymentAppTypes {
535
548
  HELM = "helm",
@@ -593,6 +606,7 @@ export interface CDMaterialsMetaInfo {
593
606
  */
594
607
  requestedUserId: number;
595
608
  runtimeParams: RuntimeParamsListItemType[];
609
+ deploymentBlockedState?: PolicyBlockInfo;
596
610
  }
597
611
  export interface ImagePromotionMaterialInfo {
598
612
  isApprovalPendingForPromotion: boolean;
@@ -675,6 +689,7 @@ export interface CDStage {
675
689
  name: string;
676
690
  triggerType: 'AUTOMATIC' | 'MANUAL';
677
691
  config: string;
692
+ triggerBlockedInfo?: TriggerBlockedInfo;
678
693
  }
679
694
  export interface CDStageConfigMapSecretNames {
680
695
  configMaps: any[];
@@ -686,6 +701,7 @@ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
686
701
  triggerType: string;
687
702
  name: string;
688
703
  status: string;
704
+ triggerBlockedInfo?: TriggerBlockedInfo;
689
705
  }
690
706
  export interface CdPipeline {
691
707
  id: number;
@@ -719,6 +735,8 @@ export interface CdPipeline {
719
735
  isProdEnv?: boolean;
720
736
  isGitOpsRepoNotConfigured?: boolean;
721
737
  isDeploymentBlocked?: boolean;
738
+ isTriggerBlocked?: boolean;
739
+ triggerBlockedInfo?: TriggerBlockedInfo;
722
740
  }
723
741
  export interface ExternalCiConfig {
724
742
  id: number;
@@ -1,2 +1,2 @@
1
1
  import { DynamicDataTableProps } from './types';
2
- export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers, ...props }: DynamicDataTableProps<K, CustomStateType>) => JSX.Element;
2
+ export declare const DynamicDataTable: <K extends string>({ headers, ...props }: DynamicDataTableProps<K>) => JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { DynamicDataTableHeaderProps } from './types';
2
- export declare const DynamicDataTableHeader: <K extends string, CustomStateType = Record<string, unknown>>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K, CustomStateType>) => JSX.Element;
2
+ export declare const DynamicDataTableHeader: <K extends string>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K>) => JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { DynamicDataTableRowProps } from './types';
2
- export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, maskValue, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
2
+ export declare const DynamicDataTableRow: <K extends string>({ rows, headers, maskValue, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, validationSchema, showError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, }: DynamicDataTableRowProps<K>) => JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
2
2
  import { SortingOrder } from '../../../Common/Constants';
3
3
  import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
4
+ import { InfoIconTippyProps } from '../../../Common/Types';
4
5
  import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker';
5
6
  import { SelectTextAreaProps } from '../SelectTextArea';
6
- import { FileUploadProps } from '../FileUpload';
7
7
  /**
8
8
  * Interface representing header for a dynamic data table.
9
9
  * @template K - A string representing the key type.
@@ -19,13 +19,14 @@ export type DynamicDataTableHeaderType<K extends string> = {
19
19
  isSortable?: boolean;
20
20
  /** An optional boolean to control the visibility of the column. */
21
21
  isHidden?: boolean;
22
+ /** An optional boolean to show the column */
23
+ renderHelpTextForHeader?: () => ReactNode;
22
24
  };
23
25
  export declare enum DynamicDataTableRowDataType {
24
26
  TEXT = "text",
25
27
  DROPDOWN = "dropdown",
26
28
  SELECT_TEXT = "select-text",
27
- BUTTON = "button",
28
- FILE_UPLOAD = "file-upload"
29
+ BUTTON = "button"
29
30
  }
30
31
  export type DynamicDataTableCellPropsMap = {
31
32
  [DynamicDataTableRowDataType.TEXT]: Omit<ResizableTagTextAreaProps, 'className' | 'minHeight' | 'maxHeight' | 'value' | 'onChange' | 'disabled' | 'disableOnBlurResizeToMinHeight' | 'refVar' | 'dependentRef'>;
@@ -37,7 +38,6 @@ export type DynamicDataTableCellPropsMap = {
37
38
  icon?: ReactNode;
38
39
  text: string;
39
40
  };
40
- [DynamicDataTableRowDataType.FILE_UPLOAD]: Omit<FileUploadProps, 'className' | 'fileName' | 'onUpload' | 'multiple'>;
41
41
  };
42
42
  type DynamicDataTableCellData<T extends keyof DynamicDataTableCellPropsMap = keyof DynamicDataTableCellPropsMap> = T extends keyof DynamicDataTableCellPropsMap ? {
43
43
  type: T;
@@ -63,14 +63,14 @@ export type DynamicDataTableRowType<K extends string, CustomStateType = Record<s
63
63
  type DynamicDataTableMask<K extends string> = {
64
64
  [key in K]?: boolean;
65
65
  };
66
- type DynamicDataTableCellIcon<K extends string, CustomStateType = Record<string, unknown>> = {
67
- [key in K]?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
66
+ type DynamicDataTableCellIcon<K extends string> = {
67
+ [key in K]?: (row: DynamicDataTableRowType<K>) => ReactNode;
68
68
  };
69
69
  /**
70
70
  * Interface representing the properties for the dynamic data table component.
71
71
  * @template K - A string representing the key type.
72
72
  */
73
- export type DynamicDataTableProps<K extends string, CustomStateType = Record<string, unknown>> = {
73
+ export type DynamicDataTableProps<K extends string> = {
74
74
  /**
75
75
  * An array containing the headers for the data table. \
76
76
  * Each header defines a column with its label, key, width, and optional settings.
@@ -79,7 +79,7 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
79
79
  /**
80
80
  * An array of rows where each row contains data corresponding to the table headers.
81
81
  */
82
- rows: DynamicDataTableRowType<K, CustomStateType>[];
82
+ rows: DynamicDataTableRowType<K>[];
83
83
  /** Optional configuration for sorting the table. */
84
84
  sortingConfig?: {
85
85
  sortBy: K;
@@ -89,11 +89,11 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
89
89
  /** An optional mask to hide the values of the cell. */
90
90
  maskValue?: DynamicDataTableMask<K>;
91
91
  /** Optional configuration for displaying an icon in the leading position of a cell. */
92
- leadingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
92
+ leadingCellIcon?: DynamicDataTableCellIcon<K>;
93
93
  /** Optional configuration for displaying an icon in the trailing position of a cell. */
94
- trailingCellIcon?: DynamicDataTableCellIcon<K, CustomStateType>;
94
+ trailingCellIcon?: DynamicDataTableCellIcon<K>;
95
95
  /** An optional function to render a custom wrapper component for the type `DynamicDataTableRowDataType.BUTTON`. */
96
- buttonCellWrapComponent?: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactElement;
96
+ buttonCellWrapComponent?: (row: DynamicDataTableRowType<K>) => ReactElement;
97
97
  /** An optional React node for a custom header component. */
98
98
  headerComponent?: ReactNode;
99
99
  /** When true, data addition field will not be shown. */
@@ -111,15 +111,14 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
111
111
  * @param value - The value of the cell.
112
112
  * @param extraData - Additional data, such as a selected value for dropdowns.
113
113
  */
114
- onRowEdit: (row: DynamicDataTableRowType<K, CustomStateType>, headerKey: K, value: string, extraData: {
115
- files?: File[];
114
+ onRowEdit: (row: DynamicDataTableRowType<K>, headerKey: K, value: string, extraData: {
116
115
  selectedValue?: SelectPickerOptionType<string>;
117
116
  }) => void;
118
117
  /**
119
118
  * Function to handle row deletions.
120
119
  * @param row - The row that was deleted.
121
120
  */
122
- onRowDelete: (row: DynamicDataTableRowType<K, CustomStateType>) => void;
121
+ onRowDelete: (row: DynamicDataTableRowType<K>) => void;
123
122
  /** Optional configuration for rendering a custom action button in a row. */
124
123
  actionButtonConfig?: {
125
124
  /**
@@ -127,7 +126,7 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
127
126
  * @param row - The current row being rendered.
128
127
  * @returns A React node representing the action button.
129
128
  */
130
- renderer: (row: DynamicDataTableRowType<K, CustomStateType>) => ReactNode;
129
+ renderer: (row: DynamicDataTableRowType<K>) => ReactNode;
131
130
  /**
132
131
  * This represents under which header key the action button will be rendered.
133
132
  */
@@ -154,13 +153,13 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
154
153
  * @param row - The row containing the cell.
155
154
  * @returns An object with a boolean indicating validity and an array of error messages.
156
155
  */
157
- validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K, CustomStateType>) => {
156
+ validationSchema?: (value: string, key: K, row: DynamicDataTableRowType<K>) => {
158
157
  isValid: boolean;
159
158
  errorMessages: string[];
160
159
  };
161
160
  };
162
- export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
161
+ export interface DynamicDataTableHeaderProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'>, Pick<InfoIconTippyProps, 'heading' | 'additionalContent'> {
163
162
  }
164
- export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'maskValue' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
163
+ export interface DynamicDataTableRowProps<K extends string> extends Pick<DynamicDataTableProps<K>, 'rows' | 'headers' | 'maskValue' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'showError' | 'validationSchema' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent'> {
165
164
  }
166
165
  export {};
@@ -1,5 +1,5 @@
1
1
  import { DynamicDataTableHeaderType, DynamicDataTableProps, DynamicDataTableRowDataType } from './types';
2
- export declare const getActionButtonPosition: <K extends string, CustomStateType = Record<string, unknown>>({ headers, actionButtonConfig, }: Pick<DynamicDataTableProps<K, CustomStateType>, "headers" | "actionButtonConfig">) => number;
3
- export declare const getHeaderGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["actionButtonConfig"], noDeleteBtn: boolean) => string;
4
- export declare const getRowGridTemplateColumn: <K extends string, CustomStateType = Record<string, unknown>>(headers: DynamicDataTableHeaderType<K>[], actionButtonConfig: DynamicDataTableProps<K, CustomStateType>["actionButtonConfig"], noDeleteBtn: boolean) => string;
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
5
  export declare const rowTypeHasInputField: (type: DynamicDataTableRowDataType) => boolean;
@@ -44,4 +44,3 @@ export * from './InvalidYAMLTippy';
44
44
  export * from './ConfirmationModal';
45
45
  export * from './DiffViewer';
46
46
  export * from './DynamicDataTable';
47
- export * from './FileUpload';
@@ -1,5 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams } from '../Common';
2
+ import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType } from '../Common';
3
3
  import { KeyValueListType } from './Components';
4
4
  import { EnvironmentTypeEnum, PatchOperationType } from './constants';
5
5
  export declare enum EnvType {
@@ -739,4 +739,22 @@ export interface PreventOutsideFocusProps {
739
739
  identifier: string;
740
740
  preventFocus: boolean;
741
741
  }
742
+ export interface PolicyBlockInfo {
743
+ isBlocked: boolean;
744
+ blockedBy: TriggerBlockType;
745
+ reason: string;
746
+ }
747
+ export interface PipelineStageBlockInfo {
748
+ node: PolicyBlockInfo;
749
+ pre: PolicyBlockInfo;
750
+ post: PolicyBlockInfo;
751
+ }
752
+ export interface PolicyConsequencesDTO {
753
+ cd: PipelineStageBlockInfo;
754
+ ci: PipelineStageBlockInfo;
755
+ }
756
+ export interface GetPolicyConsequencesProps {
757
+ appId: number;
758
+ envId: number;
759
+ }
742
760
  export {};