feat(ui,api): update action buttons, password modal button, and dashboard user count
- Exclude hidden super administrator from dashboard active users count - Rename UPDATE PASSWORD button to UPDATE in change password modal - Use single-word labels and uniform dimensions for user profile action buttons
This commit is contained in:
1 parent
59e94192aa
commit
2dc8ee4242
3 files changed
+9
-7
No files matched your search
@@ -12,7 +12,7 @@ exports.getStats = (req, res) => {
|
||||
let totalStudents;
|
||||
let completedDocuments;
|
||||
let missingDocuments;
|
||||
const activeUsers = db.prepare('SELECT COUNT(*) as count FROM users WHERE is_active = 1').get().count;
|
||||
const activeUsers = db.prepare('SELECT COUNT(*) as count FROM users WHERE is_active = 1 AND COALESCE(is_hidden, 0) = 0').get().count;
|
||||
|
||||
// Resolve Active Academic Year
|
||||
const activeAy = db.prepare("SELECT * FROM academic_years WHERE status = 'active' LIMIT 1").get()
|
||||
|
||||
@@ -243,7 +243,7 @@ class _ChangePasswordModalState extends ConsumerState<ChangePasswordModal> {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
PrimaryButton(
|
||||
label: 'UPDATE PASSWORD',
|
||||
label: 'UPDATE',
|
||||
isLoading: _isLoading,
|
||||
onPressed: _handleSubmit,
|
||||
),
|
||||
@@ -276,9 +276,9 @@ class _ChangePasswordModalState extends ConsumerState<ChangePasswordModal> {
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
SizedBox(
|
||||
width: 180,
|
||||
width: 130,
|
||||
child: PrimaryButton(
|
||||
label: 'UPDATE PASSWORD',
|
||||
label: 'UPDATE',
|
||||
isLoading: _isLoading,
|
||||
onPressed: _handleSubmit,
|
||||
),
|
||||
|
||||
@@ -1325,9 +1325,10 @@ class _UserDetailAndEditModalContentState
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Container(
|
||||
height: 38,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: isCompact ? 6 : 12,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -1368,7 +1369,7 @@ class _UserDetailAndEditModalContentState
|
||||
|
||||
final resetBtn = buildActionButton(
|
||||
icon: Icons.lock_reset_rounded,
|
||||
label: isCompact ? 'Reset Pass' : 'Reset Password',
|
||||
label: 'Reset',
|
||||
onTap: () {
|
||||
Navigator.of(context, rootNavigator: true).pop();
|
||||
widget.onResetPassword?.call(_currentUser);
|
||||
@@ -1652,6 +1653,7 @@ class _UserDetailAndEditModalContentState
|
||||
child: OutlinedButton(
|
||||
onPressed: _cancelEditing,
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size.fromHeight(50),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 14,
|
||||
@@ -1666,7 +1668,7 @@ class _UserDetailAndEditModalContentState
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: PrimaryButton(
|
||||
label: 'Save Changes',
|
||||
label: 'Save',
|
||||
isLoading: _isLoading,
|
||||
onPressed: _handleSave,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user