diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/issuable.js.es6 (renamed from app/assets/javascripts/issuable.js) | 35 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/filters.scss | 4 | ||||
-rw-r--r-- | app/controllers/ci/lints_controller.rb | 11 | ||||
-rw-r--r-- | app/views/shared/issuable/_filter.html.haml | 3 |
4 files changed, 35 insertions, 18 deletions
diff --git a/app/assets/javascripts/issuable.js b/app/assets/javascripts/issuable.js.es6 index d0305c6c6a1..4006ac740b2 100644 --- a/app/assets/javascripts/issuable.js +++ b/app/assets/javascripts/issuable.js.es6 @@ -8,6 +8,7 @@ Issuable.initTemplates(); Issuable.initSearch(); Issuable.initChecks(); + Issuable.initResetFilters(); return Issuable.initLabelFilterRemove(); }, initTemplates: function() { @@ -55,6 +56,17 @@ return Turbolinks.visit(issuesUrl); }; })(this), + initResetFilters: function() { + $('.reset-filters').on('click', function(e) { + e.preventDefault(); + const target = e.target; + const $form = $(target).parents('.js-filter-form'); + const baseIssuesUrl = target.href; + + $form.attr('action', baseIssuesUrl); + Turbolinks.visit(baseIssuesUrl); + }); + }, initChecks: function() { this.issuableBulkActions = $('.bulk-update').data('bulkActions'); $('.check_all_issues').off('click').on('click', function() { @@ -64,19 +76,22 @@ return $('.selected_issue').off('change').on('change', Issuable.checkChanged.bind(this)); }, checkChanged: function() { - var checked_issues, ids; - checked_issues = $('.selected_issue:checked'); - if (checked_issues.length > 0) { - ids = $.map(checked_issues, function(value) { + const $checkedIssues = $('.selected_issue:checked'); + const $updateIssuesIds = $('#update_issues_ids'); + const $issuesOtherFilters = $('.issues-other-filters'); + const $issuesBulkUpdate = $('.issues_bulk_update'); + + if ($checkedIssues.length > 0) { + let ids = $.map($checkedIssues, function(value) { return $(value).data('id'); }); - $('#update_issues_ids').val(ids); - $('.issues-other-filters').hide(); - $('.issues_bulk_update').show(); + $updateIssuesIds.val(ids); + $issuesOtherFilters.hide(); + $issuesBulkUpdate.show(); } else { - $('#update_issues_ids').val([]); - $('.issues_bulk_update').hide(); - $('.issues-other-filters').show(); + $updateIssuesIds.val([]); + $issuesBulkUpdate.hide(); + $issuesOtherFilters.show(); this.issuableBulkActions.willUpdateLabels = false; } return true; diff --git a/app/assets/stylesheets/framework/filters.scss b/app/assets/stylesheets/framework/filters.scss index 9209347f9bc..19827943385 100644 --- a/app/assets/stylesheets/framework/filters.scss +++ b/app/assets/stylesheets/framework/filters.scss @@ -1,6 +1,10 @@ .filter-item { margin-right: 6px; vertical-align: top; + + &.reset-filters { + padding: 7px; + } } @media (min-width: $screen-sm-min) { diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb index a7af3cb8345..e06d12cfce1 100644 --- a/app/controllers/ci/lints_controller.rb +++ b/app/controllers/ci/lints_controller.rb @@ -7,19 +7,14 @@ module Ci def create @content = params[:content] + @error = Ci::GitlabCiYamlProcessor.validation_message(@content) + @status = @error.blank? - if @content.blank? - @status = false - @error = "Please provide content of .gitlab-ci.yml" - else + if @error.blank? @config_processor = Ci::GitlabCiYamlProcessor.new(@content) @stages = @config_processor.stages @builds = @config_processor.builds - @status = true end - rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e - @error = e.message - @status = false rescue @error = 'Undefined error' @status = false diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index 0f4f744a71f..fabf6d74392 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -26,6 +26,9 @@ .filter-item.inline.labels-filter = render "shared/issuable/label_dropdown" + .filter-item.inline.reset-filters + %a{href: page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :issue_search])} Reset filters + .pull-right - if controller.controller_name == 'boards' #js-boards-seach.issue-boards-search |