Skip to content

Commit

Permalink
Adds email to list of values we display for the user
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcorrea authored and jrgriffiniii committed Aug 21, 2024
1 parent 4635090 commit 889b3e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,7 @@ div.form-subcommunities .form-check{
table.dataTable {
overflow-wrap: anywhere
}

.user-edit-long-field {
width: 400px;
}
11 changes: 8 additions & 3 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
</fieldset>

<section class="card container groups">
<section class="card container groups">
<h2><%= t('users.form.group') %></h2>
<fieldset>
<% @user.submitter_or_admin_groups.each do |group| %>
Expand Down Expand Up @@ -75,14 +75,19 @@
<%= form.text_field :orcid, placeholder: "0000-0000-0000-0000" %>
</div>

<div class="field">
Email<br />
<input id="email" type="text" class="user-edit-long-field" disabled value="<%= @user.email %>" />
</div>

<div class="field">
Princeton Net ID<br />
<input type="text" disabled value="<%= @user.uid %>" />
<input id="netid" type="text" class="user-edit-long-field" disabled value="<%= @user.uid %>" />
</div>

<div class="field">
Default group<br />
<input type="text" disabled value="<%= @user.default_group.title %>" />
<input id="default_group" type="text" class="user-edit-long-field" disabled value="<%= @user.default_group.title %>" />
</div>

<div class="text-left">
Expand Down
10 changes: 10 additions & 0 deletions spec/system/user_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
fill_in "user_orcid", with: orcid
click_on "Save"
end

it "shows user fields", js: true do
visit edit_user_path(user_admin)
# These fields are disabled so we cannot target them with
# RSpec `have_field`, but once we make them editable we
# could use the more common syntax.
expect(page.html.include?(user_admin.email)).to be true
expect(page.html.include?(user_admin.uid)).to be true
expect(page.html.include?(user_admin.default_group.title)).to be true
end
end

describe "Non-admin users cannot access others people data" do
Expand Down

0 comments on commit 889b3e9

Please sign in to comment.