@equinor/fusion-framework-dev-portal 8.0.3 → 9.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-dev-portal",
3
- "version": "8.0.3",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/main.js",
@@ -28,54 +28,58 @@
28
28
  "@equinor/fusion-wc-person": "^3.5.5",
29
29
  "@types/react": "^19.2.7",
30
30
  "@types/react-dom": "^19.2.3",
31
+ "@types/semver": "^7.7.1",
31
32
  "@vitejs/plugin-react": "^6.0.1",
32
33
  "dotenv": "^17.3.1",
33
34
  "react": "^19.2.1",
34
35
  "react-dom": "^19.2.1",
35
36
  "rxjs": "^7.8.1",
36
37
  "styled-components": "^6.3.11",
38
+ "semver": "^7.7.2",
37
39
  "tsx": "^4.19.3",
38
40
  "typescript": "^7.0.2",
39
41
  "vite": "^8.0.0",
40
- "@equinor/fusion-framework": "8.0.12",
41
- "@equinor/fusion-framework-app": "11.0.12",
42
- "@equinor/fusion-framework-module-ag-grid": "37.0.1",
43
- "@equinor/fusion-framework-module-analytics": "3.0.4",
44
- "@equinor/fusion-framework-dev-server": "2.0.17",
42
+ "@equinor/fusion-framework-app": "12.0.0",
43
+ "@equinor/fusion-framework-dev-server": "2.0.18",
44
+ "@equinor/fusion-framework": "8.0.13",
45
45
  "@equinor/fusion-framework-module-app": "8.0.4",
46
46
  "@equinor/fusion-framework-module-bookmark": "4.0.4",
47
- "@equinor/fusion-framework-module-context": "8.0.1",
47
+ "@equinor/fusion-framework-module-ag-grid": "37.0.1",
48
+ "@equinor/fusion-framework-module-context": "8.0.2",
49
+ "@equinor/fusion-framework-module-analytics": "3.0.5",
50
+ "@equinor/fusion-framework-plugin-context-navigation": "0.1.0",
48
51
  "@equinor/fusion-framework-module-feature-flag": "2.0.3",
49
- "@equinor/fusion-framework-module-navigation": "7.0.6",
50
- "@equinor/fusion-framework-module-services": "8.0.3",
51
- "@equinor/fusion-framework-module-telemetry": "7.0.1",
52
+ "@equinor/fusion-framework-module-navigation": "7.0.7",
53
+ "@equinor/fusion-framework-module-telemetry": "7.0.2",
52
54
  "@equinor/fusion-framework-react": "8.0.1",
53
- "@equinor/fusion-framework-react-module-bookmark": "6.0.1",
54
- "@equinor/fusion-framework-react-components-people-provider": "2.0.4",
55
- "@equinor/fusion-framework-react-router": "2.4.0",
55
+ "@equinor/fusion-framework-module-services": "8.0.3",
56
56
  "@equinor/fusion-framework-react-components-bookmark": "2.0.3",
57
+ "@equinor/fusion-framework-react-router": "2.4.0",
57
58
  "@equinor/fusion-observable": "9.1.1",
58
- "@equinor/fusion-query": "7.0.3"
59
+ "@equinor/fusion-query": "7.0.3",
60
+ "@equinor/fusion-framework-react-components-people-provider": "2.0.4",
61
+ "@equinor/fusion-framework-react-module-bookmark": "6.0.1"
59
62
  },
60
63
  "peerDependencies": {
61
- "@equinor/fusion-framework": "8.0.12",
62
- "@equinor/fusion-framework-app": "11.0.12",
64
+ "@equinor/fusion-framework": "8.0.13",
65
+ "@equinor/fusion-framework-app": "12.0.0",
63
66
  "@equinor/fusion-framework-module-ag-grid": "37.0.1",
64
- "@equinor/fusion-framework-module-analytics": "3.0.4",
67
+ "@equinor/fusion-framework-dev-server": "2.0.18",
65
68
  "@equinor/fusion-framework-module-app": "8.0.4",
69
+ "@equinor/fusion-framework-module-analytics": "3.0.5",
66
70
  "@equinor/fusion-framework-module-bookmark": "4.0.4",
67
- "@equinor/fusion-framework-module-context": "8.0.1",
71
+ "@equinor/fusion-framework-module-context": "8.0.2",
72
+ "@equinor/fusion-framework-plugin-context-navigation": "0.1.0",
68
73
  "@equinor/fusion-framework-module-feature-flag": "2.0.3",
69
- "@equinor/fusion-framework-dev-server": "2.0.17",
70
- "@equinor/fusion-framework-module-navigation": "7.0.6",
74
+ "@equinor/fusion-framework-module-navigation": "7.0.7",
71
75
  "@equinor/fusion-framework-module-services": "8.0.3",
72
- "@equinor/fusion-framework-module-telemetry": "7.0.1",
73
76
  "@equinor/fusion-framework-react-components-bookmark": "2.0.3",
77
+ "@equinor/fusion-framework-module-telemetry": "7.0.2",
74
78
  "@equinor/fusion-framework-react-components-people-provider": "2.0.4",
79
+ "@equinor/fusion-framework-react": "8.0.1",
75
80
  "@equinor/fusion-framework-react-module-bookmark": "6.0.1",
76
81
  "@equinor/fusion-observable": "9.1.1",
77
- "@equinor/fusion-query": "7.0.3",
78
- "@equinor/fusion-framework-react": "8.0.1"
82
+ "@equinor/fusion-query": "7.0.3"
79
83
  },
80
84
  "peerDependenciesMeta": {
81
85
  "@equinor/fusion-framework": {
package/src/Router.tsx CHANGED
@@ -1,11 +1,10 @@
1
1
  import { useBookmarkNavigate } from '@equinor/fusion-framework-react-module-bookmark/portal';
2
2
 
3
- import { Outlet, Router as FusionRouter, useParams } from '@equinor/fusion-framework-react-router';
3
+ import { Router as FusionRouter, Outlet, useParams } from '@equinor/fusion-framework-react-router';
4
4
  import AppLoader from './AppLoader';
5
5
  import { Header } from './Header';
6
6
 
7
7
  import { styled } from 'styled-components';
8
- import { useAppContextNavigation } from './useAppContextNavigation';
9
8
 
10
9
  const Styled = {
11
10
  ContentContainer: styled.div`
@@ -76,11 +75,9 @@ const routes = [
76
75
  /**
77
76
  * Top-level router for the Fusion Dev Portal.
78
77
  *
79
- * Renders the application via `FusionRouter`. Observes context changes through
80
- * {@link useAppContextNavigation} to keep the URL in sync.
78
+ * Uses `@equinor/fusion-framework-react-router` which automatically connects
79
+ * to the framework's navigation module for history and basename.
81
80
  */
82
81
  export const Router = () => {
83
- // observe the context changes and navigate when the context changes
84
- useAppContextNavigation();
85
82
  return <FusionRouter routes={routes} />;
86
83
  };
package/src/configure.ts CHANGED
@@ -1,9 +1,13 @@
1
- import { enableAppModule } from '@equinor/fusion-framework-module-app';
1
+ import { enableAppModule, type AppModule } from '@equinor/fusion-framework-module-app';
2
2
  import { enableBookmark } from '@equinor/fusion-framework-react-module-bookmark';
3
3
  import type { FrameworkConfigurator } from '@equinor/fusion-framework';
4
4
  import { enableAnalytics } from '@equinor/fusion-framework-module-analytics';
5
5
  import { ConsoleAnalyticsAdapter } from '@equinor/fusion-framework-module-analytics/adapters';
6
- import { enableNavigation } from '@equinor/fusion-framework-module-navigation';
6
+ import { enableContext } from '@equinor/fusion-framework-module-context';
7
+ import {
8
+ enableNavigation,
9
+ type NavigationModule,
10
+ } from '@equinor/fusion-framework-module-navigation';
7
11
  import { enableServices } from '@equinor/fusion-framework-module-services';
8
12
  import { enableFeatureFlagging } from '@equinor/fusion-framework-module-feature-flag';
9
13
  import {
@@ -11,15 +15,22 @@ import {
11
15
  createUrlPlugin,
12
16
  } from '@equinor/fusion-framework-module-feature-flag/plugins';
13
17
  import { enableAgGrid } from '@equinor/fusion-framework-module-ag-grid';
14
-
15
18
  import { enableTelemetry } from '@equinor/fusion-framework-module-telemetry';
19
+ import {
20
+ enableContextNavigation,
21
+ legacyAppNavigationFix,
22
+ } from '@equinor/fusion-framework-plugin-context-navigation';
23
+ import {
24
+ buildContextUrlForStrategy,
25
+ resolveContextIdFromUrl,
26
+ } from '@equinor/fusion-framework-plugin-context-navigation/utils';
16
27
  import { version } from './version';
17
28
 
18
29
  declare global {
19
30
  interface Window {
20
31
  /**
21
- * AG Grid license key for enabling enterprise features
22
- * @remarks This is typically set via environment variables during build time
32
+ * AG Grid license key for enabling enterprise features.
33
+ * @remarks Typically set via environment variables during build time.
23
34
  */
24
35
  FUSION_AG_GRID_KEY?: string;
25
36
  }
@@ -28,10 +39,15 @@ declare global {
28
39
  /**
29
40
  * Configures the Fusion Dev Portal framework with all required modules.
30
41
  *
31
- * Enables and wires together:
42
+ * Modules enabled:
32
43
  * - **Telemetry** — portal-scoped usage analytics with version metadata.
33
- * - **App module** — application manifest loading and lifecycle.
34
- * - **Navigation** — router integration with optional telemetry.
44
+ * - **App** — application manifest loading and lifecycle.
45
+ * - **Context** — context routing URL hooks (path generator + extractor) wired to the shared context-navigation URL utilities.
46
+ * - **Context Navigation plugin** — keeps the browser URL in sync with the
47
+ * active context, handles app-switch carry-over, and guards against
48
+ * accidental context loss. Telemetry is auto-resolved from the framework
49
+ * telemetry module.
50
+ * - **Navigation** — router integration with telemetry.
35
51
  * - **Services** — standard Fusion service integrations.
36
52
  * - **AG Grid** — enterprise license key from `window.FUSION_AG_GRID_KEY`.
37
53
  * - **Analytics** — console adapter gated by the `fusionLogAnalytics` feature flag.
@@ -51,10 +67,7 @@ export const configure = async (config: FrameworkConfigurator) => {
51
67
  builder.setMetadata(() => ({
52
68
  fusion: {
53
69
  type: 'portal-telemetry',
54
- portal: {
55
- version,
56
- name: 'Fusion Dev Portal',
57
- },
70
+ portal: { version, name: 'Fusion Dev Portal' },
58
71
  },
59
72
  }));
60
73
  // Scope telemetry events to portal-specific tracking
@@ -66,8 +79,26 @@ export const configure = async (config: FrameworkConfigurator) => {
66
79
 
67
80
  enableAppModule(config);
68
81
 
82
+ /**
83
+ * Configure context module with dev-portal URL conventions.
84
+ *
85
+ * This wires the context module's URL hooks — the path generator
86
+ * and path extractor — to the dev-portal's URL routing strategy.
87
+ *
88
+ * The context-navigation plugin keeps the browser URL in sync with the
89
+ * active context as it changes at runtime.
90
+ */
91
+ enableContext(config, (builder) => {
92
+ builder.setContextPathGenerator((context, path) =>
93
+ buildContextUrlForStrategy(context?.id, path),
94
+ );
95
+
96
+ builder.setContextPathExtractor((path) => resolveContextIdFromUrl(path));
97
+ });
98
+
69
99
  enableNavigation(config, {
70
100
  configure: (config) => {
101
+ config.setBasename('/');
71
102
  config.setTelemetry(async (args) => {
72
103
  // Only provide telemetry when the telemetry module was actually enabled
73
104
  if (args.hasModule('telemetry')) {
@@ -133,13 +164,23 @@ export const configure = async (config: FrameworkConfigurator) => {
133
164
  builder.addPlugin(createUrlPlugin(['fusionDebug']));
134
165
  });
135
166
 
136
- // Expose framework modules globally for development debugging and inspection
137
- config.onInitialized(async (modules) => {
138
- // NOTE: TypeScript ignore needed due to window object extension
139
- // This provides developer access to all initialized modules via window.Fusion
140
- // @ts-expect-error
167
+ // Keep portal URLs aligned with the active app/context combination by using
168
+ // the shared context-navigation plugin and the dev-portal URL helpers.
169
+ enableContextNavigation(config, (builder) => {
170
+ builder.setPortalName('dev-portal');
171
+ builder.setDebug(true);
172
+ builder.setUrlGuard(true);
173
+ builder.setNavigationOptions({
174
+ replace: false, // Use pushState for navigation to allow back button support
175
+ });
176
+ });
177
+
178
+ config.onInitialized<[AppModule, NavigationModule]>((modules) => {
179
+ // Reset legacy app routers on context navigation for apps with navigation <v7.
180
+ legacyAppNavigationFix({ event: modules.event });
181
+
182
+ // Expose framework modules globally for development debugging and inspection.
183
+ // @ts-expect-error — `window` is not typed with `Fusion`
141
184
  window.Fusion = { modules };
142
185
  });
143
186
  };
144
-
145
- export default configure;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '8.0.3';
2
+ export const version = '9.0.0';
package/tsconfig.json CHANGED
@@ -69,6 +69,9 @@
69
69
  },
70
70
  {
71
71
  "path": "../dev-server"
72
+ },
73
+ {
74
+ "path": "../plugins/context-navigation"
72
75
  }
73
76
  ],
74
77
  "include": ["src/**/*", "start.ts"],