added password reset - resend invite link

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-29 09:19:04 +02:00
parent fe5d1bd9e4
commit 05660124a7
4 changed files with 87 additions and 2 deletions

View File

@@ -174,7 +174,46 @@ class _StaffScreenState extends State<StaffScreen> {
),
],
),
trailing: canManageStaff ? const Icon(Icons.edit_note) : null,
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (member.jobTitle != null && member.jobTitle!.isNotEmpty) ...[
Text('Qualifica: ${member.jobTitle!}'),
const SizedBox(width: 8),
],
if (canManageStaff) ...[
const SizedBox(width: 8),
if (!member.hasJoined)
ElevatedButton.icon(
icon: const Icon(Icons.send),
label: const Text("Re-invia Invito (In Attesa)"),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
),
onPressed: () {
// Chiama la funzione di reset password mascherata da invito
context.read<StaffCubit>().resetPasswordOrResendInviteLink(
member.email!,
);
},
)
else
OutlinedButton.icon(
icon: const Icon(Icons.lock_reset),
label: const Text("Invia Reset Password"),
onPressed: () {
// Chiama LA STESSA IDENTICA FUNZIONE!
context.read<StaffCubit>().resetPasswordOrResendInviteLink(
member.email!,
);
},
),
],
],
),
onTap: () =>
canManageStaff ? _openStaffForm(context, member: member) : null,
),
@@ -395,6 +434,32 @@ class _StaffScreenState extends State<StaffScreen> {
),
),
),
/* const SizedBox(height: 16),
if (!member!.hasJoined)
ElevatedButton.icon(
icon: const Icon(Icons.send),
label: const Text("Re-invia Invito (In Attesa)"),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
),
onPressed: () {
// Chiama la funzione di reset password mascherata da invito
context
.read<StaffCubit>()
.resetPasswordOrResendInviteLink(member.email!);
},
)
else
OutlinedButton.icon(
icon: const Icon(Icons.lock_reset),
label: const Text("Invia Reset Password"),
onPressed: () {
// Chiama LA STESSA IDENTICA FUNZIONE!
context
.read<StaffCubit>()
.resetPasswordOrResendInviteLink(member.email!);
},
), */
],
),
),