@centreon/ui-context 23.10.6 → 23.10.8

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": "23.10.6",
3
+ "version": "23.10.8",
4
4
  "description": "Centreon UI shared context",
5
5
  "main": "src/index.ts",
6
6
  "keywords": [],
package/src/index.ts CHANGED
@@ -7,6 +7,10 @@ export { default as acknowledgementAtom } from './acknowledgementAtom';
7
7
  export { default as resourceStorageOptimizationModeAtom } from './resourceStorageOptimizationMode';
8
8
  export { default as platformNameAtom } from './platformNameAtom';
9
9
  export { ThemeMode, ListingVariant } from './types';
10
+ export {
11
+ platformFeaturesAtom,
12
+ featureFlagsDerivedAtom
13
+ } from './platformFeaturesAtom';
10
14
 
11
15
  export type {
12
16
  User,
@@ -16,5 +20,7 @@ export type {
16
20
  Downtime,
17
21
  CloudServices,
18
22
  Acknowledgement,
19
- Acl
23
+ Acl,
24
+ FeatureFlags,
25
+ PlatformFeatures
20
26
  } from './types';
@@ -0,0 +1,13 @@
1
+ import { atom } from 'jotai';
2
+
3
+ import { FeatureFlags, PlatformFeatures } from './types';
4
+
5
+ export const platformFeaturesAtom = atom<PlatformFeatures | null>(null);
6
+
7
+ export const featureFlagsDerivedAtom = atom<FeatureFlags | null>(
8
+ (get): FeatureFlags => {
9
+ const platformFeatures = get(platformFeaturesAtom);
10
+
11
+ return platformFeatures?.featureFlags as FeatureFlags;
12
+ }
13
+ );
package/src/types.ts CHANGED
@@ -66,3 +66,16 @@ export interface Downtime {
66
66
  fixed: boolean;
67
67
  with_services: boolean;
68
68
  }
69
+
70
+ export interface FeatureFlags {
71
+ adExclusionPeriods?: boolean;
72
+ dashboard?: boolean;
73
+ notification?: boolean;
74
+ resourceStatusTreeView?: boolean;
75
+ vault?: boolean;
76
+ }
77
+
78
+ export interface PlatformFeatures {
79
+ featureFlags: FeatureFlags;
80
+ isCloudPlatform: boolean;
81
+ }