Added filtered search bar to issue boards

Closes #28312
This commit is contained in:
Phil Hughes 2017-03-07 09:24:01 +00:00
parent bd1d778168
commit 850f19c02c
8 changed files with 37 additions and 21 deletions

View file

@ -4,6 +4,7 @@
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
import FilteredSearchBoards from './filtered_search_boards';
require('./models/issue');
require('./models/label');
require('./models/list');
@ -26,6 +27,8 @@ $(() => {
const Store = gl.issueBoards.BoardsStore;
const ModalStore = gl.issueBoards.ModalStore;
new FilteredSearchBoards();
window.gl = window.gl || {};
if (gl.IssueBoardsApp) {

View file

@ -0,0 +1,5 @@
export default class FilteredSearchBoards extends gl.FilteredSearchManager {
constructor() {
super('boards');
}
}

View file

@ -19,8 +19,8 @@
create () {
this.state.lists = [];
this.state.filters = {
author_id: gl.utils.getParameterValues('author_id')[0],
assignee_id: gl.utils.getParameterValues('assignee_id')[0],
author_username: gl.utils.getParameterValues('author_username')[0],
assignee_username: gl.utils.getParameterValues('assignee_username')[0],
milestone_title: gl.utils.getParameterValues('milestone_title')[0],
label_name: gl.utils.getParameterValues('label_name[]'),
search: ''

View file

@ -219,6 +219,11 @@
}
}
.filter-dropdown-container {
display: -webkit-flex;
display: flex;
}
.dropdown-menu .filter-dropdown-item {
padding: 0;
}

View file

@ -4,6 +4,7 @@
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('filtered_search')
= page_specific_javascript_bundle_tag('boards')
= page_specific_javascript_bundle_tag('simulate_drag') if Rails.env.test?
@ -12,7 +13,7 @@
= render "projects/issues/head"
= render 'shared/issuable/filter', type: :boards
= render 'shared/issuable/search_bar', type: :boards
#board-app.boards-app{ "v-cloak" => true, data: board_data }
.boards-list{ ":class" => "{ 'is-compact': detailIssueVisible }" }

View file

@ -1,4 +1,4 @@
- finder = controller.controller_name == 'issues' || controller.controller_name == 'boards' ? issues_finder : merge_requests_finder
- finder = controller.controller_name == 'issues' ? issues_finder : merge_requests_finder
- boards_page = controller.controller_name == 'boards'
.issues-filters
@ -34,20 +34,6 @@
%a{ href: page_filter_path(without: issuable_filter_params) } Reset filters
.pull-right
- if boards_page
#js-boards-search.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)
#js-add-issues-btn.pull-right.prepend-left-10
.dropdown.pull-right
%button.btn.btn-create.btn-inverted.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) } }
Add 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: "Add list" }
- if can?(current_user, :admin_label, @project)
= render partial: "shared/issuable/label_page_create"
= dropdown_loading
- else
= render 'shared/sort_dropdown'
- if @bulk_edit

View file

@ -85,7 +85,19 @@
%span.dropdown-label-box{ style: 'background: {{color}}' }
%span.label-title.js-data-value
{{title}}
.pull-right.filter-dropdown-container
.filter-dropdown-container
- if type == :boards
- if can?(current_user, :admin_list, @project)
.dropdown.prepend-left-10
%button.btn.btn-create.btn-inverted.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) } }
Add 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: "Add list" }
- if can?(current_user, :admin_label, @project)
= render partial: "shared/issuable/label_page_create"
= dropdown_loading
#js-add-issues-btn.prepend-left-10
- else
= render 'shared/sort_dropdown'
- if @bulk_edit

View file

@ -0,0 +1,4 @@
---
title: Added new filtered search bar to issue boards
merge_request:
author: