added password reset - resend invite link (#10)
Co-authored-by: Copilot <copilot@github.com> Reviewed-on: #10 Co-authored-by: Mark M2 Macbook <marco@catelli.it> Co-committed-by: Mark M2 Macbook <marco@catelli.it>
This commit is contained in:
@@ -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!);
|
||||
},
|
||||
), */
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user