@equinor/fusion-framework-react 7.2.2-alpha-8601e3ca5d5b2d11057913cdfc04bbc5e908a598 → 7.2.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/CHANGELOG.md +14 -61
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,73 +1,26 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.2.
|
|
3
|
+
## 7.2.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**Added**
|
|
13
|
-
|
|
14
|
-
- Introduced `AppClient` class to handle application manifest and configuration queries.
|
|
15
|
-
- Added `zod` to validate the application manifest.
|
|
16
|
-
|
|
17
|
-
**Changed**
|
|
18
|
-
|
|
19
|
-
- Updated `AppModuleProvider` to use `AppClient` for fetching application manifests and configurations.
|
|
20
|
-
- Modified `AppConfigurator` to utilize `AppClient` for client configuration.
|
|
21
|
-
|
|
22
|
-
**Migration**
|
|
23
|
-
|
|
24
|
-
before:
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
configurator.setClient({
|
|
28
|
-
getAppManifest: {
|
|
29
|
-
client: {
|
|
30
|
-
fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}`),
|
|
31
|
-
},
|
|
32
|
-
key: ({ appKey }) => appKey,
|
|
33
|
-
},
|
|
34
|
-
getAppManifests: {
|
|
35
|
-
client: {
|
|
36
|
-
fn: () => httpClient.json$<ApiApp[]>(`/apps`),
|
|
37
|
-
},
|
|
38
|
-
key: () => `all-apps`,
|
|
39
|
-
},
|
|
40
|
-
getAppConfig: {
|
|
41
|
-
client: {
|
|
42
|
-
fn: ({ appKey }) => httpClient.json$<ApiApp>(`/apps/${appKey}/config`),
|
|
43
|
-
},
|
|
44
|
-
key: ({ appKey }) => appKey,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
after:
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
import { AppClient } from `@equinor/fusion-framework-module-app`;
|
|
53
|
-
configurator.setClient(new AppClient());
|
|
54
|
-
```
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @equinor/fusion-framework@7.2.8
|
|
9
|
+
- @equinor/fusion-framework-module-feature-flag@1.1.9
|
|
10
|
+
- @equinor/fusion-framework-react-module-http@8.0.0
|
|
11
|
+
- @equinor/fusion-framework-react-module-signalr@3.0.16
|
|
55
12
|
|
|
56
|
-
|
|
13
|
+
## 7.2.2
|
|
57
14
|
|
|
58
|
-
|
|
59
|
-
import { AppClient } from `@equinor/fusion-framework-module-app`;
|
|
60
|
-
class CustomAppClient implements IAppClient { ... }
|
|
61
|
-
configurator.setClient(new CustomAppClient());
|
|
62
|
-
```
|
|
15
|
+
### Patch Changes
|
|
63
16
|
|
|
64
17
|
- Updated dependencies [[`2644b3d`](https://github.com/equinor/fusion-framework/commit/2644b3d63939aede736a3b1950db32dbd487877d)]:
|
|
65
|
-
- @equinor/fusion-framework-module@4.3.5
|
|
66
|
-
- @equinor/fusion-framework-react-module-signalr@3.0.15
|
|
67
|
-
- @equinor/fusion-framework@7.2.7
|
|
68
|
-
- @equinor/fusion-framework-module-feature-flag@1.1.9
|
|
69
|
-
- @equinor/fusion-framework-react-module-http@7.0.0
|
|
70
|
-
- @equinor/fusion-framework-react-module@3.1.6
|
|
18
|
+
- @equinor/fusion-framework-module@4.3.5
|
|
19
|
+
- @equinor/fusion-framework-react-module-signalr@3.0.15
|
|
20
|
+
- @equinor/fusion-framework@7.2.7
|
|
21
|
+
- @equinor/fusion-framework-module-feature-flag@1.1.9
|
|
22
|
+
- @equinor/fusion-framework-react-module-http@7.0.0
|
|
23
|
+
- @equinor/fusion-framework-react-module@3.1.6
|
|
71
24
|
|
|
72
25
|
## 7.2.1
|
|
73
26
|
|
package/dist/esm/app/useApps.js
CHANGED
|
@@ -3,14 +3,18 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { useAppProvider } from './useAppProvider';
|
|
4
4
|
/**
|
|
5
5
|
* React Hook - Get apps from framework
|
|
6
|
-
* @param args Object with
|
|
7
|
-
* @returns Object {apps, isLoading
|
|
8
|
-
* @since 7.1.1
|
|
6
|
+
* @param args Object with boolean member includeHidden
|
|
7
|
+
* @returns Object {apps, isLoading} where apps is Array of AppManifest, isLoading is a boolean on observable complete
|
|
9
8
|
*/
|
|
10
9
|
export const useApps = (args) => {
|
|
11
10
|
const provider = useAppProvider();
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
11
|
+
const { value: manifests, complete, error, } = useObservableState(useMemo(() => provider.getAllAppManifests(), [provider]));
|
|
12
|
+
const apps = useMemo(() => {
|
|
13
|
+
if (manifests && !(args === null || args === void 0 ? void 0 : args.includeHidden)) {
|
|
14
|
+
return manifests.filter((app) => !app.hide);
|
|
15
|
+
}
|
|
16
|
+
return manifests;
|
|
17
|
+
}, [args, manifests]);
|
|
14
18
|
return { apps, isLoading: !complete, error };
|
|
15
19
|
};
|
|
16
20
|
export default useApps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApps.js","sourceRoot":"","sources":["../../../src/app/useApps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useApps.js","sourceRoot":"","sources":["../../../src/app/useApps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAEvB,EAA2E,EAAE;IAC1E,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAClC,MAAM,EACF,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,KAAK,GACR,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEjF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE;QACtB,IAAI,SAAS,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,CAAA,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAEtB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/dist/esm/version.js
CHANGED