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
7ea10d4d
Commit
7ea10d4d
authored
Feb 27, 2018
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move SidebarAssignees vue component
parent
0a5eb08a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
45 deletions
+53
-45
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.vue
...cripts/sidebar/components/assignees/sidebar_assignees.vue
+46
-43
app/assets/javascripts/sidebar/mount_sidebar.js
app/assets/javascripts/sidebar/mount_sidebar.js
+1
-1
changelogs/unreleased/refactor-move-sidebar-assignee-vue-component.yml
...released/refactor-move-sidebar-assignee-vue-component.yml
+5
-0
spec/javascripts/sidebar/sidebar_assignees_spec.js
spec/javascripts/sidebar/sidebar_assignees_spec.js
+1
-1
No files found.
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.
js
→
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.
vue
View file @
7ea10d4d
<
script
>
import
Flash
from
'
../../../flash
'
;
import
Flash
from
'
../../../flash
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
AssigneeTitle
from
'
./assignee_title
'
;
import
Assignees
from
'
./assignees.vue
'
;
import
Assignees
from
'
./assignees.vue
'
;
...
@@ -6,11 +7,9 @@ import eventHub from '../../event_hub';
...
@@ -6,11 +7,9 @@ import eventHub from '../../event_hub';
export
default
{
export
default
{
name
:
'
SidebarAssignees
'
,
name
:
'
SidebarAssignees
'
,
data
()
{
components
:
{
return
{
AssigneeTitle
,
store
:
new
Store
(),
Assignees
,
loading
:
false
,
};
},
},
props
:
{
props
:
{
mediator
:
{
mediator
:
{
...
@@ -27,9 +26,28 @@ export default {
...
@@ -27,9 +26,28 @@ export default {
default
:
false
,
default
:
false
,
},
},
},
},
components
:
{
data
()
{
AssigneeTitle
,
return
{
Assignees
,
store
:
new
Store
(),
loading
:
false
,
};
},
created
()
{
this
.
removeAssignee
=
this
.
store
.
removeAssignee
.
bind
(
this
.
store
);
this
.
addAssignee
=
this
.
store
.
addAssignee
.
bind
(
this
.
store
);
this
.
removeAllAssignees
=
this
.
store
.
removeAllAssignees
.
bind
(
this
.
store
);
// Get events from glDropdown
eventHub
.
$on
(
'
sidebar.removeAssignee
'
,
this
.
removeAssignee
);
eventHub
.
$on
(
'
sidebar.addAssignee
'
,
this
.
addAssignee
);
eventHub
.
$on
(
'
sidebar.removeAllAssignees
'
,
this
.
removeAllAssignees
);
eventHub
.
$on
(
'
sidebar.saveAssignees
'
,
this
.
saveAssignees
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
sidebar.removeAssignee
'
,
this
.
removeAssignee
);
eventHub
.
$off
(
'
sidebar.addAssignee
'
,
this
.
addAssignee
);
eventHub
.
$off
(
'
sidebar.removeAllAssignees
'
,
this
.
removeAllAssignees
);
eventHub
.
$off
(
'
sidebar.saveAssignees
'
,
this
.
saveAssignees
);
},
},
methods
:
{
methods
:
{
assignSelf
()
{
assignSelf
()
{
...
@@ -54,39 +72,24 @@ export default {
...
@@ -54,39 +72,24 @@ export default {
});
});
},
},
},
},
created
()
{
this
.
removeAssignee
=
this
.
store
.
removeAssignee
.
bind
(
this
.
store
);
this
.
addAssignee
=
this
.
store
.
addAssignee
.
bind
(
this
.
store
);
this
.
removeAllAssignees
=
this
.
store
.
removeAllAssignees
.
bind
(
this
.
store
);
// Get events from glDropdown
eventHub
.
$on
(
'
sidebar.removeAssignee
'
,
this
.
removeAssignee
);
eventHub
.
$on
(
'
sidebar.addAssignee
'
,
this
.
addAssignee
);
eventHub
.
$on
(
'
sidebar.removeAllAssignees
'
,
this
.
removeAllAssignees
);
eventHub
.
$on
(
'
sidebar.saveAssignees
'
,
this
.
saveAssignees
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
sidebar.removeAssignee
'
,
this
.
removeAssignee
);
eventHub
.
$off
(
'
sidebar.addAssignee
'
,
this
.
addAssignee
);
eventHub
.
$off
(
'
sidebar.removeAllAssignees
'
,
this
.
removeAllAssignees
);
eventHub
.
$off
(
'
sidebar.saveAssignees
'
,
this
.
saveAssignees
);
},
template
:
`
<div>
<assignee-title
:number-of-assignees="store.assignees.length"
:loading="loading || store.isFetching.assignees"
:editable="store.editable"
:show-toggle="!signedIn"
/>
<assignees
v-if="!store.isFetching.assignees"
class="value"
:root-path="store.rootPath"
:users="store.assignees"
:editable="store.editable"
@assign-self="assignSelf"
/>
</div>
`
,
};
};
</
script
>
<
template
>
<div>
<assignee-title
:number-of-assignees=
"store.assignees.length"
:loading=
"loading || store.isFetching.assignees"
:editable=
"store.editable"
:show-toggle=
"!signedIn"
/>
<assignees
v-if=
"!store.isFetching.assignees"
class=
"value"
:root-path=
"store.rootPath"
:users=
"store.assignees"
:editable=
"store.editable"
@
assign-self=
"assignSelf"
/>
</div>
</
template
>
app/assets/javascripts/sidebar/mount_sidebar.js
View file @
7ea10d4d
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
SidebarTimeTracking
from
'
./components/time_tracking/sidebar_time_tracking
'
;
import
SidebarTimeTracking
from
'
./components/time_tracking/sidebar_time_tracking
'
;
import
SidebarAssignees
from
'
./components/assignees/sidebar_assignees
'
;
import
SidebarAssignees
from
'
./components/assignees/sidebar_assignees
.vue
'
;
import
ConfidentialIssueSidebar
from
'
./components/confidential/confidential_issue_sidebar.vue
'
;
import
ConfidentialIssueSidebar
from
'
./components/confidential/confidential_issue_sidebar.vue
'
;
import
SidebarMoveIssue
from
'
./lib/sidebar_move_issue
'
;
import
SidebarMoveIssue
from
'
./lib/sidebar_move_issue
'
;
import
LockIssueSidebar
from
'
./components/lock/lock_issue_sidebar.vue
'
;
import
LockIssueSidebar
from
'
./components/lock/lock_issue_sidebar.vue
'
;
...
...
changelogs/unreleased/refactor-move-sidebar-assignee-vue-component.yml
0 → 100644
View file @
7ea10d4d
---
title
:
Move SidebarAssignees vue component
merge_request
:
17398
author
:
George Tsiolis
type
:
performance
spec/javascripts/sidebar/sidebar_assignees_spec.js
View file @
7ea10d4d
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
SidebarAssignees
from
'
~/sidebar/components/assignees/sidebar_assignees
'
;
import
SidebarAssignees
from
'
~/sidebar/components/assignees/sidebar_assignees
.vue
'
;
import
SidebarMediator
from
'
~/sidebar/sidebar_mediator
'
;
import
SidebarMediator
from
'
~/sidebar/sidebar_mediator
'
;
import
SidebarService
from
'
~/sidebar/services/sidebar_service
'
;
import
SidebarService
from
'
~/sidebar/services/sidebar_service
'
;
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
...
...
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