Make invite form always visible in Organization Settings dialog, with send button enabled only if user has manage permission; reposition copy link button next to invite link text for sleeker layout

This commit is contained in:
Leon Bösche
2026-01-24 03:49:58 +01:00
parent c1c8f837a8
commit 1f7f4f33cc

View File

@@ -449,7 +449,6 @@ class _OrganizationSettingsDialogState
], ],
// Invite form // Invite form
if (_canManage) ...[
const Divider(), const Divider(),
Text( Text(
'Invite New User', 'Invite New User',
@@ -518,19 +517,15 @@ class _OrganizationSettingsDialogState
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
ModernGlassButton( ModernGlassButton(
onPressed: () { onPressed: _canManage ? () {
final username = usernameController.text.trim(); final username = usernameController.text.trim();
if (username.isNotEmpty) { if (username.isNotEmpty) {
_inviteUser(username, selectedRole); _inviteUser(username, selectedRole);
usernameController.clear(); usernameController.clear();
} }
}, } : null,
child: const Text('Send Invitation'), child: const Text('Send Invitation'),
), ),
],
// Invite link section
if (_inviteLink != null) ...[
const Divider(), const Divider(),
Text( Text(
'Invite Link', 'Invite Link',
@@ -540,25 +535,27 @@ class _OrganizationSettingsDialogState
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Row(
children: [
Expanded(
child: Text(
'https://b0esche.cloud/join?token=${_inviteLink ?? ''}', 'https://b0esche.cloud/join?token=${_inviteLink ?? ''}',
style: TextStyle(color: AppTheme.secondaryText), style: TextStyle(color: AppTheme.secondaryText),
), ),
const SizedBox(height: 16), ),
Row( const SizedBox(width: 16),
children: [
ModernGlassButton( ModernGlassButton(
onPressed: _copyInviteLink, onPressed: _copyInviteLink,
child: const Text('Copy Link'), child: const Text('Copy Link'),
), ),
const SizedBox(width: 16), ],
),
const SizedBox(height: 16),
if (_canManage) if (_canManage)
ModernGlassButton( ModernGlassButton(
onPressed: _regenerateInviteLink, onPressed: _regenerateInviteLink,
child: const Text('Regenerate'), child: const Text('Regenerate'),
), ),
],
),
] else if (_canManage) ...[ ] else if (_canManage) ...[
const Divider(), const Divider(),
const Text('No invite link available'), const Text('No invite link available'),