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 {
...
@@ -39,50 +39,51 @@ export default {
data
()
{
data
()
{
return
{
return
{
search
:
''
,
search
:
''
,
p
articipants
:
[],
issueP
articipants
:
[],
selected
:
[],
selected
:
[],
};
};
},
},
apollo
:
{
apollo
:
{
participants
:
{
issueParticipants
:
{
query
()
{
query
:
getIssueParticipants
,
return
this
.
isSearchEmpty
?
getIssueParticipants
:
searchUsers
;
},
variables
()
{
variables
()
{
if
(
this
.
isSearchEmpty
)
{
return
{
return
{
id
:
`gid://gitlab/Issue/
${
this
.
activeIssue
.
iid
}
`
,
id
:
`gid://gitlab/Issue/
${
this
.
activeIssue
.
iid
}
`
,
};
};
}
return
{
search
:
this
.
search
,
};
},
},
update
(
data
)
{
update
(
data
)
{
if
(
this
.
isSearchEmpty
)
{
return
data
.
issue
?.
participants
?.
nodes
||
[];
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
:
{
computed
:
{
...
mapGetters
([
'
activeIssue
'
]),
...
mapGetters
([
'
activeIssue
'
]),
...
mapState
([
'
isSettingAssignees
'
]),
...
mapState
([
'
isSettingAssignees
'
]),
participants
()
{
return
this
.
isSearchEmpty
?
this
.
issueParticipants
:
this
.
searchUsers
;
},
assigneeText
()
{
assigneeText
()
{
return
n__
(
'
Assignee
'
,
'
%d Assignees
'
,
this
.
selected
.
length
);
return
n__
(
'
Assignee
'
,
'
%d Assignees
'
,
this
.
selected
.
length
);
},
},
unSelectedFiltered
()
{
unSelectedFiltered
()
{
return
this
.
participants
.
filter
(({
username
})
=>
{
return
(
this
.
participants
?.
filter
(({
username
})
=>
{
return
!
this
.
selectedUserNames
.
includes
(
username
);
return
!
this
.
selectedUserNames
.
includes
(
username
);
});
})
||
[]
);
},
},
selectedIsEmpty
()
{
selectedIsEmpty
()
{
return
this
.
selected
.
length
===
0
;
return
this
.
selected
.
length
===
0
;
...
@@ -96,6 +97,11 @@ export default {
...
@@ -96,6 +97,11 @@ export default {
currentUser
()
{
currentUser
()
{
return
gon
?.
current_username
;
return
gon
?.
current_username
;
},
},
isLoading
()
{
return
(
this
.
$apollo
.
queries
.
issueParticipants
?.
loading
||
this
.
$apollo
.
queries
.
searchUsers
?.
loading
);
},
},
},
created
()
{
created
()
{
this
.
selected
=
cloneDeep
(
this
.
activeIssue
.
assignees
);
this
.
selected
=
cloneDeep
(
this
.
activeIssue
.
assignees
);
...
@@ -147,7 +153,7 @@ export default {
...
@@ -147,7 +153,7 @@ export default {
<gl-search-box-by-type
v-model.trim=
"search"
/>
<gl-search-box-by-type
v-model.trim=
"search"
/>
</
template
>
</
template
>
<
template
#items
>
<
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
>
<template
v-else
>
<gl-dropdown-item
<gl-dropdown-item
:is-checked=
"selectedIsEmpty"
: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', () => {
...
@@ -38,7 +38,7 @@ describe('BoardCardAssigneeDropdown', () => {
return
{
return
{
search
,
search
,
selected
:
[],
selected
:
[],
participants
,
issueParticipants
:
participants
,
};
};
},
},
store
,
store
,
...
@@ -49,7 +49,7 @@ describe('BoardCardAssigneeDropdown', () => {
...
@@ -49,7 +49,7 @@ describe('BoardCardAssigneeDropdown', () => {
mocks
:
{
mocks
:
{
$apollo
:
{
$apollo
:
{
queries
:
{
queries
:
{
participant
s
:
{
searchUser
s
:
{
loading
,
loading
,
},
},
},
},
...
@@ -70,7 +70,6 @@ describe('BoardCardAssigneeDropdown', () => {
...
@@ -70,7 +70,6 @@ describe('BoardCardAssigneeDropdown', () => {
return
{
return
{
search
,
search
,
selected
:
[],
selected
:
[],
participants
,
};
};
},
},
store
,
store
,
...
@@ -256,17 +255,15 @@ describe('BoardCardAssigneeDropdown', () => {
...
@@ -256,17 +255,15 @@ describe('BoardCardAssigneeDropdown', () => {
},
},
);
);
describe
(
'
when participants is loading
'
,
()
=>
{
describe
(
'
when searching users is loading
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
(
''
,
true
);
});
it
(
'
finds a loading icon in the dropdown
'
,
()
=>
{
it
(
'
finds a loading icon in the dropdown
'
,
()
=>
{
createComponent
(
'
test
'
,
true
);
expect
(
findLoadingIcon
().
exists
()).
toBe
(
true
);
expect
(
findLoadingIcon
().
exists
()).
toBe
(
true
);
});
});
});
});
describe
(
'
when participants
is
loading is false
'
,
()
=>
{
describe
(
'
when participants loading is false
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
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