@equinor/fusion-framework-react-app 14.0.3-next.0 → 14.0.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 +2 -10
- package/README.md +2 -9
- package/dist/esm/create-component.js +1 -1
- package/dist/esm/msal/useToken.js +3 -12
- package/dist/esm/msal/useToken.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/create-component.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/docs/bookmark.md +0 -7
- package/docs/context.md +1 -3
- package/docs/framework.md +2 -2
- package/docs/msal.md +3 -3
- package/package.json +25 -77
- package/src/__tests__/useStateSyncEvents.test.ts +11 -12
- package/src/create-component.tsx +1 -1
- package/src/msal/useToken.ts +3 -14
- package/src/version.ts +1 -1
- package/tsconfig.json +0 -6
- package/vitest.config.ts +8 -2
- package/dist/esm/ag-grid/community.js +0 -12
- package/dist/esm/ag-grid/community.js.map +0 -1
- package/dist/esm/ag-grid/enterprise.js +0 -12
- package/dist/esm/ag-grid/enterprise.js.map +0 -1
- package/dist/esm/ag-grid/react.js +0 -12
- package/dist/esm/ag-grid/react.js.map +0 -1
- package/dist/esm/ag-grid/testing.js +0 -19
- package/dist/esm/ag-grid/testing.js.map +0 -1
- package/dist/esm/ag-grid/theme.js +0 -13
- package/dist/esm/ag-grid/theme.js.map +0 -1
- package/dist/types/ag-grid/community.d.ts +0 -11
- package/dist/types/ag-grid/enterprise.d.ts +0 -11
- package/dist/types/ag-grid/react.d.ts +0 -11
- package/dist/types/ag-grid/testing.d.ts +0 -18
- package/dist/types/ag-grid/theme.d.ts +0 -13
- package/src/__tests__/Apploader.test.tsx +0 -51
- package/src/__tests__/fixtures/apploader-child-script.ts +0 -9
- package/src/__tests__/testApp.test.tsx +0 -76
- package/src/__tests__/useAccessToken.test.tsx +0 -51
- package/src/__tests__/useAppSetting.test.tsx +0 -133
- package/src/__tests__/useAppSettings.test.tsx +0 -147
- package/src/__tests__/useCurrentAccount.test.tsx +0 -32
- package/src/__tests__/useCurrentBookmark.test.tsx +0 -108
- package/src/__tests__/useCurrentContext.test.tsx +0 -72
- package/src/__tests__/useFeature.test.tsx +0 -104
- package/src/__tests__/useHelpCenter.test.tsx +0 -64
- package/src/__tests__/useToken.test.tsx +0 -71
- package/src/__tests__/useTrackFeature.test.tsx +0 -83
- package/src/ag-grid/community.ts +0 -11
- package/src/ag-grid/enterprise.ts +0 -11
- package/src/ag-grid/react.ts +0 -11
- package/src/ag-grid/testing.ts +0 -19
- package/src/ag-grid/theme.ts +0 -17
|
@@ -27,7 +27,7 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
27
27
|
* @example
|
|
28
28
|
* ```tsx
|
|
29
29
|
* const configCallback: AppConfigurator = (configurator) => {
|
|
30
|
-
* configurator.
|
|
30
|
+
* configurator.http.configureClient(
|
|
31
31
|
* 'bar', {
|
|
32
32
|
* baseUri: 'https://somewhere-test.com',
|
|
33
33
|
* defaultScopes: ['foo/.default']
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "14.0.3
|
|
1
|
+
export declare const version = "14.0.3";
|
package/docs/bookmark.md
CHANGED
|
@@ -78,13 +78,6 @@ const MyApp = () => {
|
|
|
78
78
|
};
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
> [!WARNING]
|
|
82
|
-
> If your app has **not** called `enableBookmark`, `useCurrentBookmark` falls back to the
|
|
83
|
-
> portal's framework-scoped bookmark provider and logs a `@deprecation` console warning
|
|
84
|
-
> (`"application has not enabled bookmarks, this will not work in the future"`). This
|
|
85
|
-
> fallback is deprecated and will be removed — always call `enableBookmark` in apps that
|
|
86
|
-
> use bookmarks.
|
|
87
|
-
|
|
88
81
|
## useBookmark (Deprecated)
|
|
89
82
|
|
|
90
83
|
> [!CAUTION]
|
package/docs/context.md
CHANGED
|
@@ -29,14 +29,12 @@ Returns the currently selected context from the application-scoped context modul
|
|
|
29
29
|
```ts
|
|
30
30
|
function useCurrentContext(): {
|
|
31
31
|
currentContext: ContextItem | null | undefined;
|
|
32
|
-
setCurrentContext: (context?: ContextItem | string | null) => void
|
|
32
|
+
setCurrentContext: (context?: ContextItem | string | null) => void;
|
|
33
33
|
};
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
**Returns:** An object with the current context (`ContextItem | null | undefined`) and a setter to change it.
|
|
37
37
|
|
|
38
|
-
`setCurrentContext` clears the context when called with no argument (or `null`), resolves an item by `id` when given a `string`, or sets the given `ContextItem` directly. Clearing returns `void`; setting by `id` or by item returns a `Promise` that resolves once the switch completes — `await` it when you need to know the new context has taken effect (e.g. before navigating).
|
|
39
|
-
|
|
40
38
|
### Example
|
|
41
39
|
|
|
42
40
|
```tsx
|
package/docs/framework.md
CHANGED
|
@@ -31,11 +31,11 @@ Use this when your app hasn't configured its own context module but still needs
|
|
|
31
31
|
```ts
|
|
32
32
|
function useFrameworkCurrentContext(): {
|
|
33
33
|
currentContext: ContextItem | undefined;
|
|
34
|
-
setCurrentContext: (entry?: ContextItem | string | null) => void
|
|
34
|
+
setCurrentContext: (entry?: ContextItem | string | null) => void;
|
|
35
35
|
};
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
**Returns:** An object with `currentContext` (the portal's active context, or `undefined` if none is selected) and `setCurrentContext` to change it.
|
|
38
|
+
**Returns:** An object with `currentContext` (the portal's active context, or `undefined` if none is selected) and `setCurrentContext` to change it.
|
|
39
39
|
|
|
40
40
|
**Example:**
|
|
41
41
|
|
package/docs/msal.md
CHANGED
|
@@ -116,7 +116,7 @@ const TokenInfo = () => {
|
|
|
116
116
|
return (
|
|
117
117
|
<div>
|
|
118
118
|
<p>Access Token: {token.accessToken.substring(0, 20)}...</p>
|
|
119
|
-
<p>Expires: {token.expiresOn
|
|
119
|
+
<p>Expires: {new Date(token.expiresOn).toLocaleString()}</p>
|
|
120
120
|
<p>Token Type: {token.tokenType}</p>
|
|
121
121
|
<p>Scope: {token.scopes.join(', ')}</p>
|
|
122
122
|
</div>
|
|
@@ -134,8 +134,8 @@ const TokenInfo = () => {
|
|
|
134
134
|
|
|
135
135
|
**Note:** The `AuthenticationResult` type includes:
|
|
136
136
|
- `accessToken: string`
|
|
137
|
-
- `account: AccountInfo
|
|
138
|
-
- `expiresOn: Date
|
|
137
|
+
- `account: AccountInfo`
|
|
138
|
+
- `expiresOn: Date`
|
|
139
139
|
- `tokenType: string`
|
|
140
140
|
- `scopes: string[]`
|
|
141
141
|
- And more...
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-react-app",
|
|
3
|
-
"version": "14.0.3
|
|
3
|
+
"version": "14.0.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"main": "./dist/esm/index.js",
|
|
7
6
|
"types": "./dist/types/index.d.ts",
|
|
8
7
|
"exports": {
|
|
@@ -69,26 +68,6 @@
|
|
|
69
68
|
"./routing": {
|
|
70
69
|
"types": "./dist/types/routing/index.d.ts",
|
|
71
70
|
"import": "./dist/esm/routing/index.js"
|
|
72
|
-
},
|
|
73
|
-
"./ag-grid": {
|
|
74
|
-
"types": "./dist/types/ag-grid/react.d.ts",
|
|
75
|
-
"import": "./dist/esm/ag-grid/react.js"
|
|
76
|
-
},
|
|
77
|
-
"./ag-grid/community": {
|
|
78
|
-
"types": "./dist/types/ag-grid/community.d.ts",
|
|
79
|
-
"import": "./dist/esm/ag-grid/community.js"
|
|
80
|
-
},
|
|
81
|
-
"./ag-grid/enterprise": {
|
|
82
|
-
"types": "./dist/types/ag-grid/enterprise.d.ts",
|
|
83
|
-
"import": "./dist/esm/ag-grid/enterprise.js"
|
|
84
|
-
},
|
|
85
|
-
"./ag-grid/theme": {
|
|
86
|
-
"types": "./dist/types/ag-grid/theme.d.ts",
|
|
87
|
-
"import": "./dist/esm/ag-grid/theme.js"
|
|
88
|
-
},
|
|
89
|
-
"./ag-grid/testing": {
|
|
90
|
-
"types": "./dist/types/ag-grid/testing.d.ts",
|
|
91
|
-
"import": "./dist/esm/ag-grid/testing.js"
|
|
92
71
|
}
|
|
93
72
|
},
|
|
94
73
|
"typesVersions": {
|
|
@@ -137,21 +116,6 @@
|
|
|
137
116
|
],
|
|
138
117
|
"routing": [
|
|
139
118
|
"dist/types/routing/index.d.ts"
|
|
140
|
-
],
|
|
141
|
-
"ag-grid": [
|
|
142
|
-
"dist/types/ag-grid/react.d.ts"
|
|
143
|
-
],
|
|
144
|
-
"ag-grid/community": [
|
|
145
|
-
"dist/types/ag-grid/community.d.ts"
|
|
146
|
-
],
|
|
147
|
-
"ag-grid/enterprise": [
|
|
148
|
-
"dist/types/ag-grid/enterprise.d.ts"
|
|
149
|
-
],
|
|
150
|
-
"ag-grid/theme": [
|
|
151
|
-
"dist/types/ag-grid/theme.d.ts"
|
|
152
|
-
],
|
|
153
|
-
"ag-grid/testing": [
|
|
154
|
-
"dist/types/ag-grid/testing.d.ts"
|
|
155
119
|
]
|
|
156
120
|
}
|
|
157
121
|
},
|
|
@@ -167,62 +131,46 @@
|
|
|
167
131
|
"directory": "packages/react"
|
|
168
132
|
},
|
|
169
133
|
"dependencies": {
|
|
170
|
-
"@equinor/fusion-framework-app": "13.0.3
|
|
171
|
-
"@equinor/fusion-framework": "
|
|
172
|
-
"@equinor/fusion-framework-module-http": "8.
|
|
173
|
-
"@equinor/fusion-framework-
|
|
174
|
-
"@equinor/fusion-framework-
|
|
175
|
-
"@equinor/fusion-framework-react
|
|
176
|
-
"@equinor/fusion-framework-module
|
|
177
|
-
"@equinor/fusion-framework-module": "
|
|
178
|
-
"@equinor/fusion-framework-module-app": "8.0.6-next.0"
|
|
134
|
+
"@equinor/fusion-framework-app": "13.0.3",
|
|
135
|
+
"@equinor/fusion-framework-module": "6.1.2",
|
|
136
|
+
"@equinor/fusion-framework-module-http": "8.0.5",
|
|
137
|
+
"@equinor/fusion-framework-module-app": "8.0.5",
|
|
138
|
+
"@equinor/fusion-framework-module-navigation": "7.0.8",
|
|
139
|
+
"@equinor/fusion-framework-react": "8.0.1",
|
|
140
|
+
"@equinor/fusion-framework-react-module": "4.0.2",
|
|
141
|
+
"@equinor/fusion-framework-react-module-http": "11.0.1"
|
|
179
142
|
},
|
|
180
143
|
"devDependencies": {
|
|
181
|
-
"@
|
|
144
|
+
"@testing-library/react": "^16.0.0",
|
|
182
145
|
"@types/react": "^19.2.7",
|
|
183
146
|
"@types/react-dom": "^19.2.3",
|
|
184
|
-
"
|
|
185
|
-
"playwright": "^1.62.1",
|
|
147
|
+
"happy-dom": "^20.8.4",
|
|
186
148
|
"react": "^19.2.1",
|
|
187
149
|
"react-dom": "^19.2.1",
|
|
188
150
|
"rxjs": "^7.8.1",
|
|
189
151
|
"typescript": "^7.0.2",
|
|
190
|
-
"vitest": "^4.1.
|
|
191
|
-
"
|
|
192
|
-
"@equinor/fusion-framework-module-
|
|
193
|
-
"@equinor/fusion-framework-
|
|
194
|
-
"@equinor/fusion-framework-module-
|
|
195
|
-
"@equinor/fusion-framework-module-
|
|
196
|
-
"@equinor/fusion-framework-module-
|
|
197
|
-
"@equinor/fusion-framework-module-
|
|
198
|
-
"@equinor/fusion-framework-module-
|
|
199
|
-
"@equinor/fusion-framework-
|
|
200
|
-
"@equinor/fusion-
|
|
201
|
-
"@equinor/fusion-framework-react-module-bookmark": "7.0.0-next.0",
|
|
202
|
-
"@equinor/fusion-framework-react-module-context": "7.0.3-next.0",
|
|
203
|
-
"@equinor/fusion-framework-react-router": "2.4.1-next.1",
|
|
204
|
-
"@equinor/fusion-framework-vitest-plugin-react-app": "1.0.0-next.5",
|
|
205
|
-
"@equinor/fusion-observable": "9.1.2-next.1",
|
|
206
|
-
"@equinor/fusion-framework-module-telemetry": "8.0.0-next.1"
|
|
152
|
+
"vitest": "^4.1.0",
|
|
153
|
+
"@equinor/fusion-framework-module-event": "6.0.1",
|
|
154
|
+
"@equinor/fusion-framework-module-analytics": "3.0.8",
|
|
155
|
+
"@equinor/fusion-framework-module-ag-grid": "37.0.2",
|
|
156
|
+
"@equinor/fusion-framework-module-msal": "10.0.2",
|
|
157
|
+
"@equinor/fusion-framework-module-feature-flag": "2.0.3",
|
|
158
|
+
"@equinor/fusion-framework-react-module-bookmark": "6.0.1",
|
|
159
|
+
"@equinor/fusion-framework-module-state": "^2.0.1",
|
|
160
|
+
"@equinor/fusion-framework-react-module-context": "7.0.2",
|
|
161
|
+
"@equinor/fusion-framework-react-router": "2.4.0",
|
|
162
|
+
"@equinor/fusion-observable": "9.2.0"
|
|
207
163
|
},
|
|
208
164
|
"peerDependencies": {
|
|
209
165
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
210
166
|
"react": "^18.0.0 || ^19.0.0",
|
|
211
167
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
212
168
|
"rxjs": "^7.0.0",
|
|
213
|
-
"@equinor/fusion-framework-module-
|
|
214
|
-
"@equinor/fusion-framework-react-
|
|
215
|
-
"@equinor/fusion-framework-module-
|
|
216
|
-
"@equinor/fusion-framework-module-state": "^2.0.2-next.0",
|
|
217
|
-
"@equinor/fusion-framework-react-router": "^2.4.1-next.1"
|
|
169
|
+
"@equinor/fusion-framework-module-msal": "^10.0.2",
|
|
170
|
+
"@equinor/fusion-framework-react-router": "^2.4.0",
|
|
171
|
+
"@equinor/fusion-framework-module-state": "^2.0.1"
|
|
218
172
|
},
|
|
219
173
|
"peerDependenciesMeta": {
|
|
220
|
-
"@equinor/fusion-framework-module-ag-grid": {
|
|
221
|
-
"optional": true
|
|
222
|
-
},
|
|
223
|
-
"@equinor/fusion-framework-react-ag-grid": {
|
|
224
|
-
"optional": true
|
|
225
|
-
},
|
|
226
174
|
"@equinor/fusion-framework-react-module-ag-grid": {
|
|
227
175
|
"optional": true
|
|
228
176
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { act } from 'react';
|
|
2
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
3
2
|
import { Subject } from 'rxjs';
|
|
4
3
|
|
|
4
|
+
import { act, renderHook } from '@testing-library/react';
|
|
5
|
+
|
|
5
6
|
import { StateSyncEvent, type StateSyncEventType } from '@equinor/fusion-framework-module-state';
|
|
6
|
-
import { renderAppHook } from '@equinor/fusion-framework-vitest-plugin-react-app/test';
|
|
7
7
|
|
|
8
8
|
const event$ = new Subject<StateSyncEventType>();
|
|
9
9
|
|
|
@@ -14,8 +14,8 @@ vi.mock('../useAppModule', () => ({
|
|
|
14
14
|
import { useStateSyncEvents } from '../state/useStateSyncEvents';
|
|
15
15
|
|
|
16
16
|
describe('useStateSyncEvents', () => {
|
|
17
|
-
it('collects dispatched onStateSync.* events, oldest first',
|
|
18
|
-
const { result } =
|
|
17
|
+
it('collects dispatched onStateSync.* events, oldest first', () => {
|
|
18
|
+
const { result } = renderHook(() => useStateSyncEvents(10));
|
|
19
19
|
|
|
20
20
|
expect(result.current).toEqual([]);
|
|
21
21
|
|
|
@@ -24,14 +24,13 @@ describe('useStateSyncEvents', () => {
|
|
|
24
24
|
event$.next(new StateSyncEvent.Status({ detail: { status: 'paused' } }));
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
expect(result.current).
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]);
|
|
27
|
+
expect(result.current).toHaveLength(2);
|
|
28
|
+
expect(result.current[0].detail.status).toBe('active');
|
|
29
|
+
expect(result.current[1].detail.status).toBe('paused');
|
|
31
30
|
});
|
|
32
31
|
|
|
33
|
-
it('ignores events unrelated to state sync and trims the log to the given limit',
|
|
34
|
-
const { result } =
|
|
32
|
+
it('ignores events unrelated to state sync and trims the log to the given limit', () => {
|
|
33
|
+
const { result } = renderHook(() => useStateSyncEvents(1));
|
|
35
34
|
|
|
36
35
|
act(() => {
|
|
37
36
|
event$.next(new StateSyncEvent.Status({ detail: { status: 'active' } }));
|
|
@@ -44,8 +43,8 @@ describe('useStateSyncEvents', () => {
|
|
|
44
43
|
expect(result.current[0]).toBeInstanceOf(StateSyncEvent.Error);
|
|
45
44
|
});
|
|
46
45
|
|
|
47
|
-
it('unsubscribes from the event stream on unmount',
|
|
48
|
-
const { result, unmount } =
|
|
46
|
+
it('unsubscribes from the event stream on unmount', () => {
|
|
47
|
+
const { result, unmount } = renderHook(() => useStateSyncEvents(10));
|
|
49
48
|
|
|
50
49
|
unmount();
|
|
51
50
|
|
package/src/create-component.tsx
CHANGED
|
@@ -41,7 +41,7 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
41
41
|
* @example
|
|
42
42
|
* ```tsx
|
|
43
43
|
* const configCallback: AppConfigurator = (configurator) => {
|
|
44
|
-
* configurator.
|
|
44
|
+
* configurator.http.configureClient(
|
|
45
45
|
* 'bar', {
|
|
46
46
|
* baseUri: 'https://somewhere-test.com',
|
|
47
47
|
* defaultScopes: ['foo/.default']
|
package/src/msal/useToken.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { AuthenticationResult } from '@equinor/fusion-framework-module-msal';
|
|
4
4
|
|
|
@@ -32,22 +32,11 @@ export const useToken = (req: {
|
|
|
32
32
|
const [token, setToken] = useState<AuthenticationResult | undefined>(undefined);
|
|
33
33
|
const [pending, setPending] = useState<boolean>(false);
|
|
34
34
|
const [error, setError] = useState<unknown>(null);
|
|
35
|
-
|
|
36
|
-
// `req` is typically a fresh object literal each render; key the effect on its
|
|
37
|
-
// scopes' content instead of identity, so it doesn't re-run (and reset `pending`
|
|
38
|
-
// to `true` forever) every time the caller re-renders. `JSON.stringify` (rather than
|
|
39
|
-
// `.join(',')`) keeps scopes with different array boundaries (e.g. `['a,b']` vs.
|
|
40
|
-
// `['a', 'b']`) from colliding on the same key.
|
|
41
|
-
const scopesKey = JSON.stringify(req.scopes);
|
|
42
|
-
const reqRef = useRef(req);
|
|
43
|
-
reqRef.current = req;
|
|
44
|
-
|
|
45
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: scopesKey is a re-run trigger, not read in the body
|
|
46
35
|
useEffect(() => {
|
|
47
36
|
setPending(true);
|
|
48
37
|
setToken(undefined);
|
|
49
38
|
msalProvider
|
|
50
|
-
.acquireToken({ request:
|
|
39
|
+
.acquireToken({ request: req })
|
|
51
40
|
.then((result) => {
|
|
52
41
|
// Only update state when a token was actually acquired
|
|
53
42
|
if (result) {
|
|
@@ -56,7 +45,7 @@ export const useToken = (req: {
|
|
|
56
45
|
})
|
|
57
46
|
.catch(setError)
|
|
58
47
|
.finally(() => setPending(false));
|
|
59
|
-
}, [msalProvider,
|
|
48
|
+
}, [msalProvider, req]);
|
|
60
49
|
return { token, pending, error };
|
|
61
50
|
};
|
|
62
51
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '14.0.3
|
|
2
|
+
export const version = '14.0.3';
|
package/tsconfig.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { defineProject } from '
|
|
1
|
+
import { defineProject } from 'vitest/config';
|
|
2
2
|
|
|
3
|
-
import { name, version } from './package.json'
|
|
3
|
+
import { name, version } from './package.json';
|
|
4
4
|
|
|
5
5
|
export default defineProject({
|
|
6
|
+
resolve: {
|
|
7
|
+
// @ts-expect-error -- tsconfigPaths is a Vite 8 option; vitest 4.x ships Vite 7 types
|
|
8
|
+
tsconfigPaths: true,
|
|
9
|
+
},
|
|
6
10
|
test: {
|
|
11
|
+
include: ['src/__tests__/**'],
|
|
7
12
|
name: `${name}@${version}`,
|
|
13
|
+
environment: 'happy-dom',
|
|
8
14
|
},
|
|
9
15
|
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid community-tier sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports every public symbol from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/community` so the application
|
|
7
|
-
* resolves a single shared copy of `ag-grid-community`.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/community';
|
|
12
|
-
//# sourceMappingURL=community.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../../src/ag-grid/community.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,mDAAmD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid enterprise-tier sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports every public symbol from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/enterprise` so the application
|
|
7
|
-
* resolves a single shared copy of `ag-grid-enterprise`.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/enterprise';
|
|
12
|
-
//# sourceMappingURL=enterprise.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise.js","sourceRoot":"","sources":["../../../src/ag-grid/enterprise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,oDAAoD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid React component sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the AG Grid React bindings from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/react`, including the
|
|
7
|
-
* `AgGridReact` component, `enableAgGrid`, and their associated types.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/react';
|
|
12
|
-
//# sourceMappingURL=react.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/ag-grid/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,+CAA+C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid test helpers sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the AG Grid test helpers from
|
|
6
|
-
* `@equinor/fusion-framework-module-ag-grid/testing`. Import from test setup
|
|
7
|
-
* files only — these helpers patch global state and are not meant for
|
|
8
|
-
* application runtime code.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Silences AG Grid Enterprise's unlicensed "License Key Not Found" banner on
|
|
14
|
-
* `console.error` so it doesn't bury real failures in test output.
|
|
15
|
-
*
|
|
16
|
-
* @returns A function that restores the original `console.error`.
|
|
17
|
-
*/
|
|
18
|
-
export { suppressAgGridLicenseBanner } from '@equinor/fusion-framework-module-ag-grid/testing';
|
|
19
|
-
//# sourceMappingURL=testing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/ag-grid/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid theme sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the Fusion AG Grid theme utilities from
|
|
6
|
-
* `@equinor/fusion-framework-module-ag-grid/themes`, together with the
|
|
7
|
-
* application-scoped {@link useTheme} hook.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export { fusionTheme, createThemeFromTheme, createTheme, } from '@equinor/fusion-framework-module-ag-grid/themes';
|
|
12
|
-
export { useTheme } from './useTheme';
|
|
13
|
-
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/ag-grid/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,WAAW,GACZ,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid community-tier sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports every public symbol from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/community` so the application
|
|
7
|
-
* resolves a single shared copy of `ag-grid-community`.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/community';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid enterprise-tier sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports every public symbol from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/enterprise` so the application
|
|
7
|
-
* resolves a single shared copy of `ag-grid-enterprise`.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/enterprise';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid React component sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the AG Grid React bindings from
|
|
6
|
-
* `@equinor/fusion-framework-react-ag-grid/react`, including the
|
|
7
|
-
* `AgGridReact` component, `enableAgGrid`, and their associated types.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export * from '@equinor/fusion-framework-react-ag-grid/react';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid test helpers sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the AG Grid test helpers from
|
|
6
|
-
* `@equinor/fusion-framework-module-ag-grid/testing`. Import from test setup
|
|
7
|
-
* files only — these helpers patch global state and are not meant for
|
|
8
|
-
* application runtime code.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Silences AG Grid Enterprise's unlicensed "License Key Not Found" banner on
|
|
14
|
-
* `console.error` so it doesn't bury real failures in test output.
|
|
15
|
-
*
|
|
16
|
-
* @returns A function that restores the original `console.error`.
|
|
17
|
-
*/
|
|
18
|
-
export { suppressAgGridLicenseBanner } from '@equinor/fusion-framework-module-ag-grid/testing';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG Grid theme sub-path entry-point.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Re-exports the Fusion AG Grid theme utilities from
|
|
6
|
-
* `@equinor/fusion-framework-module-ag-grid/themes`, together with the
|
|
7
|
-
* application-scoped {@link useTheme} hook.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export { fusionTheme, createThemeFromTheme, createTheme, } from '@equinor/fusion-framework-module-ag-grid/themes';
|
|
12
|
-
export type { Theme } from '@equinor/fusion-framework-module-ag-grid/themes';
|
|
13
|
-
export { useTheme } from './useTheme';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { mockFramework } from '@equinor/fusion-framework/mock';
|
|
4
|
-
import { enableAppManifestMock } from '@equinor/fusion-framework-app/mock';
|
|
5
|
-
import type { AppManifest, AppModule } from '@equinor/fusion-framework-module-app';
|
|
6
|
-
|
|
7
|
-
import { Apploader } from '../apploader/Apploader';
|
|
8
|
-
import { renderAppComponent } from '@equinor/fusion-framework-vitest-plugin-react-app/test';
|
|
9
|
-
|
|
10
|
-
// resolved from this test file rather than hardcoded, so it survives a package move
|
|
11
|
-
const fixturesUri = new URL('./fixtures', import.meta.url).pathname;
|
|
12
|
-
|
|
13
|
-
describe('Apploader', () => {
|
|
14
|
-
it('mounts the child app’s rendered content once its script loads', async () => {
|
|
15
|
-
const manifest: AppManifest = {
|
|
16
|
-
appKey: 'child-app',
|
|
17
|
-
displayName: 'Child App',
|
|
18
|
-
description: 'A child application',
|
|
19
|
-
type: 'standalone',
|
|
20
|
-
build: { version: '1.0.0', entryPoint: 'apploader-child-script.ts', assetPath: '' },
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const fusion = await mockFramework<[AppModule]>((configurator) =>
|
|
24
|
-
enableAppManifestMock(configurator, { manifest }, fixturesUri),
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const { container } = await renderAppComponent(<Apploader appKey="child-app" />, { fusion });
|
|
28
|
-
|
|
29
|
-
// the loading state renders synchronously, before the script's dynamic import resolves
|
|
30
|
-
expect(container.textContent).toContain('Loading child-app');
|
|
31
|
-
await vi.waitFor(() => expect(container.textContent).toContain('mounted: child-app'));
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('surfaces the load error instead of throwing when the app’s script fails to import', async () => {
|
|
35
|
-
const manifest: AppManifest = {
|
|
36
|
-
appKey: 'broken-app',
|
|
37
|
-
displayName: 'Broken App',
|
|
38
|
-
description: 'An application whose build entry point does not exist',
|
|
39
|
-
type: 'standalone',
|
|
40
|
-
build: { version: '1.0.0', entryPoint: 'does-not-exist.ts', assetPath: '' },
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const fusion = await mockFramework<[AppModule]>((configurator) =>
|
|
44
|
-
enableAppManifestMock(configurator, { manifest }, fixturesUri),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const { container } = await renderAppComponent(<Apploader appKey="broken-app" />, { fusion });
|
|
48
|
-
|
|
49
|
-
await vi.waitFor(() => expect(container.textContent).toContain('Error loading broken-app'));
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AppScriptModule } from '@equinor/fusion-framework-module-app';
|
|
2
|
-
|
|
3
|
-
// a minimal stand-in for a real app bundle's entry point, dynamically imported by `App.initialize()`
|
|
4
|
-
export const renderApp: AppScriptModule['renderApp'] = (el, { env }) => {
|
|
5
|
-
el.textContent = `mounted: ${env.manifest?.appKey}`;
|
|
6
|
-
return () => {
|
|
7
|
-
el.textContent = '';
|
|
8
|
-
};
|
|
9
|
-
};
|