feat: Add registration mode setting (invite-only vs public)
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled
Backend: - Added registrationMode and requireInviteCode to settings endpoint - Values pulled from REGISTRATION_MODE and REQUIRE_INVITE_CODE env vars - Defaults to 'invite_only' mode (requires invite code) Frontend: - Added Registration Mode dropdown to General settings tab - Options: 'Invite Only' or 'Public Registration' - Spans full width on desktop layout - Settings persist with backend save This allows admins to toggle between invite-only and public registration modes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -356,6 +356,10 @@ export class DashboardService {
|
||||
timezone: process.env.TZ || 'UTC',
|
||||
language: 'en',
|
||||
|
||||
// Registration Settings
|
||||
registrationMode: process.env.REGISTRATION_MODE || 'invite_only', // 'public' or 'invite_only'
|
||||
requireInviteCode: process.env.REQUIRE_INVITE_CODE === 'true' || true,
|
||||
|
||||
// Security Settings
|
||||
enforcePasswordPolicy: true,
|
||||
minPasswordLength: 8,
|
||||
|
||||
@@ -177,7 +177,7 @@ export default function SettingsPage() {
|
||||
<FormControl fullWidth>
|
||||
<InputLabel>Language</InputLabel>
|
||||
<Select
|
||||
value={settings.language}
|
||||
value={settings.language || 'en'}
|
||||
label="Language"
|
||||
onChange={(e) => setSettings({ ...settings, language: e.target.value })}
|
||||
>
|
||||
@@ -188,6 +188,19 @@ export default function SettingsPage() {
|
||||
<MenuItem value="zh">Chinese</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
|
||||
|
||||
<FormControl fullWidth sx={{ gridColumn: { xs: '1', md: 'span 2' } }}>
|
||||
<InputLabel>Registration Mode</InputLabel>
|
||||
<Select
|
||||
value={settings.registrationMode || 'invite_only'}
|
||||
label="Registration Mode"
|
||||
onChange={(e) => setSettings({ ...settings, registrationMode: e.target.value })}
|
||||
>
|
||||
<MenuItem value="invite_only">Invite Only (Requires Invite Code)</MenuItem>
|
||||
<MenuItem value="public">Public Registration (Open to All)</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Box>
|
||||
</TabPanel>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user