[Admin Tooling] Styling improvements to Chat Channels page (#9926)

* Styling changes to Chat Channel page

* Update text to be clearer

* Make chnages from PR review

* Fix failing spec

* Fix spec
This commit is contained in:
Arit Amana 2020-08-21 15:35:13 -04:00 committed by GitHub
parent 76de9a0317
commit 03a89c4a4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@
<%= f.text_field :channel_name, placeholder: "Channel Name", required: true %>
<%= f.label :usernames_string, "Usernames", class: "sr-only" %>
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
<%= f.submit "Create Chat channel", class: "btn btn-primary" %>
<%= f.submit "Create Chat Channel", class: "btn btn-secondary p-1" %>
</div>
</div>
<% end %>
@ -57,13 +57,13 @@
<td>
<%= form_for [:admin, channel] do |f| %>
<%= f.text_field :usernames_string, placeholder: "Usernames to add" %>
<%= f.submit "Add users to Chat Channel", class: "btn btn-primary" %>
<%= f.submit "Add users", class: "btn btn-secondary p-1 my-1" %>
<% end %>
</td>
<td>
<%= form_with url: remove_user_admin_chat_channel_url(channel), model: [:admin, channel], method: :delete, local: true do |f| %>
<%= f.text_field :username_string, placeholder: "Username to remove" %>
<%= f.submit "Remove From channel", data: { confirm: "Are you sure you want to remove this user?" }, class: "btn btn-primary" %>
<%= f.submit "Remove user", data: { confirm: "Are you sure you want to remove this user?" }, class: "btn btn-secondary p-1 my-1" %>
<% end %>
</td>
<% if current_user.any_admin? %>
@ -71,7 +71,7 @@
<% if channel.users.count.zero? %>
<%= button_to "Delete Channel", { action: "destroy", id: channel.id }, method: :delete, data: { confirm: "Are you sure?" }, class: "crayons-btn crayons-btn--danger" %>
<% else %>
Cannot delete; channel has users
Cannot delete a channel with users
<% end %>
</td>
<% end %>

View file

@ -22,7 +22,7 @@ RSpec.describe "Admin manages chat channels", type: :system do
it "creates a chat channel" do
fill_in "chat_channel_channel_name", with: "Cool chat"
fill_in "chat_channel_usernames_string", with: admin.username.to_s
click_on "Create Chat channel"
click_on "Create Chat Channel"
expect(page.body).to have_link("Cool chat")
end
@ -50,7 +50,7 @@ RSpec.describe "Admin manages chat channels", type: :system do
it "displays a 'Delete Channel' button" do
fill_in "chat_channel_channel_name", with: "No users chat"
click_on "Create Chat channel"
click_on "Create Chat Channel"
expect(page).to have_content("No users chat")
expect(page).to have_content("Delete Channel")