Skip to content

Commit

Permalink
DM-5349: Change edit profile button from icon to button (#1135)
Browse files Browse the repository at this point in the history
Co-authored-by: Camille Villa <[email protected]>
  • Loading branch information
camillevilla and camillevilla authored Nov 28, 2024
1 parent f3673ac commit 89e6b55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
11 changes: 0 additions & 11 deletions app/assets/stylesheets/dm/components/_profile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@
position: relative;
}

.edit-profile-link {
@extend .usa-link;
text-decoration: none !important;

.edit-profile-icon {
&:after {
text-decoration: none;
}
}
}

.cancel-edit-profile-link {
&:hover {
text-decoration: none !important;
Expand Down
8 changes: 3 additions & 5 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
</div>
<div class="usa-layout-docs__main desktop:grid-col-fill">
<h1 class='profile-h1 font-sans-2xl display-inline-block margin-bottom-1 margin-top-0'><%= @user.full_name %></h1>
<div class="display-inline-block margin-left-2">
<% if current_user == @user %>
<%= link_to '', edit_profile_path, class: 'edit-profile-link fas fa-edit display-inline-block text-no-underline' %>
<% end %>
</div>
<div class='profile-job-title font-sans-lg margin-top-1'><%= @user.job_title %></div>
<% unless @user.location.blank? %>
<p class="margin-top-205">
Expand All @@ -47,6 +42,9 @@
</span>
</p>
<% end %>
<% if current_user == @user %>
<%= link_to 'Edit profile', edit_profile_path, class: 'usa-button usa-button--outline display-inline-block margin-top-2' %>
<% end %>
</div>
</div>
<div class="grid-row margin-bottom-8">
Expand Down
2 changes: 1 addition & 1 deletion spec/features/users/user_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it 'should have edit profile button for logged in user' do
login_as(@user, scope: :user, run_callbacks: false)
visit "/users/#{@user.id}"
expect(page).to have_selector('.edit-profile-link')
expect(page).to have_content('Edit profile')
end

it 'if not logged in, should be redirected to landing page when accessing account edit' do
Expand Down

0 comments on commit 89e6b55

Please sign in to comment.