@burdenoff/microfe-workspaces 2026.1130.3 → 2026.1202.1
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.
|
@@ -5,11 +5,14 @@ export interface OpenableWorkspace {
|
|
|
5
5
|
orgId?: string | null;
|
|
6
6
|
tenantId?: unknown;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/** `ActiveContextValue.setContext`: commits several context fields in one update. */
|
|
9
|
+
export interface WorkspaceSelectionCommit {
|
|
10
|
+
setContext: (context: {
|
|
11
|
+
organizationId?: string | null;
|
|
12
|
+
workspaceId?: string | null;
|
|
13
|
+
projectId?: string | null;
|
|
14
|
+
tenantId?: string | null;
|
|
15
|
+
}) => void;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Commits `workspace` as the active selection (BOFF-2821 G1, BOFF-7187).
|
|
@@ -19,8 +22,16 @@ export interface WorkspaceSelectionSetters {
|
|
|
19
22
|
* the request is scoped to. A detail page opened for any other workspace gets
|
|
20
23
|
* `null` back and renders "Workspace not found". Setting the selection also
|
|
21
24
|
* re-issues the token and syncs the `?workspace=…` query.
|
|
25
|
+
*
|
|
26
|
+
* BOFF-18027: the organization, workspace, cleared project and tenant go in ONE
|
|
27
|
+
* `setContext` call. Written one field at a time, the shell's listeners briefly
|
|
28
|
+
* saw the new workspace with the previous workspace's project and minted a
|
|
29
|
+
* workspace token for that pair, which the issuer refused (prod, 2026-12-02:
|
|
30
|
+
* 3 mints, 2 of them refused, per card switch). On fe-libs 2026.1202 and later
|
|
31
|
+
* the provider writes every field before it notifies anyone; an older host's
|
|
32
|
+
* `setContext` calls the same setters in the same order as before.
|
|
22
33
|
*/
|
|
23
|
-
export declare function commitWorkspaceSelection(
|
|
34
|
+
export declare function commitWorkspaceSelection(commit: WorkspaceSelectionCommit, workspace: OpenableWorkspace): void;
|
|
24
35
|
/**
|
|
25
36
|
* Opens a workspace's detail page with that workspace committed as the active
|
|
26
37
|
* selection. Use it for every navigation into `/<workspaceId>`, including the
|
|
@@ -6,24 +6,21 @@ import { useNavigate as i } from "react-router";
|
|
|
6
6
|
// src/hooks/useOpenWorkspace.ts
|
|
7
7
|
function a(e, t) {
|
|
8
8
|
let n = t.organizationId ?? t.orgId;
|
|
9
|
-
|
|
9
|
+
e.setContext({
|
|
10
|
+
...n ? { organizationId: n } : {},
|
|
11
|
+
workspaceId: t.id,
|
|
12
|
+
projectId: null,
|
|
13
|
+
...typeof t.tenantId == "string" ? { tenantId: t.tenantId } : {}
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
16
|
function o() {
|
|
12
|
-
let o = i(), { basePath: s = "/" } = e(), { withCurrentSearch: c } = t(), {
|
|
17
|
+
let o = i(), { basePath: s = "/" } = e(), { withCurrentSearch: c } = t(), { setContext: l } = r();
|
|
13
18
|
return n((e) => {
|
|
14
|
-
a({
|
|
15
|
-
setOrganization: l,
|
|
16
|
-
setWorkspace: u,
|
|
17
|
-
setProject: d,
|
|
18
|
-
setTenant: f
|
|
19
|
-
}, e), o(c(`${s}/${e.id}`));
|
|
19
|
+
a({ setContext: l }, e), o(c(`${s}/${e.id}`));
|
|
20
20
|
}, [
|
|
21
21
|
s,
|
|
22
22
|
o,
|
|
23
23
|
l,
|
|
24
|
-
d,
|
|
25
|
-
f,
|
|
26
|
-
u,
|
|
27
24
|
c
|
|
28
25
|
]);
|
|
29
26
|
}
|