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

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.
@@ -1,7 +1,7 @@
1
1
  import { j as n, at as b, av as k, au as W } from "./@vendor-DbxoIktR.js";
2
2
  import V, { forwardRef as J, useMemo as P } from "react";
3
3
  import K, { getDefaultRegistry as q } from "@rjsf/core";
4
- import { T as F, j as N, c as v, b as S, S as Y, i as z, a as w, d as A, e as G } from "./@code-editor-BmpcIaXT.js";
4
+ import { T as F, j as N, c as v, b as S, S as Y, i as z, a as w, d as A, e as G } from "./@code-editor-BxJ15h1P.js";
5
5
  import Q, { components as D } from "react-select";
6
6
  import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
7
7
  import { getUiOptions as $, getTemplate as B, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as ae, deepEquals as se } from "@rjsf/utils";
@@ -2,6 +2,7 @@ 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>>;
5
6
  'ic-add': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
6
7
  'ic-amazon-eks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
8
  'ic-apica': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -92,6 +93,7 @@ export declare const iconMap: {
92
93
  'ic-flask': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
93
94
  'ic-folder-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
94
95
  'ic-folder-user': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
96
+ 'ic-folder': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
95
97
  'ic-gavel': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
96
98
  'ic-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
97
99
  'ic-gift-gradient': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -109,6 +111,7 @@ export declare const iconMap: {
109
111
  'ic-heart-green': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
110
112
  'ic-heart-red-animated': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
111
113
  'ic-heart-red': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
114
+ 'ic-helm-app': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
112
115
  'ic-helm': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
113
116
  'ic-help-filled': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
114
117
  'ic-help-outline': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -147,6 +150,7 @@ export declare const iconMap: {
147
150
  'ic-mobile': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
148
151
  'ic-monitoring': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
149
152
  'ic-more-vertical': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
153
+ 'ic-namespace': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
150
154
  'ic-new': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
151
155
  'ic-node-script': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
152
156
  'ic-oidc': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -0,0 +1,2 @@
1
+ import { GroupedFilterSelectPickerProps } from './type';
2
+ export declare const GroupedFilterSelectPicker: <T extends string | number>({ id, filterSelectPickerPropsMap, isFilterApplied, ...restProps }: GroupedFilterSelectPickerProps<T>) => JSX.Element;
@@ -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, ...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, autoFocus, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
137
137
  export default SelectPicker;
@@ -1,5 +1,6 @@
1
1
  export { ValueContainerWithLoadingShimmer } from './common';
2
2
  export { default as FilterSelectPicker } from './FilterSelectPicker';
3
+ export * from './GroupedFilterSelectPicker';
3
4
  export { default as SelectPicker } from './SelectPicker.component';
4
5
  export * from './SelectPickerTextArea.component';
5
6
  export * from './type';
@@ -6,6 +6,7 @@ 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';
9
10
  import { ButtonComponentType, ButtonProps, ButtonVariantType } from '../Button';
10
11
  import { FormFieldWrapperProps } from '../FormFieldWrapper/types';
11
12
  export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
@@ -215,9 +216,13 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
215
216
  export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
216
217
  isGroupHeadingSelectable: boolean;
217
218
  };
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'> {
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'> {
219
220
  appliedFilterOptions: SelectPickerOptionType[];
220
221
  handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
221
222
  }
222
223
  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
+ }
223
228
  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';
@@ -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>;
@@ -5,4 +5,4 @@ import { UserPreferenceResourceProps, UserPreferencesType } from './types';
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>;
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
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[];