@devtron-labs/devtron-fe-common-lib 1.17.0-pre-9 → 1.17.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/{@code-editor-DcQ7PPhd.js → @code-editor-CXQ0yUkc.js} +8989 -9605
  2. package/dist/@common-rjsf-CDMxkHD5.js +609 -0
  3. package/dist/Common/Hooks/index.d.ts +0 -1
  4. package/dist/Common/RJSF/constants.d.ts +0 -1
  5. package/dist/Common/RJSF/utils.d.ts +1 -1
  6. package/dist/Common/Tooltip/constants.d.ts +1 -0
  7. package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +1 -0
  8. package/dist/Shared/Components/ActionMenu/types.d.ts +33 -2
  9. package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +0 -3
  10. package/dist/Shared/Components/Icon/Icon.d.ts +0 -4
  11. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +3 -6
  12. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
  13. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +2 -2
  14. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +6 -0
  15. package/dist/Shared/Components/Security/types.d.ts +1 -5
  16. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  17. package/dist/Shared/Components/SelectPicker/index.d.ts +0 -1
  18. package/dist/Shared/Components/SelectPicker/type.d.ts +2 -7
  19. package/dist/Shared/Components/index.d.ts +0 -2
  20. package/dist/Shared/Hooks/index.d.ts +1 -0
  21. package/dist/Shared/Hooks/useIsSecureConnection/index.d.ts +1 -0
  22. package/dist/Shared/Hooks/useIsSecureConnection/useIsSecureConnection.d.ts +1 -0
  23. package/dist/Shared/Hooks/useUserPreferences/constants.d.ts +0 -2
  24. package/dist/Shared/Hooks/useUserPreferences/index.d.ts +1 -1
  25. package/dist/Shared/Hooks/useUserPreferences/service.d.ts +2 -22
  26. package/dist/Shared/Hooks/useUserPreferences/types.d.ts +11 -24
  27. package/dist/Shared/Hooks/useUserPreferences/useUserPrefrences.d.ts +3 -5
  28. package/dist/Shared/Hooks/useUserPreferences/utils.d.ts +4 -3
  29. package/dist/assets/@code-editor.css +1 -1
  30. package/dist/assets/@common-rjsf.css +1 -1
  31. package/dist/index.d.ts +0 -6
  32. package/dist/index.js +783 -791
  33. package/package.json +1 -1
  34. package/dist/@common-rjsf-DMiOG5j_.js +0 -598
  35. package/dist/Common/Hooks/UseIsTextTruncated/UseIsTextTruncated.d.ts +0 -5
  36. package/dist/Common/Hooks/UseIsTextTruncated/constants.d.ts +0 -1
  37. package/dist/Common/Hooks/UseIsTextTruncated/index.d.ts +0 -1
  38. package/dist/Shared/Components/ContextSwitcher/ContextSwitcher.d.ts +0 -2
  39. package/dist/Shared/Components/ContextSwitcher/index.d.ts +0 -3
  40. package/dist/Shared/Components/ContextSwitcher/types.d.ts +0 -14
  41. package/dist/Shared/Components/ContextSwitcher/utils.d.ts +0 -5
  42. package/dist/Shared/Components/SelectPicker/GroupedFilterSelectPicker.d.ts +0 -2
  43. package/dist/Shared/Components/TrailingItem/TrailingItem.component.d.ts +0 -3
  44. package/dist/Shared/Components/TrailingItem/index.d.ts +0 -2
  45. package/dist/Shared/Components/TrailingItem/types.d.ts +0 -39
  46. package/dist/Shared/Components/TreeView/TreeView.component.d.ts +0 -3
  47. package/dist/Shared/Components/TreeView/TreeViewNodeContent.d.ts +0 -3
  48. package/dist/Shared/Components/TreeView/constants.d.ts +0 -4
  49. package/dist/Shared/Components/TreeView/index.d.ts +0 -2
  50. package/dist/Shared/Components/TreeView/types.d.ts +0 -204
  51. package/dist/Shared/Components/TreeView/utils.d.ts +0 -22
  52. package/dist/assets/ic-activity.abf111c7.svg +0 -3
  53. package/dist/assets/ic-folder.8038c019.svg +0 -3
  54. package/dist/assets/ic-helm-app.a20cfeb3.svg +0 -4
  55. package/dist/assets/ic-namespace.8980221f.svg +0 -3
@@ -2,7 +2,6 @@ import { IconBaseProps } from './types';
2
2
  export declare const iconMap: {
3
3
  'ic-73strings': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
4
4
  'ic-aborted': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
5
- 'ic-activity': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
6
5
  'ic-add': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
6
  'ic-amazon-eks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
8
7
  'ic-apica': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -93,7 +92,6 @@ export declare const iconMap: {
93
92
  'ic-flask': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
94
93
  'ic-folder-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
95
94
  'ic-folder-user': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
96
- 'ic-folder': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
97
95
  'ic-gavel': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
98
96
  'ic-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
99
97
  'ic-gift-gradient': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -111,7 +109,6 @@ export declare const iconMap: {
111
109
  'ic-heart-green': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
112
110
  'ic-heart-red-animated': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
113
111
  'ic-heart-red': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
114
- 'ic-helm-app': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
115
112
  'ic-helm': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
116
113
  'ic-help-filled': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
117
114
  'ic-help-outline': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -150,7 +147,6 @@ export declare const iconMap: {
150
147
  'ic-mobile': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
151
148
  'ic-monitoring': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
152
149
  'ic-more-vertical': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
153
- 'ic-namespace': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
154
150
  'ic-new': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
155
151
  'ic-node-script': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
156
152
  'ic-oidc': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -1,6 +1,3 @@
1
- import { TreeViewProps } from '../../../TreeView';
2
- import { GetSidebarDataParamsType } from '../../types';
3
- import { SidebarDataChildType } from '../types';
4
- export declare const getSecurityModalSidebarId: ({ category, subCategory }: SidebarDataChildType["value"]) => string;
5
- export declare const getSecurityModalSidebarChildFromId: (id: string) => SidebarDataChildType["value"];
6
- export declare const getSidebarData: ({ imageScan, codeScan, kubernetesManifest, imageScanLicenseRisks, selectedId, scanResult, }: GetSidebarDataParamsType) => TreeViewProps["nodes"];
1
+ import { ScanCategoriesWithLicense } from '../../types';
2
+ import { SidebarDataType } from '../types';
3
+ export declare const getSidebarData: (categoriesConfig: Record<ScanCategoriesWithLicense, boolean>) => SidebarDataType[];
@@ -1,4 +1,4 @@
1
1
  export { getProgressingStateForStatus } from './ImageScan';
2
2
  export { getInfoCardData } from './InfoCard';
3
- export { getSecurityModalSidebarChildFromId, getSecurityModalSidebarId, getSidebarData } from './Sidebar';
3
+ export { getSidebarData } from './Sidebar';
4
4
  export { getTableData } from './Table';
@@ -1,7 +1,7 @@
1
- export { getProgressingStateForStatus, getSecurityModalSidebarChildFromId, getSecurityModalSidebarId, getSidebarData, } from './config';
1
+ export { getProgressingStateForStatus, getSidebarData } from './config';
2
2
  export { CATEGORY_LABELS } from './constants';
3
3
  export { default as SecurityModal } from './SecurityModal';
4
4
  export { getSecurityScan } from './service';
5
- export type { GetResourceScanDetailsPayloadType, GetResourceScanDetailsResponseType, ScanResultDTO, SidebarDataChildType, SidebarPropsType, } from './types';
5
+ export type { GetResourceScanDetailsPayloadType, GetResourceScanDetailsResponseType, ScanResultDTO, SidebarDataChildType, SidebarDataType, SidebarPropsType, } from './types';
6
6
  export { SeveritiesDTO } from './types';
7
7
  export { getSecurityScanSeveritiesCount, getTotalVulnerabilityCount, parseGetResourceScanDetailsResponse, } from './utils';
@@ -224,6 +224,12 @@ export type SidebarDataChildType = {
224
224
  subCategory: ScanSubCategories;
225
225
  };
226
226
  };
227
+ export type SidebarDataType = {
228
+ label: string;
229
+ isExpanded: boolean;
230
+ children: NonNullable<SidebarDataChildType[]>;
231
+ hideInHelmApp?: boolean;
232
+ };
227
233
  export type EmptyStateType = Pick<GenericEmptyStateType, 'image' | 'SvgImage' | 'subTitle' | 'title' | 'children'>;
228
234
  export declare const VulnerabilityState: {
229
235
  readonly [-1]: "Failed";
@@ -1,4 +1,4 @@
1
- import { CATEGORIES, ScanResultDTO, SUB_CATEGORIES } from './SecurityModal/types';
1
+ import { CATEGORIES, SUB_CATEGORIES } from './SecurityModal/types';
2
2
  export type ScanCategories = (typeof CATEGORIES)[keyof typeof CATEGORIES];
3
3
  export type ScanSubCategories = (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
4
4
  export type ScanCategoriesWithLicense = ScanCategories | 'imageScanLicenseRisks';
@@ -16,8 +16,4 @@ export interface SecurityConfigType {
16
16
  codeScan?: SecurityConfigCategoryType;
17
17
  kubernetesManifest?: SecurityConfigCategoryType;
18
18
  }
19
- export interface GetSidebarDataParamsType extends Record<ScanCategoriesWithLicense, boolean> {
20
- selectedId: string;
21
- scanResult: ScanResultDTO;
22
- }
23
19
  export {};
@@ -133,5 +133,5 @@ import { SelectPickerProps } from './type';
133
133
  * />
134
134
  * ```
135
135
  */
136
- declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef: refFromConsumer, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, menuListFooterConfig, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, shouldRenderTextArea, onKeyDown, shouldHideMenu, warningText, layout, ariaLabel, borderConfig, borderRadiusConfig, labelTippyCustomizedConfig, labelTooltipConfig, hideFormFieldInfo, autoFocus, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
136
+ declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef: refFromConsumer, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, menuListFooterConfig, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, shouldRenderTextArea, onKeyDown, shouldHideMenu, warningText, layout, ariaLabel, borderConfig, borderRadiusConfig, labelTippyCustomizedConfig, labelTooltipConfig, hideFormFieldInfo, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
137
137
  export default SelectPicker;
@@ -1,6 +1,5 @@
1
1
  export { ValueContainerWithLoadingShimmer } from './common';
2
2
  export { default as FilterSelectPicker } from './FilterSelectPicker';
3
- export * from './GroupedFilterSelectPicker';
4
3
  export { default as SelectPicker } from './SelectPicker.component';
5
4
  export * from './SelectPickerTextArea.component';
6
5
  export * from './type';
@@ -6,7 +6,6 @@ import { ServerErrors } from '../../../Common/ServerError';
6
6
  import { TooltipProps } from '../../../Common/Tooltip';
7
7
  import { OptionType } from '../../../Common/Types';
8
8
  import { ComponentSizeType } from '../../constants';
9
- import { ActionMenuProps } from '../ActionMenu';
10
9
  import { ButtonComponentType, ButtonProps, ButtonVariantType } from '../Button';
11
10
  import { FormFieldWrapperProps } from '../FormFieldWrapper/types';
12
11
  export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
@@ -101,7 +100,7 @@ export declare enum SelectPickerVariantType {
101
100
  BORDER_LESS = "border-less",
102
101
  COMPACT = "compact"
103
102
  }
104
- export type SelectPickerProps<OptionValue = number | string, IsMulti extends boolean = false> = Pick<SelectProps<OptionValue, IsMulti>, 'name' | 'classNamePrefix' | 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder' | 'menuPosition' | 'getOptionLabel' | 'getOptionValue' | 'isOptionSelected' | 'menuIsOpen' | 'onMenuOpen' | 'onMenuClose' | 'autoFocus' | 'onBlur' | 'onKeyDown' | 'formatOptionLabel' | 'onInputChange' | 'inputValue' | 'filterOption' | 'noOptionsMessage' | 'defaultMenuIsOpen' | 'onFocus'> & Partial<Pick<SelectProps<OptionValue, IsMulti>, 'shouldRenderCustomOptions' | 'renderCustomOptions' | 'icon' | 'showSelectedOptionIcon' | 'renderOptionsFooter' | 'shouldRenderTextArea'>> & Required<Pick<SelectProps<OptionValue, IsMulti>, 'inputId'>> & Partial<Pick<CreatableProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption' | 'formatCreateLabel' | 'menuPortalTarget'>> & Omit<FormFieldWrapperProps, 'children'> & {
103
+ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boolean = false> = Pick<SelectProps<OptionValue, IsMulti>, 'name' | 'classNamePrefix' | 'options' | 'value' | 'onChange' | 'isSearchable' | 'isClearable' | 'hideSelectedOptions' | 'controlShouldRenderValue' | 'closeMenuOnSelect' | 'isDisabled' | 'isLoading' | 'required' | 'isOptionDisabled' | 'placeholder' | 'menuPosition' | 'getOptionLabel' | 'getOptionValue' | 'isOptionSelected' | 'menuIsOpen' | 'onMenuOpen' | 'onMenuClose' | 'autoFocus' | 'onBlur' | 'onKeyDown' | 'formatOptionLabel' | 'onInputChange' | 'inputValue' | 'filterOption' | 'noOptionsMessage' | 'defaultMenuIsOpen'> & Partial<Pick<SelectProps<OptionValue, IsMulti>, 'shouldRenderCustomOptions' | 'renderCustomOptions' | 'icon' | 'showSelectedOptionIcon' | 'renderOptionsFooter' | 'shouldRenderTextArea'>> & Required<Pick<SelectProps<OptionValue, IsMulti>, 'inputId'>> & Partial<Pick<CreatableProps<SelectPickerOptionType<OptionValue>, IsMulti, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption' | 'formatCreateLabel' | 'menuPortalTarget'>> & Omit<FormFieldWrapperProps, 'children'> & {
105
104
  /**
106
105
  * Config for the footer at the bottom of menu list. It is sticky by default
107
106
  *
@@ -216,13 +215,9 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
216
215
  export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
217
216
  isGroupHeadingSelectable: boolean;
218
217
  };
219
- export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight' | 'optionListError' | 'reloadOptionList' | 'getOptionValue' | 'isOptionDisabled' | 'onMenuClose' | 'menuIsOpen' | 'onKeyDown'> {
218
+ export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight' | 'optionListError' | 'reloadOptionList' | 'getOptionValue' | 'isOptionDisabled'> {
220
219
  appliedFilterOptions: SelectPickerOptionType[];
221
220
  handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
222
221
  }
223
222
  export type SelectPickerTextAreaProps = Omit<SelectPickerProps<string, false>, 'selectRef' | 'inputValue' | 'onInputChange' | 'controlShouldRenderValue' | 'onKeyDown' | 'onCreateOption' | 'shouldRenderTextArea'> & Pick<ResizableTagTextAreaProps, 'maxHeight' | 'minHeight' | 'refVar' | 'dependentRefs'>;
224
- export interface GroupedFilterSelectPickerProps<T extends string | number = string | number> extends Omit<ActionMenuProps<T>, 'onClick' | 'disableDescriptionEllipsis' | 'children' | 'buttonProps' | 'isSearchable'> {
225
- isFilterApplied?: boolean;
226
- filterSelectPickerPropsMap: Record<T, Omit<FilterSelectPickerProps, 'autoFocus' | 'menuIsOpen' | 'onMenuClose' | 'onKeyDown'>>;
227
- }
228
223
  export {};
@@ -21,7 +21,6 @@ export * from './CollapsibleList';
21
21
  export * from './CommitChipCell';
22
22
  export * from './Confetti';
23
23
  export * from './ConfirmationModal';
24
- export * from './ContextSwitcher';
25
24
  export * from './CountrySelect';
26
25
  export * from './CustomInput';
27
26
  export * from './DatePicker';
@@ -86,7 +85,6 @@ export * from './TargetPlatforms';
86
85
  export * from './Textarea';
87
86
  export * from './ThemeSwitcher';
88
87
  export * from './ToggleResolveScopedVariables';
89
- export * from './TreeView';
90
88
  export * from './Typewriter';
91
89
  export * from './UnsavedChanges';
92
90
  export * from './UnsavedChangesDialog';
@@ -1,6 +1,7 @@
1
1
  export * from './UseDownload';
2
2
  export * from './useForm';
3
3
  export * from './useGetResourceKindsOptions';
4
+ export * from './useIsSecureConnection';
4
5
  export * from './useOneTimePrompt';
5
6
  export * from './UsePrompt';
6
7
  export * from './useStickyEvent';
@@ -0,0 +1 @@
1
+ export * from './useIsSecureConnection';
@@ -0,0 +1 @@
1
+ export declare const useIsSecureConnection: () => boolean;
@@ -1,3 +1 @@
1
- import { PreferredResourceKindType } from './types';
2
1
  export declare const USER_PREFERENCES_ATTRIBUTE_KEY = "userPreferences";
3
- export declare const DEFAULT_RESOURCES_MAP: Record<PreferredResourceKindType, null>;
@@ -1,4 +1,4 @@
1
1
  export * from './constants';
2
- export { getUserPreferences, updateAndPersistUserPreferences, updateUserPreferences } from './service';
2
+ export { getUserPreferences, updateUserPreferences } from './service';
3
3
  export * from './types';
4
4
  export { useUserPreferences } from './useUserPrefrences';
@@ -1,28 +1,8 @@
1
- import { PreferredResourceKindType, UserPreferenceFilteredListTypes, UserPreferenceResourceProps, UserPreferencesType } from './types';
1
+ import { UserPreferenceResourceProps, UserPreferencesType } from './types';
2
2
  /**
3
3
  * @returns UserPreferencesType
4
4
  * @description This function fetches the user preferences from the server. It uses the `get` method to make a request to the server and retrieves the user preferences based on the `USER_PREFERENCES_ATTRIBUTE_KEY`. The result is parsed and returned as a `UserPreferencesType` object.
5
5
  * @throws Will throw an error if the request fails or if the result is not in the expected format.
6
6
  */
7
7
  export declare const getUserPreferences: () => Promise<UserPreferencesType>;
8
- export declare const updateUserPreferences: ({ path, value, resourceKind, shouldThrowError, userPreferencesResponse, }: UserPreferenceResourceProps) => Promise<boolean>;
9
- /**
10
- * Optimized function to get updated user preferences with resource filtering
11
- * Can work with provided userPreferences or fetch from server/localStorage
12
- * Centralizes all resource updating logic
13
- */
14
- export declare const getUpdatedUserPreferences: ({ id, name, resourceKind, userPreferencesResponse, }: UserPreferenceFilteredListTypes & {
15
- userPreferencesResponse?: UserPreferencesType;
16
- }) => Promise<UserPreferencesType>;
17
- /**
18
- * Centralized function to update and persist user preferences
19
- * Handles both local state and server updates automatically
20
- * Eliminates the need for manual resource management in multiple places
21
- */
22
- export declare const updateAndPersistUserPreferences: ({ id, name, resourceKind, shouldThrowError, updateLocalStorage, }: {
23
- id?: number;
24
- name?: string;
25
- resourceKind?: PreferredResourceKindType;
26
- shouldThrowError?: boolean;
27
- updateLocalStorage?: boolean;
28
- }) => Promise<UserPreferencesType>;
8
+ export declare const updateUserPreferences: ({ path, value, shouldThrowError, }: UserPreferenceResourceProps) => Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import { USER_PREFERENCES_ATTRIBUTE_KEY } from './constants';
2
2
  import { AppThemeType, ThemeConfigType, ThemePreferenceType } from '../../Providers/ThemeProvider/types';
3
+ import { BaseAppMetaData } from '../../Services';
3
4
  import { ResourceKindType } from '../../types';
4
5
  export interface GetUserPreferencesQueryParamsType {
5
6
  key: typeof USER_PREFERENCES_ATTRIBUTE_KEY;
@@ -11,18 +12,12 @@ export declare enum ViewIsPipelineRBACConfiguredRadioTabs {
11
12
  export declare enum UserPreferenceResourceActions {
12
13
  RECENTLY_VISITED = "recently-visited"
13
14
  }
14
- export type PreferredResourceKindType = ResourceKindType.devtronApplication | ResourceKindType.job | 'app-group' | ResourceKindType.cluster;
15
- export interface BaseRecentlyVisitedEntitiesTypes {
16
- id: number;
17
- name: string;
18
- }
19
- export interface UserPreferenceRecentlyVisitedAppsTypes extends BaseRecentlyVisitedEntitiesTypes {
20
- resourceKind: PreferredResourceKindType;
21
- }
22
15
  export interface UserResourceKindActionType {
23
- [UserPreferenceResourceActions.RECENTLY_VISITED]: BaseRecentlyVisitedEntitiesTypes[];
16
+ [UserPreferenceResourceActions.RECENTLY_VISITED]: BaseAppMetaData[];
17
+ }
18
+ export interface UserPreferenceResourceType {
19
+ [ResourceKindType.devtronApplication]: UserResourceKindActionType;
24
20
  }
25
- export type UserPreferenceResourceType = Partial<Record<PreferredResourceKindType, UserResourceKindActionType>>;
26
21
  export interface GetUserPreferencesParsedDTO {
27
22
  viewPermittedEnvOnly?: boolean;
28
23
  /**
@@ -61,34 +56,26 @@ export interface UserPreferencesType {
61
56
  }
62
57
  export interface UpdatedUserPreferencesType extends UserPreferencesType, Pick<ThemeConfigType, 'appTheme'> {
63
58
  }
64
- export interface RecentlyVisitedFetchConfigType extends UserPreferenceRecentlyVisitedAppsTypes {
65
- isDataAvailable?: boolean;
66
- }
67
59
  export interface UseUserPreferencesProps {
68
- userPreferenceResourceKind?: PreferredResourceKindType;
69
60
  migrateUserPreferences?: (userPreferencesResponse: UserPreferencesType) => Promise<UserPreferencesType>;
70
- recentlyVisitedFetchConfig?: RecentlyVisitedFetchConfigType;
71
61
  }
72
62
  export type UserPathValueMapType = {
73
63
  path: 'themePreference';
74
64
  value: Required<Pick<UpdatedUserPreferencesType, 'themePreference' | 'appTheme'>>;
75
- resourceKind?: never;
76
- userPreferencesResponse?: never;
77
65
  } | {
78
66
  path: 'pipelineRBACViewSelectedTab';
79
67
  value: Required<Pick<UserPreferencesType, 'pipelineRBACViewSelectedTab'>>;
80
- resourceKind?: never;
81
- userPreferencesResponse?: never;
82
68
  } | {
83
69
  path: 'resources';
84
- value: Required<BaseRecentlyVisitedEntitiesTypes[]>;
85
- resourceKind: PreferredResourceKindType;
86
- userPreferencesResponse?: UserPreferencesType;
70
+ value: Required<BaseAppMetaData[]>;
87
71
  };
88
72
  export type UserPreferenceResourceProps = UserPathValueMapType & {
89
73
  shouldThrowError?: boolean;
90
- userPreferencesResponse?: UserPreferencesType;
91
74
  };
75
+ export interface UserPreferenceRecentlyVisitedAppsTypes {
76
+ appId: number;
77
+ appName: string;
78
+ }
92
79
  export interface UserPreferenceFilteredListTypes extends UserPreferenceRecentlyVisitedAppsTypes {
93
- userPreferencesResponse?: UserPreferencesType;
80
+ userPreferencesResponse: UserPreferencesType;
94
81
  }
@@ -1,12 +1,10 @@
1
1
  import { ServerErrors } from '../../../Common/ServerError';
2
- import { BaseRecentlyVisitedEntitiesTypes, UserPreferencesType, UseUserPreferencesProps, ViewIsPipelineRBACConfiguredRadioTabs } from './types';
3
- export declare const useUserPreferences: ({ migrateUserPreferences, recentlyVisitedFetchConfig }: UseUserPreferencesProps) => {
2
+ import { UserPreferenceRecentlyVisitedAppsTypes, UserPreferencesType, UseUserPreferencesProps, ViewIsPipelineRBACConfiguredRadioTabs } from './types';
3
+ export declare const useUserPreferences: ({ migrateUserPreferences }: UseUserPreferencesProps) => {
4
4
  userPreferences: UserPreferencesType;
5
5
  userPreferencesError: ServerErrors;
6
6
  handleFetchUserPreferences: () => Promise<void>;
7
7
  handleUpdatePipelineRBACViewSelectedTab: (selectedTab: ViewIsPipelineRBACConfiguredRadioTabs) => void;
8
8
  handleUpdateUserThemePreference: (themePreference: UserPreferencesType["themePreference"]) => void;
9
- fetchRecentlyVisitedParsedEntities: () => Promise<UserPreferencesType>;
10
- recentlyVisitedResources: BaseRecentlyVisitedEntitiesTypes[];
11
- recentResourcesLoading: boolean;
9
+ fetchRecentlyVisitedParsedApps: ({ appId, appName }: UserPreferenceRecentlyVisitedAppsTypes) => Promise<void>;
12
10
  };
@@ -1,3 +1,4 @@
1
- import { GetUserPreferencesParsedDTO, UserPreferenceFilteredListTypes, UserPreferencesType } from './types';
2
- export declare const getFilteredUniqueAppList: ({ userPreferencesResponse, id, name, resourceKind, }: UserPreferenceFilteredListTypes) => import('./types').BaseRecentlyVisitedEntitiesTypes[];
3
- export declare const getParsedResourcesMap: (resources: GetUserPreferencesParsedDTO["resources"]) => UserPreferencesType["resources"];
1
+ import { BaseAppMetaData } from '../../Services';
2
+ import { UserPreferenceFilteredListTypes, UserPreferenceResourceType } from './types';
3
+ export declare const getUserPreferenceResourcesMetadata: (recentlyVisited: BaseAppMetaData[]) => UserPreferenceResourceType;
4
+ export declare const getFilteredUniqueAppList: ({ userPreferencesResponse, appId, appName, }: UserPreferenceFilteredListTypes) => BaseAppMetaData[];