@devtron-labs/devtron-fe-common-lib 1.2.13 → 1.2.14-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.
@@ -2,7 +2,7 @@ import { j as n, J as A } from "./@vendor-BG3OpQCq.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-DrM78ohh.js";
5
+ import { T as y, c as H, a as J, d as w } from "./@code-editor-Dq63qqN5.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";
@@ -13,6 +13,7 @@ export declare const DOCUMENTATION: {
13
13
  GLOBAL_CONFIG_BUILD_INFRA: string;
14
14
  };
15
15
  export declare const PATTERNS: {
16
+ STRING: RegExp;
16
17
  KUBERNETES_KEY_PREFIX: RegExp;
17
18
  KUBERNETES_KEY_NAME: RegExp;
18
19
  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,20 +26,8 @@ export interface TagType {
16
26
  isInvalidValue?: boolean;
17
27
  isSuggested?: boolean;
18
28
  isPropagateDisabled?: boolean;
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;
29
+ deploymentPolicy?: DeploymentPolicy;
30
+ valueConstraint?: VariableValueConstraintTypes;
33
31
  }
34
32
  export interface TagDetailType {
35
33
  index: number;
@@ -1,6 +1,5 @@
1
1
  export { default as PropagateTagInfo } from './PropagateTagInfo';
2
2
  export * from './TagDetails';
3
- export * from './TagLabelSelect';
4
3
  export * from './TagLabelValueSelector';
5
4
  export * from './ResizableTagTextArea';
6
5
  export * from './Types';
@@ -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
  import * as Sentry from '@sentry/browser';
6
6
  export declare function showError(serverError: any, showToastOnUnknownError?: boolean, hideAccessError?: boolean): void;
@@ -135,4 +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;
138
139
  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,15 @@ 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
+ SECURITY_SCAN = "security-scan"
479
+ }
480
+ export interface TriggerBlockedInfo {
481
+ blockedBy: TriggerBlockType;
482
+ blockedReason?: string;
483
+ }
471
484
  export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
472
485
  connectingCiPipelineId?: number;
473
486
  parents: string | number[] | string[];
@@ -530,6 +543,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
530
543
  downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
531
544
  cipipelineId?: number;
532
545
  isDeploymentBlocked?: boolean;
546
+ triggerBlockedInfo?: TriggerBlockedInfo;
533
547
  }
534
548
  export declare enum DeploymentAppTypes {
535
549
  HELM = "helm",
@@ -593,6 +607,7 @@ export interface CDMaterialsMetaInfo {
593
607
  */
594
608
  requestedUserId: number;
595
609
  runtimeParams: RuntimeParamsListItemType[];
610
+ deploymentBlockedState?: PolicyBlockInfo;
596
611
  }
597
612
  export interface ImagePromotionMaterialInfo {
598
613
  isApprovalPendingForPromotion: boolean;
@@ -670,7 +685,7 @@ export interface Strategy {
670
685
  config: any;
671
686
  default?: boolean;
672
687
  }
673
- export interface CDStage {
688
+ export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
674
689
  status: string;
675
690
  name: string;
676
691
  triggerType: 'AUTOMATIC' | 'MANUAL';
@@ -680,14 +695,14 @@ export interface CDStageConfigMapSecretNames {
680
695
  configMaps: any[];
681
696
  secrets: any[];
682
697
  }
683
- export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
698
+ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
684
699
  isValid: boolean;
685
700
  steps: TaskErrorObj[];
686
701
  triggerType: string;
687
702
  name: string;
688
703
  status: string;
689
704
  }
690
- export interface CdPipeline {
705
+ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
691
706
  id: number;
692
707
  environmentId: number;
693
708
  environmentName?: string;
@@ -719,6 +734,7 @@ export interface CdPipeline {
719
734
  isProdEnv?: boolean;
720
735
  isGitOpsRepoNotConfigured?: boolean;
721
736
  isDeploymentBlocked?: boolean;
737
+ isTriggerBlocked?: boolean;
722
738
  }
723
739
  export interface ExternalCiConfig {
724
740
  id: number;
@@ -19,6 +19,8 @@ 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
+ renderAdditionalContent?: () => ReactNode;
22
24
  };
23
25
  export declare enum DynamicDataTableRowDataType {
24
26
  TEXT = "text",
@@ -134,5 +134,5 @@ import { SelectPickerProps } from './type';
134
134
  * />
135
135
  * ```
136
136
  */
137
- declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, renderMenuListFooter, inputValue, onInputChange, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
137
+ declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, renderMenuListFooter, inputValue, onInputChange, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, formatCreateLabel, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
138
138
  export default SelectPicker;
@@ -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'>> & {
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'>> & {
65
65
  /**
66
66
  * Error message for the select
67
67
  */
@@ -0,0 +1,3 @@
1
+ import { TagsContainerProps } from './types';
2
+ declare const TagsContainer: ({ isCreateApp, hidePropagateTags, ...props }: TagsContainerProps) => JSX.Element;
3
+ export default TagsContainer;
@@ -0,0 +1,4 @@
1
+ import { DynamicDataTableHeaderType } from '../DynamicDataTable';
2
+ import { TagsTableColumnsType } from './types';
3
+ export declare const TAGS_TABLE_HEADERS: DynamicDataTableHeaderType<TagsTableColumnsType>[];
4
+ export declare const DEVTRON_AI_URL: string;
@@ -0,0 +1,3 @@
1
+ export { default as TagsContainer } from './TagsContainer';
2
+ export { getEmptyTagTableRow, validateTagKeyValues } from './utils';
3
+ export type { TagsTableColumnsType } from './types';
@@ -0,0 +1,11 @@
1
+ import { DynamicDataTableCellErrorType, DynamicDataTableProps, DynamicDataTableRowType } from '../DynamicDataTable';
2
+ export type TagsTableColumnsType = 'tagKey' | 'tagValue';
3
+ export interface TagsContainerProps extends Partial<Pick<DynamicDataTableProps<TagsTableColumnsType>, 'onRowEdit'>> {
4
+ isCreateApp?: boolean;
5
+ rows: DynamicDataTableRowType<TagsTableColumnsType>[];
6
+ setRows: (updatedRows: DynamicDataTableRowType<TagsTableColumnsType>[]) => void;
7
+ hidePropagateTags?: boolean;
8
+ getEmptyRow?: (keyChoices?: string[]) => DynamicDataTableRowType<TagsTableColumnsType>;
9
+ tagsError: DynamicDataTableCellErrorType<TagsTableColumnsType>;
10
+ setTagErrors: (updatedTagsError: DynamicDataTableCellErrorType<TagsTableColumnsType>) => void;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { DynamicDataTableRowType } from '../DynamicDataTable';
2
+ import { TagsTableColumnsType } from './types';
3
+ export declare const getEmptyTagTableRow: () => DynamicDataTableRowType<TagsTableColumnsType>;
4
+ export declare const validateTagKeyValues: (value: string, key: string) => {
5
+ isValid: boolean;
6
+ errorMessages: string[];
7
+ };
@@ -45,3 +45,4 @@ export * from './EnterpriseTag';
45
45
  export * from './ConfirmationModal';
46
46
  export * from './DiffViewer';
47
47
  export * from './DynamicDataTable';
48
+ export * from './TagsKeyValueTable';
@@ -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 {
@@ -740,4 +740,22 @@ export interface PreventOutsideFocusProps {
740
740
  identifier: string;
741
741
  preventFocus: boolean;
742
742
  }
743
+ export interface PolicyBlockInfo {
744
+ isBlocked: boolean;
745
+ blockedBy: TriggerBlockType;
746
+ reason: string;
747
+ }
748
+ export interface PipelineStageBlockInfo {
749
+ node: PolicyBlockInfo;
750
+ pre: PolicyBlockInfo;
751
+ post: PolicyBlockInfo;
752
+ }
753
+ export interface PolicyConsequencesDTO {
754
+ cd: PipelineStageBlockInfo;
755
+ ci: PipelineStageBlockInfo;
756
+ }
757
+ export interface GetPolicyConsequencesProps {
758
+ appId: number;
759
+ envId: number;
760
+ }
743
761
  export {};