@stapel/workspaces-react 0.11.1 → 0.11.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 +48 -0
- package/dist/default/MembersManager.d.ts.map +1 -1
- package/dist/default/MembersManager.js +6 -2
- package/dist/default/MembersManager.js.map +1 -1
- package/dist/default/WorkspaceSettings.d.ts.map +1 -1
- package/dist/default/WorkspaceSettings.js +7 -3
- package/dist/default/WorkspaceSettings.js.map +1 -1
- package/llms.txt +1 -1
- package/manifest.json +1 -1
- package/package.json +4 -4
- package/src/analytics/generated/events.json +1 -1
- package/src/default/MembersManager.tsx +6 -2
- package/src/default/WorkspaceSettings.tsx +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @stapel/workspaces-react
|
|
2
2
|
|
|
3
|
+
## 0.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3ac8297: fix: the error surface a 500 puts on screen — readable, and in the user's language
|
|
8
|
+
|
|
9
|
+
Two defects an owner hit behind a backend 500 on a live sandbox, both fixed at
|
|
10
|
+
their root rather than at the one alert that showed them.
|
|
11
|
+
|
|
12
|
+
**The alert was unreadable on a dark deployment.** `@stapel/tokens-antd`'s
|
|
13
|
+
`readLiveCssVar` served the host's LIVE `--stapel-*` custom properties for
|
|
14
|
+
whatever mode the caller asked for — but those properties resolve through the
|
|
15
|
+
document's active `data-theme`, so they are the DOCUMENT's mode, not the
|
|
16
|
+
caller's. A default skin defaulting `mode` to `"light"` inside
|
|
17
|
+
`<html data-theme="dark">` therefore got antd's LIGHT algorithm (deriving
|
|
18
|
+
`--ant-color-error-bg: #fff2f0`, near-white) welded to a LIVE DARK
|
|
19
|
+
`--ant-color-text: #f4f5f7` — measured 1.00:1 contrast.
|
|
20
|
+
|
|
21
|
+
- `resolveThemeMode()` (new export) reads the same `data-theme` attribute
|
|
22
|
+
`@stapel/tokens`' `tokens.css` keys its dark block on. `mode` is now optional
|
|
23
|
+
on `toAntdTheme`/`toAntdThemeConfig` and defaults to it.
|
|
24
|
+
- `readLiveCssVar` serves a live value only when the document is in the mode
|
|
25
|
+
being asked for; otherwise the compiled-in default for the REQUESTED mode.
|
|
26
|
+
The bridge can no longer emit a blended theme.
|
|
27
|
+
- Every `@stapel/profiles-react` default skin defaults `mode` to
|
|
28
|
+
`resolveThemeMode()` instead of `"light"`, so it self-themes with no host
|
|
29
|
+
wiring. Pass `mode` explicitly to pin a side.
|
|
30
|
+
|
|
31
|
+
**The alert showed `Request failed with status 500`.** That is
|
|
32
|
+
`parseErrorEnvelope`'s own diagnostic for a response with no error envelope (a
|
|
33
|
+
Django 500 under `DEBUG=False` returns HTML) — the HTTP client's internals, in
|
|
34
|
+
English, on a Russian UI. The one-dialect machinery existed but had no rung a
|
|
35
|
+
query/mutation-driven skin could reach, and no catalogue behind the codes core
|
|
36
|
+
itself mints.
|
|
37
|
+
|
|
38
|
+
- `@stapel/core` now ships an error FLOOR (`stapel.http.*`,
|
|
39
|
+
`stapel.transport.failed`, `stapel.error.unknown`) in en and ru, seeded by
|
|
40
|
+
`createI18n` under every locale before any caller bundle — a host wires
|
|
41
|
+
nothing, and any pair or host bundle registered later still wins the key.
|
|
42
|
+
- `useErrorText()` (new export) folds ANY thrown value into that dialect in one
|
|
43
|
+
call, which is what a skin holding `error: unknown` needed.
|
|
44
|
+
- `formatFlowError` exposes the error's HTTP `{status}` to templates and widens
|
|
45
|
+
core's OWN `stapel.http.<status>` codes to a class-wide `stapel.http.5xx`
|
|
46
|
+
entry. Real backend codes are never widened — two different 404s stay two
|
|
47
|
+
different states.
|
|
48
|
+
- Default skins across profiles-react, auth-react, notifications-react and
|
|
49
|
+
workspaces-react now render `useErrorText(...)` instead of `error.message`.
|
|
50
|
+
|
|
3
51
|
## 0.11.1
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MembersManager.d.ts","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAU1C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"MembersManager.d.ts","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAU1C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CA8JvE"}
|
|
@@ -16,13 +16,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
*/
|
|
17
17
|
import { useState } from "react";
|
|
18
18
|
import { Alert, Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
|
|
19
|
-
import { useT } from "@stapel/core";
|
|
19
|
+
import { useErrorText, useT } from "@stapel/core";
|
|
20
20
|
import { Members } from "../headless/Members.js";
|
|
21
21
|
import { RoleSelect } from "../headless/RoleSelect.js";
|
|
22
22
|
import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
|
|
23
23
|
const DEFAULT_INVITE_ROLE = "member";
|
|
24
24
|
export function MembersManager(props) {
|
|
25
25
|
const t = useT();
|
|
26
|
+
// Never the raw `.message` — for a response with no error envelope that
|
|
27
|
+
// is the transport's own "Request failed with status 500" (owner report
|
|
28
|
+
// 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
|
|
29
|
+
const errorText = useErrorText(WORKSPACES_I18N_KEYS.unknownError);
|
|
26
30
|
const canManage = props.canManage ?? true;
|
|
27
31
|
const [inviteOpen, setInviteOpen] = useState(false);
|
|
28
32
|
const [emailsText, setEmailsText] = useState("");
|
|
@@ -76,7 +80,7 @@ export function MembersManager(props) {
|
|
|
76
80
|
]
|
|
77
81
|
: []),
|
|
78
82
|
];
|
|
79
|
-
return (_jsxs(Card, { "data-testid": "members-manager", children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.membersTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.membersSubtitle) })] }), canManage && (_jsx(Button, { type: "primary", onClick: openInvite, "data-analytics": "none", "data-analytics-reason": "local-ui-open-invite-dialog", children: t(WORKSPACES_I18N_KEYS.membersInvite) }))] }), isError && error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: error
|
|
83
|
+
return (_jsxs(Card, { "data-testid": "members-manager", children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.membersTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.membersSubtitle) })] }), canManage && (_jsx(Button, { type: "primary", onClick: openInvite, "data-analytics": "none", "data-analytics-reason": "local-ui-open-invite-dialog", children: t(WORKSPACES_I18N_KEYS.membersInvite) }))] }), isError && error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: errorText(error) })), _jsx(Table, { style: { marginTop: 16 }, size: "small", loading: isLoading, rowKey: (member) => member.id, dataSource: members, columns: columns, pagination: false }), _jsx(Modal, { title: t(WORKSPACES_I18N_KEYS.membersInviteDialogTitle), open: inviteOpen, onCancel: () => setInviteOpen(false), onOk: submitInvite, okButtonProps: { loading: isInviting, disabled: emailsText.trim().length === 0 }, children: _jsxs("div", { style: { display: "grid", gap: 12 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteEmailsLabel) }), _jsx(Input, { value: emailsText, onChange: (e) => setEmailsText(e.target.value), placeholder: t(WORKSPACES_I18N_KEYS.membersInviteEmailsPlaceholder) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.membersInviteRoleLabel) }), _jsx(Select, { value: inviteRole, onChange: setInviteRole, style: { width: "100%" }, loading: rolesBag.isLoading, options: inviteRoleOptions })] })] }) })] }));
|
|
80
84
|
} })) }));
|
|
81
85
|
}
|
|
82
86
|
//# sourceMappingURL=MembersManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MembersManager.js","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEhG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MembersManager.js","sourceRoot":"","sources":["../../src/default/MembersManager.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAA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AAoB,CAAC,8BAA8B,CAAC,GACnE,IACE,EACN,0BACE,KAAC,UAAU,CAAC,IAAI,cAAE,CAAC,CAAC,oBAAoB,CAAC,sBAAsB,CAAC,GAAmB,EACnF,KAAC,MAAM,IACL,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,QAAQ,CAAC,SAAS,EAC3B,OAAO,EAAE,iBAAiB,GAC1B,IACE,IACF,GACA,IACH,CACR,CAAC;YACJ,CAAC,GACO,CACX,GACU,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceSettings.d.ts","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB;gEAC4D;IAC5D,SAAS,CAAC,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"WorkspaceSettings.d.ts","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB;gEAC4D;IAC5D,SAAS,CAAC,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CA4G7E"}
|
|
@@ -9,12 +9,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
*/
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
11
|
import { Alert, Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
|
|
12
|
-
import { useT } from "@stapel/core";
|
|
12
|
+
import { useErrorText, useT } from "@stapel/core";
|
|
13
13
|
import { useWorkspace } from "../model/queries.js";
|
|
14
14
|
import { useUpdateWorkspace, useDeleteWorkspace } from "../model/mutations.js";
|
|
15
15
|
import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
|
|
16
16
|
export function WorkspaceSettings(props) {
|
|
17
17
|
const t = useT();
|
|
18
|
+
// Never the raw `.message` — for a response with no error envelope that
|
|
19
|
+
// is the transport's own "Request failed with status 500" (owner report
|
|
20
|
+
// 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
|
|
21
|
+
const errorText = useErrorText(WORKSPACES_I18N_KEYS.unknownError);
|
|
18
22
|
const query = useWorkspace(props.workspaceId);
|
|
19
23
|
const updateMutation = useUpdateWorkspace(props.workspaceId);
|
|
20
24
|
const deleteMutation = useDeleteWorkspace();
|
|
@@ -36,9 +40,9 @@ export function WorkspaceSettings(props) {
|
|
|
36
40
|
return _jsx(Spin, { "data-testid": "workspace-settings-loading" });
|
|
37
41
|
}
|
|
38
42
|
if (!workspace) {
|
|
39
|
-
return (_jsx(Alert, { "data-testid": "workspace-settings-error", type: "error", showIcon: true, message: query.error
|
|
43
|
+
return (_jsx(Alert, { "data-testid": "workspace-settings-error", type: "error", showIcon: true, message: errorText(query.error) ?? t(WORKSPACES_I18N_KEYS.unknownError) }));
|
|
40
44
|
}
|
|
41
45
|
const isOwner = workspace.my_role === "owner";
|
|
42
|
-
return (_jsxs("div", { "data-testid": "workspace-settings", style: { display: "grid", gap: 16 }, children: [_jsxs(Card, { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.settingsTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.settingsSubtitle) }), _jsxs("div", { style: { display: "grid", gap: 12, maxWidth: 480, marginTop: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldName) }), _jsx(Input, { value: name, onChange: (e) => setName(e.target.value), disabled: !isOwner })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldSlug) }), _jsx("div", { children: _jsx(Typography.Text, { code: true, children: workspace.slug }) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldType) }), _jsx("div", { children: _jsx(Badge, { status: "default", text: workspace.type }) })] })] }), updateMutation.error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: updateMutation.error
|
|
46
|
+
return (_jsxs("div", { "data-testid": "workspace-settings", style: { display: "grid", gap: 16 }, children: [_jsxs(Card, { children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.settingsTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.settingsSubtitle) }), _jsxs("div", { style: { display: "grid", gap: 12, maxWidth: 480, marginTop: 16 }, children: [_jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldName) }), _jsx(Input, { value: name, onChange: (e) => setName(e.target.value), disabled: !isOwner })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldSlug) }), _jsx("div", { children: _jsx(Typography.Text, { code: true, children: workspace.slug }) })] }), _jsxs("div", { children: [_jsx(Typography.Text, { children: t(WORKSPACES_I18N_KEYS.fieldType) }), _jsx("div", { children: _jsx(Badge, { status: "default", text: workspace.type }) })] })] }), updateMutation.error && (_jsx(Alert, { style: { marginTop: 12 }, type: "error", showIcon: true, message: errorText(updateMutation.error) })), _jsx(Button, { type: "primary", style: { marginTop: 16 }, loading: updateMutation.isPending, disabled: !isOwner || !name.trim(), onClick: handleSave, "data-analytics": "none", "data-analytics-reason": "business action \u2014 host app wraps with its own tracked(); pairs carry no @stapel/analytics runtime dependency by architecture", children: updateMutation.isPending ? t(WORKSPACES_I18N_KEYS.saving) : t(WORKSPACES_I18N_KEYS.save) })] }), isOwner && (_jsxs(Card, { children: [_jsx(Typography.Title, { level: 5, type: "danger", style: { marginTop: 0 }, children: t(WORKSPACES_I18N_KEYS.dangerZoneTitle) }), _jsx(Popconfirm, { title: t(WORKSPACES_I18N_KEYS.deleteWorkspaceConfirm), onConfirm: handleDelete, okButtonProps: { loading: deleteMutation.isPending, danger: true }, children: _jsx(Button, { danger: true, children: t(WORKSPACES_I18N_KEYS.deleteWorkspace) }) })] }))] }));
|
|
43
47
|
}
|
|
44
48
|
//# sourceMappingURL=WorkspaceSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceSettings.js","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspaceSettings.js","sourceRoot":"","sources":["../../src/default/WorkspaceSettings.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE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IACG,CACP,CAAC;AACJ,CAAC"}
|
package/llms.txt
CHANGED
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/workspaces-react",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Headless React flow pair for stapel-workspaces: typed API client, TanStack Query hooks, flow machines, headless components, and i18n keys. Zero visual opinion.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"size-limit": "^11.2.0",
|
|
83
83
|
"typescript": "^5.8.3",
|
|
84
84
|
"vitest": "^3.2.4",
|
|
85
|
-
"@stapel/core": "^0.
|
|
86
|
-
"@stapel/
|
|
87
|
-
"@stapel/
|
|
85
|
+
"@stapel/core": "^0.11.0",
|
|
86
|
+
"@stapel/showcase": "^0.2.0",
|
|
87
|
+
"@stapel/tokens": "^0.5.0"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22"
|
|
@@ -17,7 +17,7 @@ import { useState } from "react";
|
|
|
17
17
|
import type { ReactElement } from "react";
|
|
18
18
|
import { Alert, Button, Card, Input, Modal, Popconfirm, Select, Table, Typography } from "antd";
|
|
19
19
|
import type { TableProps } from "antd";
|
|
20
|
-
import { useT } from "@stapel/core";
|
|
20
|
+
import { useErrorText, useT } from "@stapel/core";
|
|
21
21
|
import { Members } from "../headless/Members.js";
|
|
22
22
|
import { RoleSelect } from "../headless/RoleSelect.js";
|
|
23
23
|
import type { RoleSelectBag } from "../headless/RoleSelect.js";
|
|
@@ -40,6 +40,10 @@ const DEFAULT_INVITE_ROLE = "member";
|
|
|
40
40
|
|
|
41
41
|
export function MembersManager(props: MembersManagerProps): ReactElement {
|
|
42
42
|
const t = useT();
|
|
43
|
+
// Never the raw `.message` — for a response with no error envelope that
|
|
44
|
+
// is the transport's own "Request failed with status 500" (owner report
|
|
45
|
+
// 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
|
|
46
|
+
const errorText = useErrorText(WORKSPACES_I18N_KEYS.unknownError);
|
|
43
47
|
const canManage = props.canManage ?? true;
|
|
44
48
|
const [inviteOpen, setInviteOpen] = useState(false);
|
|
45
49
|
const [emailsText, setEmailsText] = useState("");
|
|
@@ -144,7 +148,7 @@ export function MembersManager(props: MembersManagerProps): ReactElement {
|
|
|
144
148
|
</div>
|
|
145
149
|
|
|
146
150
|
{isError && error && (
|
|
147
|
-
<Alert style={{ marginTop: 12 }} type="error" showIcon message={error
|
|
151
|
+
<Alert style={{ marginTop: 12 }} type="error" showIcon message={errorText(error)} />
|
|
148
152
|
)}
|
|
149
153
|
|
|
150
154
|
<Table<Member>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import type { ReactElement } from "react";
|
|
11
11
|
import { Alert, Badge, Button, Card, Input, Popconfirm, Spin, Typography } from "antd";
|
|
12
|
-
import { useT } from "@stapel/core";
|
|
12
|
+
import { useErrorText, useT } from "@stapel/core";
|
|
13
13
|
import { useWorkspace } from "../model/queries.js";
|
|
14
14
|
import { useUpdateWorkspace, useDeleteWorkspace } from "../model/mutations.js";
|
|
15
15
|
import { WORKSPACES_I18N_KEYS } from "../i18n/keys.js";
|
|
@@ -23,6 +23,10 @@ export interface WorkspaceSettingsProps {
|
|
|
23
23
|
|
|
24
24
|
export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
|
|
25
25
|
const t = useT();
|
|
26
|
+
// Never the raw `.message` — for a response with no error envelope that
|
|
27
|
+
// is the transport's own "Request failed with status 500" (owner report
|
|
28
|
+
// 2026-08-09). `useErrorText` folds any thrown value into the one dialect.
|
|
29
|
+
const errorText = useErrorText(WORKSPACES_I18N_KEYS.unknownError);
|
|
26
30
|
const query = useWorkspace(props.workspaceId);
|
|
27
31
|
const updateMutation = useUpdateWorkspace(props.workspaceId);
|
|
28
32
|
const deleteMutation = useDeleteWorkspace();
|
|
@@ -53,7 +57,7 @@ export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
|
|
|
53
57
|
data-testid="workspace-settings-error"
|
|
54
58
|
type="error"
|
|
55
59
|
showIcon
|
|
56
|
-
message={query.error
|
|
60
|
+
message={errorText(query.error) ?? t(WORKSPACES_I18N_KEYS.unknownError)}
|
|
57
61
|
/>
|
|
58
62
|
);
|
|
59
63
|
}
|
|
@@ -92,7 +96,7 @@ export function WorkspaceSettings(props: WorkspaceSettingsProps): ReactElement {
|
|
|
92
96
|
style={{ marginTop: 12 }}
|
|
93
97
|
type="error"
|
|
94
98
|
showIcon
|
|
95
|
-
message={updateMutation.error
|
|
99
|
+
message={errorText(updateMutation.error)}
|
|
96
100
|
/>
|
|
97
101
|
)}
|
|
98
102
|
|