@centreon/ui-context 24.10.1 → 24.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui-context",
3
- "version": "24.10.1",
3
+ "version": "24.10.3",
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
@@ -2,10 +2,13 @@ export { default as userAtom } from './userAtom';
2
2
  export { default as aclAtom } from './aclAtom';
3
3
  export { default as downtimeAtom } from './downtimeAtom';
4
4
  export { default as refreshIntervalAtom } from './refreshIntervalAtom';
5
+ export { default as statisticsRefreshIntervalAtom } from './statisticsRefreshIntervalAtom';
5
6
  export { default as cloudServicesAtom } from './cloudServicesAtom';
6
7
  export { default as acknowledgementAtom } from './acknowledgementAtom';
7
8
  export { default as resourceStorageOptimizationModeAtom } from './resourceStorageOptimizationMode';
8
9
  export { default as platformNameAtom } from './platformNameAtom';
10
+ export { default as userPermissionsAtom } from './userPermissionsAtom';
11
+
9
12
  export { ThemeMode, ListingVariant, DashboardGlobalRole } from './types';
10
13
  export {
11
14
  platformFeaturesAtom,
@@ -20,6 +23,8 @@ export {
20
23
  federatedModulesAtom,
21
24
  federatedWidgetsAtom
22
25
  } from './federatedModulesAndWidgetsAtoms';
26
+ export { browserLocaleAtom } from './browserLocaleAtom';
27
+ export { isResourceStatusFullSearchEnabledAtom } from './isResourceStatusFullSearchEnabledAtom';
23
28
 
24
29
  export type {
25
30
  User,
@@ -33,5 +38,6 @@ export type {
33
38
  DashboardRolesAndPermissions,
34
39
  FeatureFlags,
35
40
  PlatformFeatures,
36
- AdditionalResource
41
+ AdditionalResource,
42
+ UserPermissions
37
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;
@@ -139,3 +139,8 @@ export interface PlatformVersions {
139
139
  web: Version;
140
140
  widgets: Record<string, Version | null>;
141
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;