Commit Graph

39 Commits

Author SHA1 Message Date
hykocx 0d6b06f217 feat(users): allow system roles to be renamed but not have permissions changed
- update `updateRole` to allow name changes for system roles while blocking permission updates
- remove edit button restriction for system roles in roles page
- disable name field only was replaced by disabling permissions checkboxes for system roles in edit modal
- update README to reflect new system role update policy
2026-04-25 10:02:51 -04:00
hykocx 826ce3dcd1 fix(auth): prevent system roles from being updated
- throw error in updateRole when role is system-protected
- hide edit button in roles table for system roles
- update README to reflect roles cannot be modified (not just renamed)
2026-04-25 09:59:33 -04:00
hykocx 2360021376 refactor(users)!: merge users.edit and users.delete into users.manage permission
BREAKING CHANGE: permissions `users.edit` and `users.delete` have been replaced by a single `users.manage` permission; any role or code referencing the old keys must be updated

- remove `USERS_EDIT` and `USERS_DELETE` from `PERMISSIONS` and `PERMISSION_DEFINITIONS`
- add `USERS_MANAGE` permission covering create, edit and delete actions
- update `db.js` to use `users.manage` in permission checks
- update `auth/api.js` to reference the new permission key
- update `UsersPage.client.js` to check `users.manage` instead of old keys
- update `api/define.js` and all README examples to reflect the new key
2026-04-25 09:47:34 -04:00
hykocx 74bc3073a7 feat(admin): add permission-based widget visibility on dashboard
- add optional `permission` field to `registerWidget` api
- filter widgets in `DashboardPage` based on user permissions
- register users widget with `users.view` permission requirement
- document `permission` parameter in admin README
2026-04-25 09:31:54 -04:00
hykocx c959b16db5 refactor(api): add granular permission enforcement on admin routes
- add optional `permission` field to route definitions with type validation in `define.js`
- check `hasPermission()` in router after `requireAdmin()` and return 403 if denied
- document `permission` and `skipRateLimit` optional fields in api README
- load user permissions in `AdminPage.server.js` and pass them to client via `user` prop
- use `user.permissions` in `RolesPage` and `UsersPage` to conditionally render actions
- expose permission-gated API routes in `auth/api.js`
2026-04-25 09:21:07 -04:00
hykocx abd9d651dc feat(auth): add user invitation flow with account setup
- add `createAccountSetup`, `verifyAccountSetupToken`, `deleteAccountSetupToken` to verifications core
- add `completeAccountSetup` function to auth core for password creation on invite
- add `InvitationEmail` template for sending invite links
- add `SetupAccountPage` client page for invited users to set their password
- add `UserCreateModal` admin component to invite new users
- wire invitation action and API endpoint in auth feature
- update admin `UsersPage` to include user creation modal
- update auth and admin README docs
2026-04-25 09:03:15 -04:00
hykocx 2d3d450e19 refactor(admin): replace inline svgs with icon components
- add `Logout02Icon` to admin top bar logout button
- add `SmartPhone01Icon` and `ComputerIcon` to profile page session list
- update icons index to use hugeicons react package imports
2026-04-24 20:52:51 -04:00
hykocx 183d151f0f style(admin): update card width classes from min-w to max-w on profile and settings pages
- replace `sm:min-w-3/5` with `lg:max-w-4/5` on all profile page cards
- replace `min-w-3/5` with `w-full lg:max-w-4/5` on settings page cards
2026-04-24 17:58:55 -04:00
hykocx 77ca4fe66f fix(ui): improve mobile responsiveness across admin components
- reduce app name font size from text-lg to text-sm in AdminTop mobile header
- make profile page cards full-width on mobile with sm:min-w-3/5 breakpoint
- stack photo upload layout vertically on mobile using flex-col sm:flex-row
- add flex-wrap to photo action buttons for small screens
- make TabNav horizontally scrollable with hidden scrollbar on mobile
- add shrink-0 and whitespace-nowrap to tab buttons to prevent wrapping
2026-04-24 17:54:37 -04:00
hykocx d0e407b67d fix(admin): update session data check to use sessions property 2026-04-24 17:01:50 -04:00
hykocx a92b4334f1 feat(admin): add session management tab to profile page
- add sessions tab with active session list in ProfilePage
- fetch and display sessions with current session highlight
- implement single and bulk session revocation with redirect on self-revoke
- add session-related api helpers in auth api
2026-04-24 16:59:54 -04:00
hykocx c844bc5e86 feat(admin): add password management to user edit modal and profile page
- add new password field in UserEditModal with optional admin-set password on save
- add send password reset link button with loading state in UserEditModal
- add password change section with strength indicator in ProfilePage
- expose sendPasswordResetEmail utility in auth api
2026-04-24 15:45:56 -04:00
hykocx 25f93526a5 feat(admin): add RoleBadge component and integrate it in user management views
- add new RoleBadge shared component for consistent role display
- export RoleBadge from shared components index
- replace inline Badge usage with RoleBadge in UsersPage role column
- use RoleBadge via renderTag prop in UserEditModal role TagInput
- simplify TagInput Pill to a generic unstyled pill, removing color logic
2026-04-24 15:31:28 -04:00
hykocx 70000e0761 refactor(admin): embed roles data in user list query and update role display
- remove separate `/zen/api/roles` fetch and `roleColorMap` state from UsersPage
- update SQL query to include aggregated roles array per user via subquery
- replace single role badge with multi-badge display supporting overflow indicator
2026-04-24 15:20:51 -04:00
hykocx b88f84e2a1 refactor(admin): wrap profile page content in fragment 2026-04-24 15:13:06 -04:00
hykocx 87990390c1 refactor(admin): replace inline email form with modal dialog
- import Modal component from shared components
- rename emailFormOpen state to emailModalOpen for clarity
- convert handleEmailSubmit from form event handler to plain async function
- move email change form into a Modal instead of inline collapsible form
- pass pendingEmailMessage as Input description prop instead of separate paragraph
- simplify toggle button to only show when no pending message
2026-04-24 15:11:29 -04:00
hykocx 66c862cf73 feat(admin): add email change flow with confirmation for users
- add `ConfirmEmailChangePage.client.js` for email change token confirmation
- add `emailChange.js` core utility to generate and verify email change tokens
- add `EmailChangeConfirmEmail.js` and `EmailChangeNotifyEmail.js` email templates
- update `UserEditModal` to handle email changes with password verification for self-edits
- update `ProfilePage` to support email change initiation
- update `UsersPage` to pass `currentUserId` to `UserEditModal`
- add email change API endpoints in `auth/api.js` and `auth/email.js`
- register `ConfirmEmailChangePage` in `AdminPage.client.js`
2026-04-24 15:04:36 -04:00
hykocx bbb55605c3 refactor(admin): simplify ProfilePage with tabs and component cleanup 2026-04-22 20:26:45 -04:00
hykocx 68d97c81da style(admin): increase settings card min-width from 1/2 to 3/5 2026-04-22 20:22:54 -04:00
hykocx f082ef4fda style(ui): adjust layout alignment and sizing in settings page and tab nav 2026-04-22 20:22:07 -04:00
hykocx ccdd309414 feat(admin): add bottom navigation items and settings page to admin panel 2026-04-22 20:12:18 -04:00
hykocx 18f1fcdbd0 style(ui): change default button size from sm to md and remove explicit size="sm" props 2026-04-22 19:45:56 -04:00
hykocx 0dc6092780 refactor(ui): change Button icon prop to accept component reference instead of JSX element 2026-04-22 19:41:57 -04:00
hykocx 9ca3e0a83b refactor(admin): pass icon components as references instead of JSX elements 2026-04-22 19:40:28 -04:00
hykocx e2dd60843f style(ui): add icon-only button sizing and fix action column alignment 2026-04-22 19:38:02 -04:00
hykocx 0fd01d2b68 fix(ui): add right alignment support for table columns using align prop 2026-04-22 19:35:39 -04:00
hykocx fa40565686 refactor(admin): migrate page titles from static map to self-registering pages 2026-04-22 17:46:53 -04:00
hykocx 94aaeb241b refactor(admin): extract page titles into a shared constants file 2026-04-22 17:43:23 -04:00
hykocx 5feceb09f2 refactor(admin): use registry titles for breadcrumb labels 2026-04-22 17:39:24 -04:00
hykocx e5df0e102b style(ui): replace dark hover bg from neutral-950 to neutral-900 and use RelativeDate component in UsersPage 2026-04-22 17:30:48 -04:00
hykocx f54b2640ad refactor(admin): replace parameterized routes with modal-based editing for users and roles 2026-04-22 16:15:43 -04:00
hykocx 0c860d9fe5 feat(admin): replace single page name with dynamic breadcrumb navigation in AdminTop 2026-04-22 15:51:01 -04:00
hykocx fe4ca228cc refactor(admin): simplify AdminHeader component by removing inline logic 2026-04-22 15:36:48 -04:00
hykocx 18270540cc refactor(admin): replace inline avatar logic with shared UserAvatar component 2026-04-22 15:14:07 -04:00
hykocx 1613bd5275 feat(admin): add dynamic role color support for user badges 2026-04-22 15:08:46 -04:00
hykocx 96c8352dcf refactor(ui): move system badge to dedicated column and update Badge styles 2026-04-22 15:02:10 -04:00
hykocx 7ca818da5a fix(ui): fix missing space between rounded-lg and transition-all in Button class 2026-04-22 14:55:19 -04:00
hykocx 0106bc4ea0 feat(core)!: introduce runtime extension registry and flat module conventions
BREAKING CHANGE: sup config now derives entries from package.json#exports and a server/client glob instead of manual lists; module structure follows flat + barrel convention with .server.js/.client.js runtime suffixes
2026-04-22 14:13:30 -04:00
hykocx 61388f04a6 refactor: reorganize feature modules with consistent naming conventions and flattened structure 2026-04-22 14:12:15 -04:00