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
ba70a934
Commit
ba70a934
authored
Oct 22, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renders assignee list as a vertical list in merge requests
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/343324
parent
ebd17d9f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
4 deletions
+65
-4
app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue
...idebar/components/assignees/uncollapsed_assignee_list.vue
+36
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
config/feature_flags/development/mr_attention_requests.yml
config/feature_flags/development/mr_attention_requests.yml
+8
-0
spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js
...ar/components/assignees/uncollapsed_assignee_list_spec.js
+20
-1
No files found.
app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue
View file @
ba70a934
<
script
>
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
AssigneeAvatarLink
from
'
./assignee_avatar_link.vue
'
;
...
...
@@ -11,6 +12,7 @@ export default {
AssigneeAvatarLink
,
UserNameWithStatus
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
users
:
{
type
:
Array
,
...
...
@@ -32,6 +34,10 @@ export default {
return
this
.
users
[
0
];
},
hasOneUser
()
{
if
(
this
.
showVerticalList
)
{
return
false
;
}
return
this
.
users
.
length
===
1
;
},
hiddenAssigneesLabel
()
{
...
...
@@ -45,6 +51,10 @@ export default {
return
this
.
users
.
length
-
DEFAULT_RENDER_COUNT
;
},
uncollapsedUsers
()
{
if
(
this
.
showVerticalList
)
{
return
this
.
users
;
}
const
uncollapsedLength
=
this
.
showLess
?
Math
.
min
(
this
.
users
.
length
,
DEFAULT_RENDER_COUNT
)
:
this
.
users
.
length
;
...
...
@@ -53,6 +63,12 @@ export default {
username
()
{
return
`@
${
this
.
firstUser
.
username
}
`
;
},
showVerticalList
()
{
return
this
.
glFeatures
.
mrAttentionRequests
&&
this
.
isMergeRequest
;
},
isMergeRequest
()
{
return
this
.
issuableType
===
IssuableType
.
MergeRequest
;
},
},
methods
:
{
toggleShowLess
()
{
...
...
@@ -84,11 +100,28 @@ export default {
<div
v-else
>
<div
class=
"gl-display-flex gl-flex-wrap"
>
<div
v-for=
"
user
in uncollapsedUsers"
v-for=
"
(user, index)
in uncollapsedUsers"
:key=
"user.id"
class=
"user-item gl-display-inline-block"
:class=
"
{
'user-item': !showVerticalList,
'gl-mb-3': index !== users.length - 1
&&
showVerticalList,
}"
class="gl-display-inline-block"
>
<assignee-avatar-link
:user=
"user"
:issuable-type=
"issuableType"
/>
<assignee-avatar-link
:user=
"user"
:issuable-type=
"issuableType"
:tooltip-has-name=
"!showVerticalList"
>
<div
v-if=
"showVerticalList"
class=
"gl-ml-3 gl-line-height-normal gl-display-grid"
data-testid=
"username"
>
<user-name-with-status
:name=
"user.name"
:availability=
"userAvailability(user)"
/>
<span>
@
{{
user
.
username
}}
</span>
</div>
</assignee-avatar-link>
</div>
</div>
<div
v-if=
"renderShowMoreSection"
class=
"user-list-more gl-hover-text-blue-800"
>
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
ba70a934
...
...
@@ -41,6 +41,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag
(
:diffs_virtual_scrolling
,
project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:restructured_mr_widget
,
project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:mr_changes_fluid_layout
,
project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:mr_attention_requests
,
project
,
default_enabled: :yaml
)
# Usage data feature flags
push_frontend_feature_flag
(
:users_expanding_widgets_usage_data
,
@project
,
default_enabled: :yaml
)
...
...
config/feature_flags/development/mr_attention_requests.yml
0 → 100644
View file @
ba70a934
---
name
:
mr_attention_requests
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72773
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/343528
milestone
:
'
14.4'
type
:
development
group
:
group::code review
default_enabled
:
false
spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js
View file @
ba70a934
...
...
@@ -10,7 +10,7 @@ const DEFAULT_RENDER_COUNT = 5;
describe
(
'
UncollapsedAssigneeList component
'
,
()
=>
{
let
wrapper
;
function
createComponent
(
props
=
{})
{
function
createComponent
(
props
=
{}
,
glFeatures
=
{}
)
{
const
propsData
=
{
users
:
[],
rootPath
:
TEST_HOST
,
...
...
@@ -19,6 +19,7 @@ describe('UncollapsedAssigneeList component', () => {
wrapper
=
mount
(
UncollapsedAssigneeList
,
{
propsData
,
provide
:
{
glFeatures
},
});
}
...
...
@@ -99,4 +100,22 @@ describe('UncollapsedAssigneeList component', () => {
});
});
});
describe
(
'
merge requests
'
,
()
=>
{
it
.
each
`
numberOfUsers
${
1
}
${
5
}
`
(
'
displays as a vertical list for $numberOfUsers of users
'
,
({
numberOfUsers
})
=>
{
createComponent
(
{
users
:
UsersMockHelper
.
createNumberRandomUsers
(
numberOfUsers
),
issuableType
:
'
merge_request
'
,
},
{
mrAttentionRequests
:
true
},
);
expect
(
wrapper
.
findAll
(
'
[data-testid="username"]
'
).
length
).
toBe
(
numberOfUsers
);
});
});
});
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