@devtron-labs/devtron-fe-common-lib 0.2.5-beta-1 → 0.2.5-beta-2

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 (29) hide show
  1. package/dist/Common/Common.service.d.ts +6 -0
  2. package/dist/Common/CustomTagSelector/TagDetails.d.ts +1 -1
  3. package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +1 -1
  4. package/dist/Common/CustomTagSelector/Types.d.ts +0 -2
  5. package/dist/Common/Types.d.ts +2 -1
  6. package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
  7. package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +28 -7
  8. package/dist/Shared/Components/KeyValueTable/constants.d.ts +2 -0
  9. package/dist/Shared/constants.d.ts +4 -0
  10. package/dist/Shared/types.d.ts +12 -0
  11. package/dist/assets/index.css +1 -1
  12. package/dist/{cssMode-48c0f680.js → cssMode-07da02cd.js} +1 -1
  13. package/dist/{freemarker2-abeb240d.js → freemarker2-9fd83d43.js} +1 -1
  14. package/dist/{handlebars-a1d03281.js → handlebars-18dccb78.js} +1 -1
  15. package/dist/{html-b2ac7b3c.js → html-201758e1.js} +1 -1
  16. package/dist/{htmlMode-9921d4db.js → htmlMode-10964d27.js} +1 -1
  17. package/dist/{index-55f67c02.js → index-8bb539c6.js} +17273 -17215
  18. package/dist/index.js +472 -468
  19. package/dist/{javascript-459ec784.js → javascript-4327a7e8.js} +1 -1
  20. package/dist/{jsonMode-61b52ed6.js → jsonMode-e59deb57.js} +1 -1
  21. package/dist/{liquid-9d8a221e.js → liquid-c96eb385.js} +1 -1
  22. package/dist/{mdx-dc4f9b48.js → mdx-0eb9a0f4.js} +1 -1
  23. package/dist/{python-6e74db51.js → python-d79b6153.js} +1 -1
  24. package/dist/{razor-a92b516d.js → razor-4d69a090.js} +1 -1
  25. package/dist/{tsMode-89890d25.js → tsMode-b991e21c.js} +1 -1
  26. package/dist/{typescript-119d98cc.js → typescript-0b46acf6.js} +1 -1
  27. package/dist/{xml-05861ac3.js → xml-eb10ea00.js} +1 -1
  28. package/dist/{yaml-137573e5.js → yaml-a9060343.js} +1 -1
  29. package/package.json +1 -1
@@ -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;
@@ -1,3 +1,3 @@
1
1
  import { TagDetailType } from './Types';
2
2
 
3
- export declare const TagDetails: ({ index, tagData, setTagData, removeTag, tabIndex, suggestedTagsOptions, hidePropagateTag, }: TagDetailType) => JSX.Element;
3
+ export declare const TagDetails: ({ index, tagData, setTagData, removeTag, tabIndex, suggestedTagsOptions, }: TagDetailType) => JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { TagLabelSelectType } from './Types';
2
2
 
3
- export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex, hidePropagateTag }: TagLabelSelectType) => JSX.Element;
3
+ export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex }: TagLabelSelectType) => JSX.Element;
@@ -29,7 +29,6 @@ export interface TagLabelSelectType {
29
29
  selectedProjectId?: number;
30
30
  suggestedTagsOptions?: SuggestedTagOptionType[];
31
31
  reloadProjectTags?: boolean;
32
- hidePropagateTag?: boolean;
33
32
  }
34
33
  export interface TagDetailType {
35
34
  index: number;
@@ -38,7 +37,6 @@ export interface TagDetailType {
38
37
  removeTag?: (index: number) => void;
39
38
  tabIndex?: number;
40
39
  suggestedTagsOptions?: SuggestedTagOptionType[];
41
- hidePropagateTag?: boolean;
42
40
  }
43
41
  export interface TagLabelValueSelectorType {
44
42
  selectedTagIndex: number;
@@ -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, Severity } from '../Shared';
5
+ import { RegistryType, RuntimeParamsListItemType, Severity } 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, readOnly, showError, validationSchema, errorMessages, onError, }: 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. */
@@ -76,18 +99,15 @@ export interface KeyValueTableProps<K extends string> {
76
99
  * @param deletedRowIndex - The index of the row that was deleted.
77
100
  */
78
101
  onDelete?: (deletedRowId: string | number) => void;
79
- /**
80
- * Indicates whether to show errors.
81
- */
82
- showError?: boolean;
83
102
  /**
84
103
  * The function to use to validate the value of the cell.
85
104
  * @param value - The value to validate.
86
105
  * @param key - The row key of the value.
106
+ * @param rowId - The id of the row.
87
107
  * @returns Return true if the value is valid, otherwise false
88
108
  * and set `showError` to `true` and provide errorMessages array to show error message.
89
109
  */
90
- validationSchema?: (value: string, key: K) => boolean;
110
+ validationSchema?: (value: string, key: K, rowId: string | number) => boolean;
91
111
  /**
92
112
  * An array of error messages to be displayed in the cell error tooltip.
93
113
  */
@@ -97,4 +117,5 @@ export interface KeyValueTableProps<K extends string> {
97
117
  * @param errorState - The error state, true when any cell has error, otherwise false.
98
118
  */
99
119
  onError?: (errorState: boolean) => void;
100
- }
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 {
@@ -287,6 +288,10 @@ export declare enum CIMaterialSidebarType {
287
288
  CODE_SOURCE = "Code Source",
288
289
  PARAMETERS = "Parameters"
289
290
  }
291
+ export declare enum CDMaterialSidebarType {
292
+ IMAGE = "Image",
293
+ PARAMETERS = "Parameters"
294
+ }
290
295
  /**
291
296
  * @example Usage with specific enum for path & `unknown` type for value
292
297
  * ```ts
@@ -566,4 +571,11 @@ export type BaseFilterQueryParams<T> = {
566
571
  */
567
572
  showAll?: boolean;
568
573
  } & SortingParams<T>;
574
+ export interface RuntimeParamsListItemType extends KeyValueListType {
575
+ id: number;
576
+ }
577
+ export declare enum RuntimeParamsHeadingType {
578
+ KEY = "key",
579
+ VALUE = "value"
580
+ }
569
581
  export {};