Allow user-member association in edit/create views closes #168 #207

Merged
moritz merged 12 commits from feature/user-linking into main 2025-11-27 16:11:03 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

#168

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues
## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [ ] Refactoring https://git.local-it.org/local-it/mitgliederverwaltung/issues/168 ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [x] axe-core dev tools show no critical or major issues
moritz self-assigned this 2025-11-13 22:35:24 +01:00
moritz added 7 commits 2025-11-13 22:35:26 +01:00
refactor: Rename Property/PropertyType to CustomFieldValue/CustomField
All checks were successful
continuous-integration/drone/push Build is passing
8400e727a7
Complete refactoring of resources, database tables, code references, tests, and documentation for improved naming consistency.
fix: Allow optional email values in custom fields
All checks were successful
continuous-integration/drone/push Build is passing
2b3c94d3b2
feat: Add Custom Fields link to navbar
All checks were successful
continuous-integration/drone/push Build is passing
158ac52d97
feat: add custom field slug
All checks were successful
continuous-integration/drone/push Build is passing
0135dafa3a
feat: add user to member linking
Some checks failed
continuous-integration/drone/push Build is failing
ad51a226f7
moritz force-pushed feature/user-linking from ad51a226f7 to 1819a1e2d1 2025-11-20 15:27:56 +01:00 Compare
moritz force-pushed feature/user-linking from 1819a1e2d1 to 62d472cee6 2025-11-20 16:33:15 +01:00 Compare
moritz force-pushed feature/user-linking from 62d472cee6 to 90ad6a1a02 2025-11-20 16:51:21 +01:00 Compare
moritz force-pushed feature/user-linking from 90ad6a1a02 to adc6608e54 2025-11-20 16:52:04 +01:00 Compare
moritz changed title from WIP: Allow user-member association in edit/create views closes #168 to Allow user-member association in edit/create views closes #168 2025-11-20 16:52:10 +01:00
requested reviews from simon, carla 2025-11-20 16:56:06 +01:00
moritz added 3 commits 2025-11-20 22:10:56 +01:00
Extract filter logic into apply_linking_filters/3 helper, add Credo disable for fuzzy search complexity
feat: improve user-member linking UI and error messages
All checks were successful
continuous-integration/drone/push Build is passing
4b4ec63613
Reload members on email change, extract user-friendly errors from Ash, add translations
carla approved these changes 2025-11-26 14:39:55 +01:00
carla left a comment
Owner

Nice work 👍
I just have the two aspects I mentioned, but they can be also handled in other issues:

  1. Enter does not selects dropdown
  2. Put fuzzy search in helper function to avoid duplicated code
    And you would also add that to member form right?
Nice work 👍 I just have the two aspects I mentioned, but they can be also handled in other issues: 1. Enter does not selects dropdown 2. Put fuzzy search in helper function to avoid duplicated code And you would also add that to member form right?
@ -363,2 +436,3 @@
# Fuzzy Search function that can be called by live view and calls search action
@doc """
Performs fuzzy search on members using PostgreSQL trigram similarity.
Owner

In the future we could maybe move fuzzy search to an helper function if we use it in multiple places?

In the future we could maybe move fuzzy search to an helper function if we use it in multiple places?
Author
Owner

I tried it, but unfortunately the apply_linking_filters function and the :search action contain slightly different Ash Queries and I couldn't figure out how to build an Ash Query by checking different conditions.

I tried it, but unfortunately the `apply_linking_filters` function and the `:search` action contain slightly different Ash Queries and I couldn't figure out how to build an Ash Query by checking different conditions.
Owner

Should we figure that out in a different issue?

Should we figure that out in a different issue?
@ -123,0 +125,4 @@
<div class="mt-6">
<h2 class="text-base font-semibold mb-3">{gettext("Linked Member")}</h2>
<%= if @user && @user.member && !@unlink_member do %>
Owner

Nice that you considered user information :)

Nice that you considered user information :)
moritz marked this conversation as resolved
@ -123,0 +173,4 @@
aria-label={gettext("Search for member to link")}
aria-describedby={if @selected_member_name, do: "member-selected", else: nil}
aria-autocomplete="list"
aria-controls="member-dropdown"
Owner

if we also use it in members, maybe we can use it as dropdown component in core components to reuse it?

if we also use it in members, maybe we can use it as dropdown component in core components to reuse it?
Author
Owner

If we really want to reuse it, we can extract it as component, but at the moment I wouldn't use it in members.

If we really want to reuse it, we can extract it as component, but at the moment I wouldn't use it in members.
moritz marked this conversation as resolved
@ -123,0 +176,4 @@
aria-controls="member-dropdown"
aria-expanded={to_string(@show_member_dropdown)}
autocomplete="off"
/>
Owner

Nice work!
One thing: I cannot select a member via enter...For me it would be also fine to handle the accessibility of the dropdown in a seperate issue. Up to you :)
I am also a bit confused that we need to add JS for a simple dropdown actually....

Nice work! One thing: I cannot select a member via enter...For me it would be also fine to handle the accessibility of the dropdown in a seperate issue. Up to you :) I am also a bit confused that we need to add JS for a simple dropdown actually....
moritz marked this conversation as resolved
@ -173,3 +305,3 @@
case AshPhoenix.Form.submit(socket.assigns.form, params: user_params) do
{:ok, user} ->
notify_parent({:saved, user})
# Then handle member linking/unlinking as a separate step
Owner

Will you also add that to the member form? :)

Will you also add that to the member form? :)
Author
Owner

I think it's an admin function to link a user to a member. And only admins can edit the users. To have a clear separation of the permission model I wouldn't add it to members as well.

I think it's an admin function to link a user to a member. And only admins can edit the users. To have a clear separation of the permission model I wouldn't add it to members as well.
moritz added 1 commit 2025-11-27 16:01:57 +01:00
feat: Add keyboard navigation to member linking dropdown
Some checks failed
continuous-integration/drone/push Build is failing
e5d4e84bd2
moritz force-pushed feature/user-linking from e5d4e84bd2 to 3da0ebcb3f 2025-11-27 16:06:22 +01:00 Compare
moritz merged commit 9fbca13342 into main 2025-11-27 16:11:03 +01:00
moritz deleted branch feature/user-linking 2025-11-27 16:11:04 +01:00
Sign in to join this conversation.
No description provided.