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
70210cca
Commit
70210cca
authored
May 19, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts
parent
151a28dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
115 deletions
+0
-115
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+0
-105
app/views/shared/issuable/_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+0
-10
No files found.
app/assets/javascripts/users_select.js
View file @
70210cca
...
@@ -64,51 +64,10 @@ function UsersSelect(currentUser, els) {
...
@@ -64,51 +64,10 @@ function UsersSelect(currentUser, els) {
unassignedSelected
.
remove
();
unassignedSelected
.
remove
();
}
}
<<<<<<<
HEAD
// Save current selected user to the DOM
// Save current selected user to the DOM
const
input
=
document
.
createElement
(
'
input
'
);
const
input
=
document
.
createElement
(
'
input
'
);
input
.
type
=
'
hidden
'
;
input
.
type
=
'
hidden
'
;
input
.
name
=
$dropdown
.
data
(
'
field-name
'
);
input
.
name
=
$dropdown
.
data
(
'
field-name
'
);
=======
$els
.
each
((
function
(
_this
)
{
return
function
(
i
,
dropdown
)
{
var
options
=
{};
var
$block
,
$collapsedSidebar
,
$dropdown
,
$loading
,
$selectbox
,
$value
,
abilityName
,
assignTo
,
assigneeTemplate
,
collapsedAssigneeTemplate
,
defaultLabel
,
defaultNullUser
,
firstUser
,
issueURL
,
selectedId
,
selectedIdDefault
,
showAnyUser
,
showNullUser
,
showMenuAbove
;
$dropdown
=
$
(
dropdown
);
options
.
projectId
=
$dropdown
.
data
(
'
project-id
'
);
options
.
groupId
=
$dropdown
.
data
(
'
group-id
'
);
options
.
showCurrentUser
=
$dropdown
.
data
(
'
current-user
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo-filter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo-state-filter
'
);
showNullUser
=
$dropdown
.
data
(
'
null-user
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null-user-default
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
showAnyUser
=
$dropdown
.
data
(
'
any-user
'
);
firstUser
=
$dropdown
.
data
(
'
first-user
'
);
options
.
authorId
=
$dropdown
.
data
(
'
author-id
'
);
defaultLabel
=
$dropdown
.
data
(
'
default-label
'
);
issueURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
$selectbox
=
$dropdown
.
closest
(
'
.selectbox
'
);
$block
=
$selectbox
.
closest
(
'
.block
'
);
abilityName
=
$dropdown
.
data
(
'
ability-name
'
);
$value
=
$block
.
find
(
'
.value
'
);
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
selectedIdDefault
=
(
defaultNullUser
&&
showNullUser
)
?
0
:
null
;
selectedId
=
$dropdown
.
data
(
'
selected
'
);
if
(
selectedId
===
undefined
)
{
selectedId
=
selectedIdDefault
;
}
const
assignYourself
=
function
()
{
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field-name
'
)}
'][value=0]`
);
if
(
unassignedSelected
)
{
unassignedSelected
.
remove
();
}
>>>>>>>
origin
/
master
const
currentUserInfo
=
$dropdown
.
data
(
'
currentUserInfo
'
);
const
currentUserInfo
=
$dropdown
.
data
(
'
currentUserInfo
'
);
...
@@ -492,52 +451,11 @@ function UsersSelect(currentUser, els) {
...
@@ -492,52 +451,11 @@ function UsersSelect(currentUser, els) {
username
=
user
.
username
?
"
@
"
+
user
.
username
:
""
;
username
=
user
.
username
?
"
@
"
+
user
.
username
:
""
;
avatar
=
user
.
avatar_url
?
user
.
avatar_url
:
false
;
avatar
=
user
.
avatar_url
?
user
.
avatar_url
:
false
;
<<<<<<<
HEAD
let
selected
=
false
;
let
selected
=
false
;
=======
if
(
selectedId
===
gon
.
current_user_id
)
{
$
(
'
.assign-to-me-link
'
).
hide
();
}
else
{
$
(
'
.assign-to-me-link
'
).
show
();
}
return
;
}
if
(
$el
.
closest
(
'
.add-issues-modal
'
).
length
)
{
gl
.
issueBoards
.
ModalStore
.
store
.
filter
[
$dropdown
.
data
(
'
field-name
'
)]
=
user
.
id
;
}
else
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
)
&&
(
isIssueIndex
||
isMRIndex
))
{
return
Issuable
.
filterResults
(
$dropdown
.
closest
(
'
form
'
));
}
else
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
))
{
return
$dropdown
.
closest
(
'
form
'
).
submit
();
}
else
if
(
!
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
selected
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field-name
'
))
+
"
']
"
).
val
();
return
assignTo
(
selected
);
}
// Automatically close dropdown after assignee is selected
// since CE has no multiple assignees
// EE does not have a max-select
if
(
$dropdown
.
data
(
'
max-select
'
)
&&
getSelected
().
length
===
$dropdown
.
data
(
'
max-select
'
))
{
// Close the dropdown
$dropdown
.
dropdown
(
'
toggle
'
);
}
},
id
:
function
(
user
)
{
return
user
.
id
;
},
opened
:
function
(
e
)
{
const
$el
=
$
(
e
.
currentTarget
);
const
selected
=
getSelected
();
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
)
&&
selected
.
length
===
0
)
{
this
.
addInput
(
$dropdown
.
data
(
'
field-name
'
),
0
,
{});
}
$el
.
find
(
'
.is-active
'
).
removeClass
(
'
is-active
'
);
>>>>>>>
origin
/
master
if
(
this
.
multiSelect
)
{
if
(
this
.
multiSelect
)
{
selected
=
getSelected
().
find
(
u
=>
user
.
id
===
u
);
selected
=
getSelected
().
find
(
u
=>
user
.
id
===
u
);
<<<<<<<
HEAD
const
fieldName
=
this
.
fieldName
;
const
fieldName
=
this
.
fieldName
;
const
field
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
user
.
id
+
"
']
"
);
const
field
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
user
.
id
+
"
']
"
);
...
@@ -556,29 +474,6 @@ function UsersSelect(currentUser, els) {
...
@@ -556,29 +474,6 @@ function UsersSelect(currentUser, els) {
img
=
"
<img src='
"
+
avatar
+
"
' class='avatar avatar-inline' width='32' />
"
;
img
=
"
<img src='
"
+
avatar
+
"
' class='avatar avatar-inline' width='32' />
"
;
}
}
}
}
=======
if
(
selected
.
length
>
0
)
{
getSelected
().
forEach
(
selectedId
=>
highlightSelected
(
selectedId
));
}
else
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
highlightSelected
(
0
);
}
else
{
highlightSelected
(
selectedId
);
}
},
updateLabel
:
$dropdown
.
data
(
'
dropdown-title
'
),
renderRow
:
function
(
user
)
{
var
avatar
,
img
,
listClosingTags
,
listWithName
,
listWithUserName
,
username
;
username
=
user
.
username
?
"
@
"
+
user
.
username
:
""
;
avatar
=
user
.
avatar_url
?
user
.
avatar_url
:
false
;
let
selected
=
false
;
if
(
this
.
multiSelect
)
{
selected
=
getSelected
().
find
(
u
=>
user
.
id
===
u
);
const
fieldName
=
this
.
fieldName
;
const
field
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
user
.
id
+
"
']
"
);
>>>>>>>
origin
/
master
return
`
return
`
<li data-user-id=
${
user
.
id
}
>
<li data-user-id=
${
user
.
id
}
>
...
...
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
70210cca
...
@@ -39,20 +39,10 @@
...
@@ -39,20 +39,10 @@
-
unless
issuable
.
assignees
.
any?
-
unless
issuable
.
assignees
.
any?
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
,
0
,
id:
nil
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
,
0
,
id:
nil
-
options
[
:toggle_class
]
+=
' js-multiselect js-save-user-data'
-
options
[
:toggle_class
]
+=
' js-multiselect js-save-user-data'
<
<<<<<<
HEAD
-
data
=
{
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
}
-
data
=
{
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
}
-
data
[
:multi_select
]
=
true
-
data
[
:multi_select
]
=
true
-
data
[
'dropdown-title'
]
=
title
-
data
[
'dropdown-title'
]
=
title
-
data
[
'dropdown-header'
]
=
'Assignee'
-
data
[
'dropdown-header'
]
=
'Assignee'
-
data
[
'max-select'
]
=
1
-
options
[
:data
].
merge!
(
data
)
-
options
[
:data
].
merge!
(
data
)
==
=====
-
options
[
:data
][
:field_name
]
=
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
-
options
[
:data
][
:multi_select
]
=
true
-
options
[
:data
][
'dropdown-title'
]
=
title
-
options
[
:data
][
'dropdown-header'
]
=
'Assignee'
-
else
-
title
=
'Select assignee'
>
>>>>>> origin/master
=
dropdown_tag
(
title
,
options:
options
)
=
dropdown_tag
(
title
,
options:
options
)
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