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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
05278b2f
Commit
05278b2f
authored
May 12, 2017
by
Luke "Jared" Bennett
Committed by
Phil Hughes
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import export users select
parent
8c4e4020
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
609 additions
and
605 deletions
+609
-605
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+14
-1
app/assets/javascripts/issuable_context.js
app/assets/javascripts/issuable_context.js
+1
-1
app/assets/javascripts/issuable_form.js
app/assets/javascripts/issuable_form.js
+2
-1
app/assets/javascripts/todos.js
app/assets/javascripts/todos.js
+2
-1
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+590
-596
app/views/import/fogbugz/new_user_map.html.haml
app/views/import/fogbugz/new_user_map.html.haml
+0
-3
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+0
-1
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+0
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
05278b2f
...
...
@@ -14,7 +14,6 @@
/* global NotificationsForm */
/* global TreeView */
/* global NotificationsDropdown */
/* global UsersSelect */
/* global GroupAvatar */
/* global LineHighlighter */
/* global ProjectFork */
...
...
@@ -52,6 +51,7 @@ import ShortcutsWiki from './shortcuts_wiki';
import
Pipelines
from
'
./pipelines
'
;
import
BlobViewer
from
'
./blob/viewer/index
'
;
import
AutoWidthDropdownSelect
from
'
./issuable/auto_width_dropdown_select
'
;
import
UsersSelect
from
'
./users_select
'
;
const
ShortcutsBlob
=
require
(
'
./shortcuts_blob
'
);
...
...
@@ -113,6 +113,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
case
'
projects:boards:show
'
:
case
'
projects:boards:index
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
new
UsersSelect
();
break
;
case
'
projects:builds:show
'
:
new
Build
();
...
...
@@ -127,6 +128,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
prefixId
:
page
===
'
projects:merge_requests:index
'
?
'
merge_request_
'
:
'
issue_
'
,
});
shortcut_handler
=
new
ShortcutsNavigation
();
new
UsersSelect
();
break
;
case
'
projects:issues:show
'
:
new
Issue
();
...
...
@@ -139,6 +141,10 @@ const ShortcutsBlob = require('./shortcuts_blob');
new
Milestone
();
new
Sidebar
();
break
;
case
'
groups:issues
'
:
case
'
groups:merge_requests
'
:
new
UsersSelect
();
break
;
case
'
dashboard:todos:index
'
:
new
gl
.
Todos
();
break
;
...
...
@@ -223,6 +229,10 @@ const ShortcutsBlob = require('./shortcuts_blob');
case
'
dashboard:activity
'
:
new
gl
.
Activities
();
break
;
case
'
dashboard:issues
'
:
case
'
dashboard:merge_requests
'
:
new
UsersSelect
();
break
;
case
'
projects:commit:show
'
:
new
Commit
();
new
gl
.
Diff
();
...
...
@@ -377,6 +387,9 @@ const ShortcutsBlob = require('./shortcuts_blob');
new
LineHighlighter
();
new
BlobViewer
();
break
;
case
'
import:fogbugz:new_user_map
'
:
new
UsersSelect
();
break
;
}
switch
(
path
.
first
())
{
case
'
sessions
'
:
...
...
app/assets/javascripts/issuable_context.js
View file @
05278b2f
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-new, comma-dangle, quotes, prefer-arrow-callback, consistent-return, one-var, no-var, one-var-declaration-per-line, no-underscore-dangle, max-len */
/* global UsersSelect */
/* global bp */
import
Cookies
from
'
js-cookie
'
;
import
UsersSelect
from
'
./users_select
'
;
(
function
()
{
this
.
IssuableContext
=
(
function
()
{
...
...
app/assets/javascripts/issuable_form.js
View file @
05278b2f
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */
/* global GitLab */
/* global UsersSelect */
/* global ZenMode */
/* global Autosave */
/* global dateFormat */
/* global Pikaday */
import
UsersSelect
from
'
./users_select
'
;
(
function
()
{
this
.
IssuableForm
=
(
function
()
{
IssuableForm
.
prototype
.
issueMoveConfirmMsg
=
'
Are you sure you want to move this issue to another project?
'
;
...
...
app/assets/javascripts/todos.js
View file @
05278b2f
/* eslint-disable class-methods-use-this, no-unneeded-ternary, quote-props */
/* global UsersSelect */
import
UsersSelect
from
'
./users_select
'
;
class
Todos
{
constructor
()
{
...
...
app/assets/javascripts/users_select.js
View file @
05278b2f
...
...
@@ -5,11 +5,7 @@
// TODO: remove eventHub hack after code splitting refactor
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
(
function
()
{
const
slice
=
[].
slice
;
this
.
UsersSelect
=
(
function
()
{
function
UsersSelect
(
currentUser
,
els
)
{
function
UsersSelect
(
currentUser
,
els
)
{
var
$els
;
this
.
users
=
this
.
users
.
bind
(
this
);
this
.
user
=
this
.
user
.
bind
(
this
);
...
...
@@ -554,17 +550,17 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
},
initSelection
:
function
()
{
var
args
;
args
=
1
<=
arguments
.
length
?
slice
.
call
(
arguments
,
0
)
:
[];
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
initSelection
.
apply
(
_this
,
args
);
},
formatResult
:
function
()
{
var
args
;
args
=
1
<=
arguments
.
length
?
slice
.
call
(
arguments
,
0
)
:
[];
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
formatResult
.
apply
(
_this
,
args
);
},
formatSelection
:
function
()
{
var
args
;
args
=
1
<=
arguments
.
length
?
slice
.
call
(
arguments
,
0
)
:
[];
args
=
1
<=
arguments
.
length
?
[].
slice
.
call
(
arguments
,
0
)
:
[];
return
_this
.
formatSelection
.
apply
(
_this
,
args
);
},
dropdownCssClass
:
"
ajax-users-dropdown
"
,
...
...
@@ -575,9 +571,9 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
});
};
})(
this
));
}
}
UsersSelect
.
prototype
.
initSelection
=
function
(
element
,
callback
)
{
UsersSelect
.
prototype
.
initSelection
=
function
(
element
,
callback
)
{
var
id
,
nullUser
;
id
=
$
(
element
).
val
();
if
(
id
===
"
0
"
)
{
...
...
@@ -588,9 +584,9 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
}
else
if
(
id
!==
""
)
{
return
this
.
user
(
id
,
callback
);
}
};
};
UsersSelect
.
prototype
.
formatResult
=
function
(
user
)
{
UsersSelect
.
prototype
.
formatResult
=
function
(
user
)
{
var
avatar
;
if
(
user
.
avatar_url
)
{
avatar
=
user
.
avatar_url
;
...
...
@@ -598,13 +594,13 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
avatar
=
gon
.
default_avatar_url
;
}
return
"
<div class='user-result
"
+
(
!
user
.
username
?
'
no-username
'
:
void
0
)
+
"
'> <div class='user-image'><img class='avatar s24' src='
"
+
avatar
+
"
'></div> <div class='user-name'>
"
+
user
.
name
+
"
</div> <div class='user-username'>
"
+
(
user
.
username
||
""
)
+
"
</div> </div>
"
;
};
};
UsersSelect
.
prototype
.
formatSelection
=
function
(
user
)
{
UsersSelect
.
prototype
.
formatSelection
=
function
(
user
)
{
return
user
.
name
;
};
};
UsersSelect
.
prototype
.
user
=
function
(
user_id
,
callback
)
{
UsersSelect
.
prototype
.
user
=
function
(
user_id
,
callback
)
{
if
(
!
/^
\d
+$/
.
test
(
user_id
))
{
return
false
;
}
...
...
@@ -618,11 +614,11 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
}).
done
(
function
(
user
)
{
return
callback
(
user
);
});
};
};
// Return users list. Filtered by query
// Only active users retrieved
UsersSelect
.
prototype
.
users
=
function
(
query
,
options
,
callback
)
{
// Return users list. Filtered by query
// Only active users retrieved
UsersSelect
.
prototype
.
users
=
function
(
query
,
options
,
callback
)
{
var
url
;
url
=
this
.
buildUrl
(
this
.
usersPath
);
return
$
.
ajax
({
...
...
@@ -645,15 +641,13 @@ window.emitSidebarEvent = window.emitSidebarEvent || $.noop;
}).
done
(
function
(
users
)
{
return
callback
(
users
);
});
};
};
UsersSelect
.
prototype
.
buildUrl
=
function
(
url
)
{
UsersSelect
.
prototype
.
buildUrl
=
function
(
url
)
{
if
(
gon
.
relative_url_root
!=
null
)
{
url
=
gon
.
relative_url_root
.
replace
(
/
\/
$/
,
''
)
+
url
;
}
return
url
;
};
};
return
UsersSelect
;
})();
}).
call
(
window
);
export
default
UsersSelect
;
app/views/import/fogbugz/new_user_map.html.haml
View file @
05278b2f
...
...
@@ -46,6 +46,3 @@
.form-actions
=
submit_tag
'Continue to the next step'
,
class:
'btn btn-create'
:javascript
new
UsersSelect
();
app/views/shared/issuable/_filter.html.haml
View file @
05278b2f
...
...
@@ -71,7 +71,6 @@
=
render
'shared/labels_row'
,
labels:
@labels
:javascript
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
05278b2f
...
...
@@ -150,7 +150,6 @@
-
unless
type
===
:boards_modal
:javascript
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
...
...
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