Commit 9f6a62ea authored by Valery Sizov's avatar Valery Sizov

Merge branch 'admin_notes' into 'master'

Add ability to create a note when blocking a user

https://gitlab.com/gitlab-org/gitlab-ee/issues/18

See merge request !73
parents f75d2dfb abcdb966
v 8.4.0 (unreleased) v 8.4.0 (unreleased)
- Add ability to create a note for user by admin
v 8.3.0 v 8.3.0
- License information can now be retrieved via the API - License information can now be retrieved via the API
......
...@@ -148,7 +148,7 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -148,7 +148,7 @@ class Admin::UsersController < Admin::ApplicationController
:email, :remember_me, :bio, :name, :username, :email, :remember_me, :bio, :name, :username,
:skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password, :skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password,
:extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key, :hide_no_password, :extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key, :hide_no_password,
:projects_limit, :can_create_group, :admin, :key_id :projects_limit, :can_create_group, :admin, :key_id, :note
) )
end end
......
...@@ -81,6 +81,12 @@ ...@@ -81,6 +81,12 @@
= f.label :website_url, 'Website', class: 'control-label' = f.label :website_url, 'Website', class: 'control-label'
.col-sm-10= f.text_field :website_url, class: 'form-control' .col-sm-10= f.text_field :website_url, class: 'form-control'
%fieldset
%legend Admin notes
.form-group
= f.label :note, 'Note', class: 'control-label'
.col-sm-10= f.text_area :note, class: 'form-control'
.form-actions .form-actions
- if @user.new_record? - if @user.new_record?
= f.submit 'Create user', class: "btn btn-create" = f.submit 'Create user', class: "btn btn-create"
......
...@@ -80,6 +80,9 @@ ...@@ -80,6 +80,9 @@
- else - else
%i.fa.fa-user.cgreen %i.fa.fa-user.cgreen
= link_to user.name, [:admin, user] = link_to user.name, [:admin, user]
- if user.note
= link_to "#", { "data-toggle" => "tooltip", title: user.note, class: "user-note"} do
= icon("sticky-note-o cgrey")
- if user.admin? - if user.admin?
%strong.cred (Admin) %strong.cred (Admin)
- if user == current_user - if user == current_user
......
class AddNoteToUsers < ActiveRecord::Migration
def up
# Column "note" has been added to schema mistakenly (without actual migration),
# and this is why it can exist in some instances.
unless column_exists?(:users, :note)
add_column :users, :note, :text
end
end
def down
end
end
...@@ -63,3 +63,9 @@ Feature: Admin Users ...@@ -63,3 +63,9 @@ Feature: Admin Users
And I visit "Pete" identities page in admin And I visit "Pete" identities page in admin
And I remove twitter identity And I remove twitter identity
Then I should not see twitter details Then I should not see twitter details
Scenario: Add note to user attributes
Given I visit admin users page
And click edit on my user
When I submit a note
Then I see note tooltip
...@@ -164,4 +164,15 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -164,4 +164,15 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step 'click on ssh keys tab' do step 'click on ssh keys tab' do
click_link 'SSH keys' click_link 'SSH keys'
end end
step 'I submit a note' do
@note = 'The reason to change status'
fill_in 'Note', with: @note
click_button 'Save'
end
step 'I see note tooltip' do
visit admin_users_path
expect(find(".user-note")["title"]).to have_content(@note)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment