@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.
- package/CHANGELOG.md +7 -64
- package/dist/esm/app/useApps.js +9 -5
- package/dist/esm/app/useApps.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/app/useApps.d.ts +5 -9
- package/dist/types/version.d.ts +1 -1
- package/package.json +11 -11
- package/src/app/useApps.ts +14 -24
- package/src/version.ts +1 -1
|
@@ -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
|
|
10
|
-
* @returns Object {apps, isLoading
|
|
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?:
|
|
7
|
+
export declare const useApps: (args?: {
|
|
8
|
+
includeHidden: boolean;
|
|
9
|
+
}) => {
|
|
14
10
|
apps: AppManifest[] | undefined;
|
|
15
11
|
isLoading: boolean;
|
|
16
12
|
error: unknown;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "7.2.
|
|
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
|
|
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
|
|
73
|
-
"@equinor/fusion-framework-module": "^
|
|
74
|
-
"@equinor/fusion-framework": "^
|
|
75
|
-
"@equinor/fusion-framework-react-module
|
|
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": "^
|
|
85
|
-
"@equinor/fusion-framework-module-
|
|
86
|
-
"@equinor/fusion-framework-module-
|
|
87
|
-
"@equinor/fusion-framework-react-module-context": "^6.2.13
|
|
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
|
|
94
|
-
"@equinor/fusion-framework-react-module-signalr": "^3.0.15
|
|
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": {
|
package/src/app/useApps.ts
CHANGED
|
@@ -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
|
|
17
|
-
* @returns Object {apps, isLoading
|
|
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
|
-
|
|
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:
|
|
17
|
+
value: manifests,
|
|
29
18
|
complete,
|
|
30
19
|
error,
|
|
31
|
-
} = useObservableState(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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.
|
|
2
|
+
export const version = '7.2.2';
|