@gooddata/sdk-ui-pluggable-host 11.58.0-alpha.3 → 11.58.0-alpha.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostChrome.d.ts","sourceRoot":"","sources":["../../src/ui/HostChrome.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAElG,OAAO,EACH,KAAK,iBAAiB,EAEtB,KAAK,gCAAgC,EACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACxB,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA2B7D,OAAO,mBAAmB,CAAC;AAK3B,OAAO,0CAA0C,CAAC;AAClD,OAAO,6CAA6C,CAAC;AACrD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,0DAA0D,CAAC;AAkBlE,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,gBAAgB,CAAC;IACtB,oBAAoB,EAAE,gCAAgC,EAAE,CAAC;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;I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K,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,CACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,iBAAiB,EAC/B,YAAY,CAAC,EAAE,OAAO,EACtB,kBAAkB,CAAC,EAAE,OAAO,KAC3B,IAAI,CAAC;IACV;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,EACvB,GAAG,EACH,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,SAAS,EAAE,UAAU,EACrB,aAAa,EACb,YAAmB,EACnB,YAAoB,EACpB,UAAkB,EAClB,QAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACX,EAAE,gBAAgB,2CAiQlB"}
|
package/esm/ui/HostChrome.js
CHANGED
|
@@ -10,7 +10,7 @@ import { getAppLifecycleCallbacks } from "../loader/pluggableApplicationsLoader.
|
|
|
10
10
|
import { getActiveInternalApplication } from "../loader/routing.js";
|
|
11
11
|
import { getBackend } from "../platformContext/backend.js";
|
|
12
12
|
import { buildAppMenu, getLocalizedTitle } from "./appMenuItems.js";
|
|
13
|
-
import { getUserDisplayName,
|
|
13
|
+
import { getUserDisplayName, getWorkspaceSwitchPath, isPlainLeftClick } from "./chromeHelpers.js";
|
|
14
14
|
import { b, e } from "./hostChromeBem.js";
|
|
15
15
|
import { HostIntlProvider } from "./HostIntlProvider.js";
|
|
16
16
|
import { HostNotificationDispatcher } from "./HostNotificationDispatcher.js";
|
|
@@ -98,13 +98,15 @@ export function HostChrome({ ctx, resolvedApplications, pathname, onNavigate, on
|
|
|
98
98
|
}, [onNavigate]);
|
|
99
99
|
const handleWorkspaceSelect = useCallback((workspace) => {
|
|
100
100
|
const newId = workspace.id;
|
|
101
|
-
|
|
101
|
+
// The picker reports a click on the current workspace too; navigating would leave the
|
|
102
|
+
// application's own in-app route (which the host router does not observe) behind.
|
|
103
|
+
if (!newId || newId === features.workspaceId) {
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
106
|
const search = typeof window === "undefined" ? "" : window.location.search;
|
|
105
|
-
const newPath =
|
|
107
|
+
const newPath = getWorkspaceSwitchPath(pathname, newId, resolvedApplications, ctx);
|
|
106
108
|
onNavigate(`${newPath}${search}`);
|
|
107
|
-
}, [pathname, onNavigate]);
|
|
109
|
+
}, [pathname, onNavigate, resolvedApplications, ctx, features.workspaceId]);
|
|
108
110
|
const organizationTitle = ctx.organization?.title ?? ctx.organization?.id;
|
|
109
111
|
const workspacePicker = features.isWorkspaceApp && features.workspaceId ? (_jsx(AppHeaderWorkspacePicker, { backend: getBackend(), userId: ctx.user.login, workspaceId: features.workspaceId, onWorkspaceSelect: handleWorkspaceSelect })) : organizationTitle ? (_jsx("div", { className: "gd-header-project", children: organizationTitle })) : null;
|
|
110
112
|
const hasTierEntitlement = ctx.entitlements?.some((e) => e.name === "Tier" && e.value);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type MouseEvent } from "react";
|
|
2
|
-
import { type IUser } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IUser, type PluggableApplicationRegistryItem } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model";
|
|
3
4
|
/**
|
|
4
5
|
* Builds the display name shown for the current user in the host header.
|
|
5
6
|
*
|
|
@@ -16,6 +17,18 @@ export declare function getUserDisplayName(user: IUser): string;
|
|
|
16
17
|
* an organization-scoped route).
|
|
17
18
|
*/
|
|
18
19
|
export declare function swapWorkspaceInPath(pathname: string, newWorkspaceId: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the path a workspace switch made from `pathname` should land on: the active
|
|
22
|
+
* application's landing route in the new workspace.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* The whole in-app remainder of the path is dropped, screens as well as object ids. The host
|
|
26
|
+
* cannot tell them apart — it knows an application only by its route base — and a remainder
|
|
27
|
+
* kept across the switch carries ids of objects that exist in the old workspace only, which
|
|
28
|
+
* lands the user on a "not found" page. A path no workspace-scoped application claims keeps
|
|
29
|
+
* the plain workspace swap.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getWorkspaceSwitchPath(pathname: string, newWorkspaceId: string, apps: PluggableApplicationRegistryItem[], ctx: IPlatformContext): string;
|
|
19
32
|
/**
|
|
20
33
|
* Whether a click on a link may be taken over with `preventDefault`, rather than left to the
|
|
21
34
|
* browser's own handling of the href.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromeHelpers.d.ts","sourceRoot":"","sources":["../../src/ui/chromeHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"chromeHelpers.d.ts","sourceRoot":"","sources":["../../src/ui/chromeHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAStD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAGpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,gCAAgC,EAAE,EACxC,GAAG,EAAE,gBAAgB,GACtB,MAAM,CAMR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CASpE"}
|
package/esm/ui/chromeHelpers.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { getActiveInternalApplication, getApplicationHref } from "../loader/routing.js";
|
|
2
3
|
/**
|
|
3
4
|
* Builds the display name shown for the current user in the host header.
|
|
4
5
|
*
|
|
@@ -27,6 +28,24 @@ export function swapWorkspaceInPath(pathname, newWorkspaceId) {
|
|
|
27
28
|
const replaced = pathname.replace(/^\/workspace\/[^/]+/, `/workspace/${newWorkspaceId}`);
|
|
28
29
|
return replaced === pathname ? `/workspace/${newWorkspaceId}` : replaced;
|
|
29
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the path a workspace switch made from `pathname` should land on: the active
|
|
33
|
+
* application's landing route in the new workspace.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* The whole in-app remainder of the path is dropped, screens as well as object ids. The host
|
|
37
|
+
* cannot tell them apart — it knows an application only by its route base — and a remainder
|
|
38
|
+
* kept across the switch carries ids of objects that exist in the old workspace only, which
|
|
39
|
+
* lands the user on a "not found" page. A path no workspace-scoped application claims keeps
|
|
40
|
+
* the plain workspace swap.
|
|
41
|
+
*/
|
|
42
|
+
export function getWorkspaceSwitchPath(pathname, newWorkspaceId, apps, ctx) {
|
|
43
|
+
const activeApp = getActiveInternalApplication(apps, ctx, pathname);
|
|
44
|
+
if (activeApp?.applicationScope === "workspace") {
|
|
45
|
+
return getApplicationHref(activeApp, { ...ctx, currentWorkspaceId: newWorkspaceId });
|
|
46
|
+
}
|
|
47
|
+
return swapWorkspaceInPath(pathname, newWorkspaceId);
|
|
48
|
+
}
|
|
30
49
|
/**
|
|
31
50
|
* Whether a click on a link may be taken over with `preventDefault`, rather than left to the
|
|
32
51
|
* browser's own handling of the href.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pluggable-host",
|
|
3
|
-
"version": "11.58.0-alpha.
|
|
3
|
+
"version": "11.58.0-alpha.4",
|
|
4
4
|
"description": "GoodData SDK runtime for hosting pluggable applications — registry, loader, routing, platform context, default UI chrome",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@module-federation/runtime": "2.6.0",
|
|
31
31
|
"lodash-es": "^4.17.23",
|
|
32
|
-
"@gooddata/sdk-backend-base": "11.58.0-alpha.
|
|
33
|
-
"@gooddata/sdk-
|
|
34
|
-
"@gooddata/sdk-backend-spi": "11.58.0-alpha.
|
|
35
|
-
"@gooddata/sdk-
|
|
36
|
-
"@gooddata/sdk-model": "11.58.0-alpha.
|
|
37
|
-
"@gooddata/sdk-
|
|
38
|
-
"@gooddata/sdk-
|
|
39
|
-
"@gooddata/sdk-ui-application-header": "11.58.0-alpha.
|
|
40
|
-
"@gooddata/sdk-ui-ext": "11.58.0-alpha.
|
|
41
|
-
"@gooddata/sdk-ui-
|
|
42
|
-
"@gooddata/sdk-ui-
|
|
43
|
-
"@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.
|
|
44
|
-
"@gooddata/
|
|
45
|
-
"@gooddata/
|
|
32
|
+
"@gooddata/sdk-backend-base": "11.58.0-alpha.4",
|
|
33
|
+
"@gooddata/sdk-embedding": "11.58.0-alpha.4",
|
|
34
|
+
"@gooddata/sdk-backend-spi": "11.58.0-alpha.4",
|
|
35
|
+
"@gooddata/sdk-backend-tiger": "11.58.0-alpha.4",
|
|
36
|
+
"@gooddata/sdk-model": "11.58.0-alpha.4",
|
|
37
|
+
"@gooddata/sdk-pluggable-application-model": "11.58.0-alpha.4",
|
|
38
|
+
"@gooddata/sdk-ui": "11.58.0-alpha.4",
|
|
39
|
+
"@gooddata/sdk-ui-application-header": "11.58.0-alpha.4",
|
|
40
|
+
"@gooddata/sdk-ui-ext": "11.58.0-alpha.4",
|
|
41
|
+
"@gooddata/sdk-ui-gen-ai": "11.58.0-alpha.4",
|
|
42
|
+
"@gooddata/sdk-ui-kit": "11.58.0-alpha.4",
|
|
43
|
+
"@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.4",
|
|
44
|
+
"@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.4",
|
|
45
|
+
"@gooddata/util": "11.58.0-alpha.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@microsoft/api-documenter": "7.30.10",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"vite": "8.0.16",
|
|
82
82
|
"vitest": "4.1.11",
|
|
83
83
|
"vitest-dom": "0.1.1",
|
|
84
|
-
"@gooddata/oxlint-config": "11.58.0-alpha.
|
|
85
|
-
"@gooddata/eslint-config": "11.58.0-alpha.
|
|
84
|
+
"@gooddata/oxlint-config": "11.58.0-alpha.4",
|
|
85
|
+
"@gooddata/eslint-config": "11.58.0-alpha.4"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": ">=18.3.1",
|