@equinor/fusion-framework-react 7.2.2-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598 → 7.2.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.
@@ -1,16 +1,12 @@
1
1
  import { AppManifest } from '@equinor/fusion-framework-module-app';
2
- type UseAppsArgs = {
3
- /** @deprecated - no longer available */
4
- includeHidden?: boolean;
5
- filterByCurrentUser?: boolean;
6
- };
7
2
  /**
8
3
  * React Hook - Get apps from framework
9
- * @param args Object with filterByCurrentUser: boolean
10
- * @returns Object {apps, isLoading, error} where apps is Array of ApplicationManifest, isLoading is a boolean on observable complete
11
- * @since 7.1.1
4
+ * @param args Object with boolean member includeHidden
5
+ * @returns Object {apps, isLoading} where apps is Array of AppManifest, isLoading is a boolean on observable complete
12
6
  */
13
- export declare const useApps: (args?: UseAppsArgs) => {
7
+ export declare const useApps: (args?: {
8
+ includeHidden: boolean;
9
+ }) => {
14
10
  apps: AppManifest[] | undefined;
15
11
  isLoading: boolean;
16
12
  error: unknown;
@@ -1 +1 @@
1
- export declare const version = "7.2.1";
1
+ export declare const version = "7.2.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-react",
3
- "version": "7.2.2-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
3
+ "version": "7.2.2",
4
4
  "description": "",
5
5
  "main": "dist/esm/index.js",
6
6
  "exports": {
@@ -69,10 +69,10 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "rxjs": "^7.8.1",
72
- "@equinor/fusion-framework-react-module": "^3.1.6-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
73
- "@equinor/fusion-framework-module": "^4.3.5-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
74
- "@equinor/fusion-framework": "^7.2.7-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
75
- "@equinor/fusion-framework-react-module-http": "^7.0.0-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
72
+ "@equinor/fusion-framework": "^7.2.7",
73
+ "@equinor/fusion-framework-react-module-http": "^7.0.0",
74
+ "@equinor/fusion-framework-module": "^4.3.5",
75
+ "@equinor/fusion-framework-react-module": "^3.1.6",
76
76
  "@equinor/fusion-observable": "^8.4.1"
77
77
  },
78
78
  "devDependencies": {
@@ -81,17 +81,17 @@
81
81
  "react": "^18.2.0",
82
82
  "react-dom": "^18.2.0",
83
83
  "typescript": "^5.5.4",
84
- "@equinor/fusion-framework-module-app": "^6.0.0-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
85
- "@equinor/fusion-framework-module-event": "^4.2.4-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
86
- "@equinor/fusion-framework-module-feature-flag": "^1.1.9-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
87
- "@equinor/fusion-framework-react-module-context": "^6.2.13-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598"
84
+ "@equinor/fusion-framework-module-app": "^5.3.11",
85
+ "@equinor/fusion-framework-module-feature-flag": "^1.1.9",
86
+ "@equinor/fusion-framework-module-event": "^4.2.4",
87
+ "@equinor/fusion-framework-react-module-context": "^6.2.13"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@types/react": "^17.0.0 || ^18.0.0",
91
91
  "react": "^17.0.0 || ^18.0.0",
92
92
  "react-dom": "^17.0.0 || ^18.0.0",
93
- "@equinor/fusion-framework-module-feature-flag": "^1.1.9-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598",
94
- "@equinor/fusion-framework-react-module-signalr": "^3.0.15-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598"
93
+ "@equinor/fusion-framework-module-feature-flag": "^1.1.9",
94
+ "@equinor/fusion-framework-react-module-signalr": "^3.0.15"
95
95
  },
96
96
  "peerDependenciesMeta": {
97
97
  "@equinor/fusion-framework-module-event": {
@@ -4,37 +4,27 @@ import { useMemo } from 'react';
4
4
 
5
5
  import { useAppProvider } from './useAppProvider';
6
6
 
7
- type UseAppsArgs = {
8
- /** @deprecated - no longer available */
9
- includeHidden?: boolean;
10
- // only show apps that the current user has access to
11
- filterByCurrentUser?: boolean;
12
- };
13
-
14
7
  /**
15
8
  * React Hook - Get apps from framework
16
- * @param args Object with filterByCurrentUser: boolean
17
- * @returns Object {apps, isLoading, error} where apps is Array of ApplicationManifest, isLoading is a boolean on observable complete
18
- * @since 7.1.1
9
+ * @param args Object with boolean member includeHidden
10
+ * @returns Object {apps, isLoading} where apps is Array of AppManifest, isLoading is a boolean on observable complete
19
11
  */
20
- export const useApps = (
21
- args?: UseAppsArgs,
22
- ): { apps: AppManifest[] | undefined; isLoading: boolean; error: unknown } => {
12
+ export const useApps = (args?: {
13
+ includeHidden: boolean;
14
+ }): { apps: AppManifest[] | undefined; isLoading: boolean; error: unknown } => {
23
15
  const provider = useAppProvider();
24
-
25
- const { filterByCurrentUser } = args || {};
26
-
27
16
  const {
28
- value: apps,
17
+ value: manifests,
29
18
  complete,
30
19
  error,
31
- } = useObservableState(
32
- useMemo(
33
- () =>
34
- provider.getAppManifests(filterByCurrentUser ? { filterByCurrentUser } : undefined),
35
- [provider, filterByCurrentUser],
36
- ),
37
- );
20
+ } = useObservableState(useMemo(() => provider.getAllAppManifests(), [provider]));
21
+
22
+ const apps = useMemo(() => {
23
+ if (manifests && !args?.includeHidden) {
24
+ return manifests.filter((app) => !app.hide);
25
+ }
26
+ return manifests;
27
+ }, [args, manifests]);
38
28
 
39
29
  return { apps, isLoading: !complete, error };
40
30
  };
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '7.2.1';
2
+ export const version = '7.2.2';