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
d05c72c3
Commit
d05c72c3
authored
Apr 27, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] rename user to assignee
parent
10d74f0a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
39 deletions
+38
-39
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-1
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+17
-17
app/assets/javascripts/boards/models/assignee.js
app/assets/javascripts/boards/models/assignee.js
+2
-2
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+11
-11
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+5
-6
spec/javascripts/boards/issue_card_spec.js
spec/javascripts/boards/issue_card_spec.js
+2
-2
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
d05c72c3
...
...
@@ -12,7 +12,7 @@ require('./models/issue');
require
(
'
./models/label
'
);
require
(
'
./models/list
'
);
require
(
'
./models/milestone
'
);
require
(
'
./models/
user
'
);
require
(
'
./models/
assignee
'
);
require
(
'
./stores/boards_store
'
);
require
(
'
./stores/modal_store
'
);
require
(
'
./services/board_service
'
);
...
...
app/assets/javascripts/boards/components/board_sidebar.js
View file @
d05c72c3
...
...
@@ -70,19 +70,19 @@ require('./sidebar/remove_issue');
// Notify gl dropdown that we are now assigning to current user
this
.
$refs
.
assigneeBlock
.
dispatchEvent
(
new
Event
(
'
assignYourself
'
));
this
.
add
User
(
this
.
currentUser
.
id
);
this
.
save
User
s
();
this
.
add
Assignee
(
this
.
currentUser
);
this
.
save
Assignee
s
();
},
remove
User
(
u
)
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
remove
User
(
u
);
remove
Assignee
(
a
)
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
remove
Assignee
(
a
);
},
add
User
(
u
)
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
add
User
(
u
);
add
Assignee
(
a
)
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
add
Assignee
(
a
);
},
removeAll
User
s
()
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
removeAll
User
s
();
removeAll
Assignee
s
()
{
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
removeAll
Assignee
s
();
},
save
User
s
()
{
save
Assignee
s
()
{
this
.
loadingAssignees
=
true
;
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
update
(
this
.
endpoint
)
...
...
@@ -103,16 +103,16 @@ require('./sidebar/remove_issue');
},
created
()
{
// Get events from glDropdown
eventHub
.
$on
(
'
sidebar.remove
User
'
,
this
.
removeUser
);
eventHub
.
$on
(
'
sidebar.add
User
'
,
this
.
addUser
);
eventHub
.
$on
(
'
sidebar.removeAll
Users
'
,
this
.
removeAllUser
s
);
eventHub
.
$on
(
'
sidebar.save
Users
'
,
this
.
saveUser
s
);
eventHub
.
$on
(
'
sidebar.remove
Assignee
'
,
this
.
removeAssignee
);
eventHub
.
$on
(
'
sidebar.add
Assignee
'
,
this
.
addAssignee
);
eventHub
.
$on
(
'
sidebar.removeAll
Assignees
'
,
this
.
removeAllAssignee
s
);
eventHub
.
$on
(
'
sidebar.save
Assignees
'
,
this
.
saveAssignee
s
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
sidebar.remove
User
'
,
this
.
removeUser
);
eventHub
.
$off
(
'
sidebar.add
User
'
,
this
.
addUser
);
eventHub
.
$off
(
'
sidebar.removeAll
Users
'
,
this
.
removeAllUser
s
);
eventHub
.
$off
(
'
sidebar.save
Users
'
,
this
.
saveUser
s
);
eventHub
.
$off
(
'
sidebar.remove
Assignee
'
,
this
.
removeAssignee
);
eventHub
.
$off
(
'
sidebar.add
Assignee
'
,
this
.
addAssignee
);
eventHub
.
$off
(
'
sidebar.removeAll
Assignees
'
,
this
.
removeAllAssignee
s
);
eventHub
.
$off
(
'
sidebar.save
Assignees
'
,
this
.
saveAssignee
s
);
},
mounted
()
{
new
IssuableContext
(
this
.
currentUser
);
...
...
app/assets/javascripts/boards/models/
user
.js
→
app/assets/javascripts/boards/models/
assignee
.js
View file @
d05c72c3
/* eslint-disable no-unused-vars */
class
List
User
{
class
List
Assignee
{
constructor
(
user
)
{
this
.
id
=
user
.
id
;
this
.
name
=
user
.
name
;
...
...
@@ -9,4 +9,4 @@ class ListUser {
}
}
window
.
List
User
=
ListUser
;
window
.
List
Assignee
=
ListAssignee
;
app/assets/javascripts/boards/models/issue.js
View file @
d05c72c3
/* eslint-disable no-unused-vars, space-before-function-paren, arrow-body-style, arrow-parens, comma-dangle, max-len */
/* global ListLabel */
/* global ListMilestone */
/* global List
User
*/
/* global List
Assignee
*/
import
Vue
from
'
vue
'
;
...
...
@@ -31,7 +31,7 @@ class ListIssue {
}
processAssignees
(
assignees
)
{
this
.
assignees
=
assignees
.
map
(
a
=>
new
List
User
(
a
));
this
.
assignees
=
assignees
.
map
(
a
=>
new
List
Assignee
(
a
));
}
addLabel
(
label
)
{
...
...
@@ -54,23 +54,23 @@ class ListIssue {
labels
.
forEach
(
this
.
removeLabel
.
bind
(
this
));
}
add
User
(
user
)
{
if
(
!
this
.
find
User
(
user
))
{
this
.
assignees
.
push
(
new
List
User
(
user
));
add
Assignee
(
assignee
)
{
if
(
!
this
.
find
Assignee
(
assignee
))
{
this
.
assignees
.
push
(
new
List
Assignee
(
assignee
));
}
}
find
User
(
user
)
{
return
this
.
assignees
.
filter
(
assignee
=>
assignee
.
id
===
user
.
id
)[
0
];
find
Assignee
(
findAssignee
)
{
return
this
.
assignees
.
filter
(
assignee
=>
assignee
.
id
===
findAssignee
.
id
)[
0
];
}
remove
User
(
user
)
{
if
(
user
)
{
this
.
assignees
=
this
.
assignees
.
filter
(
assignee
=>
assignee
.
id
!==
user
.
id
);
remove
Assignee
(
removeAssignee
)
{
if
(
assignee
)
{
this
.
assignees
=
this
.
assignees
.
filter
(
assignee
=>
assignee
.
id
!==
removeAssignee
.
id
);
}
}
removeAll
User
s
()
{
removeAll
Assignee
s
()
{
this
.
assignees
=
[];
}
...
...
app/assets/javascripts/users_select.js
View file @
d05c72c3
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, no-param-reassign */
/* global Issuable */
/* global ListUser */
import
eventHub
from
'
./sidebar/event_hub
'
;
...
...
@@ -257,7 +256,7 @@ import eventHub from './sidebar/event_hub';
defaultLabel
:
defaultLabel
,
hidden
:
function
(
e
)
{
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
eventHub
.
$emit
(
'
sidebar.save
User
s
'
);
eventHub
.
$emit
(
'
sidebar.save
Assignee
s
'
);
}
$selectbox
.
hide
();
...
...
@@ -290,7 +289,7 @@ import eventHub from './sidebar/event_hub';
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field-name
'
)}
'][value=
${
firstSelectedId
}
]`
);
firstSelected
.
remove
();
eventHub
.
$emit
(
'
sidebar.remove
User
'
,
{
eventHub
.
$emit
(
'
sidebar.remove
Assignee
'
,
{
id
:
firstSelectedId
,
});
}
...
...
@@ -302,10 +301,10 @@ import eventHub from './sidebar/event_hub';
const
id
=
parseInt
(
element
.
value
,
10
);
element
.
remove
();
});
eventHub
.
$emit
(
'
sidebar.removeAll
User
s
'
);
eventHub
.
$emit
(
'
sidebar.removeAll
Assignee
s
'
);
}
else
if
(
isActive
)
{
// user selected
eventHub
.
$emit
(
'
sidebar.add
User
'
,
user
);
eventHub
.
$emit
(
'
sidebar.add
Assignee
'
,
user
);
// Remove unassigned selection (if it was previously selected)
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
...
...
@@ -321,7 +320,7 @@ import eventHub from './sidebar/event_hub';
}
// User unselected
eventHub
.
$emit
(
'
sidebar.remove
User
'
,
user
);
eventHub
.
$emit
(
'
sidebar.remove
Assignee
'
,
user
);
}
}
...
...
spec/javascripts/boards/issue_card_spec.js
View file @
d05c72c3
/* global List
User
*/
/* global List
Assignee
*/
/* global ListLabel */
/* global listObj */
/* global ListIssue */
...
...
@@ -14,7 +14,7 @@ require('~/boards/components/issue_card_inner');
require
(
'
./mock_data
'
);
describe
(
'
Issue card component
'
,
()
=>
{
const
user
=
new
List
User
({
const
user
=
new
List
Assignee
({
id
:
1
,
name
:
'
testing 123
'
,
username
:
'
test
'
,
...
...
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