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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
19c9ee47
Commit
19c9ee47
authored
Aug 30, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added search for all lists on issue boards
Closes #21139
parent
2778dec1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
98 deletions
+71
-98
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+7
-0
app/assets/javascripts/boards/components/board.js.es6
app/assets/javascripts/boards/components/board.js.es6
+1
-9
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+0
-4
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+2
-1
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+10
-35
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+0
-5
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+12
-9
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+39
-26
spec/javascripts/boards/list_spec.js.es6
spec/javascripts/boards/list_spec.js.es6
+0
-9
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
19c9ee47
...
...
@@ -54,4 +54,11 @@ $(() => {
});
}
});
gl.IssueBoardsSearch = new Vue({
el: '#js-boards-seach',
data: {
filters: Store.state.filters
}
});
});
app/assets/javascripts/boards/components/board.js.es6
View file @
19c9ee47
...
...
@@ -21,15 +21,10 @@
},
data () {
return {
query: '',
filters: Store.state.filters
};
},
watch: {
query () {
this.list.filters = this.getFilterData();
this.list.getIssues(true);
},
filters: {
handler () {
this.list.page = 1;
...
...
@@ -40,10 +35,7 @@
},
methods: {
getFilterData () {
const filters = this.filters;
let queryData = { search: this.query };
Object.keys(filters).forEach((key) => { queryData[key] = filters[key]; });
Object.keys(this.filters).forEach((key) => { queryData[key] = this.filters[key]; });
return queryData;
}
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
19c9ee47
...
...
@@ -58,10 +58,6 @@ class List {
}
}
canSearch () {
return this.type === 'backlog';
}
getIssues (emptyIssues = true) {
const filters = this.filters;
let data = { page: this.page };
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
19c9ee47
...
...
@@ -15,7 +15,8 @@
author_id: gl.utils.getParameterValues('author_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
label_name: gl.utils.getParameterValues('label_name[]')
label_name: gl.utils.getParameterValues('label_name[]'),
search: ''
};
},
addList (listObj) {
...
...
app/assets/stylesheets/pages/boards.scss
View file @
19c9ee47
...
...
@@ -160,40 +160,6 @@
border-bottom
:
1px
solid
$border-color
;
}
.board-search-container
{
position
:
relative
;
background-color
:
#fff
;
.form-control
{
padding-right
:
30px
;
}
}
.board-search-icon
,
.board-search-clear-btn
{
position
:
absolute
;
right
:
$gl-padding
+
10px
;
top
:
50%
;
margin-top
:
-7px
;
font-size
:
14px
;
}
.board-search-icon
{
color
:
$gl-placeholder-color
;
}
.board-search-clear-btn
{
padding
:
0
;
line-height
:
1
;
background
:
transparent
;
border
:
0
;
outline
:
0
;
&
:hover
{
color
:
$gl-link-color
;
}
}
.board-delete
{
margin-right
:
10px
;
padding
:
0
;
...
...
@@ -304,3 +270,12 @@
margin-right
:
8px
;
font-weight
:
500
;
}
.issue-boards-search
{
width
:
335px
;
.form-control
{
display
:
inline-block
;
width
:
210px
;
}
}
app/views/projects/boards/components/_board.html.haml
View file @
19c9ee47
...
...
@@ -21,11 +21,6 @@
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
=
icon
(
"spinner spin"
,
class:
"board-header-loading-spinner pull-right"
,
"v-show"
=>
"list.loadingMore"
)
.board-inner-container.board-search-container
{
"v-if"
=>
"list.canSearch()"
}
%input
.form-control
{
type:
"text"
,
placeholder:
"Search issues"
,
"v-model"
=>
"query"
,
"debounce"
=>
"250"
}
=
icon
(
"search"
,
class:
"board-search-icon"
,
"v-show"
=>
"!query"
)
%button
.board-search-clear-btn
{
type:
"button"
,
role:
"button"
,
"aria-label"
=>
"Clear search"
,
"@click"
=>
"query = ''"
,
"v-show"
=>
"query"
}
=
icon
(
"times"
,
class:
"board-search-clear"
)
%board-list
{
"inline-template"
=>
true
,
"v-if"
=>
"list.type !== 'blank'"
,
":list"
=>
"list"
,
...
...
app/views/shared/issuable/_filter.html.haml
View file @
19c9ee47
...
...
@@ -27,8 +27,11 @@
=
render
"shared/issuable/label_dropdown"
.pull-right
-
if
controller
.
controller_name
==
'boards'
&&
can?
(
current_user
,
:admin_list
,
@project
)
.dropdown
-
if
controller
.
controller_name
==
'boards'
#js-boards-seach
.issue-boards-search
%input
.pull-left.form-control
{
type:
"search"
,
placeholder:
"Filter by name..."
,
"v-model"
=>
"filters.search"
,
"debounce"
=>
"250"
}
-
if
can?
(
current_user
,
:admin_list
,
@project
)
.dropdown.pull-right
%button
.btn.btn-create.js-new-board-list
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
labels:
labels_filter_path
,
project_id:
@project
.
try
(
:id
)
}
}
Create new list
.dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new.dropdown-menu-selectable
...
...
spec/features/boards/boards_spec.rb
View file @
19c9ee47
...
...
@@ -110,6 +110,45 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it
'search backlog list'
do
page
.
within
(
'#js-boards-seach'
)
do
find
(
'.form-control'
).
set
(
issue1
.
title
)
end
wait_for_vue_resource
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(3)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
,
count:
0
)
end
it
'search done list'
do
page
.
within
(
'#js-boards-seach'
)
do
find
(
'.form-control'
).
set
(
issue8
.
title
)
end
wait_for_vue_resource
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(3)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
,
count:
1
)
end
it
'search list'
do
page
.
within
(
'#js-boards-seach'
)
do
find
(
'.form-control'
).
set
(
issue5
.
title
)
end
wait_for_vue_resource
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
find
(
'.board:nth-child(3)'
)).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
,
count:
0
)
end
it
'allows user to delete board'
do
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
find
(
'.board-delete'
).
click
...
...
@@ -162,32 +201,6 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it
'is searchable'
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
find
(
'.form-control'
).
set
issue1
.
title
wait_for_vue_resource
(
spinner:
false
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
it
'clears search'
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
find
(
'.form-control'
).
set
issue1
.
title
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
find
(
'.board-search-clear-btn'
).
click
end
wait_for_vue_resource
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
end
end
it
'moves issue from backlog into list'
do
drag_to
(
list_to_index:
1
)
...
...
spec/javascripts/boards/list_spec.js.es6
View file @
19c9ee47
...
...
@@ -60,15 +60,6 @@ describe('List model', () => {
}, 0);
});
it('can\'t search when not backlog', () => {
expect(list.canSearch()).toBe(false);
});
it('can search when backlog', () => {
list.type = 'backlog';
expect(list.canSearch()).toBe(true);
});
it('gets issue from list', (done) => {
setTimeout(() => {
const issue = list.findIssue(1);
...
...
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