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

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/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/index.d.ts +1 -0
  15. package/dist/Shared/types.d.ts +45 -3
  16. package/dist/{cssMode-aa62bff3.js → cssMode-07d7773b.js} +1 -1
  17. package/dist/{freemarker2-1dd9590a.js → freemarker2-38252b9d.js} +1 -1
  18. package/dist/{handlebars-ef0c3ce9.js → handlebars-933ed526.js} +1 -1
  19. package/dist/{html-f1585fe3.js → html-98cdc8f3.js} +1 -1
  20. package/dist/{htmlMode-3278d449.js → htmlMode-347a2681.js} +1 -1
  21. package/dist/{index-14c83797.js → index-9369744f.js} +16052 -15940
  22. package/dist/index.js +396 -394
  23. package/dist/{javascript-8861f6d7.js → javascript-1c94db42.js} +1 -1
  24. package/dist/{jsonMode-e05f5492.js → jsonMode-9888b5f5.js} +1 -1
  25. package/dist/{liquid-3f20896b.js → liquid-7f732582.js} +1 -1
  26. package/dist/{mdx-31c3574f.js → mdx-bcbbf051.js} +1 -1
  27. package/dist/{python-234e60cc.js → python-ccf185f2.js} +1 -1
  28. package/dist/{razor-4c7aca07.js → razor-ba6ad09d.js} +1 -1
  29. package/dist/{tsMode-2539edcb.js → tsMode-0d8e3cff.js} +1 -1
  30. package/dist/{typescript-22db8544.js → typescript-ba44fc90.js} +1 -1
  31. package/dist/{xml-5a0853b6.js → xml-bd46f314.js} +1 -1
  32. package/dist/{yaml-e3263600.js → yaml-02afcbbb.js} +1 -1
  33. 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 './CICDHistory';
21
22
  export * from './GitCommitInfoGeneric';
22
23
  export * from './Error';
@@ -6,3 +6,4 @@ export * from './Providers';
6
6
  export * from './constants';
7
7
  export * from './Store';
8
8
  export * from './Hooks';
9
+ export * from './API';
@@ -1,5 +1,5 @@
1
1
  import { 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",
@@ -411,11 +411,53 @@ export declare enum AggregationKeys {
411
411
  Namespaces = "Namespaces"
412
412
  }
413
413
  export type AggregationKeysType = keyof typeof AggregationKeys;
414
- export interface scrollableInterface {
415
- autoBottomScroll: boolean;
414
+ export interface AppInfoListType {
415
+ application: string;
416
+ appStatus: string;
417
+ deploymentStatus: string;
418
+ lastDeployed: string;
419
+ lastDeployedImage?: string;
420
+ lastDeployedBy?: string;
421
+ appId: number;
422
+ envId: number;
423
+ pipelineId?: number;
424
+ commits?: string[];
425
+ ciArtifactId?: number;
426
+ }
427
+ export interface EnvListMinDTO {
428
+ id: number;
429
+ active: boolean;
430
+ allowedDeploymentTypes: DeploymentAppTypes[] | null;
431
+ appCount: number;
432
+ cluster_id: number;
433
+ cluster_name: string;
434
+ default: boolean;
435
+ description: string;
436
+ environmentIdentifier: string;
437
+ environment_name: string;
438
+ isClusterCdActive: boolean;
439
+ isDigestEnforcedForEnv: boolean;
440
+ isVirtualEnvironment: boolean;
441
+ namespace: string;
416
442
  }
417
443
  export declare enum PromiseAllStatusType {
418
444
  FULFILLED = "fulfilled",
419
445
  REJECTED = "rejected"
420
446
  }
447
+ export type ApiQueuingWithBatchResponseItem<T> = {
448
+ status: PromiseAllStatusType.FULFILLED;
449
+ value: T;
450
+ } | {
451
+ status: PromiseAllStatusType.REJECTED;
452
+ reason: ServerErrors;
453
+ };
454
+ export interface BatchConfigType {
455
+ lastIndex: number;
456
+ results: any[];
457
+ concurrentCount: number;
458
+ completedCalls: number;
459
+ }
460
+ export interface scrollableInterface {
461
+ autoBottomScroll: boolean;
462
+ }
421
463
  export {};
@@ -1,7 +1,7 @@
1
1
  var Le = Object.defineProperty;
2
2
  var je = (e, n, i) => n in e ? Le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => (je(e, typeof n != "symbol" ? n + "" : n, i), i);
4
- import { m as Ne } from "./index-14c83797.js";
4
+ import { m as Ne } from "./index-9369744f.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as F } from "./index-14c83797.js";
1
+ import { m as F } from "./index-9369744f.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as i } from "./index-14c83797.js";
1
+ import { m as i } from "./index-9369744f.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as d } from "./index-14c83797.js";
1
+ import { m as d } from "./index-9369744f.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,7 +1,7 @@
1
1
  var $e = Object.defineProperty;
2
2
  var qe = (e, n, i) => n in e ? $e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => (qe(e, typeof n != "symbol" ? n + "" : n, i), i);
4
- import { m as Qe } from "./index-14c83797.js";
4
+ import { m as Qe } from "./index-9369744f.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)