@devtron-labs/devtron-fe-common-lib 0.0.91-beta-6 → 0.0.91-beta-7

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 (43) hide show
  1. package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +0 -2
  2. package/dist/Common/BreadCrumb/Types.d.ts +0 -4
  3. package/dist/Common/Hooks/useStateFilters/types.d.ts +1 -4
  4. package/dist/Common/MultiSelectCustomization.d.ts +0 -8
  5. package/dist/Common/SearchBar/SearchBar.component.d.ts +1 -1
  6. package/dist/Common/SearchBar/types.d.ts +0 -4
  7. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +1 -1
  8. package/dist/Common/SortableTableHeaderCell/types.d.ts +5 -0
  9. package/dist/Common/index.d.ts +1 -1
  10. package/dist/Pages/GlobalConfigurations/BuildInfra/utils.d.ts +2 -0
  11. package/dist/Shared/API/APIQueuing.d.ts +11 -0
  12. package/dist/Shared/API/index.d.ts +1 -0
  13. package/dist/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.d.ts +4 -0
  14. package/dist/Shared/Components/EnvironmentSelector/constants.d.ts +5 -0
  15. package/dist/Shared/Components/EnvironmentSelector/index.d.ts +1 -0
  16. package/dist/Shared/Components/EnvironmentSelector/service.d.ts +3 -0
  17. package/dist/Shared/Components/EnvironmentSelector/types.d.ts +27 -0
  18. package/dist/Shared/Components/EnvironmentSelector/utils.d.ts +6 -0
  19. package/dist/Shared/Components/ReactSelect/index.d.ts +0 -1
  20. package/dist/Shared/Components/ReactSelect/utils.d.ts +4 -0
  21. package/dist/Shared/Components/index.d.ts +1 -0
  22. package/dist/Shared/index.d.ts +1 -0
  23. package/dist/Shared/types.d.ts +46 -4
  24. package/dist/assets/index.css +1 -1
  25. package/dist/{cssMode-30528ab8.js → cssMode-10711ca4.js} +1 -1
  26. package/dist/{freemarker2-b33829a1.js → freemarker2-3c28550c.js} +1 -1
  27. package/dist/{handlebars-f6cb2200.js → handlebars-fc9c420f.js} +1 -1
  28. package/dist/{html-dd23535a.js → html-60370346.js} +1 -1
  29. package/dist/{htmlMode-7c348c34.js → htmlMode-efbf16cc.js} +1 -1
  30. package/dist/{index-440ae6eb.js → index-3b564bac.js} +15658 -15674
  31. package/dist/index.js +304 -305
  32. package/dist/{javascript-9128b5a6.js → javascript-78808417.js} +1 -1
  33. package/dist/{jsonMode-28dbccd1.js → jsonMode-900328af.js} +1 -1
  34. package/dist/{liquid-a70bcd0e.js → liquid-f1a7cb7a.js} +1 -1
  35. package/dist/{mdx-a4c7252c.js → mdx-1e65c26b.js} +1 -1
  36. package/dist/{python-dca2163f.js → python-5b4a2603.js} +1 -1
  37. package/dist/{razor-9775cf93.js → razor-9ad07b04.js} +1 -1
  38. package/dist/{tsMode-25965564.js → tsMode-2484b2ad.js} +1 -1
  39. package/dist/{typescript-74fdc1f9.js → typescript-f3fd327c.js} +1 -1
  40. package/dist/{xml-ce45edc7.js → xml-34b27f33.js} +1 -1
  41. package/dist/{yaml-aeb3e4a4.js → yaml-ce48b3d4.js} +1 -1
  42. package/package.json +1 -1
  43. package/dist/Shared/Components/ReactSelect/constants.d.ts +0 -14
@@ -1,7 +1,5 @@
1
- import { BreadcrumbTextProps } from './Types';
2
1
  import { default as React } from 'react';
3
2
 
4
- export declare const BreadcrumbText: ({ heading, isActive }: BreadcrumbTextProps) => JSX.Element;
5
3
  declare const Store: ({ children }: {
6
4
  children: any;
7
5
  }) => JSX.Element;
@@ -26,7 +26,3 @@ export interface Breadcrumbs {
26
26
  className?: string;
27
27
  }
28
28
  export type UseBreadcrumbOptionalProps = UseBreadcrumbProps | null;
29
- export interface BreadcrumbTextProps {
30
- heading: string;
31
- isActive?: boolean;
32
- }
@@ -2,8 +2,5 @@ import { UseUrlFiltersProps, UseUrlFiltersReturnType } from '../useUrlFilters';
2
2
 
3
3
  export interface UseStateFiltersProps<T> extends Pick<UseUrlFiltersProps<T, never>, 'initialSortKey'> {
4
4
  }
5
- export interface UseStateFiltersReturnType<T> extends Pick<UseUrlFiltersReturnType<T>, 'sortBy' | 'sortOrder' | 'handleSorting' | 'clearFilters' | 'changePage' | 'changePageSize' | 'offset' | 'pageSize' | 'searchKey' | 'handleSearch'> {
6
- }
7
- export interface PaginationType<T> extends Pick<UseUrlFiltersReturnType<T>, 'pageSize'> {
8
- pageNumber: number;
5
+ export interface UseStateFiltersReturnType<T> extends Pick<UseUrlFiltersReturnType<T>, 'sortBy' | 'sortOrder' | 'handleSorting' | 'clearFilters' | 'searchKey' | 'handleSearch'> {
9
6
  }
@@ -2,15 +2,7 @@ import { default as React } from 'react';
2
2
 
3
3
  export declare const Option: (props: any) => JSX.Element;
4
4
  export declare const SingleSelectOption: (props: any) => JSX.Element;
5
- /**
6
- * Multi value container
7
- */
8
5
  export declare const MultiValueContainer: (props: any) => JSX.Element;
9
- /**
10
- *
11
- * Multi value container with count
12
- */
13
- export declare const MultiValueContainerWithCount: (props: any) => JSX.Element;
14
6
  export declare const ClearIndicator: (props: any) => JSX.Element;
15
7
  export declare const MultiValueRemove: (props: any) => JSX.Element;
16
8
  export declare const MultiValueChipContainer: ({ validator, isAllSelected, ...props }: {
@@ -34,5 +34,5 @@ import { SearchBarProps } from './types';
34
34
  * <SearchBar inputProps={{ placeholder: 'Enter search text' }} />
35
35
  * ```
36
36
  */
37
- declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, dataTestId, noBackgroundAndBorder, }: SearchBarProps) => JSX.Element;
37
+ declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, noBackgroundAndBorder, }: SearchBarProps) => JSX.Element;
38
38
  export default SearchBar;
@@ -32,10 +32,6 @@ export interface SearchBarProps {
32
32
  * Timeout for the debounce handler to be triggered
33
33
  */
34
34
  debounceTimeout?: number;
35
- /**
36
- * Data test id for the search input
37
- */
38
- dataTestId?: string;
39
35
  /**
40
36
  * Hide the background and border of the search
41
37
  */
@@ -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
  }
@@ -13,7 +13,7 @@ export * from './Modals/Modal';
13
13
  export * from './Modals/VisibleModal';
14
14
  export * from './Modals/VisibleModal2';
15
15
  export { BreadCrumb, useBreadcrumb } from './BreadCrumb/BreadCrumb';
16
- export { default as BreadcrumbStore, BreadcrumbText } from './BreadCrumb/BreadcrumbStore';
16
+ export { default as BreadcrumbStore } from './BreadCrumb/BreadcrumbStore';
17
17
  export { default as RadioGroup } from './RadioGroup';
18
18
  export { default as RadioGroupItem } from './RadioGroupItem';
19
19
  export { default as PopupMenu } from './PopupMenu';
@@ -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[];
@@ -1,2 +1 @@
1
1
  export * from './utils';
2
- export * from './constants';
@@ -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';
@@ -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,35 @@ export declare enum AggregationKeys {
418
418
  Namespaces = "Namespaces"
419
419
  }
420
420
  export type AggregationKeysType = keyof typeof AggregationKeys;
421
+ export interface AppInfoListType {
422
+ application: string;
423
+ appStatus: string;
424
+ deploymentStatus: string;
425
+ lastDeployed: string;
426
+ lastDeployedImage?: string;
427
+ lastDeployedBy?: string;
428
+ appId: number;
429
+ envId: number;
430
+ pipelineId?: number;
431
+ commits?: string[];
432
+ ciArtifactId?: number;
433
+ }
434
+ export interface EnvListMinDTO {
435
+ id: number;
436
+ active: boolean;
437
+ allowedDeploymentTypes: DeploymentAppTypes[] | null;
438
+ appCount: number;
439
+ cluster_id: number;
440
+ cluster_name: string;
441
+ default: boolean;
442
+ description: string;
443
+ environmentIdentifier: string;
444
+ environment_name: string;
445
+ isClusterCdActive: boolean;
446
+ isDigestEnforcedForEnv: boolean;
447
+ isVirtualEnvironment: boolean;
448
+ namespace: string;
449
+ }
421
450
  export interface EnvironmentType {
422
451
  /**
423
452
  * Unique identifier for the environment
@@ -454,11 +483,24 @@ export declare enum DependencyType {
454
483
  DOWNSTREAM = "downstream",
455
484
  LEVEL = "level"
456
485
  }
457
- export interface scrollableInterface {
458
- autoBottomScroll: boolean;
459
- }
460
486
  export declare enum PromiseAllStatusType {
461
487
  FULFILLED = "fulfilled",
462
488
  REJECTED = "rejected"
463
489
  }
490
+ export type ApiQueuingWithBatchResponseItem<T> = {
491
+ status: PromiseAllStatusType.FULFILLED;
492
+ value: T;
493
+ } | {
494
+ status: PromiseAllStatusType.REJECTED;
495
+ reason: ServerErrors;
496
+ };
497
+ export interface BatchConfigType {
498
+ lastIndex: number;
499
+ results: any[];
500
+ concurrentCount: number;
501
+ completedCalls: number;
502
+ }
503
+ export interface scrollableInterface {
504
+ autoBottomScroll: boolean;
505
+ }
464
506
  export {};