@devtron-labs/devtron-fe-common-lib 0.0.83-beta-2 → 0.0.83-beta-4

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 (48) 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/Helper.d.ts +1 -0
  4. package/dist/Common/Hooks/index.d.ts +1 -0
  5. package/dist/Common/Hooks/useStateFilters/index.d.ts +2 -0
  6. package/dist/Common/Hooks/useStateFilters/types.d.ts +6 -0
  7. package/dist/Common/Hooks/useStateFilters/useStateFilters.d.ts +17 -0
  8. package/dist/Common/Hooks/useUrlFilters/types.d.ts +1 -1
  9. package/dist/Common/SearchBar/SearchBar.component.d.ts +1 -1
  10. package/dist/Common/SearchBar/types.d.ts +4 -0
  11. package/dist/Common/Types.d.ts +25 -6
  12. package/dist/Common/index.d.ts +1 -1
  13. package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +1 -1
  14. package/dist/Shared/Components/APIResponseHandler/types.d.ts +7 -2
  15. package/dist/Shared/Components/ButtonWithSelector/ButtonWithSelector.d.ts +1 -1
  16. package/dist/Shared/Components/ButtonWithSelector/types.d.ts +1 -0
  17. package/dist/Shared/Components/FilterChips/FilterChips.component.d.ts +1 -1
  18. package/dist/Shared/Components/FilterChips/types.d.ts +11 -3
  19. package/dist/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.d.ts +1 -1
  20. package/dist/Shared/Components/GenericSectionErrorState/index.d.ts +1 -0
  21. package/dist/Shared/Components/GenericSectionErrorState/types.d.ts +6 -0
  22. package/dist/Shared/Components/index.d.ts +0 -1
  23. package/dist/Shared/Helpers.d.ts +4 -2
  24. package/dist/assets/index.css +1 -1
  25. package/dist/{cssMode-d2dee8fa.js → cssMode-f7b87c99.js} +1 -1
  26. package/dist/{freemarker2-3a003360.js → freemarker2-c91ffd2a.js} +1 -1
  27. package/dist/{handlebars-b2269272.js → handlebars-d705dd00.js} +1 -1
  28. package/dist/{html-68940811.js → html-367565c2.js} +1 -1
  29. package/dist/{htmlMode-2133ab9c.js → htmlMode-6812ba8c.js} +1 -1
  30. package/dist/{index-d31ffffc.js → index-46736d90.js} +14999 -15064
  31. package/dist/index.js +287 -286
  32. package/dist/{javascript-4b48654a.js → javascript-3456abb1.js} +1 -1
  33. package/dist/{jsonMode-8feec0cd.js → jsonMode-3996d33e.js} +1 -1
  34. package/dist/{liquid-baf62c60.js → liquid-b4808ab4.js} +1 -1
  35. package/dist/{mdx-c905cea2.js → mdx-e04c4e91.js} +1 -1
  36. package/dist/{python-3c034f19.js → python-91064e76.js} +1 -1
  37. package/dist/{razor-20fd2bef.js → razor-64d99cc8.js} +1 -1
  38. package/dist/{tsMode-589e11f2.js → tsMode-02459dfe.js} +1 -1
  39. package/dist/{typescript-3f2f9023.js → typescript-1b88bae8.js} +1 -1
  40. package/dist/{xml-16a27948.js → xml-3a2a7c9f.js} +1 -1
  41. package/dist/{yaml-1f9d4934.js → yaml-2ca7aab0.js} +1 -1
  42. package/package.json +1 -1
  43. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +0 -3
  44. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +0 -4
  45. package/dist/Shared/Components/FeatureDescription/constant.d.ts +0 -8
  46. package/dist/Shared/Components/FeatureDescription/index.d.ts +0 -2
  47. package/dist/Shared/Components/FeatureDescription/types.d.ts +0 -20
  48. package/dist/Shared/Components/FeatureDescription/utils.d.ts +0 -6
@@ -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
- }
@@ -86,4 +86,5 @@ export declare const compareObjectLength: (objA: any, objB: any) => boolean;
86
86
  * Return deep copy of the object
87
87
  */
88
88
  export declare function deepEqual(configA: any, configB: any): boolean;
89
+ export declare const prefixZeroIfSingleDigit: (value?: number) => string | number;
89
90
  export {};
@@ -3,3 +3,4 @@ export { useClickOutside } from './UseClickOutside/UseClickOutside';
3
3
  export { useWindowSize } from './UseWindowSize/UseWindowSize';
4
4
  export * from './useUrlFilters';
5
5
  export * from './UseRegisterShortcut';
6
+ export * from './useStateFilters';
@@ -0,0 +1,2 @@
1
+ export { default as useStateFilters } from './useStateFilters';
2
+ export type { UseStateFiltersProps, UseStateFiltersReturnType } from './types';
@@ -0,0 +1,6 @@
1
+ import { UseUrlFiltersProps, UseUrlFiltersReturnType } from '../useUrlFilters';
2
+
3
+ export interface UseStateFiltersProps<T> extends Pick<UseUrlFiltersProps<T, never>, 'initialSortKey'> {
4
+ }
5
+ export interface UseStateFiltersReturnType<T> extends Pick<UseUrlFiltersReturnType<T>, 'sortBy' | 'sortOrder' | 'handleSorting' | 'clearFilters'> {
6
+ }
@@ -0,0 +1,17 @@
1
+ import { UseStateFiltersProps, UseStateFiltersReturnType } from './types';
2
+
3
+ /**
4
+ * Generic hook for implementing state based pagination, search, sorting.
5
+ * Sister method of [useUrlFilters](https://github.com/devtron-labs/devtron-fe-common-lib/blob/main/src/Common/Hooks/useUrlFilters/useUrlFilters.ts)
6
+ *
7
+ * The exposed handlers can be consumed directly without the need for explicit state management
8
+ *
9
+ * @example Usage with custom type for sort keys and initial sort key:
10
+ * ```tsx
11
+ * const { sortBy, sortOrder } = useUrlFilters<'email' | 'name'>({ initialSortKey: 'email' })
12
+ * ```
13
+ *
14
+ * To be extended to be used with pagination and search as and when required
15
+ */
16
+ declare const useStateFilters: <T = string>({ initialSortKey, }?: UseStateFiltersProps<T>) => UseStateFiltersReturnType<T>;
17
+ export default useStateFilters;
@@ -56,5 +56,5 @@ export type UseUrlFiltersReturnType<T, K = unknown> = K & {
56
56
  /**
57
57
  * Update the search params with the passed object
58
58
  */
59
- updateSearchParams: (paramsToSerialize: K) => void;
59
+ updateSearchParams: (paramsToSerialize: Partial<K>) => void;
60
60
  };
@@ -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, }: SearchBarProps) => JSX.Element;
37
+ declare const SearchBar: ({ initialSearchText, handleSearchChange, handleEnter, inputProps, containerClassName, shouldDebounce, debounceTimeout, noBackgroundAndBorder, }: SearchBarProps) => JSX.Element;
38
38
  export default SearchBar;
@@ -32,4 +32,8 @@ export interface SearchBarProps {
32
32
  * Timeout for the debounce handler to be triggered
33
33
  */
34
34
  debounceTimeout?: number;
35
+ /**
36
+ * Hide the background and border of the search
37
+ */
38
+ noBackgroundAndBorder?: boolean;
35
39
  }
@@ -28,9 +28,9 @@ export interface APIOptions {
28
28
  signal?: AbortSignal;
29
29
  preventAutoLogout?: boolean;
30
30
  }
31
- export interface OptionType {
32
- label: string;
33
- value: string;
31
+ export interface OptionType<T = string, K = string> {
32
+ value: T;
33
+ label: K;
34
34
  }
35
35
  export declare enum TippyTheme {
36
36
  black = "black",
@@ -116,7 +116,7 @@ export interface GenericEmptyStateType {
116
116
  layout?: 'row' | 'column';
117
117
  contentClassName?: string;
118
118
  }
119
- export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload'> {
119
+ export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload' | 'redirectURL'> {
120
120
  code: number;
121
121
  heightToDeduct?: number;
122
122
  redirectURL?: string;
@@ -128,6 +128,10 @@ export interface ErrorScreenManagerProps {
128
128
  subtitle?: React.ReactChild;
129
129
  reloadClass?: string;
130
130
  heightToDeduct?: number;
131
+ /**
132
+ * Would be used to redirect URL in case of 404
133
+ * @default - APP_LIST
134
+ */
131
135
  redirectURL?: string;
132
136
  }
133
137
  export interface ErrorScreenNotAuthorizedProps {
@@ -136,8 +140,7 @@ export interface ErrorScreenNotAuthorizedProps {
136
140
  }
137
141
  export declare enum ImageType {
138
142
  Large = "large",
139
- Medium = "medium",
140
- SMALL = "small"
143
+ Medium = "medium"
141
144
  }
142
145
  export interface InfoColourBarType {
143
146
  message: React.ReactNode;
@@ -307,6 +310,14 @@ export interface DeploymentWindowArtifactMetadata {
307
310
  name: string;
308
311
  type: DEPLOYMENT_WINDOW_TYPE;
309
312
  }
313
+ export interface ArtifactReleaseMappingType {
314
+ id: number;
315
+ identifier: string;
316
+ releaseVersion: string;
317
+ name: string;
318
+ kind: string;
319
+ version: string;
320
+ }
310
321
  export interface CDMaterialType {
311
322
  index: number;
312
323
  id: string;
@@ -350,6 +361,14 @@ export interface CDMaterialType {
350
361
  promotionApprovalMetadata?: PromotionApprovalMetadataType;
351
362
  deployedOnEnvironments?: string[];
352
363
  deploymentWindowArtifactMetadata?: DeploymentWindowArtifactMetadata;
364
+ /**
365
+ * Will only be present in case of release
366
+ */
367
+ configuredInReleases: ArtifactReleaseMappingType[];
368
+ /**
369
+ * Would currently only be received in case of release
370
+ */
371
+ appWorkflowId: number;
353
372
  }
354
373
  export declare enum CDMaterialServiceEnum {
355
374
  ROLLBACK = "rollback",
@@ -14,7 +14,7 @@ export * from './Modals/OpaqueModal';
14
14
  export * from './Modals/VisibleModal';
15
15
  export * from './Modals/VisibleModal2';
16
16
  export { BreadCrumb, useBreadcrumb } from './BreadCrumb/BreadCrumb';
17
- export { default as BreadcrumbStore, BreadcrumbText } from './BreadCrumb/BreadcrumbStore';
17
+ export { default as BreadcrumbStore } from './BreadCrumb/BreadcrumbStore';
18
18
  export { default as RadioGroup } from './RadioGroup';
19
19
  export { default as RadioGroupItem } from './RadioGroupItem';
20
20
  export { default as PopupMenu } from './PopupMenu';
@@ -1,4 +1,4 @@
1
1
  import { APIResponseHandlerProps } from './types';
2
2
 
3
- declare const APIResponseHandler: ({ isLoading, progressingProps, customLoader, error, notAuthorized, notFoundText, reloadProps, genericSectionErrorProps, children, }: APIResponseHandlerProps) => JSX.Element;
3
+ declare const APIResponseHandler: ({ isLoading, progressingProps, customLoader, error, notAuthorized, notFoundText, reloadProps, genericSectionErrorProps, errorScreenManagerProps, children, }: APIResponseHandlerProps) => JSX.Element;
4
4
  export default APIResponseHandler;
@@ -1,5 +1,5 @@
1
1
  import { GenericSectionErrorStateProps } from '../GenericSectionErrorState/types';
2
- import { GenericEmptyStateType, ProgressingProps, ReloadType, ServerErrors } from '../../../Common';
2
+ import { ErrorScreenManagerProps, GenericEmptyStateType, ProgressingProps, ReloadType, ServerErrors } from '../../../Common';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  export interface EmptyPageTextType {
@@ -37,9 +37,14 @@ export interface APIResponseHandlerProps {
37
37
  */
38
38
  reloadProps?: ReloadType;
39
39
  /**
40
- * If given, would show this component instead of default Error component
40
+ * If given, would show GenericSectionErrorState instead of default Reload component
41
41
  */
42
42
  genericSectionErrorProps?: GenericSectionErrorStateProps;
43
+ /**
44
+ * If given, would show ErrorScreenManager component instead of Reload component
45
+ * Priority of error states are: genericSectionErrorProps > errorScreenManagerProps > Reload component
46
+ */
47
+ errorScreenManagerProps?: ErrorScreenManagerProps;
43
48
  /**
44
49
  * If no Error and no Loading, would load this component
45
50
  */
@@ -14,5 +14,5 @@ import { ButtonWithSelectorProps } from './types';
14
14
  * </ButtonWithSelector>
15
15
  * ```
16
16
  */
17
- declare const ButtonWithSelector: ({ content, onClick, children, className, popUpBodyClassName, showPopUp, }: ButtonWithSelectorProps) => JSX.Element;
17
+ declare const ButtonWithSelector: ({ content, onClick, children, className, popUpBodyClassName, showPopUp, disabled, }: ButtonWithSelectorProps) => JSX.Element;
18
18
  export default ButtonWithSelector;
@@ -7,4 +7,5 @@ export interface ButtonWithSelectorProps {
7
7
  className?: string;
8
8
  popUpBodyClassName?: string;
9
9
  showPopUp?: boolean;
10
+ disabled?: boolean;
10
11
  }
@@ -3,5 +3,5 @@ import { FilterChipsProps } from './types';
3
3
  /**
4
4
  * Component for rendering the applied filter chips
5
5
  */
6
- declare const FilterChips: ({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, }: FilterChipsProps) => JSX.Element;
6
+ declare const FilterChips: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName, }: FilterChipsProps<T>) => JSX.Element;
7
7
  export default FilterChips;
@@ -22,11 +22,11 @@ export interface FilterChipProps {
22
22
  */
23
23
  getFormattedValue?: (filterKey: string, filterValue: unknown) => ReactNode;
24
24
  }
25
- export interface FilterChipsProps extends Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue'> {
25
+ export interface FilterChipsProps<T = Record<string, unknown>> extends Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue'> {
26
26
  /**
27
27
  * Current filter configuration
28
28
  */
29
- filterConfig: Record<string, unknown>;
29
+ filterConfig: T;
30
30
  /**
31
31
  * Callback handler for removing the filters
32
32
  */
@@ -34,5 +34,13 @@ export interface FilterChipsProps extends Pick<FilterChipProps, 'getFormattedLab
34
34
  /**
35
35
  * Handler for removing a applied filter
36
36
  */
37
- onRemoveFilter: (filterConfig: Record<string, unknown>) => void;
37
+ onRemoveFilter: (filterConfig: T) => void;
38
+ /**
39
+ * Class name for the container
40
+ */
41
+ className?: string;
42
+ /**
43
+ * Class name for the clear filter button
44
+ */
45
+ clearButtonClassName?: string;
38
46
  }
@@ -1,4 +1,4 @@
1
1
  import { GenericSectionErrorStateProps } from './types';
2
2
 
3
- declare const GenericSectionErrorState: ({ reload, withBorder, title, subTitle, description, buttonText, rootClassName, }: GenericSectionErrorStateProps) => JSX.Element;
3
+ declare const GenericSectionErrorState: ({ reload, withBorder, title, subTitle, description, buttonText, rootClassName, useInfoIcon, }: GenericSectionErrorStateProps) => JSX.Element;
4
4
  export default GenericSectionErrorState;
@@ -1 +1,2 @@
1
1
  export { default as GenericSectionErrorState } from './GenericSectionErrorState.component';
2
+ export type { GenericSectionErrorStateProps } from './types';
@@ -29,4 +29,10 @@ export interface GenericSectionErrorStateProps {
29
29
  * to be applied on parent div
30
30
  */
31
31
  rootClassName?: string;
32
+ /**
33
+ * If true, info icon would be used instead of error
34
+ *
35
+ * @default false
36
+ */
37
+ useInfoIcon?: boolean;
32
38
  }
@@ -17,4 +17,3 @@ export * from './Header';
17
17
  export * from './AnnouncementBanner';
18
18
  export * from './ButtonWithLoader';
19
19
  export * from './ButtonWithSelector';
20
- export * from './FeatureDescription';
@@ -1,5 +1,5 @@
1
1
  import { GitTriggers, WebhookEventNameType } from './types';
2
- import { MaterialInfo } from '../Common';
2
+ import { MaterialInfo, SortingOrder } from '../Common';
3
3
 
4
4
  interface HighlightSearchTextProps {
5
5
  /**
@@ -19,7 +19,9 @@ export declare const highlightSearchText: ({ searchText, text, highlightClasses
19
19
  export declare const preventBodyScroll: (lock: boolean) => void;
20
20
  export declare const getIsMaterialInfoAvailable: (materialInfo: MaterialInfo[]) => boolean;
21
21
  export declare const getGitCommitInfo: (materialInfo: MaterialInfo) => GitTriggers;
22
- export declare const caseInsensitiveStringComparator: (a: string, b: string) => number;
22
+ export declare const stringComparatorBySortOrder: (a: string, b: string, sortOrder?: SortingOrder, isCaseSensitive?: boolean) => number;
23
+ export declare const numberComparatorBySortOrder: (a: number, b: number, sortOrder?: SortingOrder) => number;
23
24
  export declare const getWebhookEventIcon: (eventName: WebhookEventNameType) => JSX.Element;
24
25
  export declare const isNullOrUndefined: (value: unknown) => boolean;
26
+ export declare const getKeyToBooleanMapFromArray: <T extends string | number>(arr?: T[]) => Record<T, boolean>;
25
27
  export {};