@devtron-labs/devtron-fe-common-lib 1.4.3 → 1.4.4

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.
@@ -5,24 +5,35 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
5
5
  diffMode: boolean;
6
6
  theme: CodeEditorThemesKeys;
7
7
  code: string;
8
+ defaultCode: string;
8
9
  noParsing: boolean;
9
10
  } | {
10
11
  diffMode: any;
11
12
  mode: MODES;
12
13
  theme: CodeEditorThemesKeys;
13
14
  code: string;
15
+ defaultCode: string;
14
16
  noParsing: boolean;
15
17
  } | {
16
18
  theme: any;
17
19
  mode: MODES;
18
20
  diffMode: boolean;
19
21
  code: string;
22
+ defaultCode: string;
20
23
  noParsing: boolean;
21
24
  } | {
22
25
  code: any;
23
26
  mode: MODES;
24
27
  diffMode: boolean;
25
28
  theme: CodeEditorThemesKeys;
29
+ defaultCode: string;
30
+ noParsing: boolean;
31
+ } | {
32
+ defaultCode: any;
33
+ mode: MODES;
34
+ diffMode: boolean;
35
+ theme: CodeEditorThemesKeys;
36
+ code: string;
26
37
  noParsing: boolean;
27
38
  } | {
28
39
  height: any;
@@ -30,7 +41,8 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
30
41
  diffMode: boolean;
31
42
  theme: CodeEditorThemesKeys;
32
43
  code: string;
44
+ defaultCode: string;
33
45
  noParsing: boolean;
34
46
  };
35
47
  export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
36
- export declare const initialState: ({ mode, theme, value, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
48
+ export declare const initialState: ({ mode, theme, value, defaultValue, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
@@ -8,7 +8,7 @@ interface CodeEditorBaseInterface {
8
8
  value?: string;
9
9
  lineDecorationsWidth?: number;
10
10
  responseType?: string;
11
- onChange?: (string: any) => void;
11
+ onChange?: (value: string, defaultValue: string) => void;
12
12
  onBlur?: () => void;
13
13
  onFocus?: () => void;
14
14
  children?: any;
@@ -63,7 +63,7 @@ export interface CodeEditorHeaderComposition {
63
63
  ValidationError?: React.FC<any>;
64
64
  Clipboard?: React.FC<any>;
65
65
  }
66
- export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setHeight';
66
+ export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight';
67
67
  export interface Action {
68
68
  type: ActionTypes;
69
69
  value: any;
@@ -80,6 +80,7 @@ export interface CodeEditorInitialValueType {
80
80
  diffView: boolean;
81
81
  theme?: string;
82
82
  value: string;
83
+ defaultValue: string;
83
84
  noParsing?: boolean;
84
85
  tabSize: number;
85
86
  }
@@ -88,6 +89,7 @@ export interface CodeEditorState {
88
89
  diffMode: boolean;
89
90
  theme: CodeEditorThemesKeys;
90
91
  code: string;
92
+ defaultCode: string;
91
93
  noParsing: boolean;
92
94
  }
93
95
  export declare enum CodeEditorActionTypes {
@@ -95,6 +95,7 @@ export declare const ROUTES: {
95
95
  ATTRIBUTES_UPDATE: string;
96
96
  APP_LIST_MIN: string;
97
97
  CLUSTER_LIST_MIN: string;
98
+ CLUSTER_LIST_RAW: string;
98
99
  PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
99
100
  PLUGIN_GLOBAL_LIST_V2: string;
100
101
  PLUGIN_GLOBAL_LIST_TAGS: string;
@@ -1,4 +1,6 @@
1
1
  import { ResponseType } from '../../Common/Types';
2
2
  import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType } from './ResourceBrowser.Types';
3
+ import { ClusterDetail } from './types';
3
4
  export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
4
5
  export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
6
+ export declare const getClusterListRaw: () => Promise<ResponseType<ClusterDetail[]>>;
@@ -0,0 +1,2 @@
1
+ import { VirtualizedListProps } from './VirtualizedList.types';
2
+ export declare const VirtualizedList: <ListKeys extends string | number, ExtendedType extends object>({ className, items, renderItem, ...restProps }: VirtualizedListProps<ListKeys, ExtendedType>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const VIRTUALIZED_LIST_ROOT_ID = "virtualized-list-root";
2
+ export declare const VIRTUALIZED_LIST_ROOT_Z_INDEX = 2;
@@ -0,0 +1,36 @@
1
+ import { AutoSizedStickyTreeProps, StickyTreeRowRenderer } from 'react-virtualized-sticky-tree';
2
+ /**
3
+ * Represents a virtualized list item.
4
+ *
5
+ * @template ListKeys - The type of the keys used to identify list items (e.g., `string` or `number`).
6
+ * @template ExtendedType - An optional type to extend the base item structure with additional fields.
7
+ */
8
+ export type VirtualizedListItem<ListKeys, ExtendedType = {}> = ExtendedType & {
9
+ /** The unique identifier of the item. */
10
+ id: string | number;
11
+ /** The height of the item. (in pixels) */
12
+ height: number;
13
+ /** The depth level of the item in the hierarchical structure. */
14
+ depth: number;
15
+ /** An optional array of child item keys. */
16
+ children?: ListKeys[];
17
+ };
18
+ /**
19
+ * Props for the VirtualizedList component, which supports a virtualized tree-like structure.
20
+ *
21
+ * @template ListKeys - The type of the keys used to identify list items (e.g., `string` or `number`).
22
+ * @template ExtendedType - An optional type to extend the base item structure with additional fields.
23
+ */
24
+ export interface VirtualizedListProps<ListKeys extends string | number, ExtendedType extends object = {}> extends Omit<AutoSizedStickyTreeProps<VirtualizedListItem<ListKeys, ExtendedType>>, 'root' | 'renderRoot' | 'rowRenderer' | 'getChildren'> {
25
+ /**
26
+ * A dictionary of items keyed by their unique identifiers.
27
+ */
28
+ items: Record<ListKeys, VirtualizedListItem<ListKeys, ExtendedType>>;
29
+ /**
30
+ * A function that renders an individual list item.
31
+ *
32
+ * @param params - An object containing the node and nodeInfo to render.
33
+ * @returns A React node representing the rendered item.
34
+ */
35
+ renderItem: (params: Pick<Parameters<StickyTreeRowRenderer<VirtualizedListItem<ListKeys, ExtendedType>>>['0'], 'node' | 'nodeInfo'>) => React.ReactNode;
36
+ }
@@ -0,0 +1,2 @@
1
+ export * from './VirtualizedList.component';
2
+ export * from './VirtualizedList.types';
@@ -49,3 +49,4 @@ export * from './DynamicDataTable';
49
49
  export * from './TagsKeyValueTable';
50
50
  export * from './FileUpload';
51
51
  export * from './AnimatedDeployButton';
52
+ export * from './VirtualizedList';
@@ -17,6 +17,7 @@ export interface ClusterDTO {
17
17
  id: number;
18
18
  cluster_name: string;
19
19
  isVirtualCluster: boolean;
20
+ isProd: boolean;
20
21
  }
21
22
  export interface UseGetResourceKindsOptionsProps {
22
23
  resourcesToFetch: Extract<ResourceKindType, ResourceKindType.devtronApplication | ResourceKindType.project | ResourceKindType.cluster | ResourceKindType.environment>[];
@@ -7,6 +7,10 @@ export interface ClusterType {
7
7
  * If true, denotes virtual cluster
8
8
  */
9
9
  isVirtual: boolean;
10
+ /**
11
+ * If true, denotes prod labelled cluster
12
+ */
13
+ isProd: boolean;
10
14
  }
11
15
  /**
12
16
  * T => Type of query params