@equinor/fusion-framework-react 7.2.1 → 7.2.2-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e
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/CHANGELOG.md +12 -0
- package/dist/esm/app/useApps.js +5 -9
- package/dist/esm/app/useApps.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/app/useApps.d.ts +11 -7
- package/package.json +11 -11
- package/src/app/useApps.ts +25 -15
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplicationManifest } from '@equinor/fusion-framework-module-app';
|
|
2
|
+
type UseAppsArgs = {
|
|
3
|
+
/** @deprecated - no longer available */
|
|
4
|
+
includeHidden?: boolean;
|
|
5
|
+
filterByCurrentUser?: boolean;
|
|
6
|
+
};
|
|
2
7
|
/**
|
|
3
8
|
* React Hook - Get apps from framework
|
|
4
|
-
* @param args Object with boolean
|
|
5
|
-
* @returns Object {apps, isLoading} where apps is Array of
|
|
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
|
|
6
12
|
*/
|
|
7
|
-
export declare const useApps: (args?: {
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
10
|
-
apps: AppManifest[] | undefined;
|
|
13
|
+
export declare const useApps: (args?: UseAppsArgs) => {
|
|
14
|
+
apps: ApplicationManifest[] | undefined;
|
|
11
15
|
isLoading: boolean;
|
|
12
16
|
error: unknown;
|
|
13
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-react",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"rxjs": "^7.8.1",
|
|
72
|
-
"@equinor/fusion-framework": "^7.2.
|
|
73
|
-
"@equinor/fusion-framework-
|
|
74
|
-
"@equinor/fusion-framework-module": "^
|
|
75
|
-
"@equinor/fusion-
|
|
76
|
-
"@equinor/fusion-
|
|
72
|
+
"@equinor/fusion-framework": "^7.2.7-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
73
|
+
"@equinor/fusion-framework-module": "^4.3.5-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
74
|
+
"@equinor/fusion-framework-react-module": "^3.1.6-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
75
|
+
"@equinor/fusion-framework-react-module-http": "^7.0.0-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
76
|
+
"@equinor/fusion-observable": "^8.4.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/react": "^18.2.50",
|
|
@@ -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-feature-flag": "^1.1.8",
|
|
85
84
|
"@equinor/fusion-framework-module-app": "^5.3.11",
|
|
86
|
-
"@equinor/fusion-framework-module-
|
|
87
|
-
"@equinor/fusion-framework-
|
|
85
|
+
"@equinor/fusion-framework-module-feature-flag": "^1.1.9-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
86
|
+
"@equinor/fusion-framework-module-event": "^4.2.4-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
87
|
+
"@equinor/fusion-framework-react-module-context": "^6.2.13-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e"
|
|
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-
|
|
94
|
-
"@equinor/fusion-framework-module-
|
|
93
|
+
"@equinor/fusion-framework-module-feature-flag": "^1.1.9-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e",
|
|
94
|
+
"@equinor/fusion-framework-react-module-signalr": "^3.0.15-alpha-afdec66178b3cac96597125945ba7e1b4ca2ca7e"
|
|
95
95
|
},
|
|
96
96
|
"peerDependenciesMeta": {
|
|
97
97
|
"@equinor/fusion-framework-module-event": {
|
package/src/app/useApps.ts
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplicationManifest } from '@equinor/fusion-framework-module-app';
|
|
2
2
|
import { useObservableState } from '@equinor/fusion-observable/react';
|
|
3
3
|
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
|
+
|
|
7
14
|
/**
|
|
8
15
|
* React Hook - Get apps from framework
|
|
9
|
-
* @param args Object with boolean
|
|
10
|
-
* @returns Object {apps, isLoading} where apps is Array of
|
|
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
|
|
11
19
|
*/
|
|
12
|
-
export const useApps = (
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
export const useApps = (
|
|
21
|
+
args?: UseAppsArgs,
|
|
22
|
+
): { apps: ApplicationManifest[] | undefined; isLoading: boolean; error: unknown } => {
|
|
15
23
|
const provider = useAppProvider();
|
|
24
|
+
|
|
25
|
+
const { filterByCurrentUser } = args || {};
|
|
26
|
+
|
|
16
27
|
const {
|
|
17
|
-
value:
|
|
28
|
+
value: apps,
|
|
18
29
|
complete,
|
|
19
30
|
error,
|
|
20
|
-
} = useObservableState(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [args, manifests]);
|
|
31
|
+
} = useObservableState(
|
|
32
|
+
useMemo(
|
|
33
|
+
() =>
|
|
34
|
+
provider.getAppManifests(filterByCurrentUser ? { filterByCurrentUser } : undefined),
|
|
35
|
+
[provider, filterByCurrentUser],
|
|
36
|
+
),
|
|
37
|
+
);
|
|
28
38
|
|
|
29
39
|
return { apps, isLoading: !complete, error };
|
|
30
40
|
};
|