From c06d7aa787391b847380b3adf4c3cbf76742df1c Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Wed, 15 Oct 2025 12:10:56 -0600 Subject: [PATCH 001/180] basic ui updates for system users table --- enferno/admin/templates/admin/users.html | 75 ++++++++++++++++-------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index 466ae96ea..87c87c98a 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -20,17 +20,38 @@ > @@ -83,22 +104,26 @@ @@ -354,7 +379,7 @@ {title: "{{_('Name')}}", value: "name"}, {title: "{{_('Account Status')}}", value: "active_status"}, {title: "{{_('Groups')}}", value: "roles"}, - {title: "{{_('Two Factor Authentication')}}", value: "2fa"}, + {title: "{{_('Two-Factor Authentication')}}", value: "2fa"}, {title: "{{_('Actions')}}", value: "action", sortable: false} ], From 6701ed008ca29d5b49c95bf2c626db96eaa001e6 Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Wed, 15 Oct 2025 15:00:32 -0600 Subject: [PATCH 002/180] update create users dialog to match figma design --- enferno/admin/templates/admin/users.html | 326 +++++++++---------- enferno/static/js/components/ToggleButton.js | 23 ++ 2 files changed, 186 insertions(+), 163 deletions(-) create mode 100644 enferno/static/js/components/ToggleButton.js diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index 87c87c98a..4db7023ab 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -157,188 +157,173 @@ - - - - + + + + + + +
{{ _('User Details') }}
+ + + + + + +
+ + + + + +
+
+ +
+ - - - -
-
- - -
- - + + +
+
+ +
+ - - - - - - -
-
-
- - -
- - - + > + + + + +
+
+
+ + +
{{ _('User Roles') }}
+
+ + ${role.name} + +
+
{{ _('User Permissions') }}
+
+ + {{ _('Can View Usernames') }} + + + + {{ _('Can View Full History') }} + + + + {{ _('Can View Simple History') }} + + + + {{ _('Can Self-Assign') }} + + + + {{ _('Can Edit Locations') }} + + + + {{ _('Can Request Exports') }} + + + + {{ _('Can Import From Web') }} + +
+
+
+ + + {{ _('Revoke 2FA') }} + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ _('Revoke 2FA') }} - - - - mdi-logout - {{ _('Logout All Sessions') }} - - - - - - {{ _('Close') }} - - {{ _('Save') }} - - -
+ + mdi-logout + {{ _('Logout All Sessions') }} + + +
@@ -354,6 +339,7 @@ {% endblock %} {% block js %} + {% endblock %} diff --git a/enferno/static/js/components/ToggleButton.js b/enferno/static/js/components/ToggleButton.js new file mode 100644 index 000000000..6b8c97b1b --- /dev/null +++ b/enferno/static/js/components/ToggleButton.js @@ -0,0 +1,23 @@ +const ToggleButton = Vue.defineComponent({ + props: { + modelValue: { + type: Boolean, + required: true, + }, + activeColor: { + type: String, + default: 'primary', + }, + }, + emits: ['update:modelValue'], + template: ` + + mdi-check + + + `, +}); \ No newline at end of file From 3df53324a96a08730e7c681f9f86985d9839b195 Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Wed, 15 Oct 2025 15:07:30 -0600 Subject: [PATCH 003/180] add default to toggle button component --- enferno/static/js/components/ToggleButton.js | 1 + 1 file changed, 1 insertion(+) diff --git a/enferno/static/js/components/ToggleButton.js b/enferno/static/js/components/ToggleButton.js index 6b8c97b1b..dcaa7475c 100644 --- a/enferno/static/js/components/ToggleButton.js +++ b/enferno/static/js/components/ToggleButton.js @@ -3,6 +3,7 @@ const ToggleButton = Vue.defineComponent({ modelValue: { type: Boolean, required: true, + default: false, }, activeColor: { type: String, From 6491bbd12ad89d64f9cb04caa854a828caa909c4 Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Wed, 15 Oct 2025 15:07:50 -0600 Subject: [PATCH 004/180] Tweak message when new user created --- enferno/admin/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enferno/admin/views.py b/enferno/admin/views.py index a1c914aee..f28e623bd 100644 --- a/enferno/admin/views.py +++ b/enferno/admin/views.py @@ -5115,7 +5115,7 @@ def api_user_create( f"User {username} has been created by {current_user.username} successfully.", ) return HTTPResponse.created( - message=f"User {username} has been created successfully", + message=f"New User '{user.name}' successfully added!", data={"item": user.to_dict()}, ) else: From 9deb93d760f968b9f9b8ff7b8297ae0c465cbe96 Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Wed, 15 Oct 2025 15:07:58 -0600 Subject: [PATCH 005/180] fix typo on save button --- enferno/admin/templates/admin/users.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index 4db7023ab..a650ab554 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -163,7 +163,7 @@ {{ _('Cancel') }} - + {{ _('Add User') }} From aec0d80af2f200befc11806b418ddeee8c32bbaa Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Thu, 16 Oct 2025 09:00:49 -0600 Subject: [PATCH 006/180] allow users to use main input for search --- enferno/admin/templates/admin/users.html | 37 +++++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index a650ab554..04d5f5b69 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -24,6 +24,8 @@ {{ _('System Users') }} { - this.items = res.data.items; - this.itemsLength = res.data.total; - }).catch(err => { - console.error(err?.response?.data); - }).finally(() => { - this.loading = false; + + const params = new URLSearchParams({ + page: this.options.page, + per_page: this.options.itemsPerPage, }); + + if (this.options.q) { + params.append('q', this.options.q); + } + + api.get(`/admin/api/users/?${params.toString()}`) + .then(res => { + this.items = res.data.items; + this.itemsLength = res.data.total; + }) + .catch(err => { + console.error(err?.response?.data); + }) + .finally(() => { + this.loading = false; + }); }, createItem() { @@ -710,8 +726,13 @@ } else { this.editedItem.roles.push(role) // add } - } + }, + searchUsers: debounce(function (evt) { + this.loading = true; + this.search = evt; + this.refresh({ q: evt }) + }, 350), } }); From e02746de22f80efd4f09057438d77a9f3590f0e7 Mon Sep 17 00:00:00 2001 From: Daniel Apodaca Date: Thu, 16 Oct 2025 09:23:32 -0600 Subject: [PATCH 007/180] update edit user dialog --- enferno/admin/templates/admin/users.html | 166 +++++++++-------------- enferno/admin/views.py | 2 +- 2 files changed, 65 insertions(+), 103 deletions(-) diff --git a/enferno/admin/templates/admin/users.html b/enferno/admin/templates/admin/users.html index 04d5f5b69..8497c775b 100644 --- a/enferno/admin/templates/admin/users.html +++ b/enferno/admin/templates/admin/users.html @@ -59,9 +59,18 @@ - - - - @@ -131,7 +124,7 @@