@devtron-labs/devtron-fe-common-lib 1.12.0-beta-2 → 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 (33) hide show
  1. package/dist/{@code-editor-WfOCu__U.js → @code-editor-Ck_CH0E8.js} +8057 -8177
  2. package/dist/{@common-rjsf-Cb7AEsSR.js → @common-rjsf-D7qlH1s4.js} +1 -1
  3. package/dist/Common/CIPipeline.Types.d.ts +20 -19
  4. package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
  5. package/dist/Common/RJSF/Form.d.ts +1 -1
  6. package/dist/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.d.ts +1 -1
  7. package/dist/Shared/Components/AnimatedDeployButton/types.d.ts +0 -6
  8. package/dist/Shared/Components/CICDHistory/Artifacts.d.ts +1 -1
  9. package/dist/Shared/Components/CICDHistory/DeploymentDetailSteps.d.ts +1 -1
  10. package/dist/Shared/Components/CICDHistory/History.components.d.ts +1 -1
  11. package/dist/Shared/Components/CICDHistory/types.d.ts +5 -8
  12. package/dist/Shared/Components/CMCS/constants.d.ts +2 -2
  13. package/dist/Shared/Components/CMCS/utils.d.ts +4 -3
  14. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +1 -1
  15. package/dist/Shared/Components/DynamicDataTable/types.d.ts +5 -1
  16. package/dist/Shared/Components/Icon/Icon.d.ts +1 -5
  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/index.d.ts +0 -1
  22. package/dist/Shared/Services/app.types.d.ts +2 -6
  23. package/dist/Shared/types.d.ts +0 -2
  24. package/dist/assets/{ic-selected.3a29e244.svg → ic-timeout-two-dash.9a580698.svg} +3 -2
  25. package/dist/index.js +397 -397
  26. package/package.json +1 -1
  27. package/dist/Shared/Components/UserIdentifier/UserIdentifier.d.ts +0 -2
  28. package/dist/Shared/Components/UserIdentifier/index.d.ts +0 -2
  29. package/dist/Shared/Components/UserIdentifier/types.d.ts +0 -11
  30. package/dist/assets/ic-checks.d276fd05.svg +0 -3
  31. package/dist/assets/ic-key.8c76fb61.svg +0 -3
  32. package/dist/assets/ic-rocket-launch.1d407c66.svg +0 -3
  33. package/dist/assets/ic-timeout-dash.d8e2d62e.svg +0 -21
@@ -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-WfOCu__U.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";
@@ -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 { 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,3 +1,3 @@
1
1
  import { AnimatedDeployButtonProps } from './types';
2
- declare const AnimatedDeployButton: ({ isLoading, isVirtualEnvironment, onButtonClick, exceptionUserConfig, isBulkCDTrigger, }: AnimatedDeployButtonProps) => JSX.Element;
2
+ declare const AnimatedDeployButton: ({ isVirtualEnvironment, onButtonClick }: AnimatedDeployButtonProps) => JSX.Element;
3
3
  export default AnimatedDeployButton;
@@ -1,10 +1,4 @@
1
1
  export interface AnimatedDeployButtonProps {
2
- isLoading?: boolean;
3
2
  isVirtualEnvironment: boolean;
4
3
  onButtonClick: (e: any, disableDeployButton: boolean) => void;
5
- exceptionUserConfig?: {
6
- canDeploy: boolean;
7
- isImageApprover: boolean;
8
- };
9
- isBulkCDTrigger?: boolean;
10
4
  }
@@ -1,4 +1,4 @@
1
1
  import { ArtifactType, CIListItemType } from './types';
2
- export declare const CIListItem: ({ type, userApprovalMetadata, triggeredBy, children, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, isSuperAdmin, promotionApprovalMetadata, appliedFiltersTimestamp, selectedEnvironmentName, renderCIListHeader, targetPlatforms, isDeploymentWithoutApproval, }: CIListItemType) => JSX.Element;
2
+ export declare const CIListItem: ({ type, userApprovalMetadata, triggeredBy, children, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, isSuperAdmin, promotionApprovalMetadata, appliedFiltersTimestamp, selectedEnvironmentName, renderCIListHeader, targetPlatforms, }: CIListItemType) => JSX.Element;
3
3
  declare const Artifacts: ({ status, artifact, blobStorageEnabled, isArtifactUploaded, downloadArtifactUrl, ciPipelineId, artifactId, isJobCI, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, rootClassName, renderCIListHeader, targetPlatforms, }: ArtifactType) => JSX.Element;
4
4
  export default Artifacts;
@@ -1,3 +1,3 @@
1
1
  import { DeploymentDetailStepsType } from './types';
2
- declare const DeploymentDetailSteps: ({ deploymentStatus, deploymentAppType, isHelmApps, installedAppVersionHistoryId, isGitops, userApprovalMetadata, isVirtualEnvironment, processVirtualEnvironmentDeploymentData, renderDeploymentApprovalInfo, isDeploymentWithoutApproval, }: DeploymentDetailStepsType) => JSX.Element;
2
+ declare const DeploymentDetailSteps: ({ deploymentStatus, deploymentAppType, isHelmApps, installedAppVersionHistoryId, isGitops, userApprovalMetadata, isVirtualEnvironment, processVirtualEnvironmentDeploymentData, renderDeploymentApprovalInfo, }: DeploymentDetailStepsType) => JSX.Element;
3
3
  export default DeploymentDetailSteps;
@@ -1,4 +1,4 @@
1
1
  import { GitChangesType, LogResizeButtonType, ScrollerType } from './types';
2
2
  export declare const LogResizeButton: ({ shortcutCombo, showOnlyWhenPathIncludesLogs, fullScreenView, setFullScreenView, }: LogResizeButtonType) => JSX.Element;
3
3
  export declare const Scroller: ({ scrollToTop, scrollToBottom, style }: ScrollerType) => JSX.Element;
4
- export declare const GitChanges: ({ gitTriggers, ciMaterials, artifact, userApprovalMetadata, triggeredByEmail, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, appliedFiltersTimestamp, promotionApprovalMetadata, selectedEnvironmentName, renderCIListHeader, targetPlatforms, isDeploymentWithoutApproval, }: GitChangesType) => JSX.Element;
4
+ export declare const GitChanges: ({ gitTriggers, ciMaterials, artifact, userApprovalMetadata, triggeredByEmail, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, appliedFiltersTimestamp, promotionApprovalMetadata, selectedEnvironmentName, renderCIListHeader, targetPlatforms, }: GitChangesType) => JSX.Element;
@@ -134,7 +134,6 @@ export interface History extends Pick<TargetPlatformsDTO, 'targetPlatforms'>, Wo
134
134
  triggerMetadata?: string;
135
135
  runSource?: RunSourceType;
136
136
  targetConfig?: TargetConfigType;
137
- isDeploymentWithoutApproval?: boolean;
138
137
  }
139
138
  export interface ExecutionInfoType {
140
139
  /**
@@ -314,7 +313,7 @@ export interface DeploymentStatusDetailsTimelineType {
314
313
  statusTime: string;
315
314
  resourceDetails?: SyncStageResourceDetail[];
316
315
  }
317
- export interface DeploymentStatusDetailsType extends Pick<History, 'isDeploymentWithoutApproval'> {
316
+ export interface DeploymentStatusDetailsType {
318
317
  deploymentFinishedOn: string;
319
318
  deploymentStartedOn: string;
320
319
  triggeredBy: string;
@@ -328,7 +327,7 @@ export interface DeploymentStatusDetailsResponse extends ResponseType {
328
327
  }
329
328
  interface DeploymentStatusDetailRow {
330
329
  icon: string;
331
- displayText: ReactNode;
330
+ displayText: string;
332
331
  displaySubText: string;
333
332
  time: string;
334
333
  resourceDetails?: any;
@@ -356,7 +355,7 @@ export interface DeploymentStatusDetailsBreakdownDataType {
356
355
  HELM_PACKAGE_GENERATED?: DeploymentStatusDetailRow;
357
356
  };
358
357
  }
359
- export interface DeploymentDetailStepsType extends Pick<History, 'isDeploymentWithoutApproval'> {
358
+ export interface DeploymentDetailStepsType {
360
359
  deploymentStatus?: string;
361
360
  deploymentAppType?: DeploymentAppTypes;
362
361
  isHelmApps?: boolean;
@@ -367,7 +366,7 @@ export interface DeploymentDetailStepsType extends Pick<History, 'isDeploymentWi
367
366
  processVirtualEnvironmentDeploymentData: (data?: DeploymentStatusDetailsType) => DeploymentStatusDetailsBreakdownDataType;
368
367
  renderDeploymentApprovalInfo: (userApprovalMetadata: UserApprovalMetadataType) => JSX.Element;
369
368
  }
370
- export interface RenderCIListHeaderProps extends Required<Pick<History, 'isDeploymentWithoutApproval'>> {
369
+ export interface RenderCIListHeaderProps {
371
370
  userApprovalMetadata: UserApprovalMetadataType;
372
371
  triggeredBy: string;
373
372
  appliedFilters: FilterConditionsListType[];
@@ -385,7 +384,7 @@ export interface VirtualHistoryArtifactProps {
385
384
  workflowId: number;
386
385
  };
387
386
  }
388
- export type CIListItemType = Pick<History, 'promotionApprovalMetadata' | 'isDeploymentWithoutApproval'> & {
387
+ export type CIListItemType = Pick<History, 'promotionApprovalMetadata'> & {
389
388
  userApprovalMetadata?: UserApprovalMetadataType;
390
389
  triggeredBy?: string;
391
390
  children: ReactNode;
@@ -602,7 +601,6 @@ export type GitChangesType = {
602
601
  appliedFilters?: never;
603
602
  appliedFiltersTimestamp?: never;
604
603
  renderCIListHeader?: never;
605
- isDeploymentWithoutApproval?: never;
606
604
  } | {
607
605
  artifact: string;
608
606
  promotionApprovalMetadata: History['promotionApprovalMetadata'];
@@ -620,7 +618,6 @@ export type GitChangesType = {
620
618
  appliedFilters?: FilterConditionsListType[];
621
619
  appliedFiltersTimestamp?: string;
622
620
  renderCIListHeader: (renderCIListHeaderProps: RenderCIListHeaderProps) => JSX.Element;
623
- isDeploymentWithoutApproval?: History['isDeploymentWithoutApproval'];
624
621
  });
625
622
  export interface ArtifactType extends Pick<TargetPlatformBadgeListProps, 'targetPlatforms'> {
626
623
  status: string;
@@ -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
  }
@@ -23,7 +23,6 @@ export declare const iconMap: {
23
23
  'ic-cd': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
24
24
  'ic-chat-circle-dots': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
25
25
  'ic-check': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
26
- 'ic-checks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
27
26
  'ic-ci-linked': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
28
27
  'ic-ci-webhook': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
29
28
  'ic-circle-loader': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -69,7 +68,6 @@ export declare const iconMap: {
69
68
  'ic-info-outline': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
70
69
  'ic-job-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
71
70
  'ic-k8s-job': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
72
- 'ic-key': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
73
71
  'ic-ldap': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
74
72
  'ic-lightning-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
75
73
  'ic-lightning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -93,8 +91,6 @@ export declare const iconMap: {
93
91
  'ic-pencil': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
94
92
  'ic-quay': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
95
93
  'ic-quote': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
96
- 'ic-rocket-launch': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
97
- 'ic-selected': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
98
94
  'ic-shield-check': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
99
95
  'ic-sliders-vertical': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
100
96
  'ic-sort-ascending': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -107,7 +103,7 @@ export declare const iconMap: {
107
103
  'ic-suspended': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
108
104
  'ic-tata1mg': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
109
105
  'ic-terminal-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
110
- 'ic-timeout-dash': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
106
+ 'ic-timeout-two-dash': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
111
107
  'ic-timer': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
112
108
  'ic-travclan': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
113
109
  'ic-unknown': 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
+ };
@@ -79,6 +79,5 @@ export * from './ThemeSwitcher';
79
79
  export * from './ToggleResolveScopedVariables';
80
80
  export * from './UnsavedChanges';
81
81
  export * from './UnsavedChangesDialog';
82
- export * from './UserIdentifier';
83
82
  export * from './VirtualizedList';
84
83
  export * from './WorkflowOptionsModal';
@@ -1,3 +1,4 @@
1
+ import { KeyValueTableData } from '../Components';
1
2
  import { TargetPlatformsDTO } from '../types';
2
3
  import { OverrideMergeStrategyType } from '../../Pages/Applications';
3
4
  import { ReleaseTag, ResponseType, UserApprovalMetadataType } from '../../Common';
@@ -185,11 +186,6 @@ export interface ConfigMapSecretDataType {
185
186
  configData: ConfigMapSecretDataConfigDatumDTO[];
186
187
  isDeletable: boolean;
187
188
  }
188
- export interface CMSecretYamlData {
189
- k: string;
190
- v: string;
191
- id: string | number;
192
- }
193
189
  export interface ConfigMapSecretUseFormProps {
194
190
  name: string;
195
191
  isSecret: boolean;
@@ -204,7 +200,7 @@ export interface ConfigMapSecretUseFormProps {
204
200
  roleARN: string;
205
201
  yamlMode: boolean;
206
202
  yaml: string;
207
- currentData: CMSecretYamlData[];
203
+ currentData: KeyValueTableData[];
208
204
  secretDataYaml: string;
209
205
  esoSecretYaml: string;
210
206
  hasCurrentDataErr: boolean;
@@ -245,8 +245,6 @@ export interface WorkflowType {
245
245
  showTippy?: boolean;
246
246
  appId?: number;
247
247
  isSelected?: boolean;
248
- isExceptionUser?: boolean;
249
- canApproverDeploy?: boolean;
250
248
  approvalConfiguredIdsMap?: Record<number, ApprovalConfigDataType>;
251
249
  imageReleaseTags: string[];
252
250
  appReleaseTags?: string[];
@@ -15,6 +15,7 @@
15
15
  -->
16
16
 
17
17
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
18
- <circle cx="12" cy="12" r="10" fill="var(--B500)"/>
19
- <path fill-rule="evenodd" clip-rule="evenodd" d="M16.7071 9.29291C17.0976 9.68344 17.0976 10.3166 16.7071 10.7071L11.3738 16.0402C10.9832 16.4307 10.3501 16.4307 9.95959 16.0402L7.29292 13.3738C6.90238 12.9833 6.90235 12.3501 7.29286 11.9596C7.68337 11.5691 8.31653 11.569 8.70708 11.9595L10.6667 13.9189L15.2929 9.29288C15.6834 8.90236 16.3166 8.90238 16.7071 9.29291Z" fill="var(--N0)"/>
18
+ <path d="M3 12C3 7.02944 7.02944 3 12 3" stroke="#3B444C" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-dasharray="2 3"/>
19
+ <path d="M12 6.75V12L15 16" stroke="#3B444C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
20
+ <path d="M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3" stroke="#3B444C" stroke-width="1.5" stroke-miterlimit="10"/>
20
21
  </svg>