@devtron-labs/devtron-fe-common-lib 0.0.94 → 0.0.95-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 (37) hide show
  1. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +1 -1
  2. package/dist/Common/SortableTableHeaderCell/types.d.ts +5 -0
  3. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +2 -0
  4. package/dist/Shared/API/APIQueuing.d.ts +11 -0
  5. package/dist/Shared/API/index.d.ts +1 -0
  6. package/dist/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.d.ts +4 -0
  7. package/dist/Shared/Components/EnvironmentSelector/constants.d.ts +5 -0
  8. package/dist/Shared/Components/EnvironmentSelector/index.d.ts +1 -0
  9. package/dist/Shared/Components/EnvironmentSelector/service.d.ts +3 -0
  10. package/dist/Shared/Components/EnvironmentSelector/types.d.ts +27 -0
  11. package/dist/Shared/Components/EnvironmentSelector/utils.d.ts +6 -0
  12. package/dist/Shared/Components/ReactSelect/utils.d.ts +4 -0
  13. package/dist/Shared/Components/index.d.ts +1 -0
  14. package/dist/Shared/Helpers.d.ts +1 -0
  15. package/dist/Shared/constants.d.ts +1 -0
  16. package/dist/Shared/index.d.ts +1 -0
  17. package/dist/Shared/types.d.ts +59 -4
  18. package/dist/assets/index.css +1 -1
  19. package/dist/{cssMode-20685fd6.js → cssMode-b773b9cd.js} +1 -1
  20. package/dist/{freemarker2-97562136.js → freemarker2-a145eded.js} +1 -1
  21. package/dist/{handlebars-98156536.js → handlebars-0507ca2c.js} +1 -1
  22. package/dist/{html-e645a50c.js → html-19539481.js} +1 -1
  23. package/dist/{htmlMode-9ad9b4ce.js → htmlMode-30775328.js} +1 -1
  24. package/dist/{index-9e88d6a2.js → index-ac4e86d0.js} +16187 -16069
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.js +408 -403
  27. package/dist/{javascript-229b4261.js → javascript-e7984ed4.js} +1 -1
  28. package/dist/{jsonMode-68ee2476.js → jsonMode-ca187aaa.js} +1 -1
  29. package/dist/{liquid-ebb599ad.js → liquid-1b68d349.js} +1 -1
  30. package/dist/{mdx-2866f4a2.js → mdx-2d5337cd.js} +1 -1
  31. package/dist/{python-9e33cecd.js → python-d315888b.js} +1 -1
  32. package/dist/{razor-626e9296.js → razor-3bb641fb.js} +1 -1
  33. package/dist/{tsMode-ac23c296.js → tsMode-274d8f6a.js} +1 -1
  34. package/dist/{typescript-aeff108d.js → typescript-0cb2c05f.js} +1 -1
  35. package/dist/{xml-ac31c447.js → xml-ad62db8a.js} +1 -1
  36. package/dist/{yaml-1e335dca.js → yaml-93f6f8e1.js} +1 -1
  37. package/package.json +1 -1
@@ -14,5 +14,5 @@ import { SortableTableHeaderCellProps } from './types';
14
14
  * />
15
15
  * ```
16
16
  */
17
- declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, }: SortableTableHeaderCellProps) => JSX.Element;
17
+ declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, }: SortableTableHeaderCellProps) => JSX.Element;
18
18
  export default SortableTableHeaderCell;
@@ -23,4 +23,9 @@ export interface SortableTableHeaderCellProps {
23
23
  * If true, the cell is disabled
24
24
  */
25
25
  disabled: boolean;
26
+ /**
27
+ * If false, the cell acts like normal table header cell
28
+ * @default true
29
+ */
30
+ isSortable?: boolean;
26
31
  }
@@ -12,4 +12,6 @@ export declare const unitSelectorStyles: () => {
12
12
  loadingMessage: (base: any) => any;
13
13
  noOptionsMessage: (base: any) => any;
14
14
  placeholder: (base: any) => any;
15
+ group: (base: any) => any;
16
+ groupHeading: (base: any) => any;
15
17
  };
@@ -0,0 +1,11 @@
1
+ import { ApiQueuingWithBatchResponseItem } from '../types';
2
+
3
+ /**
4
+ * Executes a batch of function calls concurrently with queuing.
5
+ * @param functionCalls The array of function calls returning promise to be executed.
6
+ * @param batchSize The maximum number of function calls to be executed concurrently. Defaults to the value of `window._env_.API_BATCH_SIZE`.
7
+ * @param shouldRejectOnError If set to true, the promise will reject if any of the function calls rejects, i.e, acts like Promise.all else Promise.allSettled . Defaults to false.
8
+ * @returns A promise that resolves to a array of objects containing the status and value of the batch execution.
9
+ */
10
+ declare const ApiQueuingWithBatch: <T>(functionCalls: any, httpProtocol: string, shouldRejectOnError?: boolean, batchSize?: number) => Promise<ApiQueuingWithBatchResponseItem<T>[]>;
11
+ export default ApiQueuingWithBatch;
@@ -0,0 +1 @@
1
+ export { default as ApiQueuingWithBatch } from './APIQueuing';
@@ -0,0 +1,4 @@
1
+ import { EnvironmentSelectorProps } from './types';
2
+
3
+ declare const EnvironmentSelector: <T>({ handleEnvironmentChange, selectedEnvironmentsMap, isMulti, placeholder, processOptions, styles, isClearable, autoFocus, }: EnvironmentSelectorProps<T>) => JSX.Element;
4
+ export default EnvironmentSelector;
@@ -0,0 +1,5 @@
1
+ export declare const ENVIRONMENT_SELECTOR_TEXT: {
2
+ DEFAULT_PLACEHOLDER: string;
3
+ GROUP_HEADING_PREFIX: string;
4
+ NO_ENVIRONMENTS_AVAILABLE: string;
5
+ };
@@ -0,0 +1 @@
1
+ export { default as EnvironmentSelector } from './EnvironmentSelector.component';
@@ -0,0 +1,3 @@
1
+ import { GroupedOptionsType } from '../../types';
2
+
3
+ export declare const getEnvironmentsGroupedByCluster: () => Promise<GroupedOptionsType[]>;
@@ -0,0 +1,27 @@
1
+ import { commonSelectStyles } from '../ReactSelect';
2
+ import { GroupedOptionsType } from '../../types';
3
+ import { OptionType } from '../../../Common';
4
+
5
+ export type SelectedEnvironmentsMapType<T> = Record<string, T>;
6
+ export type BaseSelectorType = {
7
+ isMulti: true;
8
+ handleEnvironmentChange: (options: OptionType[]) => void;
9
+ } | {
10
+ isMulti: false;
11
+ handleEnvironmentChange: (option: OptionType) => void;
12
+ };
13
+ export type EnvironmentSelectorProps<T> = BaseSelectorType & {
14
+ /**
15
+ * Would expect selected option to be like {[selectedOption1.label] = <any value we want to store>, ...}
16
+ */
17
+ selectedEnvironmentsMap?: SelectedEnvironmentsMapType<T>;
18
+ placeholder?: string;
19
+ /**
20
+ * This is a HEAVY operation, so make sure to wrap it in useCallback
21
+ * In case we want to process (filter, rename label, etc) the options before displaying them
22
+ */
23
+ processOptions?: (options: GroupedOptionsType[]) => GroupedOptionsType[];
24
+ styles?: typeof commonSelectStyles;
25
+ isClearable?: boolean;
26
+ autoFocus?: boolean;
27
+ };
@@ -0,0 +1,6 @@
1
+ import { SelectedEnvironmentsMapType } from './types';
2
+ import { EnvListMinDTO, GroupedOptionsType } from '../../types';
3
+ import { OptionType } from '../../../Common';
4
+
5
+ export declare const parseEnvironmentClusterListToOptions: (environmentClusterList: EnvListMinDTO[]) => GroupedOptionsType[];
6
+ export declare const getSelectedOptions: <T>(selectedEnvironmentsMap: SelectedEnvironmentsMapType<T>, options: GroupedOptionsType[]) => OptionType[];
@@ -8,6 +8,8 @@ export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
8
8
  loadingMessage: (base: any) => any;
9
9
  noOptionsMessage: (base: any) => any;
10
10
  placeholder: (base: any) => any;
11
+ group: (base: any) => any;
12
+ groupHeading: (base: any) => any;
11
13
  };
12
14
  export declare const getCustomOptionSelectionStyle: (styleOverrides?: {}) => (base: any, state: any) => any;
13
15
  export declare const SelectOption: (props: any) => JSX.Element;
@@ -23,4 +25,6 @@ export declare const commonSelectStyles: {
23
25
  loadingMessage: (base: any) => any;
24
26
  noOptionsMessage: (base: any) => any;
25
27
  placeholder: (base: any) => any;
28
+ group: (base: any) => any;
29
+ groupHeading: (base: any) => any;
26
30
  };
@@ -17,6 +17,7 @@ export * from './Header';
17
17
  export * from './AnnouncementBanner';
18
18
  export * from './ButtonWithLoader';
19
19
  export * from './ButtonWithSelector';
20
+ export * from './EnvironmentSelector';
20
21
  export * from './ModalSidebarPanel';
21
22
  export * from './ImageWithFallback';
22
23
  export * from './FeatureDescription';
@@ -26,6 +26,7 @@ export declare const numberComparatorBySortOrder: (a: number, b: number, sortOrd
26
26
  export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => JSX.Element;
27
27
  export declare const useIntersection: (target: React.RefObject<Element> | Element | null, options?: IntersectionOptions, callback?: IntersectionChangeHandler) => boolean;
28
28
  export declare const isNullOrUndefined: (value: unknown) => boolean;
29
+ export declare const handleDisableSubmitOnEnter: (event: React.KeyboardEvent<HTMLFormElement>) => void;
29
30
  export declare const getKeyToBooleanMapFromArray: <T extends string | number>(arr?: T[]) => Record<T, boolean>;
30
31
  export declare const renderValidInputButtonTippy: (children: ReactElement) => JSX.Element;
31
32
  export declare const processDeploymentStatusDetailsData: (data?: DeploymentStatusDetailsType) => DeploymentStatusDetailsBreakdownDataType;
@@ -29,6 +29,7 @@ export declare const ModuleNameMap: {
29
29
  };
30
30
  export declare const DATE_TIME_FORMAT_STRING = "ddd DD MMM YYYY HH:mm:ss";
31
31
  export declare const API_TOKEN_PREFIX = "API-TOKEN:";
32
+ export declare const DEFAULT_SECRET_PLACEHOLDER = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
32
33
  export declare enum PatchOperationType {
33
34
  replace = "replace",
34
35
  remove = "remove"
@@ -7,3 +7,4 @@ export * from './constants';
7
7
  export * from './Services';
8
8
  export * from './Store';
9
9
  export * from './Hooks';
10
+ export * from './API';
@@ -1,5 +1,5 @@
1
1
  import { EnvironmentTypeEnum, PatchOperationType } from './constants';
2
- import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes } from '../Common';
2
+ import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors } from '../Common';
3
3
 
4
4
  export declare enum EnvType {
5
5
  CHART = "helm_charts",
@@ -418,6 +418,48 @@ export declare enum AggregationKeys {
418
418
  Namespaces = "Namespaces"
419
419
  }
420
420
  export type AggregationKeysType = keyof typeof AggregationKeys;
421
+ export declare enum GitOpsAuthModeType {
422
+ SSH = "SSH",
423
+ PASSWORD = "PASSWORD",
424
+ SSH_AND_PASSWORD = "PAT_AND_SSH"
425
+ }
426
+ export interface BaseGitOpsType {
427
+ authMode: GitOpsAuthModeType;
428
+ sshKey: string;
429
+ sshHost: string;
430
+ username: string;
431
+ token: string;
432
+ }
433
+ export type GitOpsFieldKeyType = 'host' | 'username' | 'token' | 'gitHubOrgId' | 'azureProjectName' | 'gitLabGroupId' | 'bitBucketWorkspaceId' | 'bitBucketProjectKey' | 'sshHost' | 'sshKey';
434
+ export interface AppInfoListType {
435
+ application: string;
436
+ appStatus: string;
437
+ deploymentStatus: string;
438
+ lastDeployed: string;
439
+ lastDeployedImage?: string;
440
+ lastDeployedBy?: string;
441
+ appId: number;
442
+ envId: number;
443
+ pipelineId?: number;
444
+ commits?: string[];
445
+ ciArtifactId?: number;
446
+ }
447
+ export interface EnvListMinDTO {
448
+ id: number;
449
+ active: boolean;
450
+ allowedDeploymentTypes: DeploymentAppTypes[] | null;
451
+ appCount: number;
452
+ cluster_id: number;
453
+ cluster_name: string;
454
+ default: boolean;
455
+ description: string;
456
+ environmentIdentifier: string;
457
+ environment_name: string;
458
+ isClusterCdActive: boolean;
459
+ isDigestEnforcedForEnv: boolean;
460
+ isVirtualEnvironment: boolean;
461
+ namespace: string;
462
+ }
421
463
  export interface EnvironmentType {
422
464
  /**
423
465
  * Unique identifier for the environment
@@ -454,11 +496,24 @@ export declare enum DependencyType {
454
496
  DOWNSTREAM = "downstream",
455
497
  LEVEL = "level"
456
498
  }
457
- export interface scrollableInterface {
458
- autoBottomScroll: boolean;
459
- }
460
499
  export declare enum PromiseAllStatusType {
461
500
  FULFILLED = "fulfilled",
462
501
  REJECTED = "rejected"
463
502
  }
503
+ export type ApiQueuingWithBatchResponseItem<T> = {
504
+ status: PromiseAllStatusType.FULFILLED;
505
+ value: T;
506
+ } | {
507
+ status: PromiseAllStatusType.REJECTED;
508
+ reason: ServerErrors;
509
+ };
510
+ export interface BatchConfigType {
511
+ lastIndex: number;
512
+ results: any[];
513
+ concurrentCount: number;
514
+ completedCalls: number;
515
+ }
516
+ export interface scrollableInterface {
517
+ autoBottomScroll: boolean;
518
+ }
464
519
  export {};