@micha.bigler/ui-core-micha 4.35.1 → 4.37.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/CHANGELOG.md +13 -0
- package/README.md +5 -0
- package/dist/chat/ChatThread.js +4 -4
- package/dist/chat/ChatWorkspace.js +2 -2
- package/dist/components/SupportRecoveryRequestsTab.js +14 -4
- package/dist/components/UserListComponent.js +35 -6
- package/dist/i18n/authTranslations.js +48 -0
- package/dist/pages/AccountPage.js +24 -13
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.37.0 - UCM-CHAT-18
|
|
4
|
+
|
|
5
|
+
`ChatWorkspace` and `ChatThread` accept the optional `showReplyCaption` (default `true`). With `false` the line under a finished
|
|
6
|
+
reply (model, effort and, when `usageToTokens` is given, the token count) is not shown. Existing callers keep the line.
|
|
7
|
+
|
|
8
|
+
## 4.36.0 - KZ-UI-2
|
|
9
|
+
|
|
10
|
+
Account invitation controls wait for a usable policy. Failed and denied invitation or
|
|
11
|
+
support loads have distinct states, and retryable failures can recover without showing
|
|
12
|
+
an empty result. `AccountPage` accepts the optional `userListCompact` prop, and
|
|
13
|
+
`UserListComponent` accepts `compact`, to display a responsive directory with last
|
|
14
|
+
login and accessible row details. Existing callers retain the default table.
|
|
15
|
+
|
|
3
16
|
## 4.35.1 - UCM-PRIV-6
|
|
4
17
|
|
|
5
18
|
`PublicFooter` is compact on phones: below the `sm` breakpoint the identity block (logo, tagline, copyright) is hidden,
|
package/README.md
CHANGED
|
@@ -287,6 +287,11 @@ Since 4.29.0 a chat without a message is not listed and "New chat" reuses it. Si
|
|
|
287
287
|
`isChatInUse(chat)` and return `true` for a chat without messages that it created on purpose (for example with released
|
|
288
288
|
excerpts): such a chat stays listed and is never reused, also when it becomes in use while it is open and empty.
|
|
289
289
|
|
|
290
|
+
## Shared chat: model line under replies
|
|
291
|
+
|
|
292
|
+
Each finished reply shows a caption with the model, the effort and, when the host passes `usageToTokens`, the token count.
|
|
293
|
+
A host that shows the model only in the picker passes `showReplyCaption={false}` to `ChatWorkspace` (or `ChatThread`).
|
|
294
|
+
|
|
290
295
|
## Shared chat: host controls
|
|
291
296
|
|
|
292
297
|
`ChatWorkspace` (from `@micha.bigler/ui-core-micha/chat`) takes optional props for apps that put UI around the surface;
|
package/dist/chat/ChatThread.js
CHANGED
|
@@ -18,7 +18,7 @@ function SourceChips({ sources }) {
|
|
|
18
18
|
return null;
|
|
19
19
|
return (_jsx(Stack, { direction: "row", flexWrap: "wrap", gap: 0.75, role: "list", "aria-label": t('Chat.sources'), children: sources.map((source, index) => (_jsx(Tooltip, { title: source.reference || '', describeChild: true, children: _jsx(Chip, { role: "listitem", size: "small", variant: "outlined", label: source.label }) }, `${source.label}-${index}`))) }));
|
|
20
20
|
}
|
|
21
|
-
function Answer({ turn, tool, onRetry, chat, renderAnswerExtra, renderTurnError, usageToTokens, onNavigate }) {
|
|
21
|
+
function Answer({ turn, tool, onRetry, chat, renderAnswerExtra, renderTurnError, usageToTokens, onNavigate, showReplyCaption }) {
|
|
22
22
|
var _a;
|
|
23
23
|
var _b;
|
|
24
24
|
const { t, i18n } = useTranslation();
|
|
@@ -36,13 +36,13 @@ function Answer({ turn, tool, onRetry, chat, renderAnswerExtra, renderTurnError,
|
|
|
36
36
|
}
|
|
37
37
|
return selectionLine(turn, t);
|
|
38
38
|
};
|
|
39
|
-
return (_jsxs(Stack, { spacing: 1, "aria-busy": generating, children: [turn.assistant_text ? _jsx(MarkdownReply, { text: turn.assistant_text, onNavigate: onNavigate }) : null, generating && !turn.assistant_text && !tool ? _jsx(Typography, { variant: "body2", color: "text.secondary", children: t('Chat.typing') }) : null, generating && tool ? _jsx(Chip, { size: "small", color: "primary", variant: "outlined", label: tool.label, sx: CHAT_THREAD_TOOL_CHIP_SX }) : null, !generating && ((_a = turn.tool_steps) === null || _a === void 0 ? void 0 : _a.length) ? _jsx(Stack, { direction: "row", flexWrap: "wrap", gap: 0.75, role: "list", "aria-label": t('Chat.toolSteps'), sx: CHAT_THREAD_TOOL_STEPS_SX, children: turn.tool_steps.map((step, index) => _jsx(Chip, { role: "listitem", size: "small", variant: "outlined", label: step.label, sx: CHAT_THREAD_TOOL_CHIP_SX }, `${step.name || step.label}-${index}`)) }) : null, _jsx(SourceChips, { sources: turn.sources }), !generating && replyCaption(turn) ? _jsx(Typography, { variant: "caption", color: "text.secondary", children: replyCaption(turn) }) : null, renderAnswerExtra ? _jsx(React.Fragment, { children: renderAnswerExtra({ turn, chat, appFrames: (_b = turn.appFrames) !== null && _b !== void 0 ? _b : [] }) }, chat === null || chat === void 0 ? void 0 : chat.id) : null, turn.state === 'interrupted' ? (_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, children: [_jsx(Chip, { size: "small", color: "warning", label: t('Chat.interrupted') }), onRetry ? _jsx(Button, { size: "small", onClick: () => onRetry(turn), children: t('Chat.retry') }) : null] })) : null, failed ? (hasCustomTurnError ? turnError : _jsx(Alert, { severity: "error", action: onRetry ? _jsx(Button, { color: "inherit", size: "small", onClick: () => onRetry(turn), children: t('Chat.retry') }) : null, children: t('Chat.answerIncomplete') })) : null] }));
|
|
39
|
+
return (_jsxs(Stack, { spacing: 1, "aria-busy": generating, children: [turn.assistant_text ? _jsx(MarkdownReply, { text: turn.assistant_text, onNavigate: onNavigate }) : null, generating && !turn.assistant_text && !tool ? _jsx(Typography, { variant: "body2", color: "text.secondary", children: t('Chat.typing') }) : null, generating && tool ? _jsx(Chip, { size: "small", color: "primary", variant: "outlined", label: tool.label, sx: CHAT_THREAD_TOOL_CHIP_SX }) : null, !generating && ((_a = turn.tool_steps) === null || _a === void 0 ? void 0 : _a.length) ? _jsx(Stack, { direction: "row", flexWrap: "wrap", gap: 0.75, role: "list", "aria-label": t('Chat.toolSteps'), sx: CHAT_THREAD_TOOL_STEPS_SX, children: turn.tool_steps.map((step, index) => _jsx(Chip, { role: "listitem", size: "small", variant: "outlined", label: step.label, sx: CHAT_THREAD_TOOL_CHIP_SX }, `${step.name || step.label}-${index}`)) }) : null, _jsx(SourceChips, { sources: turn.sources }), showReplyCaption && !generating && replyCaption(turn) ? _jsx(Typography, { variant: "caption", color: "text.secondary", children: replyCaption(turn) }) : null, renderAnswerExtra ? _jsx(React.Fragment, { children: renderAnswerExtra({ turn, chat, appFrames: (_b = turn.appFrames) !== null && _b !== void 0 ? _b : [] }) }, chat === null || chat === void 0 ? void 0 : chat.id) : null, turn.state === 'interrupted' ? (_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, children: [_jsx(Chip, { size: "small", color: "warning", label: t('Chat.interrupted') }), onRetry ? _jsx(Button, { size: "small", onClick: () => onRetry(turn), children: t('Chat.retry') }) : null] })) : null, failed ? (hasCustomTurnError ? turnError : _jsx(Alert, { severity: "error", action: onRetry ? _jsx(Button, { color: "inherit", size: "small", onClick: () => onRetry(turn), children: t('Chat.retry') }) : null, children: t('Chat.answerIncomplete') })) : null] }));
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* The turns of one chat. The streaming answer is simply the last turn in state `generating`; the caller keeps its text
|
|
43
43
|
* up to date. `notice` is a connection or limit message shown under the last turn. `readOnly` (an archived chat) hides Retry.
|
|
44
44
|
*/
|
|
45
|
-
export function ChatThread({ turns = [], tool = null, notice = null, hasOlder = false, olderBusy = false, onLoadOlder, onRetry, readOnly = false, sx, chat, renderAnswerExtra, renderTurnError, summary = null, usageToTokens, onNavigate }) {
|
|
45
|
+
export function ChatThread({ turns = [], tool = null, notice = null, hasOlder = false, olderBusy = false, onLoadOlder, onRetry, readOnly = false, sx, chat, renderAnswerExtra, renderTurnError, summary = null, usageToTokens, onNavigate, showReplyCaption = true }) {
|
|
46
46
|
var _a, _b;
|
|
47
47
|
const { t } = useTranslation();
|
|
48
48
|
const end = useRef(null);
|
|
@@ -121,7 +121,7 @@ export function ChatThread({ turns = [], tool = null, notice = null, hasOlder =
|
|
|
121
121
|
}, role: "log", "aria-live": "polite", "aria-label": t('Chat.thread'), sx: Object.assign(Object.assign({}, CHAT_THREAD_SCROLL_SX), sx), children: _jsxs("div", { ref: content, children: [hasOlder ? (_jsx(Box, { sx: { textAlign: 'center', mb: 2 }, children: _jsx(Button, { size: "small", onClick: loadOlder, disabled: olderBusy, children: t('Chat.loadOlder') }) })) : null, turns.length === 0 ? (_jsx(Typography, { variant: "h6", color: "text.secondary", align: "center", sx: { mt: 6 }, children: t('Chat.emptyTitle') })) : null, turns.map((turn, index) => {
|
|
122
122
|
var _a;
|
|
123
123
|
const previous = turns[index - 1];
|
|
124
|
-
return (_jsxs(Box, { sx: CHAT_THREAD_TURN_SX, children: [!summaryRendered && summaryVisible && turn.seq > summary.up_to_seq ? (summaryRendered = true, renderSummary()) : null, previous && !sameSelection(previous, turn) ? (_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: { mb: 2, color: 'text.secondary' }, role: "separator", children: [_jsx(Box, { sx: { flex: 1, borderTop: 1, borderColor: 'divider' } }), _jsx(Typography, { variant: "caption", children: t('Chat.modelChanged', { model: selectionLine(turn, t) }) }), _jsx(Box, { sx: { flex: 1, borderTop: 1, borderColor: 'divider' } })] })) : null, _jsx(Box, { sx: { display: 'flex', justifyContent: 'flex-end', mb: 1.5 }, children: _jsx(Typography, { sx: { maxWidth: '85%', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', bgcolor: 'action.hover', borderRadius: 2, px: 1.5, py: 1 }, children: turn.user_text }) }), _jsx(Answer, { turn: turn, tool: index === turns.length - 1 ? tool : null, onRetry: readOnly ? undefined : onRetry, chat: chat, renderAnswerExtra: renderAnswerExtra, renderTurnError: renderTurnError, usageToTokens: usageToTokens, onNavigate: onNavigate })] }, (_a = turn.id) !== null && _a !== void 0 ? _a : index));
|
|
124
|
+
return (_jsxs(Box, { sx: CHAT_THREAD_TURN_SX, children: [!summaryRendered && summaryVisible && turn.seq > summary.up_to_seq ? (summaryRendered = true, renderSummary()) : null, previous && !sameSelection(previous, turn) ? (_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: { mb: 2, color: 'text.secondary' }, role: "separator", children: [_jsx(Box, { sx: { flex: 1, borderTop: 1, borderColor: 'divider' } }), _jsx(Typography, { variant: "caption", children: t('Chat.modelChanged', { model: selectionLine(turn, t) }) }), _jsx(Box, { sx: { flex: 1, borderTop: 1, borderColor: 'divider' } })] })) : null, _jsx(Box, { sx: { display: 'flex', justifyContent: 'flex-end', mb: 1.5 }, children: _jsx(Typography, { sx: { maxWidth: '85%', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', bgcolor: 'action.hover', borderRadius: 2, px: 1.5, py: 1 }, children: turn.user_text }) }), _jsx(Answer, { turn: turn, tool: index === turns.length - 1 ? tool : null, onRetry: readOnly ? undefined : onRetry, chat: chat, renderAnswerExtra: renderAnswerExtra, renderTurnError: renderTurnError, usageToTokens: usageToTokens, onNavigate: onNavigate, showReplyCaption: showReplyCaption })] }, (_a = turn.id) !== null && _a !== void 0 ? _a : index));
|
|
125
125
|
}), !summaryRendered ? renderSummary() : null, notice ? (_jsx(Alert, { severity: notice.severity || 'warning', sx: CHAT_THREAD_NOTICE_SX, action: notice.action ? _jsx(Button, { color: "inherit", size: "small", onClick: notice.action.onClick, children: notice.action.label }) : null, children: notice.text })) : null, _jsx("div", { ref: end })] }) }));
|
|
126
126
|
}
|
|
127
127
|
export default ChatThread;
|
|
@@ -68,7 +68,7 @@ const appendDelta = (turns, text) => {
|
|
|
68
68
|
* that becomes in use while it is open and empty. Without it a chat without messages is hidden and reused, as in 4.29.0).
|
|
69
69
|
*/
|
|
70
70
|
export const CHAT_WORKSPACE_SIDE_PANEL_SX = { borderLeft: 1, borderColor: 'divider', minHeight: 0, overflow: 'auto', contain: 'strict' };
|
|
71
|
-
export function ChatWorkspace({ apiBase, wsUrl, api: apiOverrides, scope, preloadedChats, sx, unavailableReasonText, sidePanel, sidePanelLabel, renderAnswerExtra, renderTurnError, renderComposerExtra, composerLayout = 'standard', renderComposerContext, onAppFrame, onNavigate, activeChatId, onActiveChatChange, onComposeStart, composerPrefill, getSendContext, sendRequest, onSendRequestHandled, layout = 'viewport', compactBelow = 720, tokenBalance = null, usageToTokens, longChatTokens = 40000, isChatInUse }) {
|
|
71
|
+
export function ChatWorkspace({ apiBase, wsUrl, api: apiOverrides, scope, preloadedChats, sx, unavailableReasonText, sidePanel, sidePanelLabel, renderAnswerExtra, renderTurnError, renderComposerExtra, composerLayout = 'standard', renderComposerContext, onAppFrame, onNavigate, activeChatId, onActiveChatChange, onComposeStart, composerPrefill, getSendContext, sendRequest, onSendRequestHandled, layout = 'viewport', compactBelow = 720, tokenBalance = null, usageToTokens, longChatTokens = 40000, isChatInUse, showReplyCaption = true }) {
|
|
72
72
|
var _a;
|
|
73
73
|
const { t } = useTranslation();
|
|
74
74
|
const theme = useTheme();
|
|
@@ -660,7 +660,7 @@ export function ChatWorkspace({ apiBase, wsUrl, api: apiOverrides, scope, preloa
|
|
|
660
660
|
if (unavailable) {
|
|
661
661
|
return (_jsx(Stack, { alignItems: "center", justifyContent: "center", spacing: 1, sx: Object.assign({ minHeight: 320, p: 3, textAlign: 'center' }, sx), children: _jsx(Typography, { color: "text.secondary", children: unavailableText || t('Chat.notAvailableHere') }) }));
|
|
662
662
|
}
|
|
663
|
-
return (_jsxs(Box, { ref: rootRef, sx: Object.assign({ display: 'grid', gridTemplateColumns: narrow ? 'minmax(0, 1fr)' : `minmax(240px, 320px) minmax(0, 1fr)${chat && sidePanel ? ' minmax(240px, 320px)' : ''}`, height: '100%', minHeight: 480, border: 1, borderColor: 'divider', borderRadius: 1, overflow: 'hidden', bgcolor: 'background.paper' }, sx), children: [narrow ? null : _jsx(Box, { sx: { borderRight: 1, borderColor: 'divider', minHeight: 0 }, children: list }), _jsxs(Stack, { sx: { minWidth: 0, minHeight: 0 }, children: [_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: { px: 1.5, py: 0.5, borderBottom: 1, borderColor: 'divider', minHeight: narrow ? 44 : 56 }, children: [narrow ? _jsx(Button, { color: "inherit", onClick: () => setListOpen(true), children: t('Chat.chats') }) : null, _jsx(Typography, { noWrap: true, sx: { flex: 1, fontWeight: 600 }, children: chat ? (chat.title || t('Chat.untitled')) : '' }), socket.status === 'connecting' && openedOnce ? _jsx(Chip, { size: "small", color: "warning", variant: "outlined", label: t('Chat.reconnecting') }) : null, isArchived ? _jsx(Chip, { size: "small", label: t('Chat.archived') }) : null, isArchived ? _jsx(Button, { size: "small", onClick: () => updateChat(chat, { archived: false }), children: t('Chat.restore') }) : null, chat && sidePanel && narrow ? _jsx(Button, { color: "inherit", onClick: () => setSidePanelOpen(true), children: sidePanelLabel || t('Chat.sidePanel') }) : null] }), chat ? (_jsxs(_Fragment, { children: [_jsx(ChatThread, { turns: turns, chat: chat, renderAnswerExtra: answerExtra, renderTurnError: renderTurnError, tool: tool, notice: noticeFor(), hasOlder: Boolean(olderCursor), olderBusy: olderBusy, onLoadOlder: loadOlder, onRetry: retry, readOnly: isArchived, summary: summary, usageToTokens: usageToTokens, onNavigate: onNavigate }), isArchived ? _jsx(Typography, { variant: "caption", color: "text.secondary", sx: { px: 2, pb: 1 }, children: t('Chat.archivedReadOnly') }) : null, renderComposerExtra ? _jsx(Box, { children: renderComposerExtra({ chat }) }, chat.id) : null, composerLayout !== 'compact' && longChat ? _jsx(Alert, { severity: "info", action: _jsx(Button, { color: "inherit", size: "small", onClick: createChat, children: t('Chat.newConversation') }), children: t('Chat.longChat') }) : null, _jsx(ChatComposer, { layout: composerLayout, onComposeStart: composeStart, context: composerLayout === 'compact' ? renderComposerContext === null || renderComposerContext === void 0 ? void 0 : renderComposerContext({ chat }) : undefined, notice: composerLayout === 'compact' && longChat && !dismissedComposerNotices.has(`${chat.id}:long-chat`) ? {
|
|
663
|
+
return (_jsxs(Box, { ref: rootRef, sx: Object.assign({ display: 'grid', gridTemplateColumns: narrow ? 'minmax(0, 1fr)' : `minmax(240px, 320px) minmax(0, 1fr)${chat && sidePanel ? ' minmax(240px, 320px)' : ''}`, height: '100%', minHeight: 480, border: 1, borderColor: 'divider', borderRadius: 1, overflow: 'hidden', bgcolor: 'background.paper' }, sx), children: [narrow ? null : _jsx(Box, { sx: { borderRight: 1, borderColor: 'divider', minHeight: 0 }, children: list }), _jsxs(Stack, { sx: { minWidth: 0, minHeight: 0 }, children: [_jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, sx: { px: 1.5, py: 0.5, borderBottom: 1, borderColor: 'divider', minHeight: narrow ? 44 : 56 }, children: [narrow ? _jsx(Button, { color: "inherit", onClick: () => setListOpen(true), children: t('Chat.chats') }) : null, _jsx(Typography, { noWrap: true, sx: { flex: 1, fontWeight: 600 }, children: chat ? (chat.title || t('Chat.untitled')) : '' }), socket.status === 'connecting' && openedOnce ? _jsx(Chip, { size: "small", color: "warning", variant: "outlined", label: t('Chat.reconnecting') }) : null, isArchived ? _jsx(Chip, { size: "small", label: t('Chat.archived') }) : null, isArchived ? _jsx(Button, { size: "small", onClick: () => updateChat(chat, { archived: false }), children: t('Chat.restore') }) : null, chat && sidePanel && narrow ? _jsx(Button, { color: "inherit", onClick: () => setSidePanelOpen(true), children: sidePanelLabel || t('Chat.sidePanel') }) : null] }), chat ? (_jsxs(_Fragment, { children: [_jsx(ChatThread, { turns: turns, chat: chat, renderAnswerExtra: answerExtra, renderTurnError: renderTurnError, tool: tool, notice: noticeFor(), hasOlder: Boolean(olderCursor), olderBusy: olderBusy, onLoadOlder: loadOlder, onRetry: retry, readOnly: isArchived, summary: summary, usageToTokens: usageToTokens, onNavigate: onNavigate, showReplyCaption: showReplyCaption }), isArchived ? _jsx(Typography, { variant: "caption", color: "text.secondary", sx: { px: 2, pb: 1 }, children: t('Chat.archivedReadOnly') }) : null, renderComposerExtra ? _jsx(Box, { children: renderComposerExtra({ chat }) }, chat.id) : null, composerLayout !== 'compact' && longChat ? _jsx(Alert, { severity: "info", action: _jsx(Button, { color: "inherit", size: "small", onClick: createChat, children: t('Chat.newConversation') }), children: t('Chat.longChat') }) : null, _jsx(ChatComposer, { layout: composerLayout, onComposeStart: composeStart, context: composerLayout === 'compact' ? renderComposerContext === null || renderComposerContext === void 0 ? void 0 : renderComposerContext({ chat }) : undefined, notice: composerLayout === 'compact' && longChat && !dismissedComposerNotices.has(`${chat.id}:long-chat`) ? {
|
|
664
664
|
id: 'long-chat', text: t('Chat.longChatShort'), action: t('Chat.newChat'), onAction: createChat,
|
|
665
665
|
onDismiss: () => setDismissedComposerNotices((current) => new Set(current).add(`${chat.id}:long-chat`)),
|
|
666
666
|
} : null, draftRequest: (draftRequest === null || draftRequest === void 0 ? void 0 : draftRequest.chatId) === chat.id ? draftRequest : null, onDraftRequestApplied: onDraftRequestApplied, onSend: (text) => startTurn(text), onStop: () => socket.send({ type: 'stop' }), running: running, archived: isArchived, connected: socket.connected, inputRef: composerInputRef, usageLimit: usageLimit, actions: _jsx(ModelPicker, { entries: catalogue.entries, selection: selection, disabled: isArchived || running || (catalogueLoading && catalogueChatId !== chat.id), open: pickerOpen, onOpenChange: setPickerOpen, onChange: (next) => updateChat(chat, { selection: next }), balance: tokenBalance, shortLabel: composerLayout === 'compact' }) }, `composer-${chat.id}`)] })) : (_jsxs(Stack, { alignItems: "center", justifyContent: "center", spacing: 2, sx: { flex: 1, p: 3 }, children: [_jsx(Typography, { color: "text.secondary", align: "center", children: t('Chat.selectChat') }), _jsx(Button, { variant: "contained", onClick: createChat, children: t('Chat.newChat') })] }))] }), chat && sidePanel && !narrow ? _jsx(Box, { sx: CHAT_WORKSPACE_SIDE_PANEL_SX, children: sidePanel(chat) }, chat.id) : null, narrow && chat && sidePanel ? _jsx(Drawer, { anchor: "right", open: sidePanelOpen, onClose: () => setSidePanelOpen(false), slotProps: { paper: { 'aria-label': sidePanelLabel || t('Chat.sidePanel') } }, children: _jsx(Box, { children: sidePanel(chat) }, chat.id) }) : null, narrow ? _jsx(Drawer, { open: listOpen, onClose: () => setListOpen(false), slotProps: { paper: { sx: { width: 'min(320px, 86vw)' } } }, children: list }) : null] }));
|
|
@@ -17,6 +17,7 @@ export function SupportRecoveryRequestsTab() {
|
|
|
17
17
|
const [requests, setRequests] = useState([]);
|
|
18
18
|
const [loading, setLoading] = useState(true);
|
|
19
19
|
const [errorKey, setErrorKey] = useState(null);
|
|
20
|
+
const [loadError, setLoadError] = useState(null);
|
|
20
21
|
const [statusFilter, setStatusFilter] = useState('pending');
|
|
21
22
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
22
23
|
const [dialogNote, setDialogNote] = useState('');
|
|
@@ -27,14 +28,17 @@ export function SupportRecoveryRequestsTab() {
|
|
|
27
28
|
const [selectedAgentCandidate, setSelectedAgentCandidate] = useState(null);
|
|
28
29
|
const [agentActionUserId, setAgentActionUserId] = useState(null);
|
|
29
30
|
const loadRequests = async () => {
|
|
31
|
+
var _a;
|
|
32
|
+
var _b;
|
|
30
33
|
setLoading(true);
|
|
31
|
-
|
|
34
|
+
setLoadError(null);
|
|
35
|
+
setRequests([]);
|
|
32
36
|
try {
|
|
33
37
|
const data = await fetchRecoveryRequests(statusFilter);
|
|
34
38
|
setRequests(Array.isArray(data) ? data : []);
|
|
35
39
|
}
|
|
36
40
|
catch (err) {
|
|
37
|
-
|
|
41
|
+
setLoadError([401, 403].includes((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : err === null || err === void 0 ? void 0 : err.status) ? 'denied' : 'unavailable');
|
|
38
42
|
}
|
|
39
43
|
finally {
|
|
40
44
|
setLoading(false);
|
|
@@ -162,9 +166,15 @@ export function SupportRecoveryRequestsTab() {
|
|
|
162
166
|
}
|
|
163
167
|
};
|
|
164
168
|
if (loading) {
|
|
165
|
-
return (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', mt: 4 }, children: _jsx(CircularProgress, {}) }));
|
|
169
|
+
return (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', mt: 4 }, children: _jsx(CircularProgress, { "aria-label": t('Common.LOADING', 'Loading') }) }));
|
|
170
|
+
}
|
|
171
|
+
if (loadError === 'denied') {
|
|
172
|
+
return _jsx(Alert, { severity: "warning", children: t('Support.RECOVERY_ACCESS_DENIED') });
|
|
173
|
+
}
|
|
174
|
+
if (loadError === 'unavailable') {
|
|
175
|
+
return (_jsx(Alert, { severity: "error", action: (_jsx(Button, { color: "inherit", onClick: loadRequests, children: t('Account.RETRY', 'Retry') })), children: t('Support.RECOVERY_REQUESTS_LOAD_FAILED') }));
|
|
166
176
|
}
|
|
167
|
-
return (_jsxs(Box, { children: [canManageAgents && (_jsxs(Paper, { variant: "outlined", sx: SUPPORT_RECOVERY_AGENT_PAPER_SX, children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Support.AGENTS_TITLE', 'Support agents') }), _jsx(Typography, { variant: "body2", sx: { mb: 2 }, children: t('Support.AGENTS_DESCRIPTION', 'Assign which users are allowed to handle support requests.') }), agentErrorKey && (_jsx(Alert, { severity: "error", sx: SUPPORT_RECOVERY_ALERT_SX, children: agentErrorKey })), _jsxs(Stack, { direction: { xs: 'column', md: 'row' }, spacing: 2, sx: { mb: 2, alignItems: { md: 'flex-start' } }, children: [_jsx(Autocomplete, { fullWidth: true, options: availableAgentCandidates, value: selectedAgentCandidate, loading: agentLoading, onChange: (_event, value) => setSelectedAgentCandidate(value), isOptionEqualToValue: (option, value) => option.id === value.id, getOptionLabel: getUserOptionLabel, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: t('Support.AGENTS_SELECT_LABEL', 'Select user'), placeholder: t('Support.AGENTS_SELECT_PLACEHOLDER', 'Choose a user') }))) }), _jsx(Button, { variant: "contained", onClick: handleAddAgent, disabled: !selectedAgentCandidate || agentLoading || Boolean(agentActionUserId), sx: SUPPORT_RECOVERY_AGENT_BUTTON_SX, children: t('Support.AGENTS_ADD', 'Add as agent') })] }), agentLoading ? (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', py: 3 }, children: _jsx(CircularProgress, { size: 24 }) })) : supportAgents.length === 0 ? (_jsx(Typography, { variant: "body2", children: t('Support.AGENTS_EMPTY', 'No support agents assigned yet.') })) : (_jsx(TableContainer, { component: Paper, variant: "outlined", children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('Profile.NAME_LABEL', 'Name') }), _jsx(TableCell, { children: t('Auth.EMAIL_LABEL', 'Email') }), _jsx(TableCell, { align: "right", children: t('Common.ACTIONS', 'Actions') })] }) }), _jsx(TableBody, { children: supportAgents.map((agentUser) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: getUserDisplayName(agentUser) || '-' }), _jsx(TableCell, { children: agentUser.email || '-' }), _jsx(TableCell, { align: "right", children: _jsx(IconButton, { size: "small", color: "error", onClick: () => handleRemoveAgent(agentUser), disabled: agentActionUserId === agentUser.id, "aria-label": t('Support.AGENTS_REMOVE', 'Remove support agent'), children: _jsx(CloseIcon, { fontSize: "small" }) }) })] }, agentUser.id))) })] }) }))] })), _jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Support.RECOVERY_REQUESTS_TITLE', 'Account recovery requests') }), _jsx(Typography, { variant: "body2", sx: { mb: 2 }, children: t('Support.RECOVERY_REQUESTS_DESCRIPTION', 'Users who cannot complete MFA can request support. You can review their request and approve or reject it.') }), errorKey && (_jsx(Alert, { severity: "error", sx: SUPPORT_RECOVERY_ALERT_SX, children: errorKey })), _jsxs(Stack, { direction: "row", spacing: 2, sx: { mb: 2 }, children: [_jsx(Button, { variant: statusFilter === 'pending' ? 'contained' : 'outlined', size: "small", onClick: () => setStatusFilter('pending'), children: t('Support.RECOVERY_FILTER_PENDING', 'Open') }), _jsx(Button, { variant: statusFilter === 'approved' ? 'contained' : 'outlined', size: "small", onClick: () => setStatusFilter('approved'), children: t('Support.RECOVERY_FILTER_APPROVED', 'Approved') }), _jsx(Button, { variant: statusFilter === 'rejected' ? 'contained' : 'outlined', size: "small", onClick: () => setStatusFilter('rejected'), children: t('Support.RECOVERY_FILTER_REJECTED', 'Rejected') })] }), requests.length === 0 ? (_jsx(Typography, { variant: "body2", children: t('Support.RECOVERY_REQUESTS_EMPTY', 'No recovery requests for this filter.') })) : (_jsx(TableContainer, { component: Paper, children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('Support.RECOVERY_COL_CREATED', 'Created') }), _jsx(TableCell, { children: t('Support.RECOVERY_USER', 'User') }), _jsx(TableCell, { children: t('Support.RECOVERY_COL_STATUS', 'Status') }), _jsx(TableCell, { children: t('Support.RECOVERY_COL_ACTIONS', 'Actions') })] }) }), _jsx(TableBody, { children: requests.map((req) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: req.created_at
|
|
177
|
+
return (_jsxs(Box, { children: [canManageAgents && (_jsxs(Paper, { variant: "outlined", sx: SUPPORT_RECOVERY_AGENT_PAPER_SX, children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Support.AGENTS_TITLE', 'Support agents') }), _jsx(Typography, { variant: "body2", sx: { mb: 2 }, children: t('Support.AGENTS_DESCRIPTION', 'Assign which users are allowed to handle support requests.') }), agentErrorKey && (_jsx(Alert, { severity: "error", sx: SUPPORT_RECOVERY_ALERT_SX, children: agentErrorKey })), _jsxs(Stack, { direction: { xs: 'column', md: 'row' }, spacing: 2, sx: { mb: 2, alignItems: { md: 'flex-start' } }, children: [_jsx(Autocomplete, { fullWidth: true, options: availableAgentCandidates, value: selectedAgentCandidate, loading: agentLoading, onChange: (_event, value) => setSelectedAgentCandidate(value), isOptionEqualToValue: (option, value) => option.id === value.id, getOptionLabel: getUserOptionLabel, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: t('Support.AGENTS_SELECT_LABEL', 'Select user'), placeholder: t('Support.AGENTS_SELECT_PLACEHOLDER', 'Choose a user') }))) }), _jsx(Button, { variant: "contained", onClick: handleAddAgent, disabled: !selectedAgentCandidate || agentLoading || Boolean(agentActionUserId), sx: SUPPORT_RECOVERY_AGENT_BUTTON_SX, children: t('Support.AGENTS_ADD', 'Add as agent') })] }), agentLoading ? (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', py: 3 }, children: _jsx(CircularProgress, { size: 24 }) })) : supportAgents.length === 0 ? (_jsx(Typography, { variant: "body2", children: t('Support.AGENTS_EMPTY', 'No support agents assigned yet.') })) : (_jsx(TableContainer, { component: Paper, variant: "outlined", children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('Profile.NAME_LABEL', 'Name') }), _jsx(TableCell, { children: t('Auth.EMAIL_LABEL', 'Email') }), _jsx(TableCell, { align: "right", children: t('Common.ACTIONS', 'Actions') })] }) }), _jsx(TableBody, { children: supportAgents.map((agentUser) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: getUserDisplayName(agentUser) || '-' }), _jsx(TableCell, { children: agentUser.email || '-' }), _jsx(TableCell, { align: "right", children: _jsx(IconButton, { size: "small", color: "error", onClick: () => handleRemoveAgent(agentUser), disabled: agentActionUserId === agentUser.id, "aria-label": t('Support.AGENTS_REMOVE', 'Remove support agent'), children: _jsx(CloseIcon, { fontSize: "small" }) }) })] }, agentUser.id))) })] }) }))] })), _jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Support.RECOVERY_REQUESTS_TITLE', 'Account recovery requests') }), _jsx(Typography, { variant: "body2", sx: { mb: 2 }, children: t('Support.RECOVERY_REQUESTS_DESCRIPTION', 'Users who cannot complete MFA can request support. You can review their request and approve or reject it.') }), errorKey && (_jsx(Alert, { severity: "error", sx: SUPPORT_RECOVERY_ALERT_SX, children: errorKey })), _jsxs(Stack, { direction: "row", spacing: 2, sx: { mb: 2 }, children: [_jsx(Button, { variant: statusFilter === 'pending' ? 'contained' : 'outlined', size: "small", onClick: () => { setErrorKey(null); setStatusFilter('pending'); }, children: t('Support.RECOVERY_FILTER_PENDING', 'Open') }), _jsx(Button, { variant: statusFilter === 'approved' ? 'contained' : 'outlined', size: "small", onClick: () => { setErrorKey(null); setStatusFilter('approved'); }, children: t('Support.RECOVERY_FILTER_APPROVED', 'Approved') }), _jsx(Button, { variant: statusFilter === 'rejected' ? 'contained' : 'outlined', size: "small", onClick: () => { setErrorKey(null); setStatusFilter('rejected'); }, children: t('Support.RECOVERY_FILTER_REJECTED', 'Rejected') })] }), requests.length === 0 ? (_jsx(Typography, { variant: "body2", children: t('Support.RECOVERY_REQUESTS_EMPTY', 'No recovery requests for this filter.') })) : (_jsx(TableContainer, { component: Paper, children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('Support.RECOVERY_COL_CREATED', 'Created') }), _jsx(TableCell, { children: t('Support.RECOVERY_USER', 'User') }), _jsx(TableCell, { children: t('Support.RECOVERY_COL_STATUS', 'Status') }), _jsx(TableCell, { children: t('Support.RECOVERY_COL_ACTIONS', 'Actions') })] }) }), _jsx(TableBody, { children: requests.map((req) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: req.created_at
|
|
168
178
|
? new Date(req.created_at).toLocaleString(i18n === null || i18n === void 0 ? void 0 : i18n.language)
|
|
169
179
|
: '-' }), _jsx(TableCell, { children: req.user_email || req.user }), _jsx(TableCell, { children: t(`Support.RECOVERY_STATUS_${req.status}`, req.status) }), _jsx(TableCell, { children: _jsx(Button, { variant: "contained", size: "small", onClick: () => openDialog(req), disabled: req.status !== 'pending', children: t('Support.RECOVERY_ACTION_REVIEW', 'Review') }) })] }, req.id))) })] }) })), _jsxs(Dialog, { open: dialogOpen, onClose: closeDialog, fullWidth: true, maxWidth: "sm", children: [_jsx(DialogTitle, { children: t('Support.RECOVERY_REVIEW_DIALOG_TITLE', 'Review recovery request') }), _jsxs(DialogContent, { dividers: true, children: [selectedRequest && (_jsxs(Box, { sx: { mb: 2 }, children: [_jsxs(Typography, { variant: "body2", sx: { mb: 1 }, children: [_jsxs("strong", { children: [t('Support.RECOVERY_USER', 'User'), ":"] }), ' ', selectedRequest.user_email || selectedRequest.user] }), _jsxs(Typography, { variant: "body2", sx: { mb: 1 }, children: [_jsxs("strong", { children: [t('Support.RECOVERY_REVIEW_CREATED', 'Requested at'), ":"] }), ' ', selectedRequest.created_at
|
|
170
180
|
? new Date(selectedRequest.created_at).toLocaleString(i18n === null || i18n === void 0 ? void 0 : i18n.language)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo, useState, useEffect, useCallback } from 'react';
|
|
3
|
-
import { Box, Typography, FormControl, Select, MenuItem, Button, IconButton, Tooltip, CircularProgress, Alert, TextField, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TablePagination, } from '@mui/material';
|
|
3
|
+
import { Box, Typography, FormControl, Select, MenuItem, Button, IconButton, Tooltip, CircularProgress, Alert, Accordion, AccordionDetails, AccordionSummary, Stack, TextField, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TablePagination, } from '@mui/material';
|
|
4
4
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
5
5
|
import CancelIcon from '@mui/icons-material/Cancel';
|
|
6
6
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
7
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import { fetchUsersList, deleteUser, updateUserRole } from '../auth/authApi';
|
|
9
10
|
import { resolveErrorText } from '../utils/resolveErrorText';
|
|
@@ -21,7 +22,7 @@ export function formatDisplayedRowsLabel(t) {
|
|
|
21
22
|
? t('UserList.DISPLAYED_ROWS_MORE_THAN', '{{from}}–{{to}} of more than {{to}}', { from, to })
|
|
22
23
|
: t('UserList.DISPLAYED_ROWS', '{{from}}–{{to}} of {{count}}', { from, to, count }));
|
|
23
24
|
}
|
|
24
|
-
export function UserListComponent({ roles = DEFAULT_ROLES, currentUser, extraColumns = [], extraRowActions = [], extraContext = null, refreshTrigger = 0, canEditUser, showNewColumn = true, showSuccessfulLoginColumn = true, showRoleColumn = true, onChangeRole = null, showDeleteAction = true, canDeleteUser = null, onDeleteUser = null, }) {
|
|
25
|
+
export function UserListComponent({ roles = DEFAULT_ROLES, currentUser, extraColumns = [], extraRowActions = [], extraContext = null, refreshTrigger = 0, canEditUser, showNewColumn = true, showSuccessfulLoginColumn = true, showRoleColumn = true, compact = false, onChangeRole = null, showDeleteAction = true, canDeleteUser = null, onDeleteUser = null, }) {
|
|
25
26
|
const { t, i18n } = useTranslation();
|
|
26
27
|
const [users, setUsers] = useState([]);
|
|
27
28
|
const [loading, setLoading] = useState(true);
|
|
@@ -292,7 +293,7 @@ export function UserListComponent({ roles = DEFAULT_ROLES, currentUser, extraCol
|
|
|
292
293
|
align: 'left',
|
|
293
294
|
headerAlign: 'left',
|
|
294
295
|
valueGetter: (row) => (row === null || row === void 0 ? void 0 : row.role) || 'none',
|
|
295
|
-
renderCell: (row) => (_jsx(FormControl, { size: "small", fullWidth: true, sx: controlSx, disabled: !canEdit(row), children: _jsx(Select, { value: row.role || 'none', onChange: (event) => handleChangeRole(row.id, event.target.value), variant: "outlined", children: roles.map((role) => _jsx(MenuItem, { value: role, children: role }, role)) }) })),
|
|
296
|
+
renderCell: (row) => (_jsx(FormControl, { size: "small", fullWidth: true, sx: controlSx, disabled: !canEdit(row), children: _jsx(Select, { value: row.role || 'none', onChange: (event) => handleChangeRole(row.id, event.target.value), variant: "outlined", inputProps: { 'aria-label': t('UserList.ROLE', 'Role') }, children: roles.map((role) => _jsx(MenuItem, { value: role, children: role }, role)) }) })),
|
|
296
297
|
});
|
|
297
298
|
}
|
|
298
299
|
const mappedExtraColumns = visibleExtraColumns.map((column) => ({
|
|
@@ -366,12 +367,16 @@ export function UserListComponent({ roles = DEFAULT_ROLES, currentUser, extraCol
|
|
|
366
367
|
const col = columns.find((c) => c.field === sortField);
|
|
367
368
|
return [...filteredUsers].sort((a, b) => {
|
|
368
369
|
var _a, _b;
|
|
370
|
+
if (compact && sortField === 'last_login') {
|
|
371
|
+
const cmp = (Date.parse(a.last_login) || 0) - (Date.parse(b.last_login) || 0);
|
|
372
|
+
return sortDir === 'asc' ? cmp : -cmp;
|
|
373
|
+
}
|
|
369
374
|
const aVal = (col === null || col === void 0 ? void 0 : col.valueGetter) ? col.valueGetter(a) : ((_a = a[sortField]) !== null && _a !== void 0 ? _a : '');
|
|
370
375
|
const bVal = (col === null || col === void 0 ? void 0 : col.valueGetter) ? col.valueGetter(b) : ((_b = b[sortField]) !== null && _b !== void 0 ? _b : '');
|
|
371
376
|
const cmp = String(aVal !== null && aVal !== void 0 ? aVal : '').localeCompare(String(bVal !== null && bVal !== void 0 ? bVal : ''), undefined, { numeric: true, sensitivity: 'base' });
|
|
372
377
|
return sortDir === 'asc' ? cmp : -cmp;
|
|
373
378
|
});
|
|
374
|
-
}, [filteredUsers, sortField, sortDir, columns]);
|
|
379
|
+
}, [filteredUsers, sortField, sortDir, columns, compact]);
|
|
375
380
|
const pagedUsers = useMemo(() => sortedUsers.slice(page * pageSize, page * pageSize + pageSize), [sortedUsers, page, pageSize]);
|
|
376
381
|
const handleSortClick = (field) => {
|
|
377
382
|
if (sortField === field) {
|
|
@@ -383,8 +388,32 @@ export function UserListComponent({ roles = DEFAULT_ROLES, currentUser, extraCol
|
|
|
383
388
|
}
|
|
384
389
|
setPage(0);
|
|
385
390
|
};
|
|
386
|
-
|
|
391
|
+
const primaryFields = ['email', 'name', 'role', 'actions'];
|
|
392
|
+
const detailColumns = compact ? columns.filter((column) => !primaryFields.includes(column.field)) : [];
|
|
393
|
+
const actions = compact ? columns.find((column) => column.field === 'actions') : null;
|
|
394
|
+
const lastLogin = compact ? new Intl.DateTimeFormat((i18n === null || i18n === void 0 ? void 0 : i18n.language) || undefined, {
|
|
395
|
+
dateStyle: 'short',
|
|
396
|
+
timeStyle: 'short',
|
|
397
|
+
}) : null;
|
|
398
|
+
const compactSortLabel = (field, label) => sortField === field
|
|
399
|
+
? t(sortDir === 'asc' ? 'UserList.SORT_ASCENDING' : 'UserList.SORT_DESCENDING', { label })
|
|
400
|
+
: undefined;
|
|
401
|
+
const summaryColumns = 1 + Number(showRoleColumn) + Number(showSuccessfulLoginColumn);
|
|
402
|
+
return (_jsxs(Box, { children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('UserList.TITLE', 'All Users') }), _jsx(Box, { sx: { mb: 2, maxWidth: 420 }, children: _jsx(TextField, { fullWidth: true, size: "small", label: t('Common.SEARCH', 'Search'), placeholder: t('UserList.SEARCH_PLACEHOLDER', 'Search users...'), value: searchQuery, onChange: (event) => setSearchQuery(event.target.value) }) }), error && _jsx(Alert, { severity: "error", sx: USER_LIST_ALERT_SX, children: error }), loading && (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', p: 3 }, children: _jsx(CircularProgress, {}) })), !loading && (_jsxs(Box, { sx: { width: '100%' }, children: [compact ? (_jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { direction: "row", flexWrap: "wrap", gap: 1, children: [columns.filter((col) => col.sortable !== false).map((col) => (_jsx(TableSortLabel, { active: sortField === col.field, direction: sortField === col.field ? sortDir : 'asc', "aria-label": compactSortLabel(col.field, col.headerName), onClick: () => handleSortClick(col.field), children: col.headerName }, col.field))), showSuccessfulLoginColumn && (_jsx(TableSortLabel, { active: sortField === 'last_login', direction: sortField === 'last_login' ? sortDir : 'asc', "aria-label": compactSortLabel('last_login', t('UserList.LAST_LOGIN')), onClick: () => handleSortClick('last_login'), children: t('UserList.LAST_LOGIN') }))] }), pagedUsers.length === 0 && _jsx(Typography, { children: t('UserList.NO_USERS', 'No users found.') }), pagedUsers.map((row) => (_jsxs(Box, { sx: { border: 1, borderColor: 'divider', borderRadius: 1, p: 1.5 }, children: [_jsxs(Box, { sx: {
|
|
403
|
+
display: 'grid',
|
|
404
|
+
gridTemplateColumns: {
|
|
405
|
+
xs: 'minmax(0, 1fr)',
|
|
406
|
+
md: `minmax(0, 2fr) repeat(${summaryColumns}, minmax(0, 1fr))`,
|
|
407
|
+
},
|
|
408
|
+
alignItems: 'start',
|
|
409
|
+
gap: 1,
|
|
410
|
+
}, children: [_jsxs(Box, { sx: { overflowWrap: 'anywhere' }, children: [_jsx(Typography, { fontWeight: 600, children: getUserDisplayName(row) }), _jsx(Typography, { variant: "body2", children: row.email })] }), showRoleColumn && (_jsxs(Typography, { variant: "body2", sx: { overflowWrap: 'anywhere' }, children: [t('UserList.ROLE', 'Role'), ": ", row.role || 'none'] })), showSuccessfulLoginColumn && (_jsxs(Typography, { variant: "body2", children: [t('UserList.LAST_LOGIN'), ": ", row.last_login && Number.isFinite(Date.parse(row.last_login))
|
|
411
|
+
? lastLogin.format(new Date(row.last_login)) : '—'] })), actions === null || actions === void 0 ? void 0 : actions.renderCell(row)] }), (showRoleColumn || detailColumns.length > 0) && (_jsxs(Accordion, { disableGutters: true, elevation: 0, sx: { '&:before': { display: 'none' } }, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMoreIcon, {}), children: t('UserList.DETAILS') }), _jsx(AccordionDetails, { sx: { px: 0, overflowWrap: 'anywhere' }, children: _jsx(Stack, { spacing: 1, children: columns.filter((column) => column.field === 'role' || detailColumns.includes(column)).map((column) => (_jsxs(Box, { children: [_jsx(Typography, { variant: "body2", children: column.headerName }), column.renderCell(row)] }, column.field))) }) })] }))] }, row.id)))] })) : (_jsx(TableContainer, { sx: { border: 1, borderColor: 'divider', borderRadius: 1 }, children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { sx: { bgcolor: 'action.hover' }, children: _jsx(TableRow, { children: columns.map((col) => (_jsx(TableCell, { align: col.headerAlign || col.align || 'left', sortDirection: sortField === col.field ? sortDir : false, sx: [USER_LIST_HEADER_CELL_SX, { minWidth: col.minWidth }], children: col.sortable !== false ? (_jsx(TableSortLabel, { active: sortField === col.field, direction: sortField === col.field ? sortDir : 'asc', onClick: () => handleSortClick(col.field), children: col.headerName })) : (col.headerName) }, col.field))) }) }), _jsx(TableBody, { children: pagedUsers.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length, align: "center", sx: USER_LIST_EMPTY_CELL_SX, children: t('UserList.NO_USERS', 'No users found.') }) })) : (pagedUsers.map((row) => (_jsx(TableRow, { hover: true, children: columns.map((col) => (_jsx(TableCell, { align: col.align || 'left', sx: USER_LIST_BODY_CELL_SX, children: col.renderCell(row) }, col.field))) }, row.id)))) })] }) })), _jsx(TablePagination, { component: "div", count: sortedUsers.length, page: page, onPageChange: (_, newPage) => setPage(newPage), rowsPerPage: pageSize, onRowsPerPageChange: (event) => {
|
|
387
412
|
setPageSize(Number(event.target.value));
|
|
388
413
|
setPage(0);
|
|
389
|
-
}, labelRowsPerPage: t('UserList.ROWS_PER_PAGE', 'Rows per page:'), labelDisplayedRows: formatDisplayedRowsLabel(t), rowsPerPageOptions: [10, 25, 50, 100]
|
|
414
|
+
}, labelRowsPerPage: t('UserList.ROWS_PER_PAGE', 'Rows per page:'), labelDisplayedRows: formatDisplayedRowsLabel(t), rowsPerPageOptions: [10, 25, 50, 100], sx: compact ? {
|
|
415
|
+
'& .MuiTablePagination-toolbar': { flexWrap: 'wrap', px: 0, justifyContent: 'flex-end' },
|
|
416
|
+
'& .MuiTablePagination-spacer': { display: 'none' },
|
|
417
|
+
'& .MuiTablePagination-actions': { ml: 0 },
|
|
418
|
+
} : undefined })] }))] }));
|
|
390
419
|
}
|
|
@@ -1227,6 +1227,12 @@ export const authTranslations = {
|
|
|
1227
1227
|
"en": "Users who cannot complete MFA can submit a request here. You can review the request and then approve or reject it.",
|
|
1228
1228
|
"sw": "Watumiaji ambao hawawezi kukamilisha MFA wanaweza kutuma ombi hapa. Unaweza kukagua ombi na kisha kulikubali au kulikataa."
|
|
1229
1229
|
},
|
|
1230
|
+
"Support.RECOVERY_ACCESS_DENIED": {
|
|
1231
|
+
"de": "Dieses Konto hat keinen Zugriff auf die Support-Funktionen.",
|
|
1232
|
+
"en": "This account does not have access to support features.",
|
|
1233
|
+
"fr": "Ce compte n’a pas accès aux fonctions d’assistance.",
|
|
1234
|
+
"sw": "Akaunti hii haina ufikiaji wa vipengele vya usaidizi."
|
|
1235
|
+
},
|
|
1230
1236
|
"Support.RECOVERY_REQUESTS_LOAD_FAILED": {
|
|
1231
1237
|
"de": "Die Anfragen zur Kontowiederherstellung konnten nicht geladen werden.",
|
|
1232
1238
|
"fr": "Impossible de charger les demandes de récupération de compte.",
|
|
@@ -1373,6 +1379,24 @@ export const authTranslations = {
|
|
|
1373
1379
|
"en": "Expired",
|
|
1374
1380
|
"sw": "Muda umekwisha"
|
|
1375
1381
|
},
|
|
1382
|
+
"Account.INVITATIONS_UNAVAILABLE": {
|
|
1383
|
+
"de": "Einladungen konnten nicht geladen werden. Die Einstellungen bleiben unverändert.",
|
|
1384
|
+
"en": "Invitations could not be loaded. Settings remain unchanged.",
|
|
1385
|
+
"fr": "Impossible de charger les invitations. Les paramètres restent inchangés.",
|
|
1386
|
+
"sw": "Mialiko haikuweza kupakiwa. Mipangilio haijabadilika."
|
|
1387
|
+
},
|
|
1388
|
+
"Account.INVITATIONS_DENIED": {
|
|
1389
|
+
"de": "Dieses Konto hat keinen Zugriff auf die Einladungseinstellungen.",
|
|
1390
|
+
"en": "This account does not have access to invitation settings.",
|
|
1391
|
+
"fr": "Ce compte n’a pas accès aux paramètres d’invitation.",
|
|
1392
|
+
"sw": "Akaunti hii haina ufikiaji wa mipangilio ya mialiko."
|
|
1393
|
+
},
|
|
1394
|
+
"Account.RETRY": {
|
|
1395
|
+
"de": "Erneut versuchen",
|
|
1396
|
+
"en": "Retry",
|
|
1397
|
+
"fr": "Réessayer",
|
|
1398
|
+
"sw": "Jaribu tena"
|
|
1399
|
+
},
|
|
1376
1400
|
"Auth.AUTH_POLICY_FETCH_FAILED": {
|
|
1377
1401
|
"de": "Die Authentifizierungsrichtlinie konnte nicht geladen werden.",
|
|
1378
1402
|
"fr": "Impossible de charger la politique d'authentification.",
|
|
@@ -1982,6 +2006,30 @@ export const authTranslations = {
|
|
|
1982
2006
|
"en": "Actions",
|
|
1983
2007
|
"sw": "Vitendo"
|
|
1984
2008
|
},
|
|
2009
|
+
"UserList.LAST_LOGIN": {
|
|
2010
|
+
"de": "Letzte Anmeldung",
|
|
2011
|
+
"en": "Last sign-in",
|
|
2012
|
+
"fr": "Dernière connexion",
|
|
2013
|
+
"sw": "Mara ya mwisho kuingia"
|
|
2014
|
+
},
|
|
2015
|
+
"UserList.DETAILS": {
|
|
2016
|
+
"de": "Details",
|
|
2017
|
+
"en": "Details",
|
|
2018
|
+
"fr": "Détails",
|
|
2019
|
+
"sw": "Maelezo"
|
|
2020
|
+
},
|
|
2021
|
+
"UserList.SORT_ASCENDING": {
|
|
2022
|
+
"de": "{{label}}: aufsteigend sortiert",
|
|
2023
|
+
"en": "{{label}}: sorted ascending",
|
|
2024
|
+
"fr": "{{label}} : tri croissant",
|
|
2025
|
+
"sw": "{{label}}: imepangwa kwa mpangilio wa kupanda"
|
|
2026
|
+
},
|
|
2027
|
+
"UserList.SORT_DESCENDING": {
|
|
2028
|
+
"de": "{{label}}: absteigend sortiert",
|
|
2029
|
+
"en": "{{label}}: sorted descending",
|
|
2030
|
+
"fr": "{{label}} : tri décroissant",
|
|
2031
|
+
"sw": "{{label}}: imepangwa kwa mpangilio wa kushuka"
|
|
2032
|
+
},
|
|
1985
2033
|
"UserList.TITLE": {
|
|
1986
2034
|
"de": "Alle Benutzer",
|
|
1987
2035
|
"fr": "Tous les utilisateurs",
|
|
@@ -4,7 +4,6 @@ import { useSearchParams } from 'react-router-dom';
|
|
|
4
4
|
import { Box, Button, Typography, Alert, CircularProgress, Paper, Stack, useMediaQuery, } from '@mui/material';
|
|
5
5
|
import { useTheme } from '@mui/material/styles';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { resolveErrorText } from '../utils/resolveErrorText';
|
|
8
7
|
// Internal context
|
|
9
8
|
import { AuthContext } from '../auth/AuthContext';
|
|
10
9
|
export const ACCOUNT_PAGE_SECTION_PAPER_SX = { p: 2.5 };
|
|
@@ -56,13 +55,14 @@ function AccountPrivacySection() {
|
|
|
56
55
|
* may be strings or `(context) => string`; `tabs` assigns built-in tab values, and `visible(context)` can hide a group
|
|
57
56
|
* and its tabs. Without this prop, the default groups and placement are unchanged.
|
|
58
57
|
*/
|
|
59
|
-
export function AccountPage({ userListExtraColumns = [], userListExtraRowActions = [], userListExtraContext = null, userListRefreshTrigger = 0, userListCanEditUser = null, userListShowNewColumn = true, userListShowSuccessfulLoginColumn = true, userListShowRoleColumn = true, userListOnChangeRole = null, userListShowDeleteAction = true, userListCanDeleteUser = null, userListOnDeleteUser = null, showBulkInviteCsvTab = false, bulkInviteCsvProps = {}, extraTabs = [], showProfileStatements = true, privacyMode = 'legacy', billingUsers = false, billingOperator, groups: groupsProp, }) {
|
|
58
|
+
export function AccountPage({ userListExtraColumns = [], userListExtraRowActions = [], userListExtraContext = null, userListRefreshTrigger = 0, userListCanEditUser = null, userListShowNewColumn = true, userListShowSuccessfulLoginColumn = true, userListShowRoleColumn = true, userListCompact = false, userListOnChangeRole = null, userListShowDeleteAction = true, userListCanDeleteUser = null, userListOnDeleteUser = null, showBulkInviteCsvTab = false, bulkInviteCsvProps = {}, extraTabs = [], showProfileStatements = true, privacyMode = 'legacy', billingUsers = false, billingOperator, groups: groupsProp, }) {
|
|
60
59
|
var _a;
|
|
61
|
-
const { t
|
|
60
|
+
const { t } = useTranslation();
|
|
62
61
|
const { user, login, loading } = useContext(AuthContext);
|
|
63
62
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
64
63
|
const [authPolicy, setAuthPolicy] = useState(null);
|
|
65
|
-
const [
|
|
64
|
+
const [authPolicyLoad, setAuthPolicyLoad] = useState(null);
|
|
65
|
+
const [authPolicyAttempt, setAuthPolicyAttempt] = useState(0);
|
|
66
66
|
const theme = useTheme();
|
|
67
67
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
68
68
|
const billingApi = billingUsers && typeof billingUsers === 'object' ? billingUsers : defaultBillingApi;
|
|
@@ -86,6 +86,10 @@ export function AccountPage({ userListExtraColumns = [], userListExtraRowActions
|
|
|
86
86
|
const canSendInvites = Boolean(isSuperUser || perms.can_send_invites);
|
|
87
87
|
const canManageAccessCodes = Boolean(isSuperUser || perms.can_manage_access_codes);
|
|
88
88
|
const canManageSignupQr = Boolean(isSuperUser || perms.can_manage_signup_qr);
|
|
89
|
+
const canLoadPolicy = Boolean(user) && (canViewAuthPolicy || canManageSignupQr || canManageAccessCodes);
|
|
90
|
+
const policyLoad = (authPolicyLoad === null || authPolicyLoad === void 0 ? void 0 : authPolicyLoad.user) === user && (authPolicyLoad === null || authPolicyLoad === void 0 ? void 0 : authPolicyLoad.attempt) === authPolicyAttempt
|
|
91
|
+
? authPolicyLoad.state
|
|
92
|
+
: 'loading';
|
|
89
93
|
const extensionContext = { user, perms, isSuperUser, t };
|
|
90
94
|
const declaredGroups = useMemo(() => {
|
|
91
95
|
if (!Array.isArray(groupsProp))
|
|
@@ -114,32 +118,39 @@ export function AccountPage({ userListExtraColumns = [], userListExtraRowActions
|
|
|
114
118
|
};
|
|
115
119
|
useEffect(() => {
|
|
116
120
|
let active = true;
|
|
117
|
-
|
|
118
|
-
if (!canLoadPolicy) {
|
|
119
|
-
setAuthPolicy(null);
|
|
120
|
-
setAuthPolicyError('');
|
|
121
|
+
if (!canLoadPolicy)
|
|
121
122
|
return undefined;
|
|
122
|
-
}
|
|
123
123
|
const loadPolicy = async () => {
|
|
124
|
+
var _a;
|
|
125
|
+
var _b;
|
|
124
126
|
try {
|
|
125
127
|
const data = await fetchAuthPolicy();
|
|
126
128
|
if (!active)
|
|
127
129
|
return;
|
|
130
|
+
if (typeof (data === null || data === void 0 ? void 0 : data.allow_admin_invite) !== 'boolean') {
|
|
131
|
+
setAuthPolicy(null);
|
|
132
|
+
setAuthPolicyLoad({ user, attempt: authPolicyAttempt, state: 'unavailable' });
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
128
135
|
setAuthPolicy(data);
|
|
129
|
-
|
|
136
|
+
setAuthPolicyLoad({ user, attempt: authPolicyAttempt, state: 'ready' });
|
|
130
137
|
}
|
|
131
138
|
catch (err) {
|
|
132
139
|
if (!active)
|
|
133
140
|
return;
|
|
134
141
|
setAuthPolicy(null);
|
|
135
|
-
|
|
142
|
+
setAuthPolicyLoad({
|
|
143
|
+
user,
|
|
144
|
+
attempt: authPolicyAttempt,
|
|
145
|
+
state: [401, 403].includes((_b = err === null || err === void 0 ? void 0 : err.status) !== null && _b !== void 0 ? _b : (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) ? 'denied' : 'unavailable',
|
|
146
|
+
});
|
|
136
147
|
}
|
|
137
148
|
};
|
|
138
149
|
loadPolicy();
|
|
139
150
|
return () => {
|
|
140
151
|
active = false;
|
|
141
152
|
};
|
|
142
|
-
}, [user,
|
|
153
|
+
}, [user, canLoadPolicy, authPolicyAttempt]);
|
|
143
154
|
// 3. Dynamic Tabs (angepasst für Superuser)
|
|
144
155
|
const tabs = useMemo(() => {
|
|
145
156
|
if (!user)
|
|
@@ -272,5 +283,5 @@ export function AccountPage({ userListExtraColumns = [], userListExtraRowActions
|
|
|
272
283
|
const activeExtraTab = builtInTabValues.has(safeTab)
|
|
273
284
|
? null
|
|
274
285
|
: extraTabs.find((tab) => tab.value === safeTab);
|
|
275
|
-
return (_jsxs(WidePage, { title: t('Account.TITLE', 'Account & Administration'), children: [_jsx("title", { children: `${t('Account.PAGE_TITLE', 'Account')} – ${user.email}` }), _jsxs(SectionNav, { mode: isMobile ? 'mobile' : 'desktop', groups: groups, activeKey: safeTab, onSelect: (key) => handleTabChange(null, key), children: [safeTab === 'profile' && (_jsxs(Box, { sx: { mt: 2 }, children: [_jsx(ProfileComponent, { onSubmit: handleProfileSubmit, showName: true, showPrivacy: privacyMode !== 'central', showCookies: privacyMode !== 'central', showStatements: showProfileStatements, privacyMode: privacyMode }), privacyMode === 'central' && _jsx(AccountPrivacySection, {})] })), safeTab === 'security' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(SecurityComponent, { fromRecovery: fromRecovery, fromWeakLogin: fromWeakLogin }) })), safeTab === 'users' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(UserListComponent, { roles: activeRoles, currentUser: user, extraColumns: [...userListExtraColumns, ...billing.extraColumns], extraRowActions: userListExtraRowActions, extraContext: userListExtraContext, refreshTrigger: userListRefreshTrigger, canEditUser: userListCanEditUser, showNewColumn: userListShowNewColumn, showSuccessfulLoginColumn: userListShowSuccessfulLoginColumn, showRoleColumn: userListShowRoleColumn, onChangeRole: userListOnChangeRole, showDeleteAction: userListShowDeleteAction, canDeleteUser: userListCanDeleteUser, onDeleteUser: userListOnDeleteUser }) })), safeTab === 'invite' && (_jsx(Box, { sx: { mt: 2 }, children: _jsxs(Stack, { spacing: 2.5, children: [canViewAuthPolicy && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(AuthFactorRequirementCard, { canEdit: canWriteAuthPolicy, policy: authPolicy }) })), canViewAuthPolicy && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(RegistrationMethodsManager, { policy: authPolicy,
|
|
286
|
+
return (_jsxs(WidePage, { title: t('Account.TITLE', 'Account & Administration'), children: [_jsx("title", { children: `${t('Account.PAGE_TITLE', 'Account')} – ${user.email}` }), _jsxs(SectionNav, { mode: isMobile ? 'mobile' : 'desktop', groups: groups, activeKey: safeTab, onSelect: (key) => handleTabChange(null, key), children: [safeTab === 'profile' && (_jsxs(Box, { sx: { mt: 2 }, children: [_jsx(ProfileComponent, { onSubmit: handleProfileSubmit, showName: true, showPrivacy: privacyMode !== 'central', showCookies: privacyMode !== 'central', showStatements: showProfileStatements, privacyMode: privacyMode }), privacyMode === 'central' && _jsx(AccountPrivacySection, {})] })), safeTab === 'security' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(SecurityComponent, { fromRecovery: fromRecovery, fromWeakLogin: fromWeakLogin }) })), safeTab === 'users' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(UserListComponent, { roles: activeRoles, currentUser: user, extraColumns: [...userListExtraColumns, ...billing.extraColumns], extraRowActions: userListExtraRowActions, extraContext: userListExtraContext, refreshTrigger: userListRefreshTrigger, canEditUser: userListCanEditUser, showNewColumn: userListShowNewColumn, showSuccessfulLoginColumn: userListShowSuccessfulLoginColumn, showRoleColumn: userListShowRoleColumn, compact: userListCompact, onChangeRole: userListOnChangeRole, showDeleteAction: userListShowDeleteAction, canDeleteUser: userListCanDeleteUser, onDeleteUser: userListOnDeleteUser }) })), safeTab === 'invite' && canLoadPolicy && policyLoad === 'loading' && (_jsx(CircularProgress, { sx: { mt: 2 }, "aria-label": t('Account.TAB_INVITE', 'Invite') })), safeTab === 'invite' && canLoadPolicy && policyLoad === 'unavailable' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(Alert, { severity: "error", action: (_jsx(Button, { color: "inherit", onClick: () => setAuthPolicyAttempt((attempt) => attempt + 1), children: t('Account.RETRY', 'Retry') })), children: t('Account.INVITATIONS_UNAVAILABLE') }) })), safeTab === 'invite' && (!canLoadPolicy || policyLoad === 'denied') && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(Alert, { severity: "warning", children: t('Account.INVITATIONS_DENIED') }) })), safeTab === 'invite' && canLoadPolicy && policyLoad === 'ready' && (_jsx(Box, { sx: { mt: 2 }, children: _jsxs(Stack, { spacing: 2.5, children: [canViewAuthPolicy && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(AuthFactorRequirementCard, { canEdit: canWriteAuthPolicy, policy: authPolicy }) })), canViewAuthPolicy && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(RegistrationMethodsManager, { policy: authPolicy, onPolicyChange: setAuthPolicy, canEdit: canWriteAuthPolicy }) })), canSendInvites && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_admin_invite) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(UserInviteComponent, {}) })), canManageAccessCodes && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_access_code) && (_jsxs(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Auth.ACCESS_CODE_MANAGER_TITLE', 'Access Codes') }), _jsx(Typography, { variant: "body2", sx: { mb: 2, color: 'text.secondary' }, children: t('Account.ACCESS_CODES_HINT', 'Manage access codes for self-registration.') }), _jsx(AccessCodeManager, {})] })), canManageAccessCodes && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_access_code) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(AccessCodeSingleUseToggle, { canEdit: canWriteAuthPolicy, policy: authPolicy, onPolicyChange: setAuthPolicy }) })), canSendInvites && showBulkInviteCsvTab && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_admin_invite) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(BulkInviteCsvTab, Object.assign({}, bulkInviteCsvProps)) })), canViewAuthPolicy && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_email_domain) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(AllowedEmailDomainsManager, { enabled: Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_email_domain), domains: (authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allowed_email_domains) || [], onPolicyChange: setAuthPolicy, canEdit: canWriteAuthPolicy }) })), canViewAuthPolicy && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(QrSignupValidityManager, { enabled: Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr), expiryDays: authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.signup_qr_expiry_days, onPolicyChange: setAuthPolicy, canEdit: canWriteAuthPolicy }) })), canManageSignupQr && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr) && (_jsx(Paper, { variant: "outlined", sx: ACCOUNT_PAGE_SECTION_PAPER_SX, children: _jsx(QrSignupManager, { enabled: Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr), expiryDays: authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.signup_qr_expiry_days }) }))] }) })), safeTab === 'support' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(SupportRecoveryRequestsTab, {}) })), activeExtraTab && (_jsx(Box, { sx: { mt: 2 }, children: (_a = activeExtraTab.render) === null || _a === void 0 ? void 0 : _a.call(activeExtraTab, { user, perms, isSuperUser, t }) }))] })] }));
|
|
276
287
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micha.bigler/ui-core-micha",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"@mui/icons-material": "^7.3.11",
|
|
71
71
|
"@mui/x-charts": "^8.29.3",
|
|
72
72
|
"@testing-library/react": "^16.3.3",
|
|
73
|
-
"@vitejs/plugin-react": "^6.1
|
|
74
|
-
"i18next": "^26.
|
|
73
|
+
"@vitejs/plugin-react": "^6.2.1",
|
|
74
|
+
"i18next": "^26.7.1",
|
|
75
75
|
"jsdom": "^30.1.3",
|
|
76
|
-
"react-i18next": "^17.1.
|
|
76
|
+
"react-i18next": "^17.1.12",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
78
78
|
"remark-gfm": "^4.0.1",
|
|
79
79
|
"typescript": "^7.0.2",
|
|
80
80
|
"vite": "^8.3.5",
|
|
81
|
-
"vitest": "^5.0
|
|
81
|
+
"vitest": "^5.1.0"
|
|
82
82
|
}
|
|
83
83
|
}
|