@micha.bigler/ui-core-micha 4.35.0 → 4.36.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 +14 -0
- package/README.md +2 -1
- 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/dist/privacy/PublicFooter.js +13 -10
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.36.0 - KZ-UI-2
|
|
4
|
+
|
|
5
|
+
Account invitation controls wait for a usable policy. Failed and denied invitation or
|
|
6
|
+
support loads have distinct states, and retryable failures can recover without showing
|
|
7
|
+
an empty result. `AccountPage` accepts the optional `userListCompact` prop, and
|
|
8
|
+
`UserListComponent` accepts `compact`, to display a responsive directory with last
|
|
9
|
+
login and accessible row details. Existing callers retain the default table.
|
|
10
|
+
|
|
11
|
+
## 4.35.1 - UCM-PRIV-6
|
|
12
|
+
|
|
13
|
+
`PublicFooter` is compact on phones: below the `sm` breakpoint the identity block (logo, tagline, copyright) is hidden,
|
|
14
|
+
the links sit in one centred, tightly spaced wrapping row (smaller type, 28 px rows), so the footer no longer takes
|
|
15
|
+
three tall rows. From `sm` up it stays one line. No API change.
|
|
16
|
+
|
|
3
17
|
## 4.35.0 - UCM-PRIV-6
|
|
4
18
|
|
|
5
19
|
Removal, released as a minor because no consumer imports the removed names and all consumers pin exact versions: the
|
package/README.md
CHANGED
|
@@ -33,7 +33,8 @@ const privacyApi = createPrivacyApi({}, { apiBase: '/api/privacy/', csrfUrl: '/a
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Place `PrivacyProvider` above the router content and render one `PrivacyBanner` in the app shell. Use `PublicFooter` as
|
|
36
|
-
the one compact line at the end of every page, public and authenticated, including login and registration
|
|
36
|
+
the one compact line at the end of every page, public and authenticated, including login and registration (on phones
|
|
37
|
+
the `brand` and `copyright` nodes are not shown, so never make the footer the only route to something they link); there are no
|
|
37
38
|
legal or privacy entries in headers or in the account menu. The account page (`privacyMode="central"`) shows the two
|
|
38
39
|
quick choices in its profile section. This keeps public legal links available without a provider. When an app has
|
|
39
40
|
optional purposes, the footer entry reopens the same banner with “Necessary only” and “Allow all”; either choice applies
|
|
@@ -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
|
}
|
|
@@ -28,21 +28,23 @@ export const PUBLIC_FOOTER_ROOT_SX = {
|
|
|
28
28
|
borderTop: 1,
|
|
29
29
|
borderColor: 'divider',
|
|
30
30
|
px: { xs: 2, sm: 4 },
|
|
31
|
-
py: 1,
|
|
31
|
+
py: { xs: 0.5, sm: 1 },
|
|
32
32
|
bgcolor: 'background.paper',
|
|
33
33
|
display: 'flex',
|
|
34
34
|
flexWrap: 'wrap',
|
|
35
35
|
alignItems: 'center',
|
|
36
|
-
justifyContent: 'space-between',
|
|
36
|
+
justifyContent: { xs: 'center', sm: 'space-between' },
|
|
37
37
|
columnGap: 3,
|
|
38
38
|
rowGap: 0,
|
|
39
39
|
};
|
|
40
|
+
// On a phone the identity (logo, tagline, copyright) is dropped: the header already carries the brand and the
|
|
41
|
+
// footer stays a compact row of links.
|
|
40
42
|
export const PUBLIC_FOOTER_IDENTITY_SX = {
|
|
41
|
-
display: 'flex',
|
|
43
|
+
display: { xs: 'none', sm: 'flex' },
|
|
42
44
|
alignItems: 'center',
|
|
43
45
|
gap: 1.25,
|
|
44
46
|
flexShrink: 0,
|
|
45
|
-
minHeight:
|
|
47
|
+
minHeight: 32,
|
|
46
48
|
};
|
|
47
49
|
export const PUBLIC_FOOTER_COPYRIGHT_SX = {
|
|
48
50
|
color: 'text.secondary',
|
|
@@ -52,19 +54,20 @@ export const PUBLIC_FOOTER_COPYRIGHT_SX = {
|
|
|
52
54
|
export const PUBLIC_FOOTER_NAV_SX = {
|
|
53
55
|
display: 'flex',
|
|
54
56
|
flexWrap: 'wrap',
|
|
55
|
-
justifyContent: 'flex-end',
|
|
57
|
+
justifyContent: { xs: 'center', sm: 'flex-end' },
|
|
56
58
|
alignItems: 'center',
|
|
57
|
-
columnGap: { xs:
|
|
59
|
+
columnGap: { xs: 1.5, sm: 2.75 },
|
|
58
60
|
rowGap: 0,
|
|
59
61
|
minWidth: 0,
|
|
62
|
+
width: { xs: '100%', sm: 'auto' },
|
|
60
63
|
};
|
|
61
64
|
export const PUBLIC_FOOTER_LEGAL_LINK_SX = {
|
|
62
65
|
display: 'inline-flex',
|
|
63
66
|
alignItems: 'center',
|
|
64
67
|
minWidth: 0,
|
|
65
|
-
minHeight: { xs:
|
|
68
|
+
minHeight: { xs: 28, sm: 32 },
|
|
66
69
|
color: 'text.secondary',
|
|
67
|
-
fontSize: '0.8125rem',
|
|
70
|
+
fontSize: { xs: '0.75rem', sm: '0.8125rem' },
|
|
68
71
|
lineHeight: 1.35,
|
|
69
72
|
overflowWrap: 'anywhere',
|
|
70
73
|
textDecoration: 'none',
|
|
@@ -77,10 +80,10 @@ export const PUBLIC_FOOTER_SETTINGS_LINK_SX = {
|
|
|
77
80
|
display: 'inline-flex',
|
|
78
81
|
alignItems: 'center',
|
|
79
82
|
gap: 0.75,
|
|
80
|
-
minHeight: { xs:
|
|
83
|
+
minHeight: { xs: 28, sm: 32 },
|
|
81
84
|
px: 0,
|
|
82
85
|
color: 'primary.main',
|
|
83
|
-
fontSize: '0.8125rem',
|
|
86
|
+
fontSize: { xs: '0.75rem', sm: '0.8125rem' },
|
|
84
87
|
textDecoration: 'none',
|
|
85
88
|
'&:hover': { textDecoration: 'underline' },
|
|
86
89
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micha.bigler/ui-core-micha",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.36.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
|
}
|