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
e18c629a
Commit
e18c629a
authored
May 03, 2021
by
Jiaan Louw
Committed by
Nicolò Maria Mezzopera
May 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert admin/users view - update specs for feature flag rollout
parent
668fc6a8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
531 additions
and
484 deletions
+531
-484
app/assets/javascripts/admin/users/components/actions/unblock.vue
...ts/javascripts/admin/users/components/actions/unblock.vue
+1
-3
app/assets/javascripts/admin/users/components/user_actions.vue
...ssets/javascripts/admin/users/components/user_actions.vue
+2
-2
app/assets/javascripts/admin/users/components/users_table.vue
...assets/javascripts/admin/users/components/users_table.vue
+4
-0
app/views/admin/users/_user.html.haml
app/views/admin/users/_user.html.haml
+4
-4
ee/spec/features/admin/admin_users_spec.rb
ee/spec/features/admin/admin_users_spec.rb
+127
-120
spec/features/admin/users/user_spec.rb
spec/features/admin/users/user_spec.rb
+94
-83
spec/features/admin/users/users_spec.rb
spec/features/admin/users/users_spec.rb
+292
-267
spec/frontend/admin/users/components/user_actions_spec.js
spec/frontend/admin/users/components/user_actions_spec.js
+7
-5
No files found.
app/assets/javascripts/admin/users/components/actions/unblock.vue
View file @
e18c629a
...
@@ -23,9 +23,7 @@ export default {
...
@@ -23,9 +23,7 @@ export default {
'
data-method
'
:
'
put
'
,
'
data-method
'
:
'
put
'
,
'
data-modal-attributes
'
:
JSON
.
stringify
({
'
data-modal-attributes
'
:
JSON
.
stringify
({
title
:
sprintf
(
s__
(
'
AdminUsers|Unblock user %{username}?
'
),
{
username
:
this
.
username
}),
title
:
sprintf
(
s__
(
'
AdminUsers|Unblock user %{username}?
'
),
{
username
:
this
.
username
}),
message
:
s__
(
message
:
s__
(
'
AdminUsers|You can always block their account again if needed.
'
),
'
AdminUsers|You can always unblock their account, their data will remain intact.
'
,
),
okVariant
:
'
confirm
'
,
okVariant
:
'
confirm
'
,
okTitle
:
s__
(
'
AdminUsers|Unblock
'
),
okTitle
:
s__
(
'
AdminUsers|Unblock
'
),
}),
}),
...
...
app/assets/javascripts/admin/users/components/user_actions.vue
View file @
e18c629a
...
@@ -70,14 +70,14 @@ export default {
...
@@ -70,14 +70,14 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"gl-display-flex gl-justify-content-end"
>
<div
class=
"gl-display-flex gl-justify-content-end"
:data-testid=
"`user-actions-$
{user.id}`"
>
<gl-button
v-if=
"hasEditAction"
data-testid=
"edit"
:href=
"userPaths.edit"
>
{{
<gl-button
v-if=
"hasEditAction"
data-testid=
"edit"
:href=
"userPaths.edit"
>
{{
$options
.
i18n
.
edit
$options
.
i18n
.
edit
}}
</gl-button>
}}
</gl-button>
<gl-dropdown
<gl-dropdown
v-if=
"hasDropdownActions"
v-if=
"hasDropdownActions"
data-testid=
"
actions
"
data-testid=
"
dropdown-toggle
"
right
right
class=
"gl-ml-2"
class=
"gl-ml-2"
icon=
"settings"
icon=
"settings"
...
...
app/assets/javascripts/admin/users/components/users_table.vue
View file @
e18c629a
...
@@ -77,6 +77,10 @@ export default {
...
@@ -77,6 +77,10 @@ export default {
<user-date
:date=
"lastActivityOn"
show-never
/>
<user-date
:date=
"lastActivityOn"
show-never
/>
</
template
>
</
template
>
<
template
#cell(projectsCount)=
"{ item: { id, projectsCount } }"
>
<div
:data-testid=
"`user-project-count-$
{id}`">
{{
projectsCount
}}
</div>
</
template
>
<
template
#cell(settings)=
"{ item: user }"
>
<
template
#cell(settings)=
"{ item: user }"
>
<user-actions
:user=
"user"
:paths=
"paths"
/>
<user-actions
:user=
"user"
:paths=
"paths"
/>
</
template
>
</
template
>
...
...
app/views/admin/users/_user.html.haml
View file @
e18c629a
...
@@ -21,13 +21,13 @@
...
@@ -21,13 +21,13 @@
=
user
.
last_activity_on
.
nil?
?
_
(
'Never'
)
:
l
(
user
.
last_activity_on
,
format: :admin
)
=
user
.
last_activity_on
.
nil?
?
_
(
'Never'
)
:
l
(
user
.
last_activity_on
,
format: :admin
)
-
unless
user
.
internal?
-
unless
user
.
internal?
.table-section.section-20.table-button-footer
.table-section.section-20.table-button-footer
.table-action-buttons
.table-action-buttons
{
data:
{
testid:
"user-actions-#{user.id}"
}
}
=
link_to
_
(
'Edit'
),
edit_admin_user_path
(
user
),
id:
"edit_
#{
dom_id
(
user
)
}
"
,
class:
'btn gl-button btn-default'
=
link_to
_
(
'Edit'
),
edit_admin_user_path
(
user
),
class:
'btn gl-button btn-default'
-
unless
user
==
current_user
-
unless
user
==
current_user
%button
.dropdown-new.btn.gl-button.btn-default
{
type:
'button'
,
data:
{
testid:
"
user-action-button-#{user.id}
"
,
toggle:
'dropdown'
}
}
%button
.dropdown-new.btn.gl-button.btn-default
{
type:
'button'
,
data:
{
testid:
"
dropdown-toggle
"
,
toggle:
'dropdown'
}
}
=
sprite_icon
(
'settings'
)
=
sprite_icon
(
'settings'
)
=
sprite_icon
(
'chevron-down'
)
=
sprite_icon
(
'chevron-down'
)
%ul
.dropdown-menu.dropdown-menu-right
{
data:
{
testid:
"user-action-dropdown-#{user.id}"
}
}
%ul
.dropdown-menu.dropdown-menu-right
%li
.dropdown-header
%li
.dropdown-header
=
_
(
'Settings'
)
=
_
(
'Settings'
)
%li
%li
...
...
ee/spec/features/admin/admin_users_spec.rb
View file @
e18c629a
This diff is collapsed.
Click to expand it.
spec/features/admin/users/user_spec.rb
View file @
e18c629a
This diff is collapsed.
Click to expand it.
spec/features/admin/users/users_spec.rb
View file @
e18c629a
This diff is collapsed.
Click to expand it.
spec/frontend/admin/users/components/user_actions_spec.js
View file @
e18c629a
import
{
GlDropdownDivider
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownDivider
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
Extended
}
from
'
helpers/vue_test_utils_helper
'
;
import
Actions
from
'
~/admin/users/components/actions
'
;
import
Actions
from
'
~/admin/users/components/actions
'
;
import
AdminUserActions
from
'
~/admin/users/components/user_actions.vue
'
;
import
AdminUserActions
from
'
~/admin/users/components/user_actions.vue
'
;
import
{
I18N_USER_ACTIONS
}
from
'
~/admin/users/constants
'
;
import
{
I18N_USER_ACTIONS
}
from
'
~/admin/users/constants
'
;
...
@@ -14,12 +14,14 @@ describe('AdminUserActions component', () => {
...
@@ -14,12 +14,14 @@ describe('AdminUserActions component', () => {
const
user
=
users
[
0
];
const
user
=
users
[
0
];
const
userPaths
=
generateUserPaths
(
paths
,
user
.
username
);
const
userPaths
=
generateUserPaths
(
paths
,
user
.
username
);
const
findEditButton
=
()
=>
wrapper
.
find
(
'
[data-testid="edit"]
'
);
const
findUserActions
=
(
id
)
=>
wrapper
.
findByTestId
(
`user-actions-
${
id
}
`
);
const
findActionsDropdown
=
()
=>
wrapper
.
find
(
'
[data-testid="actions"
'
);
const
findEditButton
=
(
id
=
user
.
id
)
=>
findUserActions
(
id
).
find
(
'
[data-testid="edit"]
'
);
const
findDropdownDivider
=
()
=>
wrapper
.
find
(
GlDropdownDivider
);
const
findActionsDropdown
=
(
id
=
user
.
id
)
=>
findUserActions
(
id
).
find
(
'
[data-testid="dropdown-toggle"]
'
);
const
findDropdownDivider
=
()
=>
wrapper
.
findComponent
(
GlDropdownDivider
);
const
initComponent
=
({
actions
=
[]
}
=
{})
=>
{
const
initComponent
=
({
actions
=
[]
}
=
{})
=>
{
wrapper
=
shallowMount
(
AdminUserActions
,
{
wrapper
=
shallowMount
Extended
(
AdminUserActions
,
{
propsData
:
{
propsData
:
{
user
:
{
user
:
{
...
user
,
...
user
,
...
...
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