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
6da80dbd
Commit
6da80dbd
authored
Apr 12, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] more refactor
parent
a252e26b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
17 deletions
+7
-17
app/assets/javascripts/sidebar_assignees/components/collapsed/assignees.js
...ripts/sidebar_assignees/components/collapsed/assignees.js
+2
-2
app/assets/javascripts/sidebar_assignees/sidebar_assignees_options.js
...avascripts/sidebar_assignees/sidebar_assignees_options.js
+5
-6
app/assets/javascripts/sidebar_assignees/stores/sidebar_assignees_store.js
...ripts/sidebar_assignees/stores/sidebar_assignees_store.js
+0
-9
No files found.
app/assets/javascripts/sidebar_assignees/components/collapsed/assignees.js
View file @
6da80dbd
...
...
@@ -2,11 +2,11 @@ import CollapsedAvatar from './avatar';
export
default
{
name
:
'
CollapsedAssignees
'
,
data
:
{
data
()
{
return
{
defaultRenderCount
:
5
,
defaultMaxCounter
:
99
,
}
}
;
},
props
:
{
users
:
{
...
...
app/assets/javascripts/sidebar_assignees/sidebar_assignees_options.js
View file @
6da80dbd
...
...
@@ -41,7 +41,6 @@ export default {
return
{
store
,
service
,
loading
:
false
,
};
},
computed
:
{
...
...
@@ -62,13 +61,13 @@ export default {
this
.
saveUsers
();
},
saveUsers
()
{
this
.
loading
=
true
;
this
.
store
.
loading
=
true
;
this
.
service
.
update
(
this
.
store
.
getUserIds
())
.
then
((
response
)
=>
{
this
.
loading
=
false
;
this
.
store
.
loading
=
false
;
this
.
store
.
saveUsers
(
response
.
data
.
assignees
);
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
store
.
loading
=
false
;
return
new
Flash
(
'
An error occured while saving assignees
'
,
'
alert
'
);
});
},
...
...
@@ -84,12 +83,12 @@ export default {
<div>
<assignee-title
:numberOfAssignees="store.users.length"
:loading="loading"
:loading="
store.
loading"
:editable="store.editable"
/>
<collapsed-assignees :users="store.users"/>
<div class="value" v-if="!loading">
<div class="value" v-if="!
store.
loading">
<no-assignee v-if="numberOfAssignees === 0" />
<single-assignee
v-else-if="numberOfAssignees === 1"
...
...
app/assets/javascripts/sidebar_assignees/stores/sidebar_assignees_store.js
View file @
6da80dbd
...
...
@@ -10,7 +10,6 @@ export default class SidebarAssigneesStore {
this
.
users
=
[];
this
.
loading
=
false
;
this
.
editable
=
editable
;
this
.
defaultRenderCount
=
5
;
assignees
.
forEach
(
a
=>
this
.
addUser
(
this
.
destructUser
(
a
)));
}
...
...
@@ -24,8 +23,6 @@ export default class SidebarAssigneesStore {
username
,
avatarUrl
,
});
console
.
log
(
`addUser()`
);
console
.
log
(
user
);
}
addCurrentUser
()
{
...
...
@@ -33,8 +30,6 @@ export default class SidebarAssigneesStore {
}
removeUser
(
id
)
{
console
.
log
(
`removeUser()`
);
console
.
log
(
id
);
this
.
users
=
this
.
users
.
filter
(
u
=>
u
.
id
!==
id
);
}
...
...
@@ -43,12 +38,8 @@ export default class SidebarAssigneesStore {
}
getUserIds
()
{
console
.
log
(
`getUserIds`
);
const
ids
=
this
.
users
.
map
(
u
=>
u
.
id
);
if
(
ids
.
length
>
0
&&
ids
[
0
]
==
undefined
)
{
debugger
}
// If there are no ids, that means we have to unassign (which is id = 0)
return
ids
.
length
>
0
?
ids
:
[
0
];
}
...
...
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