@devtron-labs/devtron-fe-common-lib 1.10.15-beta-1 → 1.10.15-beta-3

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 (52) hide show
  1. package/dist/{@code-editor-TXu0LyKv.js → @code-editor-Cq3RvVHz.js} +5299 -5253
  2. package/dist/{@common-rjsf-BrH_D_b_.js → @common-rjsf-e_cHSsWz.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/useOneTimePrompt/constants.d.ts +1 -0
  20. package/dist/Shared/Hooks/useOneTimePrompt/index.d.ts +1 -0
  21. package/dist/Shared/Hooks/useOneTimePrompt/types.d.ts +3 -0
  22. package/dist/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.d.ts +6 -0
  23. package/dist/Shared/Services/common.service.d.ts +3 -1
  24. package/dist/Shared/Services/types.d.ts +30 -5
  25. package/dist/Shared/constants.d.ts +0 -12
  26. package/dist/Shared/types.d.ts +17 -4
  27. package/dist/assets/@code-editor.css +1 -1
  28. package/dist/assets/ic-arrows-left-right.2d4dda45.svg +3 -0
  29. package/dist/assets/ic-check.a0f5ee85.svg +3 -0
  30. package/dist/assets/ic-close-large.fb6095e0.svg +3 -0
  31. package/dist/assets/ic-delete-lightning.2a7545bd.svg +3 -0
  32. package/dist/assets/ic-folder-user.ff0670e8.svg +3 -0
  33. package/dist/assets/ic-hibernate.f75c1e70.svg +19 -0
  34. package/dist/assets/ic-lightning-fill.25ce980f.svg +3 -0
  35. package/dist/assets/ic-lightning.02da5bf8.svg +3 -0
  36. package/dist/assets/ic-medium-delete.f33a9cd7.svg +11 -0
  37. package/dist/assets/ic-pencil.3ea1c075.svg +3 -0
  38. package/dist/assets/ic-sort-ascending.45f474ff.svg +3 -0
  39. package/dist/assets/ic-sort-descending.0ee6b8dd.svg +3 -0
  40. package/dist/assets/ic-sortable.1d3308e1.svg +3 -0
  41. package/dist/assets/ic-stamp.23836e37.svg +3 -0
  42. package/dist/assets/ic-users.102d4732.svg +3 -0
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js +517 -518
  45. package/package.json +1 -1
  46. package/dist/Shared/Hooks/useUserPreferences/index.d.ts +0 -4
  47. package/dist/Shared/Hooks/useUserPreferences/service.d.ts +0 -8
  48. package/dist/Shared/Hooks/useUserPreferences/types.d.ts +0 -81
  49. package/dist/Shared/Hooks/useUserPreferences/useUserPrefrences.d.ts +0 -10
  50. package/dist/Shared/Hooks/useUserPreferences/utils.d.ts +0 -4
  51. package/dist/assets/ic-hibernate.988d2323.svg +0 -28
  52. /package/dist/Shared/{Hooks/useUserPreferences → Services}/constants.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "1.10.15-beta-1",
3
+ "version": "1.10.15-beta-3",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,4 +0,0 @@
1
- export { useUserPreferences } from './useUserPrefrences';
2
- export * from './constants';
3
- export * from './types';
4
- export { updateUserPreferences, getUserPreferences } from './service';
@@ -1,8 +0,0 @@
1
- import { UserPreferencesType, UserPreferenceResourceProps } from './types';
2
- /**
3
- * @returns UserPreferencesType
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
- * @throws Will throw an error if the request fails or if the result is not in the expected format.
6
- */
7
- export declare const getUserPreferences: () => Promise<UserPreferencesType>;
8
- export declare const updateUserPreferences: ({ path, value, shouldThrowError, }: UserPreferenceResourceProps) => Promise<boolean>;
@@ -1,81 +0,0 @@
1
- import { AppThemeType, BaseAppMetaData, ResourceKindType } from '../../index';
2
- import { ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types';
3
- import { USER_PREFERENCES_ATTRIBUTE_KEY } from '@Shared/Hooks/useUserPreferences/constants';
4
- export interface GetUserPreferencesQueryParamsType {
5
- key: typeof USER_PREFERENCES_ATTRIBUTE_KEY;
6
- }
7
- export declare enum ViewIsPipelineRBACConfiguredRadioTabs {
8
- ALL_ENVIRONMENTS = "All environments",
9
- ACCESS_ONLY = "Access only"
10
- }
11
- export declare enum UserPreferenceResourceActions {
12
- RECENTLY_VISITED = "recently-visited"
13
- }
14
- export interface UserResourceKindActionType {
15
- [UserPreferenceResourceActions.RECENTLY_VISITED]: BaseAppMetaData[];
16
- }
17
- export interface UserPreferenceResourceType {
18
- [ResourceKindType.devtronApplication]: UserResourceKindActionType;
19
- }
20
- export interface GetUserPreferencesParsedDTO {
21
- viewPermittedEnvOnly?: boolean;
22
- /**
23
- * Computed app theme for the user
24
- *
25
- * Could be 'light' | 'dark' | 'system-light' | 'system-dark'
26
- */
27
- computedAppTheme?: AppThemeType | `system-${AppThemeType}`;
28
- /**
29
- * @description resources object with key as resource kind and value as ResourceType
30
- *
31
- */
32
- resources?: UserPreferenceResourceType;
33
- }
34
- export interface UserPreferencesPayloadValueType extends GetUserPreferencesParsedDTO {
35
- }
36
- export interface UpdateUserPreferencesPayloadType extends Pick<GetUserPreferencesQueryParamsType, 'key'> {
37
- value: string;
38
- }
39
- export interface UserPreferencesType {
40
- /**
41
- * Preferred theme for the user
42
- * If null, would forcibly show user theme switcher dialog for user to select
43
- */
44
- themePreference?: ThemePreferenceType | null;
45
- /**
46
- * @type {ViewIsPipelineRBACConfiguredRadioTabs}
47
- * @description pipelineRBACViewSelectedTab is used to store the selected tab in the pipeline RBAC view
48
- * @default ViewIsPipelineRBACConfiguredRadioTabs.VIEW_PERMITTED_ENV
49
- */
50
- pipelineRBACViewSelectedTab?: ViewIsPipelineRBACConfiguredRadioTabs;
51
- /**
52
- * @description resources object
53
- */
54
- resources?: GetUserPreferencesParsedDTO['resources'];
55
- }
56
- export interface UpdatedUserPreferencesType extends UserPreferencesType, Pick<ThemeConfigType, 'appTheme'> {
57
- }
58
- export interface UseUserPreferencesProps {
59
- migrateUserPreferences?: (userPreferencesResponse: UserPreferencesType) => Promise<UserPreferencesType>;
60
- }
61
- export type UserPathValueMapType = {
62
- path: 'themePreference';
63
- value: Required<Pick<UpdatedUserPreferencesType, 'themePreference' | 'appTheme'>>;
64
- } | {
65
- path: 'pipelineRBACViewSelectedTab';
66
- value: Required<Pick<UserPreferencesType, 'pipelineRBACViewSelectedTab'>>;
67
- } | {
68
- path: 'resources';
69
- value: Required<BaseAppMetaData[]>;
70
- };
71
- export type UserPreferenceResourceProps = UserPathValueMapType & {
72
- shouldThrowError?: boolean;
73
- };
74
- export interface UserPreferenceRecentlyVisitedAppsTypes {
75
- appId: number;
76
- appName: string;
77
- isInvalidAppId?: boolean;
78
- }
79
- export interface UserPreferenceFilteredListTypes extends UserPreferenceRecentlyVisitedAppsTypes {
80
- userPreferencesResponse: UserPreferencesType;
81
- }
@@ -1,10 +0,0 @@
1
- import { ServerErrors } from '../../../Common/ServerError';
2
- import { UserPreferenceRecentlyVisitedAppsTypes, UserPreferencesType, UseUserPreferencesProps, ViewIsPipelineRBACConfiguredRadioTabs } from './types';
3
- export declare const useUserPreferences: ({ migrateUserPreferences }: UseUserPreferencesProps) => {
4
- userPreferences: UserPreferencesType;
5
- userPreferencesError: ServerErrors;
6
- handleFetchUserPreferences: () => Promise<void>;
7
- handleUpdatePipelineRBACViewSelectedTab: (selectedTab: ViewIsPipelineRBACConfiguredRadioTabs) => void;
8
- handleUpdateUserThemePreference: (themePreference: UserPreferencesType["themePreference"]) => void;
9
- fetchRecentlyVisitedParsedApps: ({ appId, appName, isInvalidAppId, }: UserPreferenceRecentlyVisitedAppsTypes) => Promise<void>;
10
- };
@@ -1,4 +0,0 @@
1
- import { BaseAppMetaData } from '../../index';
2
- import { UserPreferenceFilteredListTypes, UserPreferenceResourceType } from './types';
3
- export declare const getUserPreferenceResourcesMetadata: (recentlyVisited: BaseAppMetaData[]) => UserPreferenceResourceType;
4
- export declare const getFilteredUniqueAppList: ({ userPreferencesResponse, appId, appName, isInvalidAppId, }: UserPreferenceFilteredListTypes) => BaseAppMetaData[];
@@ -1,28 +0,0 @@
1
- <!--
2
- - Copyright (c) 2024. Devtron Inc.
3
- -
4
- - Licensed under the Apache License, Version 2.0 (the "License");
5
- - you may not use this file except in compliance with the License.
6
- - You may obtain a copy of the License at
7
- -
8
- - http://www.apache.org/licenses/LICENSE-2.0
9
- -
10
- - Unless required by applicable law or agreed to in writing, software
11
- - distributed under the License is distributed on an "AS IS" BASIS,
12
- - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- - See the License for the specific language governing permissions and
14
- - limitations under the License.
15
- -->
16
-
17
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
18
- <defs>
19
- <path id="a" d="M9 .667C4.405.667.667 4.405.667 9c0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.334-3.738 8.334-8.333 0-4.595-3.74-8.333-8.334-8.333zm.212 13.621A5.585 5.585 0 0 1 7.078 3.541a5.585 5.585 0 0 0 7.295 7.295 5.584 5.584 0 0 1-5.161 3.452z"/>
20
- </defs>
21
- <g fill="none" fill-rule="evenodd" transform="translate(1 1)">
22
- <mask id="b" fill="#fff">
23
- <use xlink:href="#a"/>
24
- </mask>
25
- <use fill="#000" fill-rule="nonzero" xlink:href="#a"/>
26
- <path fill="#3B444C" d="M-1-1h20v20H-1z" mask="url(#b)"/>
27
- </g>
28
- </svg>