@devtron-labs/devtron-fe-common-lib 1.15.0 → 1.15.1-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.
@@ -1,7 +1,7 @@
1
1
  import { j as n, as as y, au as k, at as W } from "./@vendor-STJ9h0oI.js";
2
2
  import V, { forwardRef as J, useMemo as P } from "react";
3
3
  import K, { getDefaultRegistry as q } from "@rjsf/core";
4
- import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-UCp9Sbuo.js";
4
+ import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-C_u3nWGd.js";
5
5
  import Q, { components as D } from "react-select";
6
6
  import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
7
7
  import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
@@ -1,4 +1,7 @@
1
- import { RefObject } from 'react';
1
+ import { Dispatch, RefObject, SetStateAction } from 'react';
2
+ import { GroupBase } from 'react-select';
3
+ import { ServerErrors } from '../../Common/ServerError';
4
+ import { SelectPickerOptionType } from '../../Shared/Components';
2
5
  import { Nodes, NodeType } from '../../Shared/types';
3
6
  export interface GVKType {
4
7
  Group: string;
@@ -34,14 +37,37 @@ export interface K8sResourceListPayloadType {
34
37
  filter?: string;
35
38
  k8sRequest: ResourceListPayloadK8sRequestType;
36
39
  }
40
+ export declare enum ResourceRecommenderHeaderType {
41
+ NAME = "name",
42
+ NAMESPACE = "namespace",
43
+ KIND = "kind",
44
+ API_VERSION = "apiVersion",
45
+ CONTAINER_NAME = "containerName",
46
+ CPU_REQUEST = "cpuRequest",
47
+ CPU_LIMIT = "cpuLimit",
48
+ MEMORY_REQUEST = "memoryRequest",
49
+ MEMORY_LIMIT = "memoryLimit"
50
+ }
51
+ export type ResourceRecommenderHeaderWithStringValue = Extract<ResourceRecommenderHeaderType, ResourceRecommenderHeaderType.NAME | ResourceRecommenderHeaderType.NAMESPACE | ResourceRecommenderHeaderType.KIND | ResourceRecommenderHeaderType.API_VERSION | ResourceRecommenderHeaderType.CONTAINER_NAME>;
52
+ export type ResourceRecommenderHeaderWithRecommendation = Extract<ResourceRecommenderHeaderType, ResourceRecommenderHeaderType.CPU_REQUEST | ResourceRecommenderHeaderType.CPU_LIMIT | ResourceRecommenderHeaderType.MEMORY_REQUEST | ResourceRecommenderHeaderType.MEMORY_LIMIT>;
37
53
  export type K8sResourceDetailDataType = {
38
54
  [key: string]: string | number | object | boolean;
55
+ additionalMetadata?: Partial<Record<ResourceRecommenderHeaderWithRecommendation, {
56
+ current: {
57
+ value: string | 'none';
58
+ } | null;
59
+ recommended: {
60
+ value: string | 'none';
61
+ } | null;
62
+ delta: number | null;
63
+ }>>;
39
64
  };
40
65
  export interface K8sResourceDetailType {
41
66
  headers: string[];
42
67
  data: K8sResourceDetailDataType[];
43
68
  }
44
69
  export interface BulkSelectionActionWidgetProps {
70
+ isResourceRecommendationView: boolean;
45
71
  count: number;
46
72
  handleOpenBulkDeleteModal: () => void;
47
73
  handleClearBulkSelection: () => void;
@@ -49,11 +75,12 @@ export interface BulkSelectionActionWidgetProps {
49
75
  handleOpenUncordonNodeModal: () => void;
50
76
  handleOpenDrainNodeModal: () => void;
51
77
  handleOpenRestartWorkloadModal: () => void;
78
+ handleOpenApplyResourceRecommendationModal: () => void;
52
79
  parentRef: RefObject<HTMLDivElement>;
53
80
  showBulkRestartOption: boolean;
54
81
  showNodeListingOptions: boolean;
55
82
  }
56
- export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain';
83
+ export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain' | 'applyResourceRecommendation';
57
84
  export interface CreateResourceRequestBodyType {
58
85
  appId: string;
59
86
  clusterId: number;
@@ -65,6 +92,7 @@ export interface CreateResourceRequestBodyType {
65
92
  export interface ResourceManifestDTO {
66
93
  manifestResponse: {
67
94
  manifest: Record<string, unknown>;
95
+ recommendedManifest?: Record<string, unknown>;
68
96
  };
69
97
  secretViewAccess: boolean;
70
98
  }
@@ -108,4 +136,20 @@ export interface NodeActionRequest {
108
136
  version: string;
109
137
  kind: string;
110
138
  }
139
+ export interface GVKOptionValueType {
140
+ kind: string;
141
+ apiVersion: string;
142
+ }
143
+ export interface GetResourceRecommenderResourceListPropsType {
144
+ resourceList: K8sResourceDetailType;
145
+ reloadResourceListData: () => void;
146
+ setShowAbsoluteValuesInResourceRecommender: Dispatch<SetStateAction<boolean>>;
147
+ showAbsoluteValuesInResourceRecommender: boolean;
148
+ gvkOptions: GroupBase<SelectPickerOptionType<GVKOptionValueType>>[];
149
+ areGVKOptionsLoading: boolean;
150
+ reloadGVKOptions: () => void;
151
+ gvkOptionsError: ServerErrors;
152
+ isResourceListLoading: boolean;
153
+ resourceListError: ServerErrors;
154
+ }
111
155
  export {};
@@ -1,4 +1,5 @@
1
1
  import { SelectPickerOptionType } from '../../Shared/Components';
2
+ import { ResourceRecommenderHeaderType } from './ResourceBrowser.Types';
2
3
  import { NodeDrainRequest } from './types';
3
4
  export declare const ALL_NAMESPACE_OPTION: Readonly<Pick<SelectPickerOptionType<string>, 'value' | 'label'>>;
4
5
  export declare const DRAIN_NODE_MODAL_MESSAGING: {
@@ -50,3 +51,7 @@ export declare const NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG: {
50
51
  infoText: string;
51
52
  label: string;
52
53
  }[];
54
+ export declare const RESOURCE_RECOMMENDER_HEADER_TO_TITLE_MAP: Record<ResourceRecommenderHeaderType, string>;
55
+ export declare const RESOURCE_RECOMMENDER_HEADER_TO_WIDTH_MAP: Record<ResourceRecommenderHeaderType, number>;
56
+ export declare const GVK_FILTER_KIND_QUERY_PARAM_KEY = "gvkFilterKind";
57
+ export declare const GVK_FILTER_API_VERSION_QUERY_PARAM_KEY = "gvkFilterApiVersion";
@@ -41,6 +41,7 @@ export declare const iconMap: {
41
41
  'ic-cloud-vms': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
42
42
  'ic-cluster': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
43
43
  'ic-code': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
44
+ 'ic-container-registry': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
44
45
  'ic-container': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
45
46
  'ic-cookr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
46
47
  'ic-copy': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -77,6 +78,7 @@ export declare const iconMap: {
77
78
  'ic-filter': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
78
79
  'ic-flask': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
79
80
  'ic-folder-user': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
+ 'ic-gavel': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
80
82
  'ic-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
83
  'ic-gift-gradient': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
82
84
  'ic-gift': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -122,6 +124,7 @@ export declare const iconMap: {
122
124
  'ic-memory': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
123
125
  'ic-microsoft': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
124
126
  'ic-minikube': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
127
+ 'ic-minus': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
125
128
  'ic-missing': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
126
129
  'ic-mobile': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
127
130
  'ic-monitoring': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -148,6 +151,7 @@ export declare const iconMap: {
148
151
  'ic-sort-descending': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
149
152
  'ic-sortable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
150
153
  'ic-sparkle-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
154
+ 'ic-speedometer': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
151
155
  'ic-spinny': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
152
156
  'ic-spray-can': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
153
157
  'ic-stack': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -5,7 +5,7 @@ import { Pair } from 'yaml';
5
5
  import { MaterialHistoryType } from '@Shared/Services/app.types';
6
6
  import { ApprovalConfigDataType, MaterialInfo, SortingOrder, UserApprovalConfigType, UserApprovalInfo } from '../Common';
7
7
  import { AggregatedNodes, PodMetadatum } from './Components';
8
- import { BorderConfigType, GetTimeDifferenceParamsType, GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, TargetPlatformItemDTO, TargetPlatformsDTO, WebhookEventNameType } from './types';
8
+ import { BorderConfigType, GetTimeDifferenceParamsType, GitTriggers, IntersectionChangeHandler, IntersectionOptions, Node, PreventOutsideFocusProps, TargetPlatformItemDTO, TargetPlatformsDTO, WebhookEventNameType } from './types';
9
9
  interface HighlightSearchTextProps {
10
10
  /**
11
11
  * The text to be highlighted
@@ -102,4 +102,5 @@ export declare const getClassNameForStickyHeaderWithShadow: (isStuck: boolean, t
102
102
  export declare const clearCookieOnLogout: () => void;
103
103
  export declare const getAppDetailsURL: (appId: number | string, envId?: number | string) => string;
104
104
  export declare const smoothScrollToTop: (scrollContainer: HTMLElement, targetPosition: number) => import('framer-motion').AnimationPlaybackControls;
105
+ export declare const getGroupVersionFromApiVersion: (apiVersion: string) => Pick<Node, "group" | "version">;
105
106
  export {};
@@ -97,7 +97,8 @@ export declare enum Nodes {
97
97
  Node = "Node",
98
98
  Overview = "Overview",
99
99
  MonitoringDashboard = "MonitoringDashboard",
100
- UpgradeCluster = "UpgradeCluster"
100
+ UpgradeCluster = "UpgradeCluster",
101
+ ResourceRecommender = "ResourceRecommender"
101
102
  }
102
103
  export type NodeType = keyof typeof Nodes;
103
104
  export interface Node {
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 4.5v15m0-15 9.956 2.842a.75.75 0 0 1 .544.72v7.876a.75.75 0 0 1-.544.718L12 19.5m0-15L2.144 5.906a.75.75 0 0 0-.644.745v10.698a.75.75 0 0 0 .644.745L12 19.5M9 12H4.5m2.25-6.75v13.5" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m13.656 4.655 5.688 5.689M8.406 9.905l5.688 5.689m-1.719-1.72-6.656 6.657a1.594 1.594 0 0 1-2.25 0 1.594 1.594 0 0 1 0-2.25l6.656-6.656M5.471 7.718l6-6a.75.75 0 0 1 1.06 0l1.5 1.5a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06 0l-1.5-1.5a.75.75 0 0 1 0-1.06Zm8.25 8.25 6-6a.75.75 0 0 1 1.06 0l1.5 1.5a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06 0l-1.5-1.5a.75.75 0 0 1 0-1.06Z" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 12h16" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12 7.01.01-.011M16 9.01l.01-.011M8 9.01l.01-.011M18 13.01l.01-.011M6 13.01l.01-.011M17 17.01l.01-.011M7 17.01l.01-.011M13 11l-.669 6.018M8.5 20.001H4A9.956 9.956 0 0 1 2 14C2 8.477 6.477 4 12 4s10 4.477 10 10c0 2.252-.744 4.33-2 6.001L15.5 20m-3.169-2.982a3 3 0 1 1-.663 5.964 3 3 0 0 1 .663-5.964Z" vector-effect="non-scaling-stroke"/>
3
+ </svg>
package/dist/index.d.ts CHANGED
@@ -147,6 +147,7 @@ export interface customEnv {
147
147
  * @default false
148
148
  */
149
149
  FEATURE_MANAGE_TRAFFIC_ENABLE?: boolean;
150
+ FEATURE_INFRA_PROVISION_INFO_BLOCK_HIDE?: boolean;
150
151
  }
151
152
  declare global {
152
153
  interface Window {