@devtron-labs/devtron-fe-common-lib 0.2.2-beta-17 → 0.2.2-beta-18

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 (30) hide show
  1. package/dist/Common/CodeEditor/types.d.ts +0 -1
  2. package/dist/Common/Common.service.d.ts +6 -0
  3. package/dist/Common/Constants.d.ts +0 -1
  4. package/dist/Common/RJSF/constants.d.ts +0 -5
  5. package/dist/Common/RJSF/index.d.ts +0 -1
  6. package/dist/Common/Types.d.ts +2 -1
  7. package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
  8. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +47 -3
  9. package/dist/Shared/Components/KeyValueTable/constants.d.ts +2 -0
  10. package/dist/Shared/constants.d.ts +4 -0
  11. package/dist/Shared/types.d.ts +12 -0
  12. package/dist/assets/index.css +1 -1
  13. package/dist/{cssMode-62ddc175.js → cssMode-f6fa999d.js} +1 -1
  14. package/dist/{freemarker2-308f0c51.js → freemarker2-3203ec71.js} +1 -1
  15. package/dist/{handlebars-bd7cc20f.js → handlebars-eadd4a6d.js} +1 -1
  16. package/dist/{html-8e450585.js → html-67a5c0bb.js} +1 -1
  17. package/dist/{htmlMode-fcdbe206.js → htmlMode-8f976129.js} +1 -1
  18. package/dist/{index-d00df9d3.js → index-39461e67.js} +21998 -21836
  19. package/dist/index.js +446 -443
  20. package/dist/{javascript-8bbb7ab0.js → javascript-a9273fd9.js} +1 -1
  21. package/dist/{jsonMode-1045eb56.js → jsonMode-126fbf89.js} +1 -1
  22. package/dist/{liquid-0dd677cf.js → liquid-c25ab708.js} +1 -1
  23. package/dist/{mdx-bfdb8af8.js → mdx-f6c6e820.js} +1 -1
  24. package/dist/{python-fcd3e584.js → python-7669ec41.js} +1 -1
  25. package/dist/{razor-d9fdcf79.js → razor-42f2a5ac.js} +1 -1
  26. package/dist/{tsMode-cb51e6e3.js → tsMode-a8fecce9.js} +1 -1
  27. package/dist/{typescript-7749fc44.js → typescript-67a132cc.js} +1 -1
  28. package/dist/{xml-36d66a9a.js → xml-3ff482a1.js} +1 -1
  29. package/dist/{yaml-8553fb6c.js → yaml-da2b5f23.js} +1 -1
  30. package/package.json +1 -1
@@ -31,7 +31,6 @@ export interface CodeEditorInterface {
31
31
  isKubernetes?: boolean;
32
32
  cleanData?: boolean;
33
33
  chartVersion?: any;
34
- adjustEditorHeightToContent?: boolean;
35
34
  }
36
35
  export interface CodeEditorHeaderInterface {
37
36
  children?: any;
@@ -1,3 +1,4 @@
1
+ import { RuntimeParamsAPIResponseType } from '../Shared/types';
1
2
  import { TeamList, ResponseType, DeploymentNodeType, CDMaterialServiceEnum, CDMaterialServiceQueryParams, CDMaterialResponseType, CDMaterialFilterQuery, EnvironmentListHelmResponse } from './Types';
2
3
  import { ApiResourceType } from '../Pages';
3
4
 
@@ -15,6 +16,11 @@ export declare const SourceTypeMap: {
15
16
  };
16
17
  export declare function getUserRole(appName?: string): Promise<UserRole>;
17
18
  export declare function setImageTags(request: any, pipelineId: number, artifactId: number): Promise<ResponseType<any>>;
19
+ export declare const parseRuntimeParams: (response: RuntimeParamsAPIResponseType) => {
20
+ key: string;
21
+ value: string;
22
+ id: number;
23
+ }[];
18
24
  export declare const processCDMaterialServiceResponse: (cdMaterialsResult: any, stage: DeploymentNodeType, offset: number, filter: CDMaterialFilterQuery, disableDefaultSelection?: boolean) => CDMaterialResponseType;
19
25
  export declare const genericCDMaterialsService: (serviceType: CDMaterialServiceEnum, cdMaterialID: number, stage: DeploymentNodeType, signal: AbortSignal, queryParams?: CDMaterialServiceQueryParams) => Promise<CDMaterialResponseType>;
20
26
  export declare function extractImage(image: string): string;
@@ -43,7 +43,6 @@ export declare const URLS: {
43
43
  GLOBAL_CONFIG_DOCKER: string;
44
44
  DEPLOYMENT_HISTORY_CONFIGURATIONS: string;
45
45
  GLOBAL_CONFIG_SCOPED_VARIABLES: string;
46
- GLOBAL_CONFIG_DEPLOYMENT_CHARTS_LIST: string;
47
46
  };
48
47
  export declare const ROUTES: {
49
48
  APP: string;
@@ -4,8 +4,3 @@ export declare const PLACEHOLDERS: {
4
4
  OBJECT_KEY: string;
5
5
  };
6
6
  export declare const DEFAULT_FIELD_TITLE = "Key not available";
7
- export declare const HideSubmitButtonUISchema: {
8
- 'ui:submitButtonOptions': {
9
- norender: boolean;
10
- };
11
- };
@@ -1,4 +1,3 @@
1
1
  export { RJSFForm } from './Form';
2
2
  export * from './types';
3
3
  export { getInferredTypeFromValueType, getRedirectionProps } from './utils';
4
- export { HideSubmitButtonUISchema } from './constants';
@@ -2,7 +2,7 @@ import { default as React, ReactNode, CSSProperties } from 'react';
2
2
  import { Placement } from 'tippy.js';
3
3
  import { ImageComment, ReleaseTag } from './ImageTags.Types';
4
4
  import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.';
5
- import { RegistryType } from '../Shared';
5
+ import { RegistryType, RuntimeParamsListItemType } from '../Shared';
6
6
 
7
7
  /**
8
8
  * Generic response type object with support for overriding the result type
@@ -546,6 +546,7 @@ export interface CDMaterialsMetaInfo {
546
546
  * This is the ID of user that has request the material
547
547
  */
548
548
  requestedUserId: number;
549
+ runtimeParams: RuntimeParamsListItemType[];
549
550
  }
550
551
  export interface ImagePromotionMaterialInfo {
551
552
  isApprovalPendingForPromotion: boolean;
@@ -1,3 +1,3 @@
1
1
  import { KeyValueTableProps } from './KeyValueTable.types';
2
2
 
3
- export declare const KeyValueTable: <K extends string>({ config, maskValue, isSortable, headerComponent, onChange, onDelete, placeholder, isAdditionNotAllowed, }: KeyValueTableProps<K>) => JSX.Element;
3
+ 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;
@@ -36,6 +36,29 @@ export interface KeyValueConfig<K extends string> {
36
36
  /** An array of key-value rows. */
37
37
  rows: KeyValueRow<K>[];
38
38
  }
39
+ type ErrorUIProps = {
40
+ /**
41
+ * Indicates whether to show errors.
42
+ */
43
+ showError: true;
44
+ /**
45
+ * @default - false
46
+ * If true, would validate for duplicate keys and if present would show error tooltip on the cell.
47
+ */
48
+ validateDuplicateKeys?: boolean;
49
+ /**
50
+ * @default - false
51
+ * If true, would validate for rows having values but no key and if error would show error tooltip on the cell.
52
+ */
53
+ validateEmptyKeys?: boolean;
54
+ } | {
55
+ /**
56
+ * Indicates whether to show errors.
57
+ */
58
+ showError?: false;
59
+ validateDuplicateKeys?: never;
60
+ validateEmptyKeys?: never;
61
+ };
39
62
  /**
40
63
  * Type representing a mask for key-value pairs.
41
64
  * @template K - A string representing the key type.
@@ -50,7 +73,7 @@ export type KeyValuePlaceholder<K extends string> = {
50
73
  * Interface representing the properties for a key-value table component.
51
74
  * @template K - A string representing the key type.
52
75
  */
53
- export interface KeyValueTableProps<K extends string> {
76
+ export type KeyValueTableProps<K extends string> = {
54
77
  /** The configuration for the key-value table. */
55
78
  config: KeyValueConfig<K>;
56
79
  /** An optional mask for the key-value pairs. */
@@ -60,8 +83,10 @@ export interface KeyValueTableProps<K extends string> {
60
83
  isSortable?: boolean;
61
84
  /** An optional React node for a custom header component. */
62
85
  headerComponent?: ReactNode;
63
- /** When true, data addition field will not be shown */
86
+ /** When true, data addition field will not be shown. */
64
87
  isAdditionNotAllowed?: boolean;
88
+ /** When true, data add or update is disabled. */
89
+ readOnly?: boolean;
65
90
  /**
66
91
  * An optional function to handle changes in the table rows.
67
92
  * @param rowId - The id of the row that changed.
@@ -74,4 +99,23 @@ export interface KeyValueTableProps<K extends string> {
74
99
  * @param deletedRowIndex - The index of the row that was deleted.
75
100
  */
76
101
  onDelete?: (deletedRowId: string | number) => void;
77
- }
102
+ /**
103
+ * The function to use to validate the value of the cell.
104
+ * @param value - The value to validate.
105
+ * @param key - The row key of the value.
106
+ * @param rowId - The id of the row.
107
+ * @returns Return true if the value is valid, otherwise false
108
+ * and set `showError` to `true` and provide errorMessages array to show error message.
109
+ */
110
+ validationSchema?: (value: string, key: K, rowId: string | number) => boolean;
111
+ /**
112
+ * An array of error messages to be displayed in the cell error tooltip.
113
+ */
114
+ errorMessages?: string[];
115
+ /**
116
+ * A callback function called when an error occurs.
117
+ * @param errorState - The error state, true when any cell has error, otherwise false.
118
+ */
119
+ onError?: (errorState: boolean) => void;
120
+ } & ErrorUIProps;
121
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const DUPLICATE_KEYS_VALIDATION_MESSAGE = "Keys must be unique";
2
+ export declare const EMPTY_KEY_VALIDATION_MESSAGE = "Key cannot be empty";
@@ -1,3 +1,6 @@
1
+ import { OptionType } from '../Common/Types';
2
+ import { CDMaterialSidebarType } from './types';
3
+
1
4
  export declare const ARTIFACT_STATUS: {
2
5
  PROGRESSING: string;
3
6
  DEGRADED: string;
@@ -397,3 +400,4 @@ export declare enum SelectAllGroupedResourceIdentifiers {
397
400
  allExistingAndFutureProdEnvironments = "-2",
398
401
  allExistingAndFutureEnvironments = "-3"
399
402
  }
403
+ export declare const CD_MATERIAL_SIDEBAR_TABS: OptionType<CDMaterialSidebarType, CDMaterialSidebarType>[];
@@ -1,4 +1,5 @@
1
1
  import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams } from '../Common';
2
+ import { KeyValueListType } from './Components';
2
3
  import { EnvironmentTypeEnum, PatchOperationType } from './constants';
3
4
 
4
5
  export declare enum EnvType {
@@ -285,6 +286,10 @@ export declare enum CIMaterialSidebarType {
285
286
  CODE_SOURCE = "Code Source",
286
287
  PARAMETERS = "Parameters"
287
288
  }
289
+ export declare enum CDMaterialSidebarType {
290
+ IMAGE = "Image",
291
+ PARAMETERS = "Parameters"
292
+ }
288
293
  /**
289
294
  * @example Usage with specific enum for path & `unknown` type for value
290
295
  * ```ts
@@ -554,4 +559,11 @@ export type BaseFilterQueryParams<T> = {
554
559
  */
555
560
  showAll?: boolean;
556
561
  } & SortingParams<T>;
562
+ export interface RuntimeParamsListItemType extends KeyValueListType {
563
+ id: number;
564
+ }
565
+ export declare enum RuntimeParamsHeadingType {
566
+ KEY = "key",
567
+ VALUE = "value"
568
+ }
557
569
  export {};