Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
12e3dfbe
Commit
12e3dfbe
authored
Jun 09, 2021
by
Jiaan Louw
Committed by
Albert Salim
Jun 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove vue_admin_users feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
f2d63afe
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
345 additions
and
493 deletions
+345
-493
app/assets/javascripts/admin/users/components/users_table.vue
...assets/javascripts/admin/users/components/users_table.vue
+1
-0
app/views/admin/users/_user.html.haml
app/views/admin/users/_user.html.haml
+0
-72
app/views/admin/users/_users.html.haml
app/views/admin/users/_users.html.haml
+3
-14
config/feature_flags/development/vue_admin_users.yml
config/feature_flags/development/vue_admin_users.yml
+0
-8
ee/spec/features/admin/admin_users_spec.rb
ee/spec/features/admin/admin_users_spec.rb
+115
-123
scripts/verify-tff-mapping
scripts/verify-tff-mapping
+2
-2
spec/features/admin/users/user_spec.rb
spec/features/admin/users/user_spec.rb
+11
-19
spec/features/admin/users/users_spec.rb
spec/features/admin/users/users_spec.rb
+213
-204
spec/views/admin/users/_user.html.haml_spec.rb
spec/views/admin/users/_user.html.haml_spec.rb
+0
-51
No files found.
app/assets/javascripts/admin/users/components/users_table.vue
View file @
12e3dfbe
...
...
@@ -107,6 +107,7 @@ export default {
:items=
"users"
:fields=
"$options.fields"
:empty-text=
"s__('AdminUsers|No users found')"
data-qa-selector=
"user_row_content"
show-empty
stacked=
"md"
:tbody-tr-attr=
"
{ 'data-qa-selector': 'user_row_content' }"
...
...
app/views/admin/users/_user.html.haml
deleted
100644 → 0
View file @
f2d63afe
.gl-responsive-table-row
{
role:
'row'
,
data:
{
qa_selector:
'user_row_content'
}
}
.table-section.section-40
.table-mobile-header
{
role:
'rowheader'
}
=
_
(
'Name'
)
.table-mobile-content
=
render
'user_detail'
,
user:
user
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
=
_
(
'Projects'
)
.table-mobile-content.gl-str-truncated
{
data:
{
testid:
"user-project-count-#{user.id}"
}
}
=
user
.
authorized_projects
.
length
.table-section.section-15
.table-mobile-header
{
role:
'rowheader'
}
=
_
(
'Created on'
)
.table-mobile-content
=
l
(
user
.
created_at
.
to_date
,
format: :admin
)
.table-section.section-15
.table-mobile-header
{
role:
'rowheader'
}
=
_
(
'Last activity'
)
.table-mobile-content
=
user
.
last_activity_on
.
nil?
?
_
(
'Never'
)
:
l
(
user
.
last_activity_on
,
format: :admin
)
-
unless
user
.
internal?
.table-section.section-20.table-button-footer
.table-action-buttons
{
data:
{
testid:
"user-actions-#{user.id}"
}
}
=
link_to
_
(
'Edit'
),
edit_admin_user_path
(
user
),
class:
'btn gl-button btn-default'
-
unless
user
==
current_user
%button
.dropdown-new.btn.gl-button.btn-default
{
type:
'button'
,
data:
{
testid:
"dropdown-toggle"
,
toggle:
'dropdown'
}
}
=
sprite_icon
(
'settings'
)
=
sprite_icon
(
'chevron-down'
)
%ul
.dropdown-menu.dropdown-menu-right
%li
.dropdown-header
=
_
(
'Settings'
)
%li
-
if
user
.
ldap_blocked?
%span
.small
=
s_
(
'AdminUsers|Cannot unblock LDAP blocked users'
)
-
elsif
user
.
blocked?
-
if
user
.
blocked_pending_approval?
=
link_to
s_
(
'AdminUsers|Approve'
),
approve_admin_user_path
(
user
),
method: :put
=
link_to
s_
(
'AdminUsers|Reject'
),
reject_admin_user_path
(
user
),
method: :delete
-
else
%button
.gl-button.btn.btn-default-tertiary.js-confirm-modal-button
{
data:
user_unblock_data
(
user
)
}
=
s_
(
'AdminUsers|Unblock'
)
-
else
%button
.gl-button.btn.btn-default-tertiary.js-confirm-modal-button
{
data:
user_block_data
(
user
,
user_block_effects
)
}
=
s_
(
'AdminUsers|Block'
)
-
if
user
.
can_be_deactivated?
%li
%button
.gl-button.btn.btn-default-tertiary.js-confirm-modal-button
{
data:
user_deactivation_data
(
user
,
user_deactivation_effects
)
}
=
s_
(
'AdminUsers|Deactivate'
)
-
elsif
user
.
deactivated?
%li
%button
.gl-button.btn.btn-default-tertiary.js-confirm-modal-button
{
data:
user_activation_data
(
user
)
}
=
s_
(
'AdminUsers|Activate'
)
-
if
user
.
access_locked?
%li
=
link_to
_
(
'Unlock'
),
unlock_admin_user_path
(
user
),
method: :put
,
data:
{
confirm:
_
(
'Are you sure?'
)
}
-
if
can?
(
current_user
,
:destroy_user
,
user
)
&&
!
user
.
blocked_pending_approval?
%li
.divider
-
if
user
.
can_be_removed?
%li
%button
.js-delete-user-modal-button.gl-button.btn.btn-danger-tertiary
{
data:
{
'gl-modal-action'
:
'delete'
,
delete_user_url:
admin_user_path
(
user
),
block_user_url:
block_admin_user_path
(
user
),
username:
sanitize_name
(
user
.
name
)
}
}
=
s_
(
'AdminUsers|Delete user'
)
%li
%button
.js-delete-user-modal-button.gl-button.btn.btn-danger-tertiary
{
data:
{
'gl-modal-action'
:
'delete-with-contributions'
,
delete_user_url:
admin_user_path
(
user
,
hard_delete:
true
),
block_user_url:
block_admin_user_path
(
user
),
username:
sanitize_name
(
user
.
name
)
}
}
=
s_
(
'AdminUsers|Delete user and contributions'
)
app/views/admin/users/_users.html.haml
View file @
12e3dfbe
...
...
@@ -73,20 +73,9 @@
=
link_to
admin_users_path
(
sort:
value
,
filter:
params
[
:filter
],
search_query:
params
[
:search_query
])
do
=
title
-
if
Feature
.
enabled?
(
:vue_admin_users
,
default_enabled: :yaml
)
#js-admin-users-app
{
data:
admin_users_data_attributes
(
@users
)
}
.gl-spinner-container.gl-my-7
%span
.gl-vertical-align-bottom.gl-spinner.gl-spinner-dark.gl-spinner-lg
{
aria:
{
label:
_
(
'Loading'
)
}
}
-
elsif
@users
.
empty?
.nothing-here-block.border-top-0
=
s_
(
'AdminUsers|No users found'
)
-
else
.table-holder
.thead-white.text-nowrap.gl-responsive-table-row.table-row-header
{
role:
'row'
}
-
user_table_headers
.
each
do
|
header
|
.table-section
{
class:
header
[
:section_class_name
],
role:
'rowheader'
}=
header
[
:header_text
]
=
render
partial:
'admin/users/user'
,
collection:
@users
#js-admin-users-app
{
data:
admin_users_data_attributes
(
@users
)
}
.gl-spinner-container.gl-my-7
%span
.gl-vertical-align-bottom.gl-spinner.gl-spinner-dark.gl-spinner-lg
{
aria:
{
label:
_
(
'Loading'
)
}
}
=
paginate_collection
@users
...
...
config/feature_flags/development/vue_admin_users.yml
deleted
100644 → 0
View file @
f2d63afe
---
name
:
vue_admin_users
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48922
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/290737
milestone
:
'
13.7'
type
:
development
group
:
group::compliance
default_enabled
:
true
ee/spec/features/admin/admin_users_spec.rb
View file @
12e3dfbe
This diff is collapsed.
Click to expand it.
scripts/verify-tff-mapping
View file @
12e3dfbe
...
...
@@ -84,8 +84,8 @@ tests = [
{
explanation:
'FOSS views should map to respective spec'
,
source:
'app/views/admin/
users/_user
.html.haml'
,
expected:
[
'spec/views/admin/
users/_user
.html.haml_spec.rb'
]
source:
'app/views/admin/
dashboard/index
.html.haml'
,
expected:
[
'spec/views/admin/
dashboard/index
.html.haml_spec.rb'
]
},
{
...
...
spec/features/admin/users/user_spec.rb
View file @
12e3dfbe
...
...
@@ -356,27 +356,19 @@ RSpec.describe 'Admin::Users::User' do
end
end
[
true
,
false
].
each
do
|
vue_admin_users
|
context
"with vue_admin_users feature flag set to
#{
vue_admin_users
}
"
,
js:
vue_admin_users
do
before
do
stub_feature_flags
(
vue_admin_users:
vue_admin_users
)
end
describe
'GET /admin/users'
do
context
'user pending approval'
do
it
'shows user info'
,
:aggregate_failures
do
user
=
create
(
:user
,
:blocked_pending_approval
)
describe
'GET /admin/users'
,
:js
do
context
'user pending approval'
do
it
'shows user info'
,
:aggregate_failures
do
user
=
create
(
:user
,
:blocked_pending_approval
)
visit
admin_users_path
click_link
'Pending approval'
click_link
user
.
name
visit
admin_users_path
click_link
'Pending approval'
click_link
user
.
name
expect
(
page
).
to
have_content
(
user
.
name
)
expect
(
page
).
to
have_content
(
'Pending approval'
)
expect
(
page
).
to
have_link
(
'Approve user'
)
expect
(
page
).
to
have_link
(
'Reject request'
)
end
end
expect
(
page
).
to
have_content
(
user
.
name
)
expect
(
page
).
to
have_content
(
'Pending approval'
)
expect
(
page
).
to
have_link
(
'Approve user'
)
expect
(
page
).
to
have_link
(
'Reject request'
)
end
end
end
...
...
spec/features/admin/users/users_spec.rb
View file @
12e3dfbe
This diff is collapsed.
Click to expand it.
spec/views/admin/users/_user.html.haml_spec.rb
deleted
100644 → 0
View file @
f2d63afe
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'admin/users/_user.html.haml'
do
before
do
allow
(
view
).
to
receive
(
:user
).
and_return
(
user
)
end
context
'internal users'
do
context
'when showing a `Ghost User`'
do
let
(
:user
)
{
create
(
:user
,
:ghost
)
}
it
'does not render action buttons'
do
render
expect
(
rendered
).
not_to
have_selector
(
'.table-action-buttons'
)
end
end
context
'when showing a `Bot User`'
do
let
(
:user
)
{
create
(
:user
,
user_type: :alert_bot
)
}
it
'does not render action buttons'
do
render
expect
(
rendered
).
not_to
have_selector
(
'.table-action-buttons'
)
end
end
context
'when showing a `Migration User`'
do
let
(
:user
)
{
create
(
:user
,
user_type: :migration_bot
)
}
it
'does not render action buttons'
do
render
expect
(
rendered
).
not_to
have_selector
(
'.table-action-buttons'
)
end
end
end
context
'when showing an external user'
do
let
(
:user
)
{
create
(
:user
)
}
it
'renders action buttons'
do
render
expect
(
rendered
).
to
have_selector
(
'.table-action-buttons'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment