BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
19642f61
Commit
19642f61
authored
May 24, 2017
by
Phil Hughes
Committed by
Timothy Andrew
May 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '32170-assignees-spinner' into 'master'
show loading indicator while waiting for assignees first fetch Closes #32170 See merge request !11434
parent
218eae87
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
1 deletion
+26
-1
sidebar_assignees.js
...scripts/sidebar/components/assignees/sidebar_assignees.js
+2
-1
sidebar_store.js
app/assets/javascripts/sidebar/stores/sidebar_store.js
+4
-0
_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+3
-0
sidebar_assignees_spec.js
spec/javascripts/sidebar/sidebar_assignees_spec.js
+12
-0
sidebar_store_spec.js
spec/javascripts/sidebar/sidebar_store_spec.js
+5
-0
No files found.
app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.js
View file @
19642f61
...
@@ -69,10 +69,11 @@ export default {
...
@@ -69,10 +69,11 @@ export default {
<div>
<div>
<assignee-title
<assignee-title
:number-of-assignees="store.assignees.length"
:number-of-assignees="store.assignees.length"
:loading="loading"
:loading="loading
|| store.isFetching.assignees
"
:editable="store.editable"
:editable="store.editable"
/>
/>
<assignees
<assignees
v-if="!store.isFetching.assignees"
class="value"
class="value"
:root-path="store.rootPath"
:root-path="store.rootPath"
:users="store.assignees"
:users="store.assignees"
...
...
app/assets/javascripts/sidebar/stores/sidebar_store.js
View file @
19642f61
...
@@ -10,6 +10,9 @@ export default class SidebarStore {
...
@@ -10,6 +10,9 @@ export default class SidebarStore {
this
.
humanTimeEstimate
=
''
;
this
.
humanTimeEstimate
=
''
;
this
.
humanTimeSpent
=
''
;
this
.
humanTimeSpent
=
''
;
this
.
assignees
=
[];
this
.
assignees
=
[];
this
.
isFetching
=
{
assignees
:
true
,
};
SidebarStore
.
singleton
=
this
;
SidebarStore
.
singleton
=
this
;
}
}
...
@@ -18,6 +21,7 @@ export default class SidebarStore {
...
@@ -18,6 +21,7 @@ export default class SidebarStore {
}
}
setAssigneeData
(
data
)
{
setAssigneeData
(
data
)
{
this
.
isFetching
.
assignees
=
false
;
if
(
data
.
assignees
)
{
if
(
data
.
assignees
)
{
this
.
assignees
=
data
.
assignees
;
this
.
assignees
=
data
.
assignees
;
}
}
...
...
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
19642f61
-
if
issuable
.
is_a?
(
Issue
)
-
if
issuable
.
is_a?
(
Issue
)
#js-vue-sidebar-assignees
{
data:
{
field:
"#{issuable.to_ability_name}[assignee_ids]"
}
}
#js-vue-sidebar-assignees
{
data:
{
field:
"#{issuable.to_ability_name}[assignee_ids]"
}
}
.title.hide-collapsed
Assignee
=
icon
(
'spinner spin'
)
-
else
-
else
.sidebar-collapsed-icon.sidebar-collapsed-user
{
data:
{
toggle:
"tooltip"
,
placement:
"left"
,
container:
"body"
},
title:
(
issuable
.
assignee
.
name
if
issuable
.
assignee
)
}
.sidebar-collapsed-icon.sidebar-collapsed-user
{
data:
{
toggle:
"tooltip"
,
placement:
"left"
,
container:
"body"
},
title:
(
issuable
.
assignee
.
name
if
issuable
.
assignee
)
}
-
if
issuable
.
assignee
-
if
issuable
.
assignee
...
...
spec/javascripts/sidebar/sidebar_assignees_spec.js
View file @
19642f61
...
@@ -42,4 +42,16 @@ describe('sidebar assignees', () => {
...
@@ -42,4 +42,16 @@ describe('sidebar assignees', () => {
expect
(
SidebarMediator
.
prototype
.
assignYourself
).
toHaveBeenCalled
();
expect
(
SidebarMediator
.
prototype
.
assignYourself
).
toHaveBeenCalled
();
expect
(
this
.
mediator
.
store
.
assignees
.
length
).
toEqual
(
1
);
expect
(
this
.
mediator
.
store
.
assignees
.
length
).
toEqual
(
1
);
});
});
it
(
'hides assignees until fetched'
,
(
done
)
=>
{
component
=
new
SidebarAssigneeComponent
().
$mount
(
this
.
sidebarAssigneesEl
);
const
currentAssignee
=
this
.
sidebarAssigneesEl
.
querySelector
(
'.value'
);
expect
(
currentAssignee
).
toBe
(
null
);
component
.
store
.
isFetching
.
assignees
=
false
;
Vue
.
nextTick
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'.value'
)).
toBeVisible
();
done
();
});
});
});
});
spec/javascripts/sidebar/sidebar_store_spec.js
View file @
19642f61
...
@@ -35,6 +35,10 @@ describe('Sidebar store', () => {
...
@@ -35,6 +35,10 @@ describe('Sidebar store', () => {
SidebarStore
.
singleton
=
null
;
SidebarStore
.
singleton
=
null
;
});
});
it
(
'has default isFetching values'
,
()
=>
{
expect
(
this
.
store
.
isFetching
.
assignees
).
toBe
(
true
);
});
it
(
'adds a new assignee'
,
()
=>
{
it
(
'adds a new assignee'
,
()
=>
{
this
.
store
.
addAssignee
(
assignee
);
this
.
store
.
addAssignee
(
assignee
);
expect
(
this
.
store
.
assignees
.
length
).
toEqual
(
1
);
expect
(
this
.
store
.
assignees
.
length
).
toEqual
(
1
);
...
@@ -67,6 +71,7 @@ describe('Sidebar store', () => {
...
@@ -67,6 +71,7 @@ describe('Sidebar store', () => {
};
};
this
.
store
.
setAssigneeData
(
users
);
this
.
store
.
setAssigneeData
(
users
);
expect
(
this
.
store
.
isFetching
.
assignees
).
toBe
(
false
);
expect
(
this
.
store
.
assignees
.
length
).
toEqual
(
3
);
expect
(
this
.
store
.
assignees
.
length
).
toEqual
(
3
);
});
});
...
...
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