Link to userdate from profile button closes #170 #173

Merged
simon merged 15 commits from 170-userdata-for-profile-button into main 2025-10-16 12:23:28 +02:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Set the link for the "profile" button. This led to every view needing the current_user, resulting in a little refactoring of the the layout handling. This was done to make the current_user requirement explicit in authenticated views.

Also edited the test helper functions to allow for multiple tests creating users with the same function

What has been changed?

  • passed current user in all views
  • Navbar is only shown when current_user is present

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

Additional Notes

  • Added @tag :skip for avatar initials tests - topic for discussion and later implementation
  • Other questions arose - should users be reference by uuid in the url - or have a unique username?
    • see: http://localhost:4000/users/0dc6439e-b193-4d8b-b2b1-dadd8b23d946
  • Later, users should probably get their own detail view on their user profile details, distinct from that one admins use to manage the user details
## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [x] Refactoring <!--- Describe the goal of the PR in a few words --> Set the link for the "profile" button. This led to every view needing the `current_user`, resulting in a little refactoring of the the layout handling. This was done to make the current_user requirement explicit in authenticated views. Also edited the test helper functions to allow for multiple tests creating users with the same function ## What has been changed? - passed `current user` in all views - Navbar is only shown when current_user is present ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [x] New elements are properly defined with html-tags - [x] Colour contrast follows WCAG criteria - [x] Aria labels are added when needed - [x] Everything is accessible by keyboard - [x] Tab-Order is comprehensible - [x] 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 ## Additional Notes - Added @tag :skip for avatar initials tests - topic for discussion and later implementation - Other questions arose - should users be reference by uuid in the url - or have a unique username? - see: `http://localhost:4000/users/0dc6439e-b193-4d8b-b2b1-dadd8b23d946` - Later, users should probably get their own detail view on their user profile details, distinct from that one admins use to manage the user details
simon added 4 commits 2025-09-29 16:29:50 +02:00
simon added 1 commit 2025-09-29 16:42:32 +02:00
style: fix linting errors
Some checks failed
continuous-integration/drone/push Build is failing
d10fcc3da1
simon added 1 commit 2025-09-29 16:59:50 +02:00
fix: add missing user for view and fix test
Some checks failed
continuous-integration/drone/push Build is failing
1d334c7da1
simon changed title from WIP: Link to userdate from profile button closes #170 to Link to userdate from profile button closes #170 2025-09-29 17:15:41 +02:00
requested reviews from moritz, carla, rafael 2025-09-29 17:15:49 +02:00
carla approved these changes 2025-10-01 09:42:06 +02:00
carla left a comment
Owner

Nice work :)
Just the linting / Todo thing.. but then approved :)

Nice work :) Just the linting / Todo thing.. but then approved :)
@ -23,2 +24,4 @@
</Layout.app>
<Layouts.app flash={@flash} current_user={@current_user}>
<h1>Authenticated Content</h1>
Owner

I know the h1 tag was there before, but I actually do not get when its rendered. Do you know? Because if its an h1 tag which says authenticated content we should maybe change it but if its not rendered we could also omit?

I know the h1 tag was there before, but I actually do not get when its rendered. Do you know? Because if its an h1 tag which says authenticated content we should maybe change it but if its not rendered we could also omit?
Collaborator

I'm not sure if that's the case with you but for me, the forgejo review UI confused me a bit. I found out that this code is part of an example in a documentation comment, so the h1 you're referring to will never get really rendered, it's just a placeholder to illustrate the functionality.

I'm not sure if that's the case with you but for me, the forgejo review UI confused me a bit. I found out that this code is part of an example in a documentation comment, so the h1 you're referring to will never get really rendered, it's just a placeholder to illustrate the functionality.
simon marked this conversation as resolved
@ -0,0 +23,4 @@
end
@tag :skip
# TODO: Implement user initials in navbar avatar - see issue #170
Owner

Just a minor thing but: Lint is not passing with TODO s :/

Just a minor thing but: Lint is not passing with TODO s :/
simon added this to the Sprint 7 - 02.10 - 23.10. project 2025-10-02 13:14:48 +02:00
simon removed this from the Sprint 7 - 02.10 - 23.10. project 2025-10-02 13:16:08 +02:00
rafael approved these changes 2025-10-13 18:01:42 +02:00
rafael left a comment
Collaborator

Nice!

Nice!
@ -6,3 +6,3 @@
def render(assigns) do
~H"""
<Layouts.app flash={@flash}>
<Layouts.app flash={@flash} current_user={@current_user}>
Collaborator

As a future possibility (outside of this PR), we could try Phoenix's new scopes feature for this.

As a future possibility (outside of this PR), we could try Phoenix's [new scopes feature](https://hexdocs.pm/phoenix/scopes.html) for this.
simon added 8 commits 2025-10-16 12:07:50 +02:00
simon added 1 commit 2025-10-16 12:13:54 +02:00
chore: disable linter breaking for TODOs
Some checks failed
continuous-integration/drone/push Build is failing
8d3b76b954
simon merged commit ce9878791e into main 2025-10-16 12:23:28 +02:00
simon deleted branch 170-userdata-for-profile-button 2025-10-16 12:23:41 +02:00
Sign in to join this conversation.
No description provided.