@devtron-labs/devtron-fe-common-lib 1.3.0 → 1.3.2-beta-1

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 (26) hide show
  1. package/dist/{@code-editor-BvXchjCR.js → @code-editor-CUAwqT3V.js} +3611 -3471
  2. package/dist/{@common-rjsf-vfPS8lwE.js → @common-rjsf-BIT011zH.js} +1 -1
  3. package/dist/Common/Constants.d.ts +1 -0
  4. package/dist/Common/CustomTagSelector/Types.d.ts +12 -14
  5. package/dist/Common/CustomTagSelector/index.d.ts +1 -1
  6. package/dist/Common/CustomTagSelector/tags.utils.d.ts +13 -0
  7. package/dist/Common/DraggableWrapper/types.d.ts +1 -0
  8. package/dist/Common/Helper.d.ts +3 -1
  9. package/dist/Common/SegmentedBarChart/types.d.ts +1 -0
  10. package/dist/Common/Types.d.ts +20 -4
  11. package/dist/Pages/GlobalConfigurations/Authorization/index.d.ts +1 -0
  12. package/dist/Pages/GlobalConfigurations/Authorization/types.d.ts +6 -0
  13. package/dist/Pages/ResourceBrowser/types.d.ts +39 -0
  14. package/dist/Shared/Components/DynamicDataTable/types.d.ts +2 -0
  15. package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +3 -0
  16. package/dist/Shared/Components/TagsKeyValueTable/constants.d.ts +4 -0
  17. package/dist/Shared/Components/TagsKeyValueTable/index.d.ts +4 -0
  18. package/dist/Shared/Components/TagsKeyValueTable/types.d.ts +12 -0
  19. package/dist/Shared/Components/TagsKeyValueTable/utils.d.ts +3 -0
  20. package/dist/Shared/Components/index.d.ts +1 -0
  21. package/dist/Shared/types.d.ts +19 -1
  22. package/dist/assets/@code-editor.css +1 -1
  23. package/dist/index.js +559 -550
  24. package/package.json +1 -1
  25. package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +0 -2
  26. package/dist/Common/CustomTagSelector/TagSelector.utils.d.ts +0 -12
@@ -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-BvXchjCR.js";
5
+ import { T as y, c as H, a as J, d as w } from "./@code-editor-CUAwqT3V.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
  DECIMAL_NUMBERS: RegExp;
17
18
  NATURAL_NUMBERS: RegExp;
18
19
  KUBERNETES_KEY_PREFIX: 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,6 @@
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';
6
+ export { validateTagKeyValue, validateTagValue } from './tags.utils';
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * @param value tag key value to validate
4
+ * @returns isValid: boolean, errorMessages: string[]
5
+ */
6
+ export declare const validateTagKeyValue: (value: string) => {
7
+ isValid: boolean;
8
+ errorMessages: string[];
9
+ };
10
+ export declare const validateTagValue: (value: string, key: string) => {
11
+ isValid: boolean;
12
+ errorMessages: string[];
13
+ };
@@ -20,6 +20,7 @@ export interface DraggableWrapperProps {
20
20
  childDivProps?: HTMLAttributes<HTMLDivElement>;
21
21
  /**
22
22
  * Delta for fixing the scrollable layout positioning
23
+ * @deprecated
23
24
  */
24
25
  layoutFixDelta?: number;
25
26
  }
@@ -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;
@@ -24,6 +24,7 @@ export declare const reportIssue: () => void;
24
24
  export declare function useEffectAfterMount(cb: any, dependencies: any): void;
25
25
  export declare function getCookie(sKey: any): string;
26
26
  export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
27
+ export declare const getFormattedUTCTimeForExport: (timeToConvert: string, fallback?: string) => string;
27
28
  export declare function useSearchString(): UseSearchString;
28
29
  export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) => void;
29
30
  export declare function useJsonYaml(value: any, tabSize?: number, language?: string, shouldRun?: boolean): any[];
@@ -135,5 +136,6 @@ export declare const getSanitizedIframe: (iframeString: string) => string;
135
136
  * This method adds default attributes to iframe - title, loading ="lazy", width="100%", height="100%"
136
137
  */
137
138
  export declare const getIframeWithDefaultAttributes: (iframeString: string, defaultName?: string) => string;
139
+ export declare const getStageTitle: (stageType: DeploymentNodeType) => string;
138
140
  export declare const getGoLangFormattedDateWithTimezone: (dateFormat: string) => string;
139
141
  export {};
@@ -8,4 +8,5 @@ export interface SegmentedBarChartProps {
8
8
  rootClassName?: string;
9
9
  countClassName?: string;
10
10
  labelClassName?: string;
11
+ isProportional?: boolean;
11
12
  }
@@ -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, RuntimePluginVariables, Severity } from '../Shared';
6
+ import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo } from '../Shared';
7
7
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, RefVariableType, SortingOrder, TaskErrorObj, VariableTypeFormat } from '.';
8
8
  /**
9
9
  * Generic response type object with support for overriding the result type
@@ -433,6 +433,10 @@ export interface CDMaterialType {
433
433
  * Would currently only be received in case of release
434
434
  */
435
435
  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;
436
440
  }
437
441
  export declare enum CDMaterialServiceEnum {
438
442
  ROLLBACK = "rollback",
@@ -469,6 +473,15 @@ export interface DownstreamNodesEnvironmentsType {
469
473
  environmentId: number;
470
474
  environmentName: string;
471
475
  }
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
+ }
472
485
  export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
473
486
  connectingCiPipelineId?: number;
474
487
  parents: string | number[] | string[];
@@ -531,6 +544,7 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr
531
544
  downstreamEnvironments?: DownstreamNodesEnvironmentsType[];
532
545
  cipipelineId?: number;
533
546
  isDeploymentBlocked?: boolean;
547
+ triggerBlockedInfo?: TriggerBlockedInfo;
534
548
  }
535
549
  export declare enum DeploymentAppTypes {
536
550
  HELM = "helm",
@@ -593,6 +607,7 @@ export interface CDMaterialsMetaInfo {
593
607
  * This is the ID of user that has request the material
594
608
  */
595
609
  requestedUserId: number;
610
+ deploymentBlockedState?: PolicyBlockInfo;
596
611
  runtimeParams: RuntimePluginVariables[];
597
612
  }
598
613
  export interface ImagePromotionMaterialInfo {
@@ -671,7 +686,7 @@ export interface Strategy {
671
686
  config: any;
672
687
  default?: boolean;
673
688
  }
674
- export interface CDStage {
689
+ export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo' | 'isTriggerBlocked'>> {
675
690
  status: string;
676
691
  name: string;
677
692
  triggerType: 'AUTOMATIC' | 'MANUAL';
@@ -681,14 +696,14 @@ export interface CDStageConfigMapSecretNames {
681
696
  configMaps: any[];
682
697
  secrets: any[];
683
698
  }
684
- export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
699
+ export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
685
700
  isValid: boolean;
686
701
  steps: TaskErrorObj[];
687
702
  triggerType: string;
688
703
  name: string;
689
704
  status: string;
690
705
  }
691
- export interface CdPipeline {
706
+ export interface CdPipeline extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
692
707
  id: number;
693
708
  environmentId: number;
694
709
  environmentName?: string;
@@ -720,6 +735,7 @@ export interface CdPipeline {
720
735
  isProdEnv?: boolean;
721
736
  isGitOpsRepoNotConfigured?: boolean;
722
737
  isDeploymentBlocked?: boolean;
738
+ isTriggerBlocked?: boolean;
723
739
  }
724
740
  export interface ExternalCiConfig {
725
741
  id: number;
@@ -1,5 +1,6 @@
1
1
  export * from './constants';
2
2
  export type { UserListFilterParams, UserRoleGroup, UserGroupDTO, UserGroupType } from './types';
3
+ export { UserTypeToFetchType } from './types';
3
4
  export * from './shared';
4
5
  export * from './service';
5
6
  export { getUserAndApiTokenOption } from './utils';
@@ -1,10 +1,16 @@
1
1
  import { BaseFilterQueryParams } from '../../../Shared';
2
2
  import { UserListSortableKeys, UserStatus } from './constants';
3
+ export declare enum UserTypeToFetchType {
4
+ includeDeleted = "includeDeleted",
5
+ excludeDelete = "excludeDelete",
6
+ onlyDeleted = "onlyDeleted"
7
+ }
3
8
  export type UserListFilterParams = BaseFilterQueryParams<UserListSortableKeys> & {
4
9
  /**
5
10
  * Selected statuses (if any)
6
11
  */
7
12
  status: UserStatus[];
13
+ typeToFetch?: UserTypeToFetchType;
8
14
  };
9
15
  export interface UserMinType {
10
16
  id: number;
@@ -8,3 +8,42 @@ export declare enum ClusterStatusType {
8
8
  UNHEALTHY = "unhealthy",
9
9
  CONNECTION_FAILED = "connection failed"
10
10
  }
11
+ export interface ResourceDetail {
12
+ name: string;
13
+ capacity: string;
14
+ allocatable: string;
15
+ usage: string;
16
+ request: string;
17
+ limit: string;
18
+ usagePercentage: string;
19
+ requestPercentage: string;
20
+ limitPercentage: string;
21
+ }
22
+ export interface NodeTaintType {
23
+ effect: string;
24
+ key: string;
25
+ value: string;
26
+ }
27
+ export interface NodeDetailsType {
28
+ nodeName: string;
29
+ nodeGroup: string;
30
+ taints?: NodeTaintType[];
31
+ }
32
+ export interface ClusterCapacityType {
33
+ name: string;
34
+ nodeCount: number;
35
+ nodeK8sVersions: string[];
36
+ cpu: ResourceDetail;
37
+ memory: ResourceDetail;
38
+ serverVersion: string;
39
+ nodeDetails?: NodeDetailsType[];
40
+ nodeErrors: Record<string, string>[];
41
+ status?: ClusterStatusType;
42
+ isProd: boolean;
43
+ }
44
+ export interface ClusterDetail extends ClusterCapacityType {
45
+ id: number;
46
+ errorInNodeListing: string;
47
+ nodeNames?: string[];
48
+ isVirtualCluster?: boolean;
49
+ }
@@ -20,6 +20,8 @@ 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;
23
25
  };
24
26
  export declare enum DynamicDataTableRowDataType {
25
27
  TEXT = "text",
@@ -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,4 @@
1
+ export { default as TagsContainer } from './TagsContainer';
2
+ export { getEmptyTagTableRow } from './utils';
3
+ export type { TagsTableColumnsType } from './types';
4
+ export { DEVTRON_AI_URL } from './constants';
@@ -0,0 +1,12 @@
1
+ import { DynamicDataTableCellErrorType, DynamicDataTableProps, DynamicDataTableRowType } from '../DynamicDataTable';
2
+ export type TagsTableColumnsType = 'tagKey' | 'tagValue';
3
+ export interface TagsContainerProps extends Partial<Pick<DynamicDataTableProps<TagsTableColumnsType>, 'onRowEdit'>> {
4
+ appType: string;
5
+ isCreateApp?: boolean;
6
+ rows: DynamicDataTableRowType<TagsTableColumnsType>[];
7
+ setRows: (updatedRows: DynamicDataTableRowType<TagsTableColumnsType>[]) => void;
8
+ hidePropagateTags?: boolean;
9
+ getEmptyRow?: (keyChoices?: string[]) => DynamicDataTableRowType<TagsTableColumnsType>;
10
+ tagsError: DynamicDataTableCellErrorType<TagsTableColumnsType>;
11
+ setTagErrors: (updatedTagsError: DynamicDataTableCellErrorType<TagsTableColumnsType>) => void;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { DynamicDataTableRowType } from '../DynamicDataTable';
2
+ import { TagsTableColumnsType } from './types';
3
+ export declare const getEmptyTagTableRow: () => DynamicDataTableRowType<TagsTableColumnsType>;
@@ -46,4 +46,5 @@ export * from './EnterpriseTag';
46
46
  export * from './ConfirmationModal';
47
47
  export * from './DiffViewer';
48
48
  export * from './DynamicDataTable';
49
+ export * from './TagsKeyValueTable';
49
50
  export * from './FileUpload';
@@ -1,5 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
2
+ import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
3
3
  import { EnvironmentTypeEnum, PatchOperationType } from './constants';
4
4
  export declare enum EnvType {
5
5
  CHART = "helm_charts",
@@ -752,6 +752,24 @@ export interface PreventOutsideFocusProps {
752
752
  identifier: string;
753
753
  preventFocus: boolean;
754
754
  }
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
+ }
755
773
  export interface UploadFileDTO {
756
774
  id: number;
757
775
  name: string;