Commit graph

214 commits

Author SHA1 Message Date
a22081f288
refactor: Replace bang calls with error handling in Index LiveViews
- Replace Ash.get!/Ash.destroy! with Ash.get/Ash.destroy
- Add case statements for Forbidden, NotFound, and generic errors
- Display user-friendly flash messages for all error cases
- Use Enum.map_join/3 for efficient error formatting
2026-01-13 15:17:07 +01:00
77ae5c4888
refactor: Use submit_form wrapper in all LiveView forms
- Replace AshPhoenix.Form.submit with submit_form/3 wrapper
- Import current_actor and submit_form from LiveHelpers
- Consistent actor handling in all form submissions
2026-01-13 15:17:06 +01:00
351eac4c02
Fix error handling and actor access in MemberLive.Index
Replace bang calls with proper error handling and use current_actor/1
helper for consistent actor access.
2026-01-13 15:17:05 +01:00
cd7e6b0843
Use current_actor/1 helper in all LiveViews
Replace inconsistent actor access patterns with current_actor/1 helper
and ensure actor is passed to all Ash operations for proper authorization.
2026-01-13 15:16:00 +01:00
075a06ba6f
Refactor test setup: use global setup and fix MembershipFees domain alias
- Remove redundant setup blocks from member_live tests
- Add build_unauthenticated_conn helper for AuthController tests
- Add global setup in conn_case.ex
2026-01-13 15:15:56 +01:00
bc87893134
Integrate Member policies in LiveViews
- Add on_mount hook to ensure user role is loaded in all Member LiveViews
- Pass actor parameter to all Ash operations (read, get, create, update, destroy, load)
2026-01-13 15:12:24 +01:00
35895ac7fd fix tests
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-13 10:48:44 +01:00
922f9f93d0 Merge branch 'main' into feature/223_memberfields_settings
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-12 13:15:40 +01:00
e38de7d690 chore: rename custom to data field in the UI
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-12 09:50:51 +01:00
68c09b761e
perf: optimize load_user_counts with DB-side aggregation
All checks were successful
continuous-integration/drone/push Build is passing
Replace Elixir-side counting with Ecto GROUP BY COUNT query for
better performance. This avoids loading all users into memory and
performs the aggregation directly in the database.
2026-01-08 16:20:27 +01:00
5ac9ab7ff9
refactor: add opts_with_actor helper and improve error formatting
Add opts_with_actor helper function to reduce duplication when building
Ash options with actor and domain. Improve format_error documentation
and ensure consistent error message formatting.
2026-01-08 16:20:27 +01:00
675ab14fce
fix: correct German translations for role management
Fix incorrect translations:
- 'Listing Roles' -> 'Rollen auflisten' (was 'Benutzer*innen auflisten')
- 'Custom' -> 'Benutzerdefiniert' (was 'Benutzerdefinierte Felder')
2026-01-08 16:20:27 +01:00
32296625fe
refactor: extract shared helpers for RoleLive modules
Extract format_error and permission_set_badge_class functions into
MvWeb.RoleLive.Helpers module to eliminate code duplication between
Index and Show LiveViews.
2026-01-08 16:20:26 +01:00
d9dd936ae3
fix: add actor and domain parameters to user count functions in Show
Add actor and domain parameters to recalculate_user_count and
load_user_count to ensure consistent authorization. Clarify that
load_user_count is for initial display while recalculate_user_count
is for fresh count before deletion.
2026-01-08 16:20:26 +01:00
548bad6703
fix: add actor and domain parameters to user count functions
Add actor parameter to load_user_counts and recalculate_user_count
in Index LiveView to ensure consistent authorization and policy
enforcement. Also add domain parameter for clarity.
2026-01-08 16:20:25 +01:00
37a2fc3e83
refactor: replace cond with if in handle_delete_role functions 2026-01-08 16:20:25 +01:00
75ab046be4
refactor: extract ensure_user_role_loaded into shared on_mount hook
Move duplicate ensure_user_role_loaded logic into MvWeb.LiveHelpers
on_mount hook to eliminate code duplication across RoleLive modules
and centralize security-related user role loading.
2026-01-08 16:20:25 +01:00
ac67b8073d
fix: eliminate duplicate user_count queries in delete handlers
Calculate user_count once and reuse the value instead of calling
recalculate_user_count twice, reducing unnecessary database queries.
2026-01-08 16:20:25 +01:00
83812193b6
fix: add actor parameter to Authorization.get_role in Index
Ensure consistent authorization by passing actor parameter to
get_role call, matching the pattern used in Show LiveView.
2026-01-08 16:20:24 +01:00
8d36c0b02c
fix: use reraise instead of raise in rescue blocks
Replace raise with reraise to preserve the original stacktrace when
re-raising exceptions in rescue blocks, improving error debugging.
2026-01-08 16:19:49 +01:00
54c825bac3
refactor: reduce nesting depth in RoleLive handle_event functions 2026-01-08 16:19:49 +01:00
b638a54bd6
feat: prevent deletion of roles with assigned users 2026-01-08 16:19:47 +01:00
954fc4261a
fix: improve contrast for 'No description' text to meet WCAG 2 AA
Change text-base-content/50 to text-base-content/70 for better
accessibility contrast ratio in role index and show pages
2026-01-08 16:19:02 +01:00
9c8cdb5e17
feat: add user count display for each role
- Add Users column showing number of users assigned to each role
- Load user counts efficiently in single query to avoid N+1
- Similar implementation to membership fee types member count
2026-01-08 16:18:07 +01:00
7d4bc84ce0
refactor: reduce nesting depth in RoleLive.Index.mount
Extract role loading logic into separate private functions to fix Credo warning about nested function body.
2026-01-08 16:16:54 +01:00
2f03f7c00c
feat: assign admin role to admin user in seeds
- Create Admin role if it doesn't exist
- Assign Admin role to admin@mv.local user
- Remove separate create_admin_role script (integrated into seeds)
2026-01-08 16:16:54 +01:00
61c98d1b88
feat: add visible buttons with text for role CRUD operations
- Add text labels to Edit and Delete buttons in index page
- Change button size from btn-xs to btn-sm for better visibility
- Add Delete button to show page for non-system roles
- Implement handle_event for delete in show page
- Add format_error helper to show page
2026-01-08 16:16:54 +01:00
9a86e0ec01
feat: implement role management LiveViews
Add complete CRUD interface for role management under /admin/roles.

- Index page with table showing name, description, permission_set_name, is_system_role
- Show page for role details
- Form component for create/edit with permission_set_name dropdown
- System role badge and disabled delete button
- Flash messages for success/error
- Authorization checks using MvWeb.Authorization helpers
- Comprehensive test coverage (22 tests)

Routes added under /admin scope. All LiveViews load user role
for authorization checks. Form uses custom dropdown for permission sets.
2026-01-08 16:16:53 +01:00
47c46eaebf i18n: update translations 2026-01-08 11:40:04 +01:00
b139d85791 fix: add missing event handler for member field visibility updates 2026-01-08 11:37:39 +01:00
30c43271ea refactor: remove code duplication using helper modules 2026-01-08 11:37:07 +01:00
36776f8e28 fix tests and linting 2026-01-07 18:11:36 +01:00
4a6e7cf51a feat: show only edit or list view in settings 2026-01-07 18:11:07 +01:00
38d106a69e fix: exit date as default hidden column 2026-01-07 12:14:41 +01:00
df8c6a1854 Merge branch 'main' into feature/223_memberfields_settings
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 11:42:54 +01:00
909d4af2a2 Merge branch 'main' into feature/223_memberfields_settings 2026-01-07 11:11:02 +01:00
ee3e1745e0 fix linting errors
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 10:59:20 +01:00
a5a1cb7fdd style: remove display name helper in member overview for UX
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 09:55:06 +01:00
9f97515d74 chore: movs display name helper to won helper module 2026-01-07 09:54:37 +01:00
e1211fcf0f fix linting
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-07 09:05:51 +01:00
b59a4ef61a feat: adds email as fallback for name in member details
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-06 16:43:13 +01:00
dc8271451d feat: adapt UI 2026-01-02 16:20:23 +01:00
08f563a412 Merge branch 'main' into bugfix/274_required_custom_fields
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-02 13:47:24 +01:00
0df5d1c0b9
Merge branch 'main' into feature/280_membership_fee_ui
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-26 23:14:10 +01:00
77ac3d1b18 fix: remove duplicate toggle button in table header
Keep only the toggle button in toolbar for better UX.
2025-12-26 21:41:22 +01:00
619fdc90af fix: clear warning state on Decimal.parse error
Explicitly call hide_amount_warning when Decimal.parse returns error.
2025-12-26 21:41:14 +01:00
856ce53295 fix: improve MembershipFeesComponent state management and error handling
Replace assign_new with assign for cycles and available_fee_types. Set regenerating flag at event start. Fix create_cycle parsing with explicit error handling. Use atomic bulk delete for all cycles. Improve delete confirmation robustness. Fix unless/else pattern for Credo compliance.
2025-12-26 21:41:05 +01:00
3035869fc8 Add explicit domain to Ash.get! for consistency
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-26 21:04:43 +01:00
3cf8244cd6 fix linting errors
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-23 18:14:59 +01:00
1dd68bcaf2 feat: coherent required boolean handling
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-23 18:08:31 +01:00