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
7d318866
Commit
7d318866
authored
Dec 01, 2020
by
Scott Stern
Committed by
David O'Regan
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add loading spinner to assignee header
parent
1a633aa5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
6 deletions
+52
-6
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
...javascripts/boards/components/board_assignee_dropdown.vue
+3
-2
app/assets/javascripts/boards/stores/actions.js
app/assets/javascripts/boards/stores/actions.js
+5
-0
app/assets/javascripts/boards/stores/mutation_types.js
app/assets/javascripts/boards/stores/mutation_types.js
+1
-0
app/assets/javascripts/boards/stores/mutations.js
app/assets/javascripts/boards/stores/mutations.js
+4
-0
app/assets/javascripts/boards/stores/state.js
app/assets/javascripts/boards/stores/state.js
+1
-0
changelogs/unreleased/ss-add-loading-state-to-assignee-header.yml
...gs/unreleased/ss-add-loading-state-to-assignee-header.yml
+5
-0
changelogs/unreleased/ss-add-loading-to-assignees.yml
changelogs/unreleased/ss-add-loading-to-assignees.yml
+1
-1
spec/frontend/boards/components/board_assignee_dropdown_spec.js
...rontend/boards/components/board_assignee_dropdown_spec.js
+16
-3
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+8
-0
spec/frontend/boards/stores/mutations_spec.js
spec/frontend/boards/stores/mutations_spec.js
+8
-0
No files found.
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
View file @
7d318866
<
script
>
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
GlDropdownItem
,
...
...
@@ -75,6 +75,7 @@ export default {
},
computed
:
{
...
mapGetters
([
'
activeIssue
'
]),
...
mapState
([
'
isSettingAssignees
'
]),
assigneeText
()
{
return
n__
(
'
Assignee
'
,
'
%d Assignees
'
,
this
.
selected
.
length
);
},
...
...
@@ -131,7 +132,7 @@ export default {
</
script
>
<
template
>
<board-editable-item
:title=
"assigneeText"
@
close=
"saveAssignees"
>
<board-editable-item
:
loading=
"isSettingAssignees"
:
title=
"assigneeText"
@
close=
"saveAssignees"
>
<template
#collapsed
>
<issuable-assignees
:users=
"selected"
@
assign-self=
"assignSelf"
/>
</
template
>
...
...
app/assets/javascripts/boards/stores/actions.js
View file @
7d318866
...
...
@@ -320,6 +320,8 @@ export default {
},
setAssignees
:
({
commit
,
getters
},
assigneeUsernames
)
=>
{
commit
(
types
.
SET_ASSIGNEE_LOADING
,
true
);
return
gqlClient
.
mutate
({
mutation
:
updateAssignees
,
...
...
@@ -339,6 +341,9 @@ export default {
});
return
nodes
;
})
.
finally
(()
=>
{
commit
(
types
.
SET_ASSIGNEE_LOADING
,
false
);
});
},
...
...
app/assets/javascripts/boards/stores/mutation_types.js
View file @
7d318866
...
...
@@ -34,4 +34,5 @@ export const SET_CURRENT_PAGE = 'SET_CURRENT_PAGE';
export
const
TOGGLE_EMPTY_STATE
=
'
TOGGLE_EMPTY_STATE
'
;
export
const
SET_ACTIVE_ID
=
'
SET_ACTIVE_ID
'
;
export
const
UPDATE_ISSUE_BY_ID
=
'
UPDATE_ISSUE_BY_ID
'
;
export
const
SET_ASSIGNEE_LOADING
=
'
SET_ASSIGNEE_LOADING
'
;
export
const
RESET_ISSUES
=
'
RESET_ISSUES
'
;
app/assets/javascripts/boards/stores/mutations.js
View file @
7d318866
...
...
@@ -143,6 +143,10 @@ export default {
Vue
.
set
(
state
.
issues
[
issueId
],
prop
,
value
);
},
[
mutationTypes
.
SET_ASSIGNEE_LOADING
](
state
,
isLoading
)
{
state
.
isSettingAssignees
=
isLoading
;
},
[
mutationTypes
.
REQUEST_ADD_ISSUE
]:
()
=>
{
notImplemented
();
},
...
...
app/assets/javascripts/boards/stores/state.js
View file @
7d318866
...
...
@@ -11,6 +11,7 @@ export default () => ({
boardLists
:
{},
listsFlags
:
{},
issuesByListId
:
{},
isSettingAssignees
:
false
,
pageInfoByListId
:
{},
issues
:
{},
filterParams
:
{},
...
...
changelogs/unreleased/ss-add-loading-state-to-assignee-header.yml
0 → 100644
View file @
7d318866
---
title
:
Add loading state to assignees header
merge_request
:
48392
author
:
type
:
added
changelogs/unreleased/ss-add-loading-to-assignees.yml
View file @
7d318866
---
title
:
Add loading state to
assignees
dropdown
title
:
Add loading state to
boards assignees header
dropdown
merge_request
:
47848
author
:
type
:
added
spec/frontend/boards/components/board_assignee_dropdown_spec.js
View file @
7d318866
...
...
@@ -37,7 +37,7 @@ describe('BoardCardAssigneeDropdown', () => {
data
()
{
return
{
search
,
selected
:
store
.
getters
.
activeIssue
.
assignees
,
selected
:
[]
,
participants
,
};
},
...
...
@@ -63,14 +63,13 @@ describe('BoardCardAssigneeDropdown', () => {
[
getIssueParticipants
,
getIssueParticipantsSpy
],
[
searchUsers
,
getSearchUsersSpy
],
]);
wrapper
=
mount
(
BoardAssigneeDropdown
,
{
localVue
,
apolloProvider
:
fakeApollo
,
data
()
{
return
{
search
,
selected
:
store
.
getters
.
activeIssue
.
assignees
,
selected
:
[]
,
participants
,
};
},
...
...
@@ -369,4 +368,18 @@ describe('BoardCardAssigneeDropdown', () => {
expect
(
findByText
(
currentUser
.
username
).
exists
()).
toBe
(
true
);
});
});
describe
(
'
when setting an assignee
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
it
(
'
passes loading state from Vuex to BoardEditableItem
'
,
async
()
=>
{
store
.
state
.
isSettingAssignees
=
true
;
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
BoardEditableItem
).
props
(
'
loading
'
)).
toBe
(
true
);
});
});
});
spec/frontend/boards/stores/actions_spec.js
View file @
7d318866
...
...
@@ -690,10 +690,18 @@ describe('setAssignees', () => {
{},
{
activeIssue
:
{
iid
,
referencePath
:
refPath
},
commit
:
()
=>
{}
},
[
{
type
:
'
SET_ASSIGNEE_LOADING
'
,
payload
:
true
,
},
{
type
:
'
UPDATE_ISSUE_BY_ID
'
,
payload
:
{
prop
:
'
assignees
'
,
issueId
:
undefined
,
value
:
[
node
]
},
},
{
type
:
'
SET_ASSIGNEE_LOADING
'
,
payload
:
false
,
},
],
[],
done
,
...
...
spec/frontend/boards/stores/mutations_spec.js
View file @
7d318866
...
...
@@ -516,6 +516,14 @@ describe('Board Store Mutations', () => {
});
});
describe
(
'
SET_ASSIGNEE_LOADING
'
,
()
=>
{
it
(
'
sets isSettingAssignees to the value passed
'
,
()
=>
{
mutations
.
SET_ASSIGNEE_LOADING
(
state
,
true
);
expect
(
state
.
isSettingAssignees
).
toBe
(
true
);
});
});
describe
(
'
SET_CURRENT_PAGE
'
,
()
=>
{
expectNotImplemented
(
mutations
.
SET_CURRENT_PAGE
);
});
...
...
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