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
d265d67d
Commit
d265d67d
authored
Jan 29, 2021
by
Natalia Tepluhina
Committed by
Nicolò Maria Mezzopera
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix search debounce for Swimlanes board assignees
parent
632b7768
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
34 deletions
+42
-34
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
...javascripts/boards/components/board_assignee_dropdown.vue
+31
-25
ee/changelogs/unreleased/300272-on-swimlanes-board-assignees-search-debounce-is-not-working.yml
...mlanes-board-assignees-search-debounce-is-not-working.yml
+5
-0
spec/frontend/boards/components/board_assignee_dropdown_spec.js
...rontend/boards/components/board_assignee_dropdown_spec.js
+6
-9
No files found.
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
View file @
d265d67d
...
...
@@ -39,50 +39,51 @@ export default {
data
()
{
return
{
search
:
''
,
p
articipants
:
[],
issueP
articipants
:
[],
selected
:
[],
};
},
apollo
:
{
participants
:
{
query
()
{
return
this
.
isSearchEmpty
?
getIssueParticipants
:
searchUsers
;
},
issueParticipants
:
{
query
:
getIssueParticipants
,
variables
()
{
if
(
this
.
isSearchEmpty
)
{
return
{
id
:
`gid://gitlab/Issue/
${
this
.
activeIssue
.
iid
}
`
,
};
}
return
{
search
:
this
.
search
,
};
},
update
(
data
)
{
if
(
this
.
isSearchEmpty
)
{
return
data
.
issue
?.
participants
?.
nodes
||
[];
}
return
data
.
users
?.
nodes
||
[];
},
debounce
()
{
const
{
noSearchDelay
,
searchDelay
}
=
this
.
$options
;
return
this
.
isSearchEmpty
?
noSearchDelay
:
searchDelay
;
},
searchUsers
:
{
query
:
searchUsers
,
variables
()
{
return
{
search
:
this
.
search
,
};
},
update
:
(
data
)
=>
data
.
users
?.
nodes
||
[],
skip
()
{
return
this
.
isSearchEmpty
;
},
debounce
:
250
,
},
},
computed
:
{
...
mapGetters
([
'
activeIssue
'
]),
...
mapState
([
'
isSettingAssignees
'
]),
participants
()
{
return
this
.
isSearchEmpty
?
this
.
issueParticipants
:
this
.
searchUsers
;
},
assigneeText
()
{
return
n__
(
'
Assignee
'
,
'
%d Assignees
'
,
this
.
selected
.
length
);
},
unSelectedFiltered
()
{
return
this
.
participants
.
filter
(({
username
})
=>
{
return
(
this
.
participants
?.
filter
(({
username
})
=>
{
return
!
this
.
selectedUserNames
.
includes
(
username
);
});
})
||
[]
);
},
selectedIsEmpty
()
{
return
this
.
selected
.
length
===
0
;
...
...
@@ -96,6 +97,11 @@ export default {
currentUser
()
{
return
gon
?.
current_username
;
},
isLoading
()
{
return
(
this
.
$apollo
.
queries
.
issueParticipants
?.
loading
||
this
.
$apollo
.
queries
.
searchUsers
?.
loading
);
},
},
created
()
{
this
.
selected
=
cloneDeep
(
this
.
activeIssue
.
assignees
);
...
...
@@ -147,7 +153,7 @@ export default {
<gl-search-box-by-type
v-model.trim=
"search"
/>
</
template
>
<
template
#items
>
<gl-loading-icon
v-if=
"
$apollo.queries.participants.l
oading"
size=
"lg"
/>
<gl-loading-icon
v-if=
"
isL
oading"
size=
"lg"
/>
<template
v-else
>
<gl-dropdown-item
:is-checked=
"selectedIsEmpty"
...
...
ee/changelogs/unreleased/300272-on-swimlanes-board-assignees-search-debounce-is-not-working.yml
0 → 100644
View file @
d265d67d
---
title
:
Fix search debounce for Swimlanes board assignees
merge_request
:
52786
author
:
type
:
fixed
spec/frontend/boards/components/board_assignee_dropdown_spec.js
View file @
d265d67d
...
...
@@ -38,7 +38,7 @@ describe('BoardCardAssigneeDropdown', () => {
return
{
search
,
selected
:
[],
participants
,
issueParticipants
:
participants
,
};
},
store
,
...
...
@@ -49,7 +49,7 @@ describe('BoardCardAssigneeDropdown', () => {
mocks
:
{
$apollo
:
{
queries
:
{
participant
s
:
{
searchUser
s
:
{
loading
,
},
},
...
...
@@ -70,7 +70,6 @@ describe('BoardCardAssigneeDropdown', () => {
return
{
search
,
selected
:
[],
participants
,
};
},
store
,
...
...
@@ -256,17 +255,15 @@ describe('BoardCardAssigneeDropdown', () => {
},
);
describe
(
'
when participants is loading
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
(
''
,
true
);
});
describe
(
'
when searching users is loading
'
,
()
=>
{
it
(
'
finds a loading icon in the dropdown
'
,
()
=>
{
createComponent
(
'
test
'
,
true
);
expect
(
findLoadingIcon
().
exists
()).
toBe
(
true
);
});
});
describe
(
'
when participants
is
loading is false
'
,
()
=>
{
describe
(
'
when participants loading is false
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
...
...
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