@devtron-labs/devtron-fe-common-lib 1.2.12-beta-1 → 1.2.14-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.
@@ -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-C_dq_os7.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";
@@ -48,6 +48,7 @@ export declare const URLS: {
48
48
  NETWORK_STATUS_INTERFACE: string;
49
49
  CONFIG_DRIFT: string;
50
50
  RESOURCE_BROWSER: string;
51
+ COMPARE_CLUSTERS: string;
51
52
  };
52
53
  export declare const ROUTES: {
53
54
  APP: string;
@@ -56,6 +57,8 @@ export declare const ROUTES: {
56
57
  PROJECT_LIST_MIN: string;
57
58
  USER_CHECK_ROLE: string;
58
59
  IMAGE_TAGGING: string;
60
+ CREATE_RESOURCE: string;
61
+ K8S_RESOURCE_CREATE: string;
59
62
  CI_CONFIG_GET: string;
60
63
  CD_MATERIAL_GET: string;
61
64
  DEPLOYMENT_TEMPLATE_LIST: string;
@@ -94,6 +97,7 @@ export declare const ROUTES: {
94
97
  DEPLOYMENT_CHARTS_LIST: string;
95
98
  USER_LIST_MIN: string;
96
99
  CONFIG_DATA: string;
100
+ K8S_RESOURCE: string;
97
101
  K8S_RESOURCE_LIST: string;
98
102
  CONFIG_COMPARE_SECRET: string;
99
103
  };
@@ -1,2 +1,13 @@
1
1
  import { AggregationKeys, NodeType } from '../../Shared';
2
+ import { ApiResourceGroupType, CreateResourceRequestBodyParamsType, CreateResourceRequestBodyType } from './ResourceBrowser.Types';
2
3
  export declare function getAggregator(nodeType: NodeType, defaultAsOtherResources?: boolean): AggregationKeys;
4
+ export declare const getK8sResourceListPayload: (clusterId: string, namespace: string, selectedResource: ApiResourceGroupType, filters: object) => {
5
+ clusterId: number;
6
+ k8sRequest: {
7
+ resourceIdentifier: {
8
+ namespace: string;
9
+ groupVersionKind: import('./ResourceBrowser.Types').GVKType;
10
+ };
11
+ };
12
+ };
13
+ export declare const createResourceRequestBody: ({ clusterId, group, version, kind, name, namespace, updatedManifest, }: CreateResourceRequestBodyParamsType) => CreateResourceRequestBodyType;
@@ -49,12 +49,25 @@ export interface BulkSelectionActionWidgetProps {
49
49
  parentRef: RefObject<HTMLDivElement>;
50
50
  showBulkRestartOption: boolean;
51
51
  }
52
+ interface BulkOperationAdditionalKeysType {
53
+ label: string;
54
+ value: string;
55
+ isSortable: boolean;
56
+ /**
57
+ * width to be given in gridTemplateColumns
58
+ */
59
+ width: string;
60
+ }
52
61
  export interface BulkOperation {
53
62
  name: string;
63
+ /**
64
+ * Would these keys beside the name
65
+ */
66
+ additionalKeys?: BulkOperationAdditionalKeysType[];
54
67
  operation: (signal: AbortSignal, data?: unknown) => Promise<void>;
55
68
  }
56
69
  export type BulkOperationModalProps = {
57
- operationType: 'restart' | 'delete';
70
+ operationType: 'restart' | 'delete' | 'creation';
58
71
  clusterName: string;
59
72
  operations: NonNullable<BulkOperation[]>;
60
73
  handleModalClose: () => void;
@@ -64,4 +77,34 @@ export type BulkOperationModalProps = {
64
77
  shouldAllowForceOperation?: true;
65
78
  };
66
79
  export type BulkOperationModalState = BulkOperationModalProps['operationType'] | 'closed';
80
+ export interface CreateResourceRequestBodyType {
81
+ appId: string;
82
+ clusterId: number;
83
+ k8sRequest: {
84
+ resourceIdentifier: Required<K8sRequestResourceIdentifierType>;
85
+ patch?: string;
86
+ };
87
+ }
88
+ export interface ResourceManifestDTO {
89
+ manifestResponse: {
90
+ manifest: Record<string, unknown>;
91
+ };
92
+ secretViewAccess: boolean;
93
+ }
94
+ export interface CreateResourceRequestBodyParamsType extends Pick<CreateResourceRequestBodyType, 'clusterId'>, Required<Pick<K8sRequestResourceIdentifierType, 'name' | 'namespace'>> {
95
+ updatedManifest?: string;
96
+ group: GVKType['Group'];
97
+ version: GVKType['Version'];
98
+ kind: GVKType['Kind'];
99
+ }
100
+ export interface CreateResourcePayload {
101
+ clusterId: number;
102
+ manifest: string;
103
+ }
104
+ export interface CreateResourceDTO {
105
+ kind: string;
106
+ name: string;
107
+ isUpdate: boolean;
108
+ error: string;
109
+ }
67
110
  export {};
@@ -0,0 +1,4 @@
1
+ export declare const ALL_NAMESPACE_OPTION: {
2
+ value: string;
3
+ label: string;
4
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './ResourceBrowser.Types';
2
2
  export * from './Helper';
3
+ export * from './constants';
3
4
  export * from './types';
4
5
  export * from './service';
@@ -1,3 +1,4 @@
1
1
  import { ResponseType } from '../../Common/Types';
2
- import { K8sResourceDetailType, K8sResourceListPayloadType } from './ResourceBrowser.Types';
2
+ import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType } from './ResourceBrowser.Types';
3
3
  export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
4
+ export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
@@ -1,3 +1,3 @@
1
1
  import { BulkSelectionProps } from './types';
2
- declare const BulkSelection: <T>({ showPagination, disabled }: BulkSelectionProps) => JSX.Element;
2
+ declare const BulkSelection: <T>({ showPagination, disabled, showChevronDownIcon }: BulkSelectionProps) => JSX.Element;
3
3
  export default BulkSelection;
@@ -28,6 +28,10 @@ export interface UseBulkSelectionReturnType<T> extends GetBulkSelectionCheckboxV
28
28
  }
29
29
  export interface BulkSelectionProps {
30
30
  showPagination: boolean;
31
+ /**
32
+ * @default true
33
+ */
34
+ showChevronDownIcon?: boolean;
31
35
  disabled?: boolean;
32
36
  }
33
37
  export interface BulkSelectionDropdownItemsType {
@@ -0,0 +1,3 @@
1
+ import { NumbersCountProps } from './types';
2
+ declare const NumbersCount: ({ count, isApprox, isSelected }: NumbersCountProps) => JSX.Element;
3
+ export default NumbersCount;
@@ -0,0 +1 @@
1
+ export { default as NumbersCount } from './NumbersCount.component';
@@ -0,0 +1,13 @@
1
+ export interface NumbersCountProps {
2
+ count: number;
3
+ /**
4
+ * @default false
5
+ * @description If true, it will change the bgColor to var(--B500)
6
+ */
7
+ isSelected?: boolean;
8
+ /**
9
+ * @default false
10
+ * @description If true, it will show the count with tilde like ~number
11
+ */
12
+ isApprox?: boolean;
13
+ }
@@ -41,6 +41,7 @@ export * from './Collapse';
41
41
  export * from './Security';
42
42
  export * from './Button';
43
43
  export * from './InvalidYAMLTippy';
44
+ export * from './NumbersCount';
44
45
  export * from './EnterpriseTag';
45
46
  export * from './ConfirmationModal';
46
47
  export * from './DiffViewer';
@@ -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-width="1.5" d="M21 10c-.095.47-.236.896-.422 1.28-.41.864-.981 1.512-1.716 1.947-.736.428-1.565.642-2.49.642-.758 0-1.463-.15-2.115-.45-.651-.299-1.383-.78-2.194-1.443-.833-.692-1.715-1.252-2.36-1.538A4.948 4.948 0 0 0 7.636 10c-.948 0-1.789.217-2.524.652-.728.428-1.296 1.074-1.705 1.936a5.5 5.5 0 0 0-.406 1.28" vector-effect="non-scaling-stroke"/>
3
+ </svg>
package/dist/index.d.ts CHANGED
@@ -79,6 +79,7 @@ export interface customEnv {
79
79
  FEATURE_PROMO_EMBEDDED_MODAL_TITLE?: string;
80
80
  FEATURE_PROMO_EMBEDDED_IFRAME_URL?: string;
81
81
  FEATURE_BULK_RESTART_WORKLOADS_FROM_RB: string;
82
+ FEATURE_RB_SYNC_CLUSTER_ENABLE?: boolean;
82
83
  FEATURE_DEFAULT_MERGE_STRATEGY?: OverrideMergeStrategyType;
83
84
  FEATURE_DEFAULT_LANDING_RB_ENABLE?: boolean;
84
85
  FEATURE_CLUSTER_MAP_ENABLE?: boolean;