Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account page using design system #2377

Merged
merged 35 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4322f8e
Inline partial
mike29736 Sep 19, 2023
453341e
Use the Error Summary component
mike29736 Sep 19, 2023
81c7f23
Inline string from locales
mike29736 Sep 19, 2023
e869ac3
Group `alias_method`s more clearly
mike29736 Sep 20, 2023
ad6d785
Move "Change your email or password" to /account
mike29736 Sep 19, 2023
fd5038b
Move #update_email to /account namespace
mike29736 Sep 20, 2023
9e8eb24
Move #update_password to /account namespace
mike29736 Sep 21, 2023
a3f5a79
A separate #resend_email_change for /account
mike29736 Sep 21, 2023
f39cbc2
Extract User#cancel_email_change!
mike29736 Sep 21, 2023
9b06439
A separate #cancel_email_change for /account
mike29736 Sep 21, 2023
091cfcd
Use `redirect_to` instead of `redirect_back_or_to`
mike29736 Sep 27, 2023
6dba232
Extract duplicate flash notice
mike29736 Sep 25, 2023
218f4f8
Add missing flash message
mike29736 Sep 25, 2023
18ea94e
Introduce new Account page with one sub-page
mike29736 Sep 22, 2023
240e98e
Use breadcrumbs on Change email or password page
mike29736 Sep 22, 2023
63d3fe3
Add Account page to sub-page's breadcrumbs
mike29736 Sep 22, 2023
d38344b
Point redirects to Account page, not to Dashboard
mike29736 Sep 29, 2023
76dea66
Build a temporary Manage permissions page
mike29736 Sep 29, 2023
5b4f7f5
Link to Manage permissions from Account page
mike29736 Sep 22, 2023
cc93b37
Redirect from Manage permissions to Account page
mike29736 Sep 29, 2023
134877f
Un-nest Devise routes
mike29736 Sep 22, 2023
67c279f
Move 2SV setup page to /account
mike29736 Sep 22, 2023
79c112a
Extract conditional page title/name to helper
mike29736 Sep 28, 2023
6c662c3
Link to 2SV setup page from Account page
mike29736 Sep 22, 2023
f57bbdd
Use breadcrumbs on 2SV setup page
mike29736 Sep 22, 2023
acc8ec6
Add Account page to 2SV page's breadcrumbs
mike29736 Sep 22, 2023
e1d4c39
Introduce parameter to method
mike29736 Sep 26, 2023
56b56cc
Redirect from 2SV setup page to Account page
mike29736 Sep 25, 2023
0bf6496
Introduce Role and organisation Account sub-page
mike29736 Sep 26, 2023
549dd67
Extract event logs table partial
mike29736 Sep 28, 2023
5c35d13
Introduce Your account access log Account sub-page
mike29736 Sep 28, 2023
8b1c699
Only Super Admin users can update their role
chrisroos Oct 3, 2023
acad605
Redirect users to account page for editing their own account
chrisroos Oct 3, 2023
bcde442
Prevent users editing their details on users/edit pages
chrisroos Oct 3, 2023
22c3626
Avoid using Pundit.policy in _form_fields partial
chrisroos Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid using Pundit.policy in _form_fields partial
We're already using the `policy` helper method elsewhere so let's use
that consistently. This also avoids us having to pass the `current_user`
in.
  • Loading branch information
chrisroos committed Oct 3, 2023
commit 22c3626a676001be5a40b6a281861509a62898ce
4 changes: 2 additions & 2 deletions app/views/users/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<% if @user.exempt_from_2sv? %>
<p>
The user has been made exempt from 2-step verification for the following reason: <%= @user.reason_for_2sv_exemption %>
<% if Pundit.policy(current_user, @user).exempt_from_two_step_verification? %>
<% if policy(@user).exempt_from_two_step_verification? %>
<br>
<%= link_to 'Edit reason or expiry date for 2-step verification exemption', edit_two_step_verification_exemption_path(@user) %>
<% end %>
Expand Down Expand Up @@ -77,7 +77,7 @@
<br/>
User will be prompted to set up 2-step verification again the next time they sign in.</p>
<% end %>
<% if @user.persisted? && Pundit.policy(current_user, @user).exempt_from_two_step_verification? && @user.reason_for_2sv_exemption.nil? %>
<% if @user.persisted? && policy(@user).exempt_from_two_step_verification? && @user.reason_for_2sv_exemption.nil? %>
<p>
<%= link_to 'Exempt user from 2-step verification', edit_two_step_verification_exemption_path(@user) %>
<br/>
Expand Down