@centreon/ui-context 24.10.2 → 24.10.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui-context",
3
- "version": "24.10.2",
3
+ "version": "24.10.4",
4
4
  "description": "Centreon UI shared context",
5
5
  "main": "src/index.ts",
6
6
  "keywords": [],
@@ -0,0 +1,3 @@
1
+ import { atom } from 'jotai';
2
+
3
+ export const browserLocaleAtom = atom(navigator.language.slice(0, 2));
package/src/defaults.ts CHANGED
@@ -7,7 +7,7 @@ const defaultUser: User = {
7
7
  id: undefined,
8
8
  isAdmin: undefined,
9
9
  isExportButtonEnabled: false,
10
- locale: navigator.language,
10
+ locale: null,
11
11
  name: '',
12
12
  themeMode: ThemeMode.light,
13
13
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
package/src/index.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  export { default as userAtom } from './userAtom';
2
- export { default as profileAtom } from './profileAtom';
3
2
  export { default as aclAtom } from './aclAtom';
4
3
  export { default as downtimeAtom } from './downtimeAtom';
5
4
  export { default as refreshIntervalAtom } from './refreshIntervalAtom';
5
+ export { default as statisticsRefreshIntervalAtom } from './statisticsRefreshIntervalAtom';
6
6
  export { default as cloudServicesAtom } from './cloudServicesAtom';
7
7
  export { default as acknowledgementAtom } from './acknowledgementAtom';
8
8
  export { default as resourceStorageOptimizationModeAtom } from './resourceStorageOptimizationMode';
9
9
  export { default as platformNameAtom } from './platformNameAtom';
10
+ export { default as userPermissionsAtom } from './userPermissionsAtom';
11
+
10
12
  export { ThemeMode, ListingVariant, DashboardGlobalRole } from './types';
11
13
  export {
12
14
  platformFeaturesAtom,
@@ -21,10 +23,11 @@ export {
21
23
  federatedModulesAtom,
22
24
  federatedWidgetsAtom
23
25
  } from './federatedModulesAndWidgetsAtoms';
26
+ export { browserLocaleAtom } from './browserLocaleAtom';
27
+ export { isResourceStatusFullSearchEnabledAtom } from './isResourceStatusFullSearchEnabledAtom';
24
28
 
25
29
  export type {
26
30
  User,
27
- Profile,
28
31
  UserContext,
29
32
  ActionAcl,
30
33
  Actions,
@@ -35,5 +38,6 @@ export type {
35
38
  DashboardRolesAndPermissions,
36
39
  FeatureFlags,
37
40
  PlatformFeatures,
38
- AdditionalResource
41
+ AdditionalResource,
42
+ UserPermissions
39
43
  } from './types';
@@ -0,0 +1,3 @@
1
+ import { atom } from 'jotai';
2
+
3
+ export const isResourceStatusFullSearchEnabledAtom = atom(false);
@@ -0,0 +1,6 @@
1
+ import { atom } from 'jotai';
2
+ import { defaultRefreshInterval } from './defaults';
3
+
4
+ const statisticsRefreshIntervalAtom = atom(defaultRefreshInterval);
5
+
6
+ export default statisticsRefreshIntervalAtom;
package/src/types.ts CHANGED
@@ -26,7 +26,7 @@ export interface User {
26
26
  id?: number;
27
27
  isAdmin?: boolean;
28
28
  isExportButtonEnabled: boolean;
29
- locale: string;
29
+ locale: string | null;
30
30
  name: string;
31
31
  themeMode?: ThemeMode;
32
32
  timezone: string;
@@ -34,10 +34,6 @@ export interface User {
34
34
  user_interface_density: ListingVariant;
35
35
  }
36
36
 
37
- export interface Profile {
38
- favoriteDashboards?: Array<number>;
39
- }
40
-
41
37
  export enum ThemeMode {
42
38
  dark = 'dark',
43
39
  light = 'light'
@@ -143,3 +139,8 @@ export interface PlatformVersions {
143
139
  web: Version;
144
140
  widgets: Record<string, Version | null>;
145
141
  }
142
+
143
+ export interface UserPermissions {
144
+ top_counter: boolean;
145
+ poller_statistics: boolean;
146
+ }
@@ -0,0 +1,6 @@
1
+ import { atom } from 'jotai';
2
+ import { UserPermissions } from '.';
3
+
4
+ const userPermissionsAtom = atom<UserPermissions | null>(null);
5
+
6
+ export default userPermissionsAtom;
@@ -1,7 +0,0 @@
1
- import { atom } from 'jotai';
2
-
3
- import { Profile } from '.';
4
-
5
- const profileAtom = atom<Profile>({});
6
-
7
- export default profileAtom;