@micha.bigler/ui-core-micha 2.2.5 → 2.2.6
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/dist/components/AuthFactorRequirementCard.js +1 -1
- package/dist/i18n/authTranslations.js +30 -0
- package/dist/pages/AccountPage.js +1 -1
- package/package.json +2 -1
- package/src/components/AuthFactorRequirementCard.jsx +15 -4
- package/src/i18n/authTranslations.ts +30 -0
- package/src/pages/AccountPage.jsx +6 -6
|
@@ -45,5 +45,5 @@ export function AuthFactorRequirementCard() {
|
|
|
45
45
|
setBusy(false);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
return (_jsxs(Box, { children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Auth.AUTH_FACTOR_TITLE', 'Authentication
|
|
48
|
+
return (_jsxs(Box, { children: [_jsx(Typography, { variant: "h6", gutterBottom: true, children: t('Auth.AUTH_FACTOR_TITLE', 'Authentication Requirements') }), _jsx(Typography, { variant: "body2", sx: { mb: 2, color: 'text.secondary' }, children: t('Auth.AUTH_FACTOR_HINT', 'Define the minimum number of authentication factors required for sign-in.') }), error && _jsx(Alert, { severity: "error", sx: { mb: 2 }, children: error }), success && _jsx(Alert, { severity: "success", sx: { mb: 2 }, children: success }), _jsx(FormControl, { children: _jsxs(RadioGroup, { value: value, onChange: handleChange, children: [_jsx(FormControlLabel, { value: "1", control: _jsx(Radio, { disabled: busy }), label: t('Auth.ONE_FACTOR_LABEL', 'Allow single-factor authentication') }), _jsx(FormControlLabel, { value: "2", control: _jsx(Radio, { disabled: busy }), label: t('Auth.TWO_FACTOR_LABEL', 'Require two-factor authentication') })] }) })] }));
|
|
49
49
|
}
|
|
@@ -1290,6 +1290,36 @@ export const authTranslations = {
|
|
|
1290
1290
|
"en": "Authentication settings saved.",
|
|
1291
1291
|
"sw": "Mipangilio ya uthibitishaji imehifadhiwa."
|
|
1292
1292
|
},
|
|
1293
|
+
"Auth.AUTH_FACTOR_TITLE": {
|
|
1294
|
+
"de": "Authentifizierungsanforderungen",
|
|
1295
|
+
"fr": "Exigences d'authentification",
|
|
1296
|
+
"en": "Authentication Requirements",
|
|
1297
|
+
"sw": "Mahitaji ya uthibitishaji"
|
|
1298
|
+
},
|
|
1299
|
+
"Auth.AUTH_FACTOR_HINT": {
|
|
1300
|
+
"de": "Legen Sie fest, wie viele Authentifizierungsfaktoren mindestens für die Anmeldung erforderlich sind.",
|
|
1301
|
+
"fr": "Définissez le nombre minimal de facteurs d'authentification requis pour la connexion.",
|
|
1302
|
+
"en": "Define the minimum number of authentication factors required for sign-in.",
|
|
1303
|
+
"sw": "Weka idadi ya chini ya vipengele vya uthibitishaji vinavyohitajika ili kuingia."
|
|
1304
|
+
},
|
|
1305
|
+
"Auth.ONE_FACTOR_LABEL": {
|
|
1306
|
+
"de": "Single-Factor-Authentifizierung erlauben",
|
|
1307
|
+
"fr": "Autoriser l'authentification à un facteur",
|
|
1308
|
+
"en": "Allow single-factor authentication",
|
|
1309
|
+
"sw": "Ruhusu uthibitishaji wa kipengele kimoja"
|
|
1310
|
+
},
|
|
1311
|
+
"Auth.TWO_FACTOR_LABEL": {
|
|
1312
|
+
"de": "Zwei-Faktor-Authentifizierung erzwingen",
|
|
1313
|
+
"fr": "Exiger l'authentification à deux facteurs",
|
|
1314
|
+
"en": "Require two-factor authentication",
|
|
1315
|
+
"sw": "Hitaji uthibitishaji wa vipengele viwili"
|
|
1316
|
+
},
|
|
1317
|
+
"Auth.AUTH_FACTOR_SAVE_SUCCESS": {
|
|
1318
|
+
"de": "Die Anforderung für Authentifizierungsfaktoren wurde gespeichert.",
|
|
1319
|
+
"fr": "L'exigence relative aux facteurs d'authentification a été enregistrée.",
|
|
1320
|
+
"en": "Factor requirement saved.",
|
|
1321
|
+
"sw": "Hitaji la vipengele vya uthibitishaji limehifadhiwa."
|
|
1322
|
+
},
|
|
1293
1323
|
"Auth.REGISTRATION_METHODS_TITLE": {
|
|
1294
1324
|
"de": "Registrierungsmethoden",
|
|
1295
1325
|
"fr": "Méthodes d'inscription",
|
|
@@ -122,5 +122,5 @@ export function AccountPage({ userListExtraColumns = [], userListExtraRowActions
|
|
|
122
122
|
const activeExtraTab = builtInTabValues.has(safeTab)
|
|
123
123
|
? null
|
|
124
124
|
: extraTabs.find((tab) => tab.value === safeTab);
|
|
125
|
-
return (_jsxs(WidePage, { title: t('Account.TITLE', 'Account & Administration'), children: [_jsx(Helmet, { children: _jsxs("title", { children: [t('Account.PAGE_TITLE', 'Account'), " \u2013 ", user.email] }) }), _jsx(Tabs, { value: safeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", sx: { mb: 3, borderBottom: 1, borderColor: 'divider' }, children: tabs.map((tab) => (_jsx(Tab, { label: tab.label, value: tab.value }, tab.value))) }), safeTab === 'profile' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(ProfileComponent, { onSubmit: handleProfileSubmit, showName: true, showPrivacy: true, showCookies: true }) })), 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, extraRowActions: userListExtraRowActions, extraContext: userListExtraContext, refreshTrigger: userListRefreshTrigger, canEditUser: userListCanEditUser }) })), safeTab === 'invite' && (_jsx(Box, { sx: { mt: 2 }, children: _jsxs(Stack, { spacing: 2.5, children: [(isSuperUser || perms.can_invite) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, children: _jsx(
|
|
125
|
+
return (_jsxs(WidePage, { title: t('Account.TITLE', 'Account & Administration'), children: [_jsx(Helmet, { children: _jsxs("title", { children: [t('Account.PAGE_TITLE', 'Account'), " \u2013 ", user.email] }) }), _jsx(Tabs, { value: safeTab, onChange: handleTabChange, variant: "scrollable", scrollButtons: "auto", sx: { mb: 3, borderBottom: 1, borderColor: 'divider' }, children: tabs.map((tab) => (_jsx(Tab, { label: tab.label, value: tab.value }, tab.value))) }), safeTab === 'profile' && (_jsx(Box, { sx: { mt: 2 }, children: _jsx(ProfileComponent, { onSubmit: handleProfileSubmit, showName: true, showPrivacy: true, showCookies: true }) })), 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, extraRowActions: userListExtraRowActions, extraContext: userListExtraContext, refreshTrigger: userListRefreshTrigger, canEditUser: userListCanEditUser }) })), safeTab === 'invite' && (_jsx(Box, { sx: { mt: 2 }, children: _jsxs(Stack, { spacing: 2.5, children: [(isSuperUser || perms.can_invite) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, children: _jsx(AuthFactorRequirementCard, {}) })), (isSuperUser || perms.can_invite) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, children: _jsx(RegistrationMethodsManager, { policy: authPolicy, error: authPolicyError, onPolicyChange: setAuthPolicy }) })), (isSuperUser || perms.can_invite) && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_admin_invite) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, children: _jsx(UserInviteComponent, {}) })), (isSuperUser || perms.can_manage_access_codes) && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_access_code) && (_jsxs(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, 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, {})] })), (isSuperUser || perms.can_invite) && showBulkInviteCsvTab && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_admin_invite) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, children: _jsx(BulkInviteCsvTab, Object.assign({}, bulkInviteCsvProps)) })), (isSuperUser || perms.can_invite) && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_email_domain) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, 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 }) })), (isSuperUser || perms.can_invite) && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, 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 }) })), (isSuperUser || perms.can_invite) && Boolean(authPolicy === null || authPolicy === void 0 ? void 0 : authPolicy.allow_self_signup_qr) && (_jsx(Paper, { variant: "outlined", sx: { p: 2.5, borderRadius: 2 }, 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 }) }))] }));
|
|
126
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micha.bigler/ui-core-micha",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"build": "tsc -p tsconfig.build.json"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"typescript": "^5.9.3"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"react-i18next": "^16.3.5"
|
|
@@ -56,17 +56,28 @@ export function AuthFactorRequirementCard() {
|
|
|
56
56
|
return (
|
|
57
57
|
<Box>
|
|
58
58
|
<Typography variant="h6" gutterBottom>
|
|
59
|
-
{t('Auth.AUTH_FACTOR_TITLE', 'Authentication
|
|
59
|
+
{t('Auth.AUTH_FACTOR_TITLE', 'Authentication Requirements')}
|
|
60
60
|
</Typography>
|
|
61
61
|
<Typography variant="body2" sx={{ mb: 2, color: 'text.secondary' }}>
|
|
62
|
-
{t(
|
|
62
|
+
{t(
|
|
63
|
+
'Auth.AUTH_FACTOR_HINT',
|
|
64
|
+
'Define the minimum number of authentication factors required for sign-in.',
|
|
65
|
+
)}
|
|
63
66
|
</Typography>
|
|
64
67
|
{error && <Alert severity="error" sx={{ mb: 2 }}>{error}</Alert>}
|
|
65
68
|
{success && <Alert severity="success" sx={{ mb: 2 }}>{success}</Alert>}
|
|
66
69
|
<FormControl>
|
|
67
70
|
<RadioGroup value={value} onChange={handleChange}>
|
|
68
|
-
<FormControlLabel
|
|
69
|
-
|
|
71
|
+
<FormControlLabel
|
|
72
|
+
value="1"
|
|
73
|
+
control={<Radio disabled={busy} />}
|
|
74
|
+
label={t('Auth.ONE_FACTOR_LABEL', 'Allow single-factor authentication')}
|
|
75
|
+
/>
|
|
76
|
+
<FormControlLabel
|
|
77
|
+
value="2"
|
|
78
|
+
control={<Radio disabled={busy} />}
|
|
79
|
+
label={t('Auth.TWO_FACTOR_LABEL', 'Require two-factor authentication')}
|
|
80
|
+
/>
|
|
70
81
|
</RadioGroup>
|
|
71
82
|
</FormControl>
|
|
72
83
|
</Box>
|
|
@@ -1337,6 +1337,36 @@ export const authTranslations = {
|
|
|
1337
1337
|
"en": "Authentication settings saved.",
|
|
1338
1338
|
"sw": "Mipangilio ya uthibitishaji imehifadhiwa."
|
|
1339
1339
|
},
|
|
1340
|
+
"Auth.AUTH_FACTOR_TITLE": {
|
|
1341
|
+
"de": "Authentifizierungsanforderungen",
|
|
1342
|
+
"fr": "Exigences d'authentification",
|
|
1343
|
+
"en": "Authentication Requirements",
|
|
1344
|
+
"sw": "Mahitaji ya uthibitishaji"
|
|
1345
|
+
},
|
|
1346
|
+
"Auth.AUTH_FACTOR_HINT": {
|
|
1347
|
+
"de": "Legen Sie fest, wie viele Authentifizierungsfaktoren mindestens für die Anmeldung erforderlich sind.",
|
|
1348
|
+
"fr": "Définissez le nombre minimal de facteurs d'authentification requis pour la connexion.",
|
|
1349
|
+
"en": "Define the minimum number of authentication factors required for sign-in.",
|
|
1350
|
+
"sw": "Weka idadi ya chini ya vipengele vya uthibitishaji vinavyohitajika ili kuingia."
|
|
1351
|
+
},
|
|
1352
|
+
"Auth.ONE_FACTOR_LABEL": {
|
|
1353
|
+
"de": "Single-Factor-Authentifizierung erlauben",
|
|
1354
|
+
"fr": "Autoriser l'authentification à un facteur",
|
|
1355
|
+
"en": "Allow single-factor authentication",
|
|
1356
|
+
"sw": "Ruhusu uthibitishaji wa kipengele kimoja"
|
|
1357
|
+
},
|
|
1358
|
+
"Auth.TWO_FACTOR_LABEL": {
|
|
1359
|
+
"de": "Zwei-Faktor-Authentifizierung erzwingen",
|
|
1360
|
+
"fr": "Exiger l'authentification à deux facteurs",
|
|
1361
|
+
"en": "Require two-factor authentication",
|
|
1362
|
+
"sw": "Hitaji uthibitishaji wa vipengele viwili"
|
|
1363
|
+
},
|
|
1364
|
+
"Auth.AUTH_FACTOR_SAVE_SUCCESS": {
|
|
1365
|
+
"de": "Die Anforderung für Authentifizierungsfaktoren wurde gespeichert.",
|
|
1366
|
+
"fr": "L'exigence relative aux facteurs d'authentification a été enregistrée.",
|
|
1367
|
+
"en": "Factor requirement saved.",
|
|
1368
|
+
"sw": "Hitaji la vipengele vya uthibitishaji limehifadhiwa."
|
|
1369
|
+
},
|
|
1340
1370
|
"Auth.REGISTRATION_METHODS_TITLE": {
|
|
1341
1371
|
"de": "Registrierungsmethoden",
|
|
1342
1372
|
"fr": "Méthodes d'inscription",
|
|
@@ -229,17 +229,17 @@ export function AccountPage({
|
|
|
229
229
|
<Stack spacing={2.5}>
|
|
230
230
|
{(isSuperUser || perms.can_invite) && (
|
|
231
231
|
<Paper variant="outlined" sx={{ p: 2.5, borderRadius: 2 }}>
|
|
232
|
-
<
|
|
233
|
-
policy={authPolicy}
|
|
234
|
-
error={authPolicyError}
|
|
235
|
-
onPolicyChange={setAuthPolicy}
|
|
236
|
-
/>
|
|
232
|
+
<AuthFactorRequirementCard />
|
|
237
233
|
</Paper>
|
|
238
234
|
)}
|
|
239
235
|
|
|
240
236
|
{(isSuperUser || perms.can_invite) && (
|
|
241
237
|
<Paper variant="outlined" sx={{ p: 2.5, borderRadius: 2 }}>
|
|
242
|
-
<
|
|
238
|
+
<RegistrationMethodsManager
|
|
239
|
+
policy={authPolicy}
|
|
240
|
+
error={authPolicyError}
|
|
241
|
+
onPolicyChange={setAuthPolicy}
|
|
242
|
+
/>
|
|
243
243
|
</Paper>
|
|
244
244
|
)}
|
|
245
245
|
|