@devtron-labs/devtron-fe-common-lib 0.1.7-beta-5 → 0.1.8-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 (55) hide show
  1. package/dist/Common/CIPipeline.Types.d.ts +10 -0
  2. package/dist/Common/Constants.d.ts +1 -3
  3. package/dist/Common/Policy.Types.d.ts +0 -8
  4. package/dist/Pages/GlobalConfigurations/Authorization/index.d.ts +1 -1
  5. package/dist/Pages/GlobalConfigurations/Authorization/types.d.ts +19 -1
  6. package/dist/Shared/Components/CICDHistory/DetectBottom.d.ts +4 -0
  7. package/dist/Shared/Components/FilterChips/FilterChips.component.d.ts +1 -1
  8. package/dist/Shared/Components/FilterChips/types.d.ts +2 -7
  9. package/dist/Shared/Components/ReactSelect/utils.d.ts +1 -5
  10. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +85 -0
  11. package/dist/Shared/Components/SelectPicker/common.d.ts +10 -0
  12. package/dist/Shared/Components/SelectPicker/index.d.ts +2 -0
  13. package/dist/Shared/Components/SelectPicker/type.d.ts +74 -0
  14. package/dist/Shared/Components/SelectPicker/utils.d.ts +4 -0
  15. package/dist/Shared/Components/index.d.ts +1 -1
  16. package/dist/Shared/Hooks/UseDownload/UseDownload.d.ts +7 -0
  17. package/dist/Shared/Hooks/UseDownload/index.d.ts +2 -0
  18. package/dist/Shared/Hooks/UseDownload/service.d.ts +1 -0
  19. package/dist/Shared/Hooks/UseDownload/types.d.ts +5 -0
  20. package/dist/Shared/Hooks/index.d.ts +1 -0
  21. package/dist/Shared/constants.d.ts +8 -0
  22. package/dist/Shared/types.d.ts +1 -19
  23. package/dist/assets/index.css +1 -1
  24. package/dist/{cssMode-b1897296.js → cssMode-f2041000.js} +1 -1
  25. package/dist/{freemarker2-5a32d5e3.js → freemarker2-6d4da3dd.js} +1 -1
  26. package/dist/{handlebars-a347b1e1.js → handlebars-c6090b95.js} +1 -1
  27. package/dist/{html-b48eba55.js → html-9b18aef3.js} +1 -1
  28. package/dist/{htmlMode-eec954d4.js → htmlMode-b79b819d.js} +1 -1
  29. package/dist/{index-d4b995df.js → index-a02e8b40.js} +25783 -26044
  30. package/dist/index.js +415 -426
  31. package/dist/{javascript-829a0a11.js → javascript-f0049b34.js} +1 -1
  32. package/dist/{jsonMode-bc88d9d2.js → jsonMode-42a677c8.js} +1 -1
  33. package/dist/{liquid-4ce6b4ec.js → liquid-8059c291.js} +1 -1
  34. package/dist/{mdx-c8c0cf4f.js → mdx-4a7fcdf5.js} +1 -1
  35. package/dist/{python-4ecc8787.js → python-33772baf.js} +1 -1
  36. package/dist/{razor-282fa5be.js → razor-78c05948.js} +1 -1
  37. package/dist/{tsMode-0689e6e8.js → tsMode-f6f13eda.js} +1 -1
  38. package/dist/{typescript-4a59eaf1.js → typescript-15389368.js} +1 -1
  39. package/dist/{xml-df3d771b.js → xml-bed45dad.js} +1 -1
  40. package/dist/{yaml-9fc63603.js → yaml-4c66b731.js} +1 -1
  41. package/package.json +1 -1
  42. package/dist/Shared/Components/DetectBottom/DetectBottom.component.d.ts +0 -5
  43. package/dist/Shared/Components/DetectBottom/index.d.ts +0 -1
  44. package/dist/Shared/Components/Plugin/PluginCard.d.ts +0 -4
  45. package/dist/Shared/Components/Plugin/PluginCardSkeletonList.d.ts +0 -4
  46. package/dist/Shared/Components/Plugin/PluginImageContainer.d.ts +0 -4
  47. package/dist/Shared/Components/Plugin/PluginList.d.ts +0 -4
  48. package/dist/Shared/Components/Plugin/PluginListContainer.d.ts +0 -4
  49. package/dist/Shared/Components/Plugin/PluginTagSelect.d.ts +0 -4
  50. package/dist/Shared/Components/Plugin/PluginTagsContainer.d.ts +0 -4
  51. package/dist/Shared/Components/Plugin/constants.d.ts +0 -5
  52. package/dist/Shared/Components/Plugin/index.d.ts +0 -7
  53. package/dist/Shared/Components/Plugin/service.d.ts +0 -5
  54. package/dist/Shared/Components/Plugin/types.d.ts +0 -180
  55. package/dist/Shared/Components/Plugin/utils.d.ts +0 -20
@@ -252,4 +252,14 @@ export interface FormErrorObjectType {
252
252
  steps: TaskErrorObj[];
253
253
  };
254
254
  }
255
+ export interface PluginDetailType {
256
+ id: number;
257
+ name: string;
258
+ type: string;
259
+ description: string;
260
+ icon: string;
261
+ tags: string[];
262
+ inputVariables?: VariableType[];
263
+ outputVariables?: VariableType[];
264
+ }
255
265
  export {};
@@ -74,9 +74,6 @@ export declare const ROUTES: {
74
74
  CONFIG_CD_PIPELINE: string;
75
75
  MODULE_CONFIGURED: string;
76
76
  RESOURCE_HISTORY_DEPLOYMENT: string;
77
- PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
78
- PLUGIN_GLOBAL_LIST_V2: string;
79
- PLUGIN_GLOBAL_LIST_TAGS: string;
80
77
  };
81
78
  export declare enum KEY_VALUE {
82
79
  KEY = "key",
@@ -231,6 +228,7 @@ export declare enum ReactSelectInputAction {
231
228
  export declare const ZERO_TIME_STRING = "0001-01-01T00:00:00Z";
232
229
  export declare const EXCLUDED_FALSY_VALUES: readonly [any, any, "", number];
233
230
  export declare const API_STATUS_CODES: {
231
+ OK: number;
234
232
  BAD_REQUEST: number;
235
233
  UNAUTHORIZED: number;
236
234
  PERMISSION_DENIED: number;
@@ -1,6 +1,4 @@
1
- import { PluginDataStoreType } from '../Shared';
2
1
  import { VariableType } from './CIPipeline.Types';
3
- import { ServerErrors } from './ServerError';
4
2
  import { ResponseType } from './Types';
5
3
 
6
4
  export declare enum ApplyPolicyToStage {
@@ -26,7 +24,6 @@ export interface DefinitionSourceType {
26
24
  }
27
25
  export interface MandatoryPluginDetailType {
28
26
  id: number;
29
- parentPluginId: number;
30
27
  icon: string;
31
28
  name: string;
32
29
  description?: string;
@@ -41,11 +38,6 @@ export interface MandatoryPluginDataType {
41
38
  isValidPre: boolean;
42
39
  isValidPost: boolean;
43
40
  }
44
- export interface ProcessPluginDataReturnType {
45
- mandatoryPluginData: MandatoryPluginDataType;
46
- pluginDataStore: PluginDataStoreType;
47
- mandatoryPluginsError?: ServerErrors;
48
- }
49
41
  export declare enum ConsequenceAction {
50
42
  BLOCK = "BLOCK",
51
43
  ALLOW_UNTIL_TIME = "ALLOW_UNTIL_TIME",
@@ -1,3 +1,3 @@
1
1
  export * from './constants';
2
- export type { UserListFilterParams, UserRoleGroup } from './types';
2
+ export type { UserListFilterParams, BaseFilterQueryParams, UserRoleGroup } from './types';
3
3
  export * from './shared';
@@ -1,6 +1,24 @@
1
- import { BaseFilterQueryParams } from '../../../Shared';
1
+ import { SortingParams } from '../../../Common/Types';
2
2
  import { UserListSortableKeys, UserStatus } from './constants';
3
3
 
4
+ export type BaseFilterQueryParams<T> = {
5
+ /**
6
+ * Offset for the list result
7
+ */
8
+ offset?: number;
9
+ /**
10
+ * Number of items required in the list
11
+ */
12
+ size?: number;
13
+ /**
14
+ * Search string (if any)
15
+ */
16
+ searchKey?: string;
17
+ /**
18
+ * If true, all items are returned with any search / filtering applied without pagination
19
+ */
20
+ showAll?: boolean;
21
+ } & SortingParams<T>;
4
22
  export type UserListFilterParams = BaseFilterQueryParams<UserListSortableKeys> & {
5
23
  /**
6
24
  * Selected statuses (if any)
@@ -0,0 +1,4 @@
1
+ declare const DetectBottom: ({ callback }: {
2
+ callback: () => void;
3
+ }) => JSX.Element;
4
+ export default DetectBottom;
@@ -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: <T = Record<string, unknown>>({ filterConfig, clearFilters, onRemoveFilter, getFormattedLabel, getFormattedValue, className, clearButtonClassName, shouldHideLabel, }: FilterChipsProps<T>) => 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;
@@ -4,7 +4,7 @@ export interface FilterChipProps {
4
4
  /**
5
5
  * Filter label
6
6
  */
7
- label?: string;
7
+ label: string;
8
8
  /**
9
9
  * Corresponding value of the filter
10
10
  */
@@ -21,13 +21,8 @@ export interface FilterChipProps {
21
21
  * If passed, the label will be formatted accordingly
22
22
  */
23
23
  getFormattedValue?: (filterKey: string, filterValue: unknown) => ReactNode;
24
- /**
25
- * If true, would hide the label
26
- * @default false
27
- */
28
- shouldHideLabel?: boolean;
29
24
  }
30
- export interface FilterChipsProps<T = Record<string, unknown>> extends Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue' | 'shouldHideLabel'> {
25
+ export interface FilterChipsProps<T = Record<string, unknown>> extends Pick<FilterChipProps, 'getFormattedLabel' | 'getFormattedValue'> {
31
26
  /**
32
27
  * Current filter configuration
33
28
  */
@@ -1,5 +1,4 @@
1
- import { MenuListProps, ValueContainerProps } from 'react-select';
2
- import { OptionType } from '../../../Common';
1
+ import { MenuListProps } from 'react-select';
3
2
 
4
3
  export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
5
4
  container: (base: any, state: any) => any;
@@ -34,6 +33,3 @@ export declare const commonSelectStyles: {
34
33
  export declare const MenuListWithApplyButton: ({ handleApplyFilter, ...props }: MenuListProps<unknown, boolean, import('react-select').GroupBase<unknown>> & {
35
34
  handleApplyFilter: () => void;
36
35
  }) => JSX.Element;
37
- export declare const MultiSelectValueContainer: ({ title, ...props }: ValueContainerProps<OptionType<string, string>, true, import('react-select').GroupBase<OptionType<string, string>>> & {
38
- title: string;
39
- }) => JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { SelectPickerProps } from './type';
2
+
3
+ /**
4
+ * Generic component for select picker
5
+ *
6
+ * @example With icon in control
7
+ * ```tsx
8
+ * <SelectPicker ... icon={<CustomIcon />} />
9
+ * ```
10
+ *
11
+ * @example Medium menu list width
12
+ * ```tsx
13
+ * <SelectPicker ... menuSize={ComponentSizeType.medium} />
14
+ * ```
15
+ *
16
+ * @example Large menu list width
17
+ * ```tsx
18
+ * <SelectPicker ... menuSize={ComponentSizeType.large} />
19
+ * ```
20
+ *
21
+ * @example Required label
22
+ * ```tsx
23
+ * <SelectPicker ... required label="Label" />
24
+ * ```
25
+ *
26
+ * @example Custom label
27
+ * ```tsx
28
+ * <SelectPicker ... label={<div>Label</div>} />
29
+ * ```
30
+ *
31
+ * @example Error state
32
+ * ```tsx
33
+ * <SelectPicker ... error="Something went wrong" />
34
+ * ```
35
+ *
36
+ * @example Helper text
37
+ * ```tsx
38
+ * <SelectPicker ... helperText="Help information" />
39
+ * ```
40
+ *
41
+ * @example Menu list footer
42
+ * The footer is sticky by default
43
+ * ```tsx
44
+ * <SelectPicker
45
+ * ...
46
+ * renderMenuListFooter={() => (
47
+ * <div className="px-8 py-6 dc__border-top bcn-50 cn-6">
48
+ * <div>Foot note</div>
49
+ * </div>
50
+ * )}
51
+ * />
52
+ * ```
53
+ *
54
+ * @example Loading state
55
+ * ```tsx
56
+ * <SelectPicker ... isLoading />
57
+ * ```
58
+ *
59
+ * @example Disabled state
60
+ * ```tsx
61
+ * <SelectPicker ... isDisabled />
62
+ * ```
63
+ *
64
+ * @example Loading & disabled state
65
+ * ```tsx
66
+ * <SelectPicker ... isLoading isDisabled />
67
+ * ```
68
+ *
69
+ * @example Hide selected option icon in control
70
+ * ```tsx
71
+ * <SelectPicker ... showSelectedOptionIcon={false} />
72
+ * ```
73
+ *
74
+ * @example Selected option clearable
75
+ * ```tsx
76
+ * <SelectPicker ... isClearable />
77
+ * ```
78
+ *
79
+ * @example Selected option clearable
80
+ * ```tsx
81
+ * <SelectPicker ... showSelectedOptionsCount />
82
+ * ```
83
+ */
84
+ declare const SelectPicker: ({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, ...props }: SelectPickerProps) => JSX.Element;
85
+ export default SelectPicker;
@@ -0,0 +1,10 @@
1
+ import { DropdownIndicatorProps, ControlProps, OptionProps, ClearIndicatorProps, ValueContainerProps, MenuListProps } from 'react-select';
2
+ import { SelectPickerOptionType, SelectPickerProps } from './type';
3
+
4
+ export declare const SelectPickerDropdownIndicator: (props: DropdownIndicatorProps<SelectPickerOptionType>) => JSX.Element;
5
+ export declare const SelectPickerClearIndicator: (props: ClearIndicatorProps<SelectPickerOptionType>) => JSX.Element;
6
+ export declare const SelectPickerControl: ({ icon, showSelectedOptionIcon, ...props }: ControlProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'icon' | 'showSelectedOptionIcon'>) => JSX.Element;
7
+ export declare const SelectPickerValueContainer: ({ showSelectedOptionsCount, ...props }: ValueContainerProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'showSelectedOptionsCount'>) => JSX.Element;
8
+ export declare const SelectPickerLoadingIndicator: () => JSX.Element;
9
+ export declare const SelectPickerOption: (props: OptionProps<SelectPickerOptionType>) => JSX.Element;
10
+ export declare const SelectPickerMenuList: ({ renderMenuListFooter, ...props }: MenuListProps<SelectPickerOptionType> & Pick<SelectPickerProps, 'renderMenuListFooter'>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default as SelectPicker } from './SelectPicker.component';
2
+ export * from './type';
@@ -0,0 +1,74 @@
1
+ import { OptionType } from '../../../Common/Types';
2
+ import { ComponentSizeType } from '../../constants';
3
+ import { ReactElement, ReactNode } from 'react';
4
+ import { Props as ReactSelectProps } from 'react-select';
5
+
6
+ export interface SelectPickerOptionType extends OptionType<number | string, ReactNode> {
7
+ /**
8
+ * Description to be displayed for the option
9
+ */
10
+ description?: string;
11
+ /**
12
+ * Icon at the start of the option
13
+ */
14
+ startIcon?: ReactElement;
15
+ /**
16
+ * Icon at the end of the option
17
+ */
18
+ endIcon?: ReactElement;
19
+ }
20
+ type SelectProps = ReactSelectProps<SelectPickerOptionType>;
21
+ export interface SelectPickerProps extends Pick<SelectProps, 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'isLoading' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder'>, Required<Pick<SelectProps, 'classNamePrefix' | 'inputId' | 'name'>> {
22
+ /**
23
+ * Icon to be rendered in the control
24
+ */
25
+ icon?: ReactElement;
26
+ /**
27
+ * Error message for the select
28
+ */
29
+ error?: ReactNode;
30
+ /**
31
+ * Render function for the footer at the bottom of menu list. It is sticky by default
32
+ */
33
+ renderMenuListFooter?: () => ReactNode;
34
+ /**
35
+ * Info text for the select, if any
36
+ */
37
+ helperText?: ReactNode;
38
+ /**
39
+ * Label for the select. if required is added, the corresponding * is also added
40
+ */
41
+ label?: ReactNode;
42
+ /**
43
+ * If true, the selected option icon is shown in the container.
44
+ * startIcon has higher priority than endIcon.
45
+ *
46
+ * @default 'true'
47
+ */
48
+ showSelectedOptionIcon?: boolean;
49
+ /**
50
+ * Height of the dropdown
51
+ *
52
+ * @default 'ComponentSizeType.medium'
53
+ */
54
+ size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.large>;
55
+ /**
56
+ * Content to be shown in a tippy when disabled
57
+ */
58
+ disabledTippyContent?: ReactNode;
59
+ /**
60
+ * If true, the selected options count is shown in a chip inside ValueContainer
61
+ *
62
+ * @default 'false'
63
+ */
64
+ showSelectedOptionsCount?: boolean;
65
+ /**
66
+ * Width of the menu list
67
+ *
68
+ * Note: the overflow needs to be handled explicitly for non-small variants
69
+ *
70
+ * @default 'ComponentSizeType.small'
71
+ */
72
+ menuSize?: ComponentSizeType;
73
+ }
74
+ export {};
@@ -0,0 +1,4 @@
1
+ import { StylesConfig } from 'react-select';
2
+ import { SelectPickerOptionType, SelectPickerProps } from './type';
3
+
4
+ export declare const getCommonSelectStyle: ({ error, size, menuSize, }: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => StylesConfig<SelectPickerOptionType>;
@@ -30,5 +30,5 @@ export * from './ImageChipCell';
30
30
  export * from './ArtifactInfoModal';
31
31
  export * from './MaterialHistory';
32
32
  export * from './IframeContainer';
33
- export * from './Plugin';
34
33
  export * from './KeyValueTable';
34
+ export * from './SelectPicker';
@@ -0,0 +1,7 @@
1
+ import { HandleDownloadProps } from './types';
2
+
3
+ declare const useDownload: () => {
4
+ handleDownload: ({ downloadUrl, showFilePreparingToast, fileName, }: HandleDownloadProps) => Promise<void>;
5
+ isDownloading: boolean;
6
+ };
7
+ export default useDownload;
@@ -0,0 +1,2 @@
1
+ export { default as useDownload } from './UseDownload';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ export declare const getDownloadResponse: (downloadUrl: string) => Promise<Response>;
@@ -0,0 +1,5 @@
1
+ export interface HandleDownloadProps {
2
+ downloadUrl: string;
3
+ showFilePreparingToast?: boolean;
4
+ fileName?: string;
5
+ }
@@ -1 +1,2 @@
1
1
  export * from './UsePrompt';
2
+ export * from './UseDownload';
@@ -353,3 +353,11 @@ export declare enum K8sResourcePayloadAppType {
353
353
  HELM_APP = 1,
354
354
  EXTERNAL_ARGO_APP = 2
355
355
  }
356
+ /**
357
+ * Size variants for components
358
+ */
359
+ export declare enum ComponentSizeType {
360
+ small = "small",
361
+ medium = "medium",
362
+ large = "large"
363
+ }
@@ -1,4 +1,4 @@
1
- import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams } from '../Common';
1
+ import { OptionType, CommonNodeAttr, ResponseType, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors } from '../Common';
2
2
  import { EnvironmentTypeEnum, PatchOperationType } from './constants';
3
3
 
4
4
  export declare enum EnvType {
@@ -516,22 +516,4 @@ export interface BatchConfigType {
516
516
  export interface scrollableInterface {
517
517
  autoBottomScroll: boolean;
518
518
  }
519
- export type BaseFilterQueryParams<T> = {
520
- /**
521
- * Offset for the list result
522
- */
523
- offset?: number;
524
- /**
525
- * Number of items required in the list
526
- */
527
- size?: number;
528
- /**
529
- * Search string (if any)
530
- */
531
- searchKey?: string;
532
- /**
533
- * If true, all items are returned with any search / filtering applied without pagination
534
- */
535
- showAll?: boolean;
536
- } & SortingParams<T>;
537
519
  export {};