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
3d790c6d
Commit
3d790c6d
authored
Mar 22, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] add loading indicator when saving users
parent
b9d4f3c7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
6 deletions
+11
-6
app/assets/javascripts/vue_sidebar_assignees/components/assignee_title.js
...cripts/vue_sidebar_assignees/components/assignee_title.js
+2
-1
app/assets/javascripts/vue_sidebar_assignees/components/multiple_assignees.js
...ts/vue_sidebar_assignees/components/multiple_assignees.js
+1
-1
app/assets/javascripts/vue_sidebar_assignees/components/no_assignee.js
...vascripts/vue_sidebar_assignees/components/no_assignee.js
+1
-1
app/assets/javascripts/vue_sidebar_assignees/components/single_assignee.js
...ripts/vue_sidebar_assignees/components/single_assignee.js
+1
-1
app/assets/javascripts/vue_sidebar_assignees/index.js
app/assets/javascripts/vue_sidebar_assignees/index.js
+2
-2
app/assets/javascripts/vue_sidebar_assignees/stores/sidebar_assignees_store.js
...s/vue_sidebar_assignees/stores/sidebar_assignees_store.js
+4
-0
No files found.
app/assets/javascripts/vue_sidebar_assignees/components/assignee_title.js
View file @
3d790c6d
export
default
{
name
:
'
AssigneeTitle
'
,
props
:
{
loading
:
{
type
:
Boolean
,
required
:
true
},
numberOfAssignees
:
{
type
:
Number
,
required
:
true
},
},
computed
:
{
...
...
@@ -16,7 +17,7 @@ export default {
<template v-else>
Assignee
</template>
<i aria-hidden="true" class="fa fa-spinner fa-spin block-loading"
style="display: none;
"></i>
<i aria-hidden="true" class="fa fa-spinner fa-spin block-loading"
:class="{ hidden: !loading }
"></i>
<a class="edit-link pull-right" href="#">Edit</a>
</div>
`
,
...
...
app/assets/javascripts/vue_sidebar_assignees/components/multiple_assignees.js
View file @
3d790c6d
...
...
@@ -27,7 +27,7 @@ export default {
'
show-more-assignees
'
:
ShowMoreAssignees
,
},
template
:
`
<div class="
value
hide-collapsed">
<div class="hide-collapsed">
<div class="hide-collapsed">
<div class="user-list">
<div class="user-item" v-for="(user, index) in assignees.users" v-if="showMore || (index < 5 && !showMore)">
...
...
app/assets/javascripts/vue_sidebar_assignees/components/no_assignee.js
View file @
3d790c6d
...
...
@@ -9,7 +9,7 @@ export default {
}
},
template
:
`
<div class="
value
hide-collapsed">
<div class="hide-collapsed">
<span class="assign-yourself no-value">
No assignee -
<button type="button" class="btn-link" @click="assignSelf">
...
...
app/assets/javascripts/vue_sidebar_assignees/components/single_assignee.js
View file @
3d790c6d
...
...
@@ -9,7 +9,7 @@ export default {
},
},
template
:
`
<div class="
value
hide-collapsed">
<div class="hide-collapsed">
<a class="author_link bold" :href="'/' + user.username">
<img width="32" class="avatar avatar-inline s32" alt="" :src="user.avatarUrl">
<span class="author">{{user.name}}</span>
...
...
app/assets/javascripts/vue_sidebar_assignees/index.js
View file @
3d790c6d
...
...
@@ -50,8 +50,8 @@ const sidebarAssigneesOptions = () => ({
},
template
:
`
<div class="sidebar-assignees">
<assignee-title :numberOfAssignees="assignees.users.length" />
<component :is="componentName" :assignees="assignees" :class="{ hidden: hideComponent }" />
<assignee-title :numberOfAssignees="assignees.users.length"
:loading="assignees.loading"
/>
<component
class="value"
:is="componentName" :assignees="assignees" :class="{ hidden: hideComponent }" />
</div>
`
,
});
...
...
app/assets/javascripts/vue_sidebar_assignees/stores/sidebar_assignees_store.js
View file @
3d790c6d
...
...
@@ -4,6 +4,7 @@ export default class SidebarAssigneesStore {
this
.
service
=
service
;
this
.
users
=
[];
this
.
saved
=
true
;
this
.
loading
=
false
;
}
addUser
(
id
,
name
,
username
,
avatarUrl
,
saved
)
{
...
...
@@ -31,6 +32,7 @@ export default class SidebarAssigneesStore {
saveUsers
()
{
const
ids
=
this
.
users
.
map
((
u
)
=>
u
.
id
)
||
0
;
this
.
loading
=
true
;
this
.
service
.
update
(
ids
.
length
>
0
?
ids
:
0
)
.
then
((
response
)
=>
{
const
data
=
response
.
data
;
...
...
@@ -42,9 +44,11 @@ export default class SidebarAssigneesStore {
this
.
addUser
(
assignee
.
id
,
assignee
.
name
,
assignee
.
username
,
assignee
.
avatar_url
,
true
);
}
this
.
saved
=
true
;
this
.
loading
=
false
;
}).
catch
((
err
)
=>
{
console
.
log
(
err
);
console
.
log
(
'
error
'
);
this
.
loading
=
false
;
});
}
}
\ No newline at end of file
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