@devtron-labs/devtron-fe-common-lib 1.10.16-beta-1 → 1.10.16-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.
Files changed (53) hide show
  1. package/dist/{@code-editor-_rShAsik.js → @code-editor-BPAbtV3J.js} +5011 -4949
  2. package/dist/{@common-rjsf-BOeRTuMh.js → @common-rjsf-BpO7Uh9_.js} +1 -1
  3. package/dist/Common/Constants.d.ts +0 -1
  4. package/dist/Common/SegmentedControl/types.d.ts +4 -0
  5. package/dist/Common/Toggle/Toggle.d.ts +2 -1
  6. package/dist/Common/Types.d.ts +1 -0
  7. package/dist/Shared/Components/ConfirmationModal/index.d.ts +2 -1
  8. package/dist/Shared/Components/DatePicker/constants.d.ts +9 -0
  9. package/dist/Shared/Components/FramerComponents/MotionDiv.d.ts +2 -0
  10. package/dist/Shared/Components/FramerComponents/index.d.ts +3 -0
  11. package/dist/Shared/Components/Icon/Icon.d.ts +14 -0
  12. package/dist/Shared/Components/Icon/types.d.ts +1 -1
  13. package/dist/Shared/Components/ReactSelect/constants.d.ts +0 -11
  14. package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +2 -2
  15. package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +5 -3
  16. package/dist/Shared/Components/TabGroup/TabGroup.utils.d.ts +2 -0
  17. package/dist/Shared/Components/index.d.ts +1 -0
  18. package/dist/Shared/Hooks/index.d.ts +1 -1
  19. package/dist/Shared/Hooks/useForm/useForm.d.ts +8 -0
  20. package/dist/Shared/Hooks/useOneTimePrompt/constants.d.ts +1 -0
  21. package/dist/Shared/Hooks/useOneTimePrompt/index.d.ts +1 -0
  22. package/dist/Shared/Hooks/useOneTimePrompt/types.d.ts +3 -0
  23. package/dist/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.d.ts +6 -0
  24. package/dist/Shared/Services/common.service.d.ts +3 -1
  25. package/dist/Shared/Services/types.d.ts +30 -5
  26. package/dist/Shared/constants.d.ts +0 -12
  27. package/dist/Shared/types.d.ts +17 -4
  28. package/dist/assets/@code-editor.css +1 -1
  29. package/dist/assets/ic-arrows-left-right.2d4dda45.svg +3 -0
  30. package/dist/assets/ic-check.a0f5ee85.svg +3 -0
  31. package/dist/assets/ic-close-large.fb6095e0.svg +3 -0
  32. package/dist/assets/ic-delete-lightning.2a7545bd.svg +3 -0
  33. package/dist/assets/ic-folder-user.ff0670e8.svg +3 -0
  34. package/dist/assets/ic-hibernate.f75c1e70.svg +19 -0
  35. package/dist/assets/ic-lightning-fill.25ce980f.svg +3 -0
  36. package/dist/assets/ic-lightning.02da5bf8.svg +3 -0
  37. package/dist/assets/ic-medium-delete.f33a9cd7.svg +11 -0
  38. package/dist/assets/ic-pencil.3ea1c075.svg +3 -0
  39. package/dist/assets/ic-sort-ascending.45f474ff.svg +3 -0
  40. package/dist/assets/ic-sort-descending.0ee6b8dd.svg +3 -0
  41. package/dist/assets/ic-sortable.1d3308e1.svg +3 -0
  42. package/dist/assets/ic-stamp.23836e37.svg +3 -0
  43. package/dist/assets/ic-users.102d4732.svg +3 -0
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +499 -500
  46. package/package.json +1 -1
  47. package/dist/Shared/Hooks/useUserPreferences/index.d.ts +0 -4
  48. package/dist/Shared/Hooks/useUserPreferences/service.d.ts +0 -8
  49. package/dist/Shared/Hooks/useUserPreferences/types.d.ts +0 -80
  50. package/dist/Shared/Hooks/useUserPreferences/useUserPrefrences.d.ts +0 -10
  51. package/dist/Shared/Hooks/useUserPreferences/utils.d.ts +0 -4
  52. package/dist/assets/ic-hibernate.988d2323.svg +0 -28
  53. /package/dist/Shared/{Hooks/useUserPreferences → Services}/constants.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { j as n, au as y, aw as k, av as W } from "./@vendor-DZHtXPTX.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, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-_rShAsik.js";
4
+ import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-BPAbtV3J.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 B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
@@ -90,7 +90,6 @@ export declare const ROUTES: {
90
90
  readonly ATTRIBUTES_USER: "attributes/user";
91
91
  readonly GET: "get";
92
92
  readonly UPDATE: "update";
93
- readonly PATCH: "patch";
94
93
  readonly ENVIRONMENT_LIST_MIN: "env/autocomplete";
95
94
  readonly CLUSTER: "cluster";
96
95
  readonly API_RESOURCE: "k8s/api-resources";
@@ -8,6 +8,10 @@ export type SegmentType = Pick<SelectPickerOptionType, 'value'> & {
8
8
  * If true, the segment will be in error state with error icon
9
9
  */
10
10
  isError?: boolean;
11
+ /**
12
+ * If true, the segment will be in disabled state
13
+ */
14
+ isDisabled?: boolean;
11
15
  } & (({
12
16
  /**
13
17
  * Label for the segment
@@ -1,4 +1,4 @@
1
- declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dataTestId, Icon, iconClass, throttleOnChange, shouldToggleValueOnLabelClick, ...props }: {
1
+ declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dataTestId, Icon, iconClass, throttleOnChange, shouldToggleValueOnLabelClick, isLoading, ...props }: {
2
2
  [x: string]: any;
3
3
  selected?: boolean;
4
4
  onSelect?: any;
@@ -10,5 +10,6 @@ declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dat
10
10
  iconClass?: string;
11
11
  throttleOnChange?: boolean;
12
12
  shouldToggleValueOnLabelClick?: boolean;
13
+ isLoading?: boolean;
13
14
  }) => JSX.Element;
14
15
  export default Toggle;
@@ -349,6 +349,7 @@ export interface ApprovalConfigDataType extends Pick<UserApprovalInfo, 'currentC
349
349
  groupName: UserGroupDTO['name'];
350
350
  })[];
351
351
  };
352
+ isExceptionUser: boolean;
352
353
  }
353
354
  export declare enum ApprovalRuntimeStateType {
354
355
  init = 0,
@@ -2,5 +2,6 @@ export { default as ConfirmationModal, BaseConfirmationModal } from './Confirmat
2
2
  export { DeleteConfirmationModal } from './DeleteConfirmationModal';
3
3
  export { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal';
4
4
  export { CannotDeleteModal } from './CannotDeleteModal';
5
- export { ConfirmationModalVariantType, type ConfirmationModalProps, type DeleteConfirmationModalProps } from './types';
5
+ export { ConfirmationModalVariantType, type ConfirmationModalProps } from './types';
6
6
  export { ConfirmationModalProvider } from './ConfirmationModalContext';
7
+ export { getConfirmationLabel } from './utils';
@@ -132,3 +132,12 @@ export declare const DATE_PICKER_IDS: {
132
132
  MONTH: string;
133
133
  TIME: string;
134
134
  };
135
+ export declare const reactSelectStyles: {
136
+ container: (base: any) => any;
137
+ control: (base: any, state: any) => any;
138
+ valueContainer: (base: any) => any;
139
+ input: (base: any) => any;
140
+ dropdownIndicator: (base: any, state: any) => any;
141
+ option: (base: any) => any;
142
+ menuList: (base: any) => any;
143
+ };
@@ -0,0 +1,2 @@
1
+ import { HTMLMotionProps } from 'framer-motion';
2
+ export declare const MotionDiv: (props: HTMLMotionProps<"div">) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { AnimatePresence } from 'framer-motion';
2
+ export * from './MotionDiv';
3
+ export { AnimatePresence };
@@ -6,6 +6,7 @@ export declare const iconMap: {
6
6
  'ic-apica': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
7
  'ic-app-group': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
8
8
  'ic-arrow-right': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
9
+ 'ic-arrows-left-right': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
9
10
  'ic-ather': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
10
11
  'ic-azure': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
11
12
  'ic-bharatpe': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -19,10 +20,12 @@ export declare const iconMap: {
19
20
  'ic-caret-left': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
20
21
  'ic-cd': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
21
22
  'ic-chat-circle-dots': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
23
+ 'ic-check': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
22
24
  'ic-ci-linked': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
23
25
  'ic-ci-webhook': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
24
26
  'ic-circle-loader': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
25
27
  'ic-clock': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
28
+ 'ic-close-large': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
26
29
  'ic-close-small': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
27
30
  'ic-code': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
28
31
  'ic-container': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -30,6 +33,7 @@ export declare const iconMap: {
30
33
  'ic-copy': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
31
34
  'ic-crown': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
32
35
  'ic-cube': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
36
+ 'ic-delete-lightning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
33
37
  'ic-delete': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
34
38
  'ic-delhivery': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
35
39
  'ic-devtron-header-logo': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -39,6 +43,7 @@ export declare const iconMap: {
39
43
  'ic-env': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
40
44
  'ic-error': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
41
45
  'ic-failure': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
46
+ 'ic-folder-user': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
42
47
  'ic-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
43
48
  'ic-git': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
44
49
  'ic-github': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -59,9 +64,12 @@ export declare const iconMap: {
59
64
  'ic-job-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
60
65
  'ic-k8s-job': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
61
66
  'ic-ldap': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
67
+ 'ic-lightning-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
68
+ 'ic-lightning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
62
69
  'ic-livspace': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
63
70
  'ic-login-devtron-logo': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
64
71
  'ic-logout': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
72
+ 'ic-medium-delete': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
65
73
  'ic-medium-paintbucket': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
66
74
  'ic-microsoft': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
67
75
  'ic-missing': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -74,11 +82,16 @@ export declare const iconMap: {
74
82
  'ic-openshift': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
75
83
  'ic-out-of-sync': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
76
84
  'ic-paper-plane-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
85
+ 'ic-pencil': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
77
86
  'ic-quay': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
78
87
  'ic-quote': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
79
88
  'ic-shield-check': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
89
+ 'ic-sort-ascending': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
90
+ 'ic-sort-descending': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
91
+ 'ic-sortable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
80
92
  'ic-spinny': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
93
  'ic-stack': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
94
+ 'ic-stamp': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
82
95
  'ic-success': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
83
96
  'ic-suspended': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
84
97
  'ic-tata1mg': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -87,6 +100,7 @@ export declare const iconMap: {
87
100
  'ic-travclan': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
88
101
  'ic-unknown': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
89
102
  'ic-user-key': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
103
+ 'ic-users': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
90
104
  'ic-warning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
91
105
  };
92
106
  export type IconName = keyof typeof iconMap;
@@ -18,6 +18,6 @@ export interface IconBaseProps {
18
18
  * If `null`, the default color present in icon is used.
19
19
  * @example `'B500'`, `'N200'`, `'G50'`, `'R700'`
20
20
  */
21
- color: `${'B' | 'N' | 'G' | 'Y' | 'R' | 'V' | 'O'}${`${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | '50'}` | 'white' | 'black' | null;
21
+ color: `${'B' | 'N' | 'G' | 'Y' | 'R' | 'V' | 'O'}${`${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | '50' | '0'}` | 'white' | 'black' | null;
22
22
  }
23
23
  export {};
@@ -2,17 +2,6 @@ import { DropdownIndicatorProps, StylesConfig } from 'react-select';
2
2
  export declare const CommonGroupedDropdownStyles: StylesConfig;
3
3
  export declare const APP_SELECTOR_STYLES: StylesConfig;
4
4
  export declare const AppSelectorDropdownIndicator: (props: DropdownIndicatorProps) => JSX.Element;
5
- /**
6
- *
7
- * @returns {string}
8
- * @description Returns the no matching result text for the select component.
9
- */
10
- export declare const getNoMatchingResultText: () => string;
11
- /**
12
- * @param inputObj
13
- * @returns {string}
14
- * @description Returns the no options message for the select component.
15
- */
16
5
  export declare const AppSelectorNoOptionsMessage: (inputObj: {
17
6
  inputValue: string;
18
7
  }) => string;
@@ -1,5 +1,5 @@
1
- import { TabProps } from './TabGroup.types';
2
- export declare const getTabIcon: ({ icon: Icon, showError, showWarning, className, }: Pick<TabProps, "showError" | "showWarning" | "icon"> & {
1
+ import { TabGroupProps, TabProps } from './TabGroup.types';
2
+ export declare const getTabIcon: ({ icon, showError, showWarning, className, size, active, }: Pick<TabProps, "showError" | "showWarning" | "icon" | "active"> & Pick<TabGroupProps, "size"> & {
3
3
  className: string;
4
4
  }) => JSX.Element;
5
5
  export declare const getTabBadge: (badge: TabProps["badge"], className: string) => JSX.Element;
@@ -2,6 +2,7 @@ import { LinkProps, NavLinkProps } from 'react-router-dom';
2
2
  import { ComponentSizeType } from '../../constants';
3
3
  import { DataAttributes } from '../../types';
4
4
  import { TooltipProps } from '@Common/Tooltip/types';
5
+ import { IconName } from '../Icon';
5
6
  type TabComponentProps<TabTypeProps> = TabTypeProps & DataAttributes;
6
7
  type ConditionalTabType = {
7
8
  /**
@@ -79,10 +80,11 @@ export type TabProps = {
79
80
  */
80
81
  description?: string | string[];
81
82
  /**
82
- * Icon component to be displayed in the tab.
83
- * This should be a functional component that renders an SVG.
83
+ * Icon to be displayed in the tab.
84
+ * This can either be a functional component that renders a SVG
85
+ * or a string representing the name of the icon to be rendered by the Icon component.
84
86
  */
85
- icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
87
+ icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>> | IconName;
86
88
  /**
87
89
  * Badge number to be displayed on the tab, typically for notifications.
88
90
  */
@@ -1,7 +1,9 @@
1
+ import { IconsProps } from '../Icon';
1
2
  import { TabGroupProps } from './TabGroup.types';
2
3
  export declare const getClassNameBySizeMap: ({ hideTopPadding, alignActiveBorderWithContainer, }: Pick<TabGroupProps, "hideTopPadding" | "alignActiveBorderWithContainer">) => Record<TabGroupProps["size"], {
3
4
  tabClassName: string;
4
5
  iconClassName: string;
5
6
  badgeClassName: string;
6
7
  }>;
8
+ export declare const TAB_ICON_SIZE_MAP: Record<TabGroupProps['size'], IconsProps['size']>;
7
9
  export declare const tabGroupClassMap: Record<TabGroupProps['size'], string>;
@@ -77,4 +77,5 @@ export * from './FlagImage';
77
77
  export * from './DevtronLicenseCard';
78
78
  export * from './LoginBanner';
79
79
  export * from './Confetti';
80
+ export * from './FramerComponents';
80
81
  export * from './ActionMenu';
@@ -3,4 +3,4 @@ export * from './useGetResourceKindsOptions';
3
3
  export * from './UseDownload';
4
4
  export * from './useForm';
5
5
  export * from './useStickyEvent';
6
- export * from './useUserPreferences';
6
+ export * from './useOneTimePrompt';
@@ -57,6 +57,8 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
57
57
  shouldDirty?: boolean;
58
58
  /** A boolean indicating whether to mark the field as touched after setting the value. */
59
59
  shouldTouch?: boolean;
60
+ /** A boolean indicating whether to trigger validation after setting the value. */
61
+ triggerError?: boolean;
60
62
  }) => void;
61
63
  reset: (formData: T, resetOptions?: {
62
64
  /** A boolean indicating whether to retain the current dirty state of the form fields. */
@@ -67,8 +69,14 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
67
69
  keepErrors?: boolean;
68
70
  /** A boolean indicating whether the form should check for dirty state upon reset. */
69
71
  triggerDirty?: boolean;
72
+ /** A boolean indicating whether the form should check for errors upon reset. */
73
+ triggerError?: boolean;
70
74
  /** A boolean indicating whether the initial values of the form should be retained after reset. If false, provided formData will become initial data. */
71
75
  keepInitialValues?: boolean;
76
+ /** Partial initial values to override the current initial values upon reset.
77
+ * @note `keepInitialValues` will have no effect when this is provided.
78
+ */
79
+ formInitialValues?: Partial<T>;
72
80
  }) => void;
73
81
  /** An object representing additional form state. */
74
82
  formState: {
@@ -0,0 +1 @@
1
+ export declare const ONE_TIME_PROMPT_LOCAL_STORAGE_KEY = "one-time-prompt-do-not-show-again";
@@ -0,0 +1 @@
1
+ export * from './useOneTimePrompt';
@@ -0,0 +1,3 @@
1
+ export interface UseOneTimePromptProps {
2
+ localStorageKey: string;
3
+ }
@@ -0,0 +1,6 @@
1
+ import { UseOneTimePromptProps } from './types';
2
+ export declare const useOneTimePrompt: ({ localStorageKey }: UseOneTimePromptProps) => {
3
+ showPrompt: boolean;
4
+ handleClose: () => void;
5
+ handleDoNotShowAgainClose: () => void;
6
+ };
@@ -1,6 +1,8 @@
1
1
  import { AppConfigProps } from '../../Pages/index';
2
- import { EnvironmentDataValuesDTO, GetPolicyApiUrlProps, GetResourceApiUrlProps } from './types';
2
+ import { EnvironmentDataValuesDTO, GetPolicyApiUrlProps, GetResourceApiUrlProps, UpdatedUserPreferencesType, UserPreferencesType } from './types';
3
3
  export declare const getResourceApiUrl: <T>({ baseUrl, kind, version, suffix, queryParams }: GetResourceApiUrlProps<T>) => string;
4
4
  export declare const getPolicyApiUrl: <T>({ kind, version, queryParams, suffix }: GetPolicyApiUrlProps<T>) => string;
5
5
  export declare const saveCDPipeline: (request: any, { isTemplateView }: Required<Pick<AppConfigProps, "isTemplateView">>) => Promise<import('../../Common').ResponseType<any>>;
6
6
  export declare const getEnvironmentData: () => Promise<import('../../Common').ResponseType<EnvironmentDataValuesDTO>>;
7
+ export declare const getUserPreferences: () => Promise<UserPreferencesType>;
8
+ export declare const updateUserPreferences: (updatedUserPreferences: UpdatedUserPreferencesType, shouldThrowError?: boolean) => Promise<boolean>;
@@ -1,10 +1,8 @@
1
1
  import { MainContext } from '../Providers';
2
+ import { AppThemeType, ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types';
2
3
  import { getUrlWithSearchParams } from '../../Common';
3
- import { PolicyKindType, ResourceKindType, ResourceVersionType } from '../types';
4
- export interface BaseAppMetaData {
5
- appId: number;
6
- appName: string;
7
- }
4
+ import { PolicyKindType, ResourceKindType, ResourceVersionType, ViewIsPipelineRBACConfiguredRadioTabs } from '../types';
5
+ import { USER_PREFERENCES_ATTRIBUTE_KEY } from './constants';
8
6
  export interface ClusterType {
9
7
  id: number;
10
8
  name: string;
@@ -39,4 +37,31 @@ export interface EnvironmentDataValuesDTO extends Pick<MainContext, 'featureGitO
39
37
  canOnlyViewPermittedEnvOrgLevel: boolean;
40
38
  devtronManagedLicensingEnabled: boolean;
41
39
  }
40
+ export interface GetUserPreferencesQueryParamsType {
41
+ key: typeof USER_PREFERENCES_ATTRIBUTE_KEY;
42
+ }
43
+ export interface GetUserPreferencesParsedDTO {
44
+ viewPermittedEnvOnly?: boolean;
45
+ /**
46
+ * Computed app theme for the user
47
+ *
48
+ * Could be 'light' | 'dark' | 'system-light' | 'system-dark'
49
+ */
50
+ computedAppTheme: AppThemeType | `system-${AppThemeType}`;
51
+ }
52
+ export interface UserPreferencesPayloadValueType extends GetUserPreferencesParsedDTO {
53
+ }
54
+ export interface UpdateUserPreferencesPayloadType extends Pick<GetUserPreferencesQueryParamsType, 'key'> {
55
+ value: string;
56
+ }
57
+ export interface UserPreferencesType {
58
+ /**
59
+ * Preferred theme for the user
60
+ * If null, would forcibly show user theme switcher dialog for user to select
61
+ */
62
+ themePreference: ThemePreferenceType | null;
63
+ pipelineRBACViewSelectedTab: ViewIsPipelineRBACConfiguredRadioTabs;
64
+ }
65
+ export interface UpdatedUserPreferencesType extends UserPreferencesType, Pick<ThemeConfigType, 'appTheme'> {
66
+ }
42
67
  export {};
@@ -72,18 +72,6 @@ export declare enum TIMELINE_STATUS {
72
72
  HELM_MANIFEST_PUSHED_TO_HELM_REPO = "HELM_MANIFEST_PUSHED_TO_HELM_REPO",
73
73
  HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED = "HELM_MANIFEST_PUSHED_TO_HELM_REPO_FAILED"
74
74
  }
75
- /**
76
- * Constants for NO MATCHING result
77
- */
78
- export declare const NO_MATCHING_RESULT = "No matching results";
79
- /**
80
- * Constants for TYPE 3 CHARACTERS
81
- */
82
- export declare const TYPE_3_CHARACTERS_TO_SEE_MATCHING_RESULTS = "Type 3 chars to see matching results";
83
- /**
84
- * Constants for TYPE TO SEE MATCHING RESULTS
85
- */
86
- export declare const TYPE_TO_SEE_MATCHING_RESULTS = "Type to see matching results";
87
75
  export declare const EMPTY_STATE_STATUS: {
88
76
  DATA_NOT_AVAILABLE: string;
89
77
  API_TOKEN: {
@@ -340,8 +340,7 @@ export declare enum CDMaterialSidebarType {
340
340
  * }
341
341
  * ```
342
342
  *
343
- * @example Usage with `PatchOperationType.remove`
344
- * Note: Value is not allowed for remove operation
343
+ * @example Usage with `PatchOperationType.remove` without value
345
344
  *
346
345
  * ```ts
347
346
  * const query: PatchQueryType<string> = {
@@ -349,8 +348,18 @@ export declare enum CDMaterialSidebarType {
349
348
  * path: 'name'
350
349
  * }
351
350
  * ```
351
+ *
352
+ * @example Usage with `PatchOperationType.remove` with value
353
+ *
354
+ * ```ts
355
+ * const query: PatchQueryType<string, number, true> = {
356
+ * op: PatchOperationType.remove,
357
+ * path: 'name'
358
+ * value: 1
359
+ * }
360
+ * ```
352
361
  */
353
- export type PatchQueryType<T extends string, K = unknown> = {
362
+ export type PatchQueryType<T extends string, K = unknown, IsRemoveValueEnabled extends boolean = false> = {
354
363
  /**
355
364
  * The path of the json to be patched
356
365
  */
@@ -369,7 +378,7 @@ export type PatchQueryType<T extends string, K = unknown> = {
369
378
  * Operation type for patch
370
379
  */
371
380
  op: PatchOperationType.remove;
372
- value?: never;
381
+ value?: IsRemoveValueEnabled extends true ? K : never;
373
382
  } | {
374
383
  /**
375
384
  * Operation type for add
@@ -841,6 +850,10 @@ export declare const TriggerType: {
841
850
  readonly Auto: "AUTOMATIC";
842
851
  readonly Manual: "MANUAL";
843
852
  };
853
+ export declare enum ViewIsPipelineRBACConfiguredRadioTabs {
854
+ ALL_ENVIRONMENTS = "All environments",
855
+ ACCESS_ONLY = "Access only"
856
+ }
844
857
  export type ComponentLayoutType = 'row' | 'column';
845
858
  export interface BorderConfigType {
846
859
  /**