@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
package/CHANGELOG.md
CHANGED
|
@@ -1,73 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.2.2
|
|
3
|
+
## 7.2.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#2178](https://github.com/equinor/fusion-framework/pull/2178) [`dbdccb0`](https://github.com/equinor/fusion-framework/commit/dbdccb0c8878b59a6f5f2d404b3daf8f2b138ea6) Thanks [@eikeland](https://github.com/eikeland)! - Adjusted module to the new app service API.
|
|
8
|
-
|
|
9
|
-
> [!WARNING]
|
|
10
|
-
> This will introduce breaking changes to the configuration of `AppConfigurator.client`.
|
|
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
|
-
```
|
|
55
|
-
|
|
56
|
-
custom client implementation:
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
import { AppClient } from `@equinor/fusion-framework-module-app`;
|
|
60
|
-
class CustomAppClient implements IAppClient { ... }
|
|
61
|
-
configurator.setClient(new CustomAppClient());
|
|
62
|
-
```
|
|
63
|
-
|
|
64
7
|
- 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
|
|
8
|
+
- @equinor/fusion-framework-module@4.3.5
|
|
9
|
+
- @equinor/fusion-framework-react-module-signalr@3.0.15
|
|
10
|
+
- @equinor/fusion-framework@7.2.7
|
|
11
|
+
- @equinor/fusion-framework-module-feature-flag@1.1.9
|
|
12
|
+
- @equinor/fusion-framework-react-module-http@7.0.0
|
|
13
|
+
- @equinor/fusion-framework-react-module@3.1.6
|
|
71
14
|
|
|
72
15
|
## 7.2.1
|
|
73
16
|
|
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