diff options
-rw-r--r-- | app/assets/javascripts/boards/components/board.js.es6 | 2 | ||||
-rw-r--r-- | app/assets/javascripts/boards/models/list.js.es6 | 2 | ||||
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js.es6 | 11 | ||||
-rw-r--r-- | app/assets/javascripts/labels_select.js | 9 | ||||
-rw-r--r-- | app/assets/javascripts/milestone_select.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/users_select.js | 5 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/boards.scss | 8 | ||||
-rw-r--r-- | spec/features/boards/boards_spec.rb | 2 |
8 files changed, 27 insertions, 16 deletions
diff --git a/app/assets/javascripts/boards/components/board.js.es6 b/app/assets/javascripts/boards/components/board.js.es6 index 3e75469af5c..8ef61a2b587 100644 --- a/app/assets/javascripts/boards/components/board.js.es6 +++ b/app/assets/javascripts/boards/components/board.js.es6 @@ -11,13 +11,11 @@ watch: { 'query': function () { if (this.board.canSearch()) { - this.board.filters = this.getFilterData(); this.board.getIssues(true); } }, 'filters': { handler: function () { - this.board.filters = this.getFilterData(); this.board.getIssues(true); }, deep: true diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6 index aa73c93f52b..35126c4de2b 100644 --- a/app/assets/javascripts/boards/models/list.js.es6 +++ b/app/assets/javascripts/boards/models/list.js.es6 @@ -4,7 +4,7 @@ class List { this.position = obj.position; this.title = obj.title; this.type = obj.list_type; - this.filters = {}; + this.filters = BoardsStore.state.filters; this.page = 1; this.loading = true; this.issues = []; diff --git a/app/assets/javascripts/boards/stores/boards_store.js.es6 b/app/assets/javascripts/boards/stores/boards_store.js.es6 index aeb2475f9e1..97fcf637a7f 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js.es6 +++ b/app/assets/javascripts/boards/stores/boards_store.js.es6 @@ -3,10 +3,10 @@ state: { lists: [], filters: { - author_id: null, - assignee_id: null, - milestone_title: null, - label_name: [] + 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[]') } }, reset: function () { @@ -118,6 +118,9 @@ return _.find(this.state.lists, (list) => { return list[key] === val; }); + }, + updateFiltersUrl: function () { + history.pushState(null, null, `?${$.param(this.state.filters)}`); } }; }(window)); diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index d3bee457619..61d064aa031 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -272,6 +272,9 @@ isMRIndex = page === 'projects:merge_requests:index'; $selectbox.hide(); $value.removeAttr('style'); + if (page === 'projects:boards:show') { + return; + } if ($dropdown.hasClass('js-multiselect')) { if ($dropdown.hasClass('js-filter-submit') && (isIssueIndex || isMRIndex)) { selectedLabels = $dropdown.closest('form').find("input:hidden[name='" + ($dropdown.data('fieldName')) + "']"); @@ -291,7 +294,7 @@ } }, multiSelect: $dropdown.hasClass('js-multiselect'), - clicked: function(label) { + clicked: function(label, $el, e) { var isIssueIndex, isMRIndex, page; _this.enableBulkLabelDropdown(); if ($dropdown.hasClass('js-filter-bulk-update')) { @@ -301,7 +304,9 @@ isIssueIndex = page === 'projects:issues:index'; isMRIndex = page === 'projects:merge_requests:index'; if (page === 'projects:boards:show') { - BoardsStore.state.filters['label_name'] = label.title; + BoardsStore.state.filters['label_name'].push(label.title); + BoardsStore.updateFiltersUrl(); + e.preventDefault(); return; } else if ($dropdown.hasClass('js-filter-submit') && (isIssueIndex || isMRIndex)) { if (!$dropdown.hasClass('js-multiselect')) { diff --git a/app/assets/javascripts/milestone_select.js b/app/assets/javascripts/milestone_select.js index b14bef73da4..9093098359e 100644 --- a/app/assets/javascripts/milestone_select.js +++ b/app/assets/javascripts/milestone_select.js @@ -94,7 +94,7 @@ $selectbox.hide(); return $value.css('display', ''); }, - clicked: function(selected) { + clicked: function(selected, $el, e) { var data, isIssueIndex, isMRIndex, page; page = $('body').data('page'); isIssueIndex = page === 'projects:issues:index'; @@ -104,6 +104,8 @@ } if (page === 'projects:boards:show') { BoardsStore.state.filters[$dropdown.data('field-name')] = selected.name; + BoardsStore.updateFiltersUrl(); + e.preventDefault(); } else if ($dropdown.hasClass('js-filter-submit') && (isIssueIndex || isMRIndex)) { if (selected.name != null) { selectedMilestone = selected.name; diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js index d0abb18a44c..aa157749443 100644 --- a/app/assets/javascripts/users_select.js +++ b/app/assets/javascripts/users_select.js @@ -141,7 +141,7 @@ $selectbox.hide(); return $value.css('display', ''); }, - clicked: function(user) { + clicked: function(user, $el, e) { var isIssueIndex, isMRIndex, page, selected; page = $('body').data('page'); isIssueIndex = page === 'projects:issues:index'; @@ -150,7 +150,10 @@ return; } if (page === 'projects:boards:show') { + selectedId = user.id; BoardsStore.state.filters[$dropdown.data('field-name')] = user.id; + BoardsStore.updateFiltersUrl(); + e.preventDefault(); } else if ($dropdown.hasClass('js-filter-submit') && (isIssueIndex || isMRIndex)) { selectedId = user.id; return Issuable.filterResults($dropdown.closest('form')); diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 010c1ddca0f..0c5e89c0759 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -5,7 +5,7 @@ .is-dragging { * { cursor: -webkit-grabbing; - cursor: grabbing; + cursor: grabbing; } } @@ -13,7 +13,7 @@ width: 320px; .dropdown-content { - max-height: 150px; + max-height: 150px; } } @@ -111,7 +111,7 @@ border-top-left-radius: $border-radius-default; border-top-right-radius: $border-radius-default; cursor: -webkit-grab; - cursor: grab; + cursor: grab; &.has-border { padding-top: ($gl-padding - 3px); @@ -231,7 +231,7 @@ box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5); list-style: none; cursor: -webkit-grab; - cursor: grab; + cursor: grab; &:not(:last-child) { margin-bottom: 5px; diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 6c514598653..403eaebce64 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -8,7 +8,7 @@ describe 'Issue Boards', feature: true, js: true do project.team << [user, :master] login_as(user) - visit namespace_project_boards_path(project.namespace, project) + visit namespace_project_board_path(project.namespace, project) end it 'shows default lists' do |