summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-08-30 23:29:26 +0000
committerRuben Davila <rdavila84@gmail.com>2016-09-07 10:19:38 -0500
commite7f13df75842e971878041b6fd3610ebad1f4252 (patch)
treeb472400747228318f24c62bc53a31268f41dd32e /app
parentfb9d3e6e444e602335712c2ea11edefedaa41189 (diff)
downloadgitlab-ce-e7f13df75842e971878041b6fd3610ebad1f4252.tar.gz
Merge branch 'issue-boards-search' into 'master'
Added search for all lists on issue boards Adds a search box to allow the user to search all lists in issue boards rather than just the backlog. ![Screen_Shot_2016-08-30_at_10.33.15](/uploads/67e96055d60a9b3209ce3831a1980c09/Screen_Shot_2016-08-30_at_10.33.15.png) ![Screen_Shot_2016-08-30_at_10.33.19](/uploads/8d5253b8f2ecf1cf9a69d70be8ccf1f9/Screen_Shot_2016-08-30_at_10.33.19.png) Closes #21139 See merge request !6101 Conflicts: app/assets/stylesheets/pages/boards.scss app/views/projects/boards/components/_board.html.haml
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/boards/boards_bundle.js.es67
-rw-r--r--app/assets/javascripts/boards/components/board.js.es615
-rw-r--r--app/assets/javascripts/boards/models/list.js.es64
-rw-r--r--app/assets/javascripts/boards/stores/boards_store.js.es63
-rw-r--r--app/assets/stylesheets/pages/boards.scss36
-rw-r--r--app/views/projects/boards/components/_board.html.haml1
-rw-r--r--app/views/shared/issuable/_filter.html.haml21
7 files changed, 23 insertions, 64 deletions
diff --git a/app/assets/javascripts/boards/boards_bundle.js.es6 b/app/assets/javascripts/boards/boards_bundle.js.es6
index a612cf0f1ae..91c12570e09 100644
--- a/app/assets/javascripts/boards/boards_bundle.js.es6
+++ b/app/assets/javascripts/boards/boards_bundle.js.es6
@@ -54,4 +54,11 @@ $(() => {
});
}
});
+
+ gl.IssueBoardsSearch = new Vue({
+ el: '#js-boards-seach',
+ data: {
+ filters: Store.state.filters
+ }
+ });
});
diff --git a/app/assets/javascripts/boards/components/board.js.es6 b/app/assets/javascripts/boards/components/board.js.es6
index d7f4107cb02..7e86f001f44 100644
--- a/app/assets/javascripts/boards/components/board.js.es6
+++ b/app/assets/javascripts/boards/components/board.js.es6
@@ -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;
@@ -38,16 +33,6 @@
deep: true
}
},
- methods: {
- getFilterData () {
- const filters = this.filters;
- let queryData = { search: this.query };
-
- Object.keys(filters).forEach((key) => { queryData[key] = filters[key]; });
-
- return queryData;
- }
- },
ready () {
const options = gl.issueBoards.getBoardSortableDefaultOptions({
disabled: this.disabled,
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6
index d4e755b9b70..91fd620fdb3 100644
--- a/app/assets/javascripts/boards/models/list.js.es6
+++ b/app/assets/javascripts/boards/models/list.js.es6
@@ -59,10 +59,6 @@ class List {
}
}
- canSearch () {
- return this.type === 'backlog';
- }
-
getIssues (emptyIssues = true) {
const filters = this.filters;
let data = { page: this.page };
diff --git a/app/assets/javascripts/boards/stores/boards_store.js.es6 b/app/assets/javascripts/boards/stores/boards_store.js.es6
index 18f26a1f911..bd07ee0c161 100644
--- a/app/assets/javascripts/boards/stores/boards_store.js.es6
+++ b/app/assets/javascripts/boards/stores/boards_store.js.es6
@@ -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) {
diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss
index f8e44ba7cb3..037278bb083 100644
--- a/app/assets/stylesheets/pages/boards.scss
+++ b/app/assets/stylesheets/pages/boards.scss
@@ -10,7 +10,7 @@
.is-dragging {
// Important because plugin sets inline CSS
opacity: 1!important;
-
+
* {
// !important to make sure no style can override this when dragging
cursor: -webkit-grabbing!important;
@@ -155,40 +155,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;
diff --git a/app/views/projects/boards/components/_board.html.haml b/app/views/projects/boards/components/_board.html.haml
index 73066150fb3..287ba334736 100644
--- a/app/views/projects/boards/components/_board.html.haml
+++ b/app/views/projects/boards/components/_board.html.haml
@@ -20,6 +20,7 @@
"v-if" => "!list.preset && list.id" }
%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-list{ "inline-template" => true,
"v-if" => "list.type !== 'blank'",
":list" => "list",
diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml
index 4f8ea7e7cef..0f4f744a71f 100644
--- a/app/views/shared/issuable/_filter.html.haml
+++ b/app/views/shared/issuable/_filter.html.haml
@@ -27,15 +27,18 @@
= render "shared/issuable/label_dropdown"
.pull-right
- - if controller.controller_name == 'boards' && can?(current_user, :admin_list, @project)
- .dropdown
- %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
- = render partial: "shared/issuable/label_page_default", locals: { show_footer: true, show_create: true, show_boards_content: true, title: "Create a new list" }
- - if can?(current_user, :admin_label, @project)
- = render partial: "shared/issuable/label_page_create"
- = dropdown_loading
+ - 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
+ = render partial: "shared/issuable/label_page_default", locals: { show_footer: true, show_create: true, show_boards_content: true, title: "Create a new list" }
+ - if can?(current_user, :admin_label, @project)
+ = render partial: "shared/issuable/label_page_create"
+ = dropdown_loading
- else
= render 'shared/sort_dropdown'