@devtron-labs/devtron-fe-common-lib 1.12.0-beta-1 → 1.12.0-beta-3

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 (35) hide show
  1. package/dist/{@code-editor-3U2FmTaO.js → @code-editor-Ck_CH0E8.js} +7141 -7227
  2. package/dist/{@common-rjsf-C2CrGIz6.js → @common-rjsf-D7qlH1s4.js} +19 -19
  3. package/dist/Common/CIPipeline.Types.d.ts +20 -19
  4. package/dist/Common/Common.service.d.ts +2 -2
  5. package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
  6. package/dist/Common/RJSF/Form.d.ts +1 -1
  7. package/dist/Pages/GlobalConfigurations/index.d.ts +0 -1
  8. package/dist/Pages/ResourceBrowser/service.d.ts +1 -1
  9. package/dist/Pages/ResourceBrowser/types.d.ts +0 -38
  10. package/dist/Shared/Components/CMCS/constants.d.ts +2 -2
  11. package/dist/Shared/Components/CMCS/utils.d.ts +4 -3
  12. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +1 -1
  13. package/dist/Shared/Components/DynamicDataTable/types.d.ts +5 -1
  14. package/dist/Shared/Components/EnterpriseTag/EnterpriseTag.component.d.ts +2 -0
  15. package/dist/Shared/Components/EnterpriseTag/index.d.ts +1 -0
  16. package/dist/Shared/Components/Icon/Icon.d.ts +1 -4
  17. package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
  18. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +75 -78
  19. package/dist/Shared/Components/KeyValueTable/index.d.ts +1 -1
  20. package/dist/Shared/Components/KeyValueTable/utils.d.ts +13 -0
  21. package/dist/Shared/Components/LoginBanner/index.d.ts +0 -2
  22. package/dist/Shared/Components/index.d.ts +1 -0
  23. package/dist/Shared/Services/app.types.d.ts +2 -6
  24. package/dist/Shared/types.d.ts +0 -5
  25. package/dist/assets/ic-login-devtron-logo.702a1d04.svg +22 -0
  26. package/dist/assets/ic-medal.a2e911f5.svg +19 -0
  27. package/dist/index.js +594 -596
  28. package/package.json +1 -1
  29. package/dist/Pages/GlobalConfigurations/ClustersAndEnvironments/index.d.ts +0 -1
  30. package/dist/Pages/GlobalConfigurations/ClustersAndEnvironments/types.d.ts +0 -8
  31. package/dist/Shared/Components/LoginBanner/Testimonials.components.d.ts +0 -3
  32. package/dist/assets/ic-amazon-eks.13404569.svg +0 -5
  33. package/dist/assets/ic-cluster.71ba9e26.svg +0 -3
  34. package/dist/assets/ic-enterprise-feat.5ee25d5b.svg +0 -3
  35. package/dist/assets/ic-enterprise-tag.209dd129.svg +0 -43
@@ -1,7 +1,7 @@
1
1
  import { j as n, av as y, ax as k, aw as W } from "./@vendor-SjXFleuT.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-3U2FmTaO.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-Ck_CH0E8.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";
@@ -89,14 +89,14 @@ import './assets/@common-rjsf.css';const O = {
89
89
  }) => {
90
90
  const u = B(a), f = $("ArrayFieldItemTemplate", c, u), p = u.title || x;
91
91
  return /* @__PURE__ */ n.jsx("fieldset", { className: t, id: r.$id, children: i.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
92
- i.map(({ key: j, ..._ }, h) => {
92
+ i.map(({ key: _, ...j }, h) => {
93
93
  const m = {
94
- ..._.children,
94
+ ...j.children,
95
95
  props: {
96
- ..._.children.props
96
+ ...j.children.props
97
97
  }
98
98
  };
99
- return /* @__PURE__ */ n.jsx(f, { ..._, children: m }, j);
99
+ return /* @__PURE__ */ n.jsx(f, { ...j, children: m }, _);
100
100
  }),
101
101
  /* @__PURE__ */ n.jsx(
102
102
  A,
@@ -178,11 +178,11 @@ import './assets/@common-rjsf.css';const O = {
178
178
  classNames: x,
179
179
  schema: u,
180
180
  rawDescription: f
181
- } = e, p = B(d), j = $(
181
+ } = e, p = B(d), _ = $(
182
182
  "WrapIfAdditionalTemplate",
183
183
  c,
184
184
  p
185
- ), _ = L in u, h = (o || u.type === "boolean") && !_, m = u.type === "array";
185
+ ), j = L in u, h = (o || u.type === "boolean") && !j, m = u.type === "array";
186
186
  return i ? /* @__PURE__ */ n.jsx("div", { className: "hidden", children: r }) : (
187
187
  // NOTE: need to override the margins of default rjsf css
188
188
  /* @__PURE__ */ n.jsxs("div", { className: `${x} mb-0`, children: [
@@ -206,7 +206,7 @@ import './assets/@common-rjsf.css';const O = {
206
206
  id: t,
207
207
  required: l,
208
208
  rawDescription: f,
209
- children: /* @__PURE__ */ n.jsx(j, { ...e, children: r })
209
+ children: /* @__PURE__ */ n.jsx(_, { ...e, children: r })
210
210
  }
211
211
  ),
212
212
  a
@@ -366,8 +366,8 @@ import './assets/@common-rjsf.css';const O = {
366
366
  uiSchema: x,
367
367
  registry: l
368
368
  }
369
- ), j = a.filter((_) => {
370
- const h = c.properties?.[_.name]?.hidden;
369
+ ), _ = a.filter((j) => {
370
+ const h = c.properties?.[j.name]?.hidden;
371
371
  if (!h)
372
372
  return !0;
373
373
  try {
@@ -384,7 +384,7 @@ import './assets/@common-rjsf.css';const O = {
384
384
  } catch {
385
385
  return !0;
386
386
  }
387
- }).map((_) => _.content);
387
+ }).sort((j) => c.properties?.[j.name]?.type === "boolean" ? -1 : 1).map((j) => j.content);
388
388
  return f ? a.length ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
389
389
  /* @__PURE__ */ n.jsx(
390
390
  T,
@@ -394,12 +394,12 @@ import './assets/@common-rjsf.css';const O = {
394
394
  showLabel: !0,
395
395
  id: s.$id,
396
396
  shouldAlignCenter: !1,
397
- children: /* @__PURE__ */ n.jsx("div", { children: j })
397
+ children: /* @__PURE__ */ n.jsx("div", { children: _ })
398
398
  }
399
399
  ),
400
400
  p
401
401
  ] }) : /* @__PURE__ */ n.jsx(T, { label: d, required: o, showLabel: !0, id: s.$id, children: p }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
402
- j,
402
+ _,
403
403
  p
404
404
  ] });
405
405
  }, we = (e) => {
@@ -473,8 +473,8 @@ import './assets/@common-rjsf.css';const O = {
473
473
  onFocus: c
474
474
  }) => {
475
475
  const d = (u, f) => {
476
- const { id: p, checked: j } = u.target;
477
- f === "blur" ? o(p, j) : f === "focus" && c(p, j);
476
+ const { id: p, checked: _ } = u.target;
477
+ f === "blur" ? o(p, _) : f === "focus" && c(p, _);
478
478
  }, x = z(s) ? !1 : s;
479
479
  return /* @__PURE__ */ n.jsxs("div", { children: [
480
480
  /* @__PURE__ */ n.jsx(
@@ -507,18 +507,18 @@ import './assets/@common-rjsf.css';const O = {
507
507
  onBlur: d,
508
508
  onFocus: x,
509
509
  placeholder: u
510
- } = e, { enumOptions: f = [] } = r, p = s ? [] : "", j = (h) => {
510
+ } = e, { enumOptions: f = [] } = r, p = s ? [] : "", _ = (h) => {
511
511
  c(s ? h.map((m) => m.value) : h.value);
512
- }, _ = (h) => s ? f.filter((m) => h.some((g) => E(g, m.value))) : f.find((m) => E(h, m.value));
512
+ }, j = (h) => s ? f.filter((m) => h.some((g) => E(g, m.value))) : f.find((m) => E(h, m.value));
513
513
  return /* @__PURE__ */ n.jsx(
514
514
  Q,
515
515
  {
516
516
  id: t,
517
517
  name: t,
518
518
  isMulti: s,
519
- value: typeof a > "u" ? p : _(a),
519
+ value: typeof a > "u" ? p : j(a),
520
520
  autoFocus: o,
521
- onChange: j,
521
+ onChange: _,
522
522
  options: f,
523
523
  onBlur: () => d(t, a),
524
524
  onFocus: () => x(t, a),
@@ -1,4 +1,4 @@
1
- import { DynamicDataTableCellValidationState } from '../Shared/Components';
1
+ import { DynamicDataTableCellValidationState, KeyValueTableData } from '../Shared/Components';
2
2
  export interface MaterialType {
3
3
  name: string;
4
4
  type: string;
@@ -123,7 +123,7 @@ export interface PortMapType {
123
123
  portOnLocal: number;
124
124
  portOnContainer: number;
125
125
  }
126
- interface ConditionDetails {
126
+ export interface ConditionDetails {
127
127
  id: number;
128
128
  conditionOnVariable: string;
129
129
  conditionOperator: string;
@@ -220,10 +220,7 @@ export declare enum WORKFLOW_CACHE_CONFIG_ENUM {
220
220
  }
221
221
  export interface FormType {
222
222
  name: string;
223
- args: {
224
- key: string;
225
- value: string;
226
- }[];
223
+ args: KeyValueTableData[];
227
224
  materials: MaterialType[];
228
225
  gitHost: Githost;
229
226
  webhookEvents: WebhookEvent[];
@@ -271,22 +268,26 @@ export declare enum InputOutputVariablesHeaderKeys {
271
268
  FORMAT = "format",
272
269
  VALUE = "val"
273
270
  }
274
- export type InputOutputVariablesErrorObj = Record<InputOutputVariablesHeaderKeys, DynamicDataTableCellValidationState>;
271
+ export declare enum ConditionDataTableHeaderKeys {
272
+ VARIABLE = "variable",
273
+ OPERATOR = "operator",
274
+ VALUE = "val"
275
+ }
276
+ type InputOutputVariablesErrorObj = Record<InputOutputVariablesHeaderKeys, DynamicDataTableCellValidationState>;
277
+ type ConditionDetailsErrorObj = Record<ConditionDataTableHeaderKeys, DynamicDataTableCellValidationState>;
278
+ interface StepDetailTaskErrorObj {
279
+ inputVariables?: Record<number, InputOutputVariablesErrorObj>;
280
+ outputVariables?: Record<number, InputOutputVariablesErrorObj>;
281
+ isInputVariablesValid?: boolean;
282
+ isOutputVariablesValid?: boolean;
283
+ conditionDetails?: Record<number, ConditionDetailsErrorObj>;
284
+ isConditionDetailsValid?: boolean;
285
+ }
275
286
  export interface TaskErrorObj {
276
287
  isValid: boolean;
277
288
  name: ErrorObj;
278
- inlineStepDetail?: {
279
- inputVariables?: Record<number, InputOutputVariablesErrorObj>;
280
- outputVariables?: Record<number, InputOutputVariablesErrorObj>;
281
- isInputVariablesValid?: boolean;
282
- isOutputVariablesValid?: boolean;
283
- };
284
- pluginRefStepDetail?: {
285
- inputVariables?: Record<number, InputOutputVariablesErrorObj>;
286
- outputVariables?: Record<number, InputOutputVariablesErrorObj>;
287
- isInputVariablesValid?: boolean;
288
- isOutputVariablesValid?: boolean;
289
- };
289
+ inlineStepDetail?: StepDetailTaskErrorObj;
290
+ pluginRefStepDetail?: StepDetailTaskErrorObj;
290
291
  }
291
292
  export interface FormErrorObjectType {
292
293
  name: ErrorObj;
@@ -1,6 +1,6 @@
1
1
  import { MutableRefObject } from 'react';
2
2
  import { RuntimeParamsAPIResponseType, RuntimePluginVariables } from '../Shared/types';
3
- import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, UserApprovalMetadataType, GlobalVariableOptionType, UserRole, APIOptions } from './Types';
3
+ import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse, UserApprovalMetadataType, GlobalVariableOptionType, UserRole } from './Types';
4
4
  import { ApiResourceType } from '../Pages';
5
5
  export declare const getTeamListMin: () => Promise<TeamList>;
6
6
  export declare const SourceTypeMap: {
@@ -21,7 +21,7 @@ export declare const getDefaultConfig: () => Promise<ResponseType>;
21
21
  export declare function getEnvironmentListMinPublic(includeAllowedDeploymentTypes?: boolean): Promise<ResponseType<any>>;
22
22
  export declare function getClusterListMin(): Promise<ResponseType<any>>;
23
23
  export declare const getResourceGroupListRaw: (clusterId: string) => Promise<ResponseType<ApiResourceType>>;
24
- export declare function getNamespaceListMin(clusterIdsCsv: string, abortControllerRef?: APIOptions['abortControllerRef']): Promise<EnvironmentListHelmResponse>;
24
+ export declare function getNamespaceListMin(clusterIdsCsv: string): Promise<EnvironmentListHelmResponse>;
25
25
  export declare function getWebhookEventsForEventId(eventId: string | number): Promise<ResponseType<any>>;
26
26
  /**
27
27
  *
@@ -1,6 +1,6 @@
1
1
  import { ShortcutType } from './types';
2
2
  export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
3
- keys: ("Alt" | "F" | "E" | "R" | "K" | "X" | "A" | "Home" | "End" | "." | "Space" | "Control" | "Shift" | "Meta" | "Escape" | "Enter" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "PageUp" | "PageDown" | "Backspace" | "Delete")[];
3
+ keys: ("R" | "Alt" | "F" | "E" | "K" | "X" | "A" | "Home" | "End" | "." | "Space" | "Control" | "Shift" | "Meta" | "Escape" | "Enter" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "PageUp" | "PageDown" | "Backspace" | "Delete")[];
4
4
  id: string;
5
5
  };
6
6
  export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "children" | "id" | "className" | "disabled" | "onChange" | "name" | "target" | "onFocus" | "onBlur" | "onSubmit" | "onError" | "autoComplete" | "action" | "method" | "tagName" | "noValidate" | "readonly" | "uiSchema" | "schema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<any, import('./types').RJSFFormSchema, any>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "disabled" | "className" | "onChange" | "target" | "onFocus" | "onBlur" | "onSubmit" | "onError" | "autoComplete" | "action" | "method" | "tagName" | "noValidate" | "readonly" | "uiSchema" | "schema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<any, import('./types').RJSFFormSchema, any>>>;
@@ -1,5 +1,4 @@
1
1
  export * from './Authorization';
2
2
  export * from './BuildInfra';
3
- export * from './ClustersAndEnvironments';
4
3
  export * from './DeploymentCharts';
5
4
  export * from './ScopedVariables';
@@ -7,4 +7,4 @@ export declare const deleteResource: (resourceListPayload: ResourceListPayloadTy
7
7
  export declare const deleteNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
8
8
  export declare const cordonNodeCapacity: (requestPayload: NodeCordonRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
9
9
  export declare const drainNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
10
- export declare const getClusterListRaw: (abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType<ClusterDetail[]>>;
10
+ export declare const getClusterListRaw: () => Promise<ResponseType<ClusterDetail[]>>;
@@ -1,20 +1,10 @@
1
1
  import { Dispatch, ReactElement, SetStateAction } from 'react';
2
- import { InstallationClusterType } from '../../Shared/types';
3
2
  import { NodeActionRequest } from './ResourceBrowser.Types';
4
3
  export declare enum ClusterFiltersType {
5
4
  ALL_CLUSTERS = "all",
6
5
  HEALTHY = "healthy",
7
6
  UNHEALTHY = "unhealthy"
8
7
  }
9
- export declare enum InstallationClusterStatus {
10
- Creating = "Creating",
11
- Deleting = "Deleting",
12
- Updating = "Updating",
13
- Installed = "Installed",
14
- Failed = "Failed",
15
- Superseded = "Superseded",
16
- Undefined = "Undefined"
17
- }
18
8
  export declare enum ClusterStatusType {
19
9
  HEALTHY = "healthy",
20
10
  UNHEALTHY = "unhealthy",
@@ -52,7 +42,6 @@ export interface ClusterCapacityType {
52
42
  nodeErrors: Record<string, string>[];
53
43
  status?: ClusterStatusType;
54
44
  isProd: boolean;
55
- installationId?: number;
56
45
  }
57
46
  export interface ClusterDetail extends ClusterCapacityType {
58
47
  id: number;
@@ -81,31 +70,4 @@ export interface AdditionalConfirmationModalOptionsProps<T = unknown> {
81
70
  setOptionsData: Dispatch<SetStateAction<T>>;
82
71
  children?: ReactElement;
83
72
  }
84
- export interface InstallationClusterStepType {
85
- lastTransitionTime: string;
86
- lastProbeTime: string;
87
- message: string;
88
- reason: string;
89
- status: 'False' | 'True' | 'Unknown';
90
- type: string;
91
- }
92
- export interface InstallationClusterConfigDTO {
93
- installationId: number;
94
- installationStatus: InstallationClusterStatus;
95
- name: string;
96
- values: string;
97
- valuesSchema: string;
98
- isProd: boolean;
99
- installationType: InstallationClusterType;
100
- conditions: InstallationClusterStepType[];
101
- installedEntityId: number | 0;
102
- }
103
- export interface InstallationClusterConfigType extends Pick<InstallationClusterConfigDTO, 'installationType' | 'conditions'> {
104
- schema: object;
105
- values: object;
106
- installationId: number;
107
- name: string;
108
- status: InstallationClusterStatus;
109
- correspondingClusterId: number | 0;
110
- }
111
73
  export {};
@@ -1,4 +1,4 @@
1
- import { CMSecretYamlData } from '../../Services';
1
+ import { KeyValueTableData } from '../KeyValueTable';
2
2
  import { ConfigMapSecretDataTypeOptionType } from './types';
3
3
  export declare const CONFIG_MAP_SECRET_YAML_PARSE_ERROR = "Please provide valid YAML";
4
4
  export declare const SECRET_TOAST_INFO: {
@@ -10,7 +10,7 @@ export declare const SECRET_TOAST_INFO: {
10
10
  BOTH_ESO_DATA_AND_DATA_FROM_UNAVAILABLE: string;
11
11
  };
12
12
  export declare const configMapDataTypeOptions: ConfigMapSecretDataTypeOptionType[];
13
- export declare const CONFIG_MAP_SECRET_DEFAULT_CURRENT_DATA: CMSecretYamlData[];
13
+ export declare const CONFIG_MAP_SECRET_DEFAULT_CURRENT_DATA: KeyValueTableData[];
14
14
  export declare const configMapSecretMountDataMap: {
15
15
  environment: {
16
16
  title: string;
@@ -1,8 +1,9 @@
1
1
  import { GroupBase, OptionsOrGroups } from 'react-select';
2
- import { CMSecretPayloadType, CMSecretYamlData, ConfigMapSecretUseFormProps, ESOSecretData, GetConfigMapSecretFormInitialValuesParamsType } from '../../Services';
2
+ import { CMSecretPayloadType, ConfigMapSecretUseFormProps, ESOSecretData, GetConfigMapSecretFormInitialValuesParamsType } from '../../Services';
3
+ import { KeyValueTableData } from '../KeyValueTable';
3
4
  import { ConfigMapSecretDataTypeOptionType, GetConfigMapSecretReadOnlyValuesParamsType } from './types';
4
5
  export declare const getSecretDataTypeOptions: (isJob: boolean, isHashiOrAWS: boolean) => ConfigMapSecretDataTypeOptionType[] | OptionsOrGroups<ConfigMapSecretDataTypeOptionType, GroupBase<ConfigMapSecretDataTypeOptionType>>;
5
- export declare const convertKeyValuePairToYAML: (currentData: CMSecretYamlData[]) => string;
6
+ export declare const convertKeyValuePairToYAML: (currentData: KeyValueTableData[]) => string;
6
7
  export declare const getConfigMapSecretFormInitialValues: ({ isJob, configMapSecretData, cmSecretStateLabel, componentType, skipValidation, fallbackMergeStrategy, }: GetConfigMapSecretFormInitialValuesParamsType) => ConfigMapSecretUseFormProps;
7
8
  export declare const getConfigMapSecretReadOnlyValues: ({ configMapSecretData, cmSecretStateLabel, componentType, isJob, fallbackMergeStrategy, displayKeys, }: GetConfigMapSecretReadOnlyValuesParamsType) => {
8
9
  configData: {
@@ -12,6 +13,6 @@ export declare const getConfigMapSecretReadOnlyValues: ({ configMapSecretData, c
12
13
  }[];
13
14
  data: string;
14
15
  };
15
- export declare const convertYAMLToKeyValuePair: (yaml: string) => CMSecretYamlData[];
16
+ export declare const convertYAMLToKeyValuePair: (yaml: string) => KeyValueTableData[];
16
17
  export declare const getESOSecretDataFromYAML: (yaml: string) => ESOSecretData;
17
18
  export declare const getConfigMapSecretPayload: ({ isSecret, external, externalType, externalSubpathValues, yaml, yamlMode, currentData, esoSecretYaml, filePermission, name, selectedType, isFilePermissionChecked, roleARN, volumeMountPath, isSubPathChecked, mergeStrategy, }: ConfigMapSecretUseFormProps) => CMSecretPayloadType;
@@ -1,2 +1,2 @@
1
1
  import { DynamicDataTableHeaderProps } from './types';
2
- export declare const DynamicDataTableHeader: <K extends string, CustomStateType = Record<string, unknown>>({ headers, rows, sortingConfig, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K, CustomStateType>) => JSX.Element;
2
+ export declare const DynamicDataTableHeader: <K extends string, CustomStateType = Record<string, unknown>>({ headers, rows, sortingConfig, addBtnTooltip, onRowAdd, readOnly, isAdditionNotAllowed, isDeletionNotAllowed, headerComponent, actionButtonConfig, }: DynamicDataTableHeaderProps<K, CustomStateType>) => JSX.Element;
@@ -112,6 +112,10 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
112
112
  isDeletionNotAllowed?: boolean;
113
113
  /** When true, data add or update is disabled. */
114
114
  readOnly?: boolean;
115
+ /** Tooltip for add button.
116
+ * @default 'Add'
117
+ */
118
+ addBtnTooltip?: string;
115
119
  /** Function to handle the addition of a new row to the table. */
116
120
  onRowAdd: () => void;
117
121
  /**
@@ -163,7 +167,7 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
163
167
  */
164
168
  focusableFieldKey?: K;
165
169
  };
166
- export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
170
+ export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'addBtnTooltip' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
167
171
  }
168
172
  export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent' | 'focusableFieldKey'> {
169
173
  }
@@ -0,0 +1,2 @@
1
+ declare const EnterpriseTag: () => JSX.Element;
2
+ export default EnterpriseTag;
@@ -0,0 +1 @@
1
+ export { default as EnterpriseTag } from './EnterpriseTag.component';
@@ -3,7 +3,6 @@ export declare const iconMap: {
3
3
  'ic-73strings': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
4
4
  'ic-aborted': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
5
5
  'ic-add': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
6
- 'ic-amazon-eks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
6
  'ic-apica': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
8
7
  'ic-app-group': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
9
8
  'ic-arrow-clockwise': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -30,7 +29,6 @@ export declare const iconMap: {
30
29
  'ic-clock': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
31
30
  'ic-close-large': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
32
31
  'ic-close-small': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
33
- 'ic-cluster': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
34
32
  'ic-code': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
35
33
  'ic-container': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
36
34
  'ic-cookr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -45,8 +43,6 @@ export declare const iconMap: {
45
43
  'ic-devtron': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
46
44
  'ic-dockerhub': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
47
45
  'ic-ecr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
48
- 'ic-enterprise-feat': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
49
- 'ic-enterprise-tag': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
50
46
  'ic-env': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
51
47
  'ic-error': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
52
48
  'ic-failure': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -76,6 +72,7 @@ export declare const iconMap: {
76
72
  'ic-lightning-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
77
73
  'ic-lightning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
78
74
  'ic-livspace': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
75
+ 'ic-login-devtron-logo': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
79
76
  'ic-logout': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
80
77
  'ic-medium-delete': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
78
  'ic-medium-paintbucket': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -1,2 +1,2 @@
1
1
  import { KeyValueTableProps } from './KeyValueTable.types';
2
- export declare const KeyValueTable: <K extends string>({ config, maskValue, isSortable, headerComponent, onChange, onDelete, placeholder, isAdditionNotAllowed, readOnly, showError, validationSchema: parentValidationSchema, errorMessages: parentErrorMessages, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps<K>) => JSX.Element;
2
+ export declare const KeyValueTable: ({ headerLabel, rows: initialRows, placeholder, maskValue, isSortable, headerComponent, onChange, isAdditionNotAllowed, readOnly, showError, validationSchema: parentValidationSchema, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps) => JSX.Element;
@@ -1,40 +1,7 @@
1
- import { ReactNode } from 'react';
2
- import { ResizableTagTextAreaProps } from '../../../Common';
3
- /**
4
- * Interface representing a key-value header.
5
- * @template K - A string representing the key type.
6
- */
7
- export interface KeyValueHeader<K extends string> {
8
- /** The label of the header. */
9
- label: string;
10
- /** The key associated with the header. */
11
- key: K;
12
- /** An optional class name for the header. */
13
- className?: string;
14
- }
15
- /**
16
- * Type representing a key-value row.
17
- * @template K - A string representing the key type.
18
- */
19
- export type KeyValueRow<K extends string> = {
20
- data: {
21
- [key in K]: Pick<ResizableTagTextAreaProps, 'value' | 'disabled' | 'tabIndex'> & {
22
- /** An optional boolean indicating if an asterisk should be shown. */
23
- required?: boolean;
24
- };
25
- };
26
- id: string | number;
27
- };
28
- /**
29
- * Interface representing the configuration for a key-value table.
30
- * @template K - A string representing the key type.
31
- */
32
- export interface KeyValueConfig<K extends string> {
33
- /** An array containing two key-value headers. */
34
- headers: [KeyValueHeader<K>, KeyValueHeader<K>];
35
- /** An array of key-value rows. */
36
- rows: KeyValueRow<K>[];
37
- }
1
+ import { TooltipProps } from '../../../Common/Tooltip';
2
+ import { DynamicDataTableProps } from '../DynamicDataTable';
3
+ export type KeyValueTableDataType = 'key' | 'value';
4
+ export type KeyValueTableInternalProps = DynamicDataTableProps<KeyValueTableDataType, never>;
38
5
  type ErrorUIProps = {
39
6
  /**
40
7
  * Indicates whether to show errors.
@@ -58,63 +25,93 @@ type ErrorUIProps = {
58
25
  validateDuplicateKeys?: never;
59
26
  validateEmptyKeys?: never;
60
27
  };
61
- /**
62
- * Type representing a mask for key-value pairs.
63
- * @template K - A string representing the key type.
64
- */
65
- export type KeyValueMask<K extends string> = {
28
+ export type KeyValueHeaderLabel<K extends KeyValueTableDataType = KeyValueTableDataType> = {
29
+ [key in K]: string;
30
+ };
31
+ export type KeyValueMask<K extends KeyValueTableDataType = KeyValueTableDataType> = {
66
32
  [key in K]?: boolean;
67
33
  };
68
- export type KeyValuePlaceholder<K extends string> = {
34
+ export type KeyValuePlaceholder<K extends KeyValueTableDataType = KeyValueTableDataType> = {
69
35
  [key in K]?: string;
70
36
  };
37
+ export interface KeyValueTableRowType<K extends KeyValueTableDataType = KeyValueTableDataType> {
38
+ id: string | number;
39
+ data: {
40
+ [key in K]: {
41
+ value: string;
42
+ /** An optional boolean indicating if the cell should be marked as disabled. */
43
+ disabled?: boolean;
44
+ /** An optional boolean indicating if an asterisk should be shown. */
45
+ required?: boolean;
46
+ /** An optional tooltip to show when hovering over cell. */
47
+ tooltip?: Partial<Pick<TooltipProps, 'content' | 'className'>>;
48
+ };
49
+ };
50
+ }
51
+ export interface KeyValueTableData extends Pick<KeyValueTableRowType, 'id'> {
52
+ key: string;
53
+ value: string;
54
+ }
71
55
  /**
72
- * Interface representing the properties for a key-value table component.
73
- * @template K - A string representing the key type.
56
+ * Props for the KeyValueTable component.
74
57
  */
75
- export type KeyValueTableProps<K extends string> = {
76
- /** The configuration for the key-value table. */
77
- config: KeyValueConfig<K>;
78
- /** An optional mask for the key-value pairs. */
79
- maskValue?: KeyValueMask<K>;
80
- placeholder?: KeyValuePlaceholder<K>;
81
- /** An optional boolean indicating if the table is sortable. */
82
- isSortable?: boolean;
83
- /** An optional React node for a custom header component. */
84
- headerComponent?: ReactNode;
85
- /** When true, data addition field will not be shown. */
86
- isAdditionNotAllowed?: boolean;
87
- /** When true, data add or update is disabled. */
88
- readOnly?: boolean;
58
+ export type KeyValueTableProps = Pick<DynamicDataTableProps<KeyValueTableDataType>, 'isAdditionNotAllowed' | 'readOnly' | 'headerComponent'> & {
89
59
  /**
90
- * An optional function to handle changes in the table rows.
91
- * @param rowId - The id of the row that changed.
92
- * @param headerKey - The key of the header that changed.
93
- * @param value - The value of the cell.
60
+ * The label for the table header.
94
61
  */
95
- onChange?: (rowId: string | number, headerKey: K, value: string) => void;
62
+ headerLabel: KeyValueHeaderLabel;
96
63
  /**
97
- * An optional function to handle row deletions.
98
- * @param deletedRowIndex - The index of the row that was deleted.
64
+ * The rows of the key-value table.
99
65
  */
100
- onDelete?: (deletedRowId: string | number) => void;
66
+ rows: KeyValueTableRowType[];
101
67
  /**
102
- * The function to use to validate the value of the cell.
103
- * @param value - The value to validate.
104
- * @param key - The row key of the value.
105
- * @param rowId - The id of the row.
106
- * @returns Return true if the value is valid, otherwise false
107
- * and set `showError` to `true` and provide errorMessages array to show error message.
68
+ * An optional configuration to mask values in the table.
108
69
  */
109
- validationSchema?: (value: string, key: K, rowId: string | number) => boolean;
70
+ maskValue?: KeyValueMask;
110
71
  /**
111
- * An array of error messages to be displayed in the cell error tooltip.
72
+ * An optional placeholder configuration for the table columns.
112
73
  */
113
- errorMessages?: string[];
74
+ placeholder?: KeyValuePlaceholder;
75
+ /**
76
+ * An optional boolean indicating if the `key` column is sortable.
77
+ */
78
+ isSortable?: boolean;
79
+ /**
80
+ * A callback function triggered when the table rows change.
81
+ *
82
+ * @param data - The updated table data.
83
+ */
84
+ onChange: (data: KeyValueTableData[]) => void;
85
+ /**
86
+ * A function to validate the value of a cell.
87
+ *
88
+ * @param value - The value to validate.
89
+ * @param key - The key of the header associated with the value.
90
+ * @param row - The row containing the value.
91
+ * @returns A boolean indicating whether the value is valid. If false,
92
+ * `showError` should be set to `true` and `errorMessages` should
93
+ * provide an array of error messages to display.
94
+ */
95
+ validationSchema?: (value: string, key: KeyValueTableDataType, row: KeyValueTableRowType) => {
96
+ /** Boolean indicating if the cell data is valid or not. */
97
+ isValid: boolean;
98
+ /**
99
+ * An array of error messages to display in the cell error tooltip.
100
+ */
101
+ errorMessages?: string[];
102
+ };
114
103
  /**
115
- * A callback function called when an error occurs.
116
- * @param errorState - The error state, true when any cell has error, otherwise false.
104
+ * A callback function triggered when an error occurs in the table.
105
+ *
106
+ * @param errorState - A boolean indicating the error state. True if any
107
+ * cell has an error, otherwise false.
117
108
  */
118
109
  onError?: (errorState: boolean) => void;
119
110
  } & ErrorUIProps;
111
+ export type KeyValueValidationSchemaProps = {
112
+ value: Parameters<KeyValueTableProps['validationSchema']>[0];
113
+ key: Parameters<KeyValueTableProps['validationSchema']>[1];
114
+ row: Parameters<KeyValueTableProps['validationSchema']>[2];
115
+ keysFrequency?: Record<string, number>;
116
+ } & Pick<KeyValueTableProps, 'validateDuplicateKeys' | 'validateEmptyKeys' | 'validationSchema'> & Partial<Pick<KeyValueTableInternalProps, 'rows'>>;
120
117
  export {};
@@ -1,2 +1,2 @@
1
1
  export * from './KeyValueTable.component';
2
- export * from './KeyValueTable.types';
2
+ export type { KeyValueTableData, KeyValueTableProps } from './KeyValueTable.types';
@@ -0,0 +1,13 @@
1
+ import { UseStateFiltersReturnType } from '../../../Common/Hooks';
2
+ import { KeyValueTableData, KeyValueTableDataType, KeyValueTableInternalProps, KeyValueTableProps, KeyValueValidationSchemaProps } from './KeyValueTable.types';
3
+ export declare const getModifiedDataForOnChange: (rows: KeyValueTableInternalProps["rows"]) => KeyValueTableData[];
4
+ export declare const getEmptyRow: (placeholder: KeyValueTableProps["placeholder"]) => KeyValueTableInternalProps["rows"][number];
5
+ export declare const getKeyValueTableRows: ({ rows: initialRows, placeholder, maskValue, }: Required<Pick<KeyValueTableProps, "rows" | "placeholder" | "maskValue">>) => KeyValueTableInternalProps["rows"];
6
+ export declare const getKeyValueTableSortedRows: ({ rows, sortBy, sortOrder, }: Required<Pick<UseStateFiltersReturnType<KeyValueTableDataType>, "sortBy" | "sortOrder">> & Pick<KeyValueTableInternalProps, "rows">) => import('../DynamicDataTable').DynamicDataTableRowType<KeyValueTableDataType, never>[];
7
+ export declare const getKeyValueHeaders: ({ headerLabel, isSortable, }: Pick<KeyValueTableProps, "headerLabel" | "isSortable">) => KeyValueTableInternalProps["headers"];
8
+ export declare const getKeyValueTableCellError: ({ validateDuplicateKeys, validateEmptyKeys, validationSchema: parentValidationSchema, rows, }: Pick<KeyValueValidationSchemaProps, "validateDuplicateKeys" | "validateEmptyKeys" | "validationSchema" | "rows"> & {
9
+ skipValidationIfValueIsEmpty?: boolean;
10
+ }) => {
11
+ isValid: boolean;
12
+ updatedCellError: {};
13
+ };
@@ -1,3 +1 @@
1
- export { TESTIMONIAL_CARD_DATA } from './constants';
2
1
  export { default as LoginBanner } from './LoginBanner';
3
- export { default as TestimonialContent } from './Testimonials.components';
@@ -28,6 +28,7 @@ export * from './DiffViewer';
28
28
  export * from './DynamicDataTable';
29
29
  export * from './EditableTextArea';
30
30
  export * from './EditImageFormField';
31
+ export * from './EnterpriseTag';
31
32
  export * from './EnvironmentSelector';
32
33
  export * from './Error';
33
34
  export * from './ExcludedImageNode';