diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 14:02:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 14:02:45 +0000 |
commit | 80f61b4035607d7cd87de993b8f5e996bde3481f (patch) | |
tree | 06b12f51e97d87192e3dd0e05edf55143645b894 /app/helpers | |
parent | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff) | |
download | gitlab-ce-80f61b4035607d7cd87de993b8f5e996bde3481f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/boards_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/diff_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/emails_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/issuables_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/runners_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/safe_params_helper.rb | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 9a1a2b3a79c..8c5be1c315d 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -184,10 +184,10 @@ module ApplicationSettingsHelper :disabled_oauth_sign_in_sources, :domain_blacklist, :domain_blacklist_enabled, - # TODO Remove domain_blacklist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-ce/issues/67204) + # TODO Remove domain_blacklist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-foss/issues/67204) :domain_blacklist_raw, :domain_whitelist, - # TODO Remove domain_whitelist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-ce/issues/67204) + # TODO Remove domain_whitelist_raw in APIv5 (See https://gitlab.com/gitlab-org/gitlab-foss/issues/67204) :domain_whitelist_raw, :outbound_local_requests_whitelist_raw, :dsa_key_restriction, diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb index d3950219f3f..3f0679f9bf9 100644 --- a/app/helpers/boards_helper.rb +++ b/app/helpers/boards_helper.rb @@ -88,7 +88,7 @@ module BoardsHelper end def boards_link_text - if current_board_parent.multiple_issue_boards_available? + if multiple_boards_available? s_("IssueBoards|Boards") else s_("IssueBoards|Board") diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 32431959851..7f3e78f3a81 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -189,11 +189,9 @@ module DiffHelper params[:w] == '1' end - # rubocop: disable CodeReuse/ActiveRecord def params_with_whitespace hide_whitespace? ? request.query_parameters.except(:w) : request.query_parameters.merge(w: 1) end - # rubocop: enable CodeReuse/ActiveRecord def toggle_whitespace_link(url, options) options[:class] = [*options[:class], 'btn btn-default'].join(' ') diff --git a/app/helpers/emails_helper.rb b/app/helpers/emails_helper.rb index ee4991c0b53..c244eba9e08 100644 --- a/app/helpers/emails_helper.rb +++ b/app/helpers/emails_helper.rb @@ -102,7 +102,7 @@ module EmailsHelper end when String # Technically speaking this should be Commit but per - # https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15610#note_163812339 + # https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/15610#note_163812339 # we can't deserialize Commit without custom serializer for ActiveJob return "" unless Ability.allowed?(@recipient, :download_code, @project) diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 014523b54cb..24614b5030c 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -272,7 +272,7 @@ module IssuablesHelper markdownPreviewPath: preview_markdown_path(parent), markdownDocsPath: help_page_path('user/markdown'), lockVersion: issuable.lock_version, - issuableTemplates: issuable_templates(issuable), + issuableTemplateNamesPath: template_names_path(parent, issuable), initialTitleHtml: markdown_field(issuable, :title), initialTitleText: issuable.title, initialDescriptionHtml: markdown_field(issuable, :description), @@ -429,6 +429,12 @@ module IssuablesHelper end end + def template_names_path(parent, issuable) + return '' unless parent.is_a?(Project) + + project_template_names_path(parent, template_type: issuable.class.name.underscore) + end + def issuable_sidebar_options(issuable) { endpoint: "#{issuable[:issuable_json_path]}?serializer=sidebar_extras", diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 5ed95311767..bf6abdb8c4b 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -235,7 +235,6 @@ module ProjectsHelper # # If no limit is applied we'll just issue a COUNT since the result set could # be too large to load into memory. - # rubocop: disable CodeReuse/ActiveRecord def any_projects?(projects) return projects.any? if projects.is_a?(Array) @@ -245,10 +244,9 @@ module ProjectsHelper projects.except(:offset).any? end end - # rubocop: enable CodeReuse/ActiveRecord # TODO: Remove this method when removing the feature flag - # https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11209#note_162234863 + # https://gitlab.com/gitlab-org/gitlab/merge_requests/11209#note_162234863 # make sure to remove from the EE specific controller as well: ee/app/controllers/ee/dashboard/projects_controller.rb def show_projects?(projects, params) Feature.enabled?(:project_list_filter_bar) || !!(params[:personal] || params[:name] || any_projects?(projects)) diff --git a/app/helpers/runners_helper.rb b/app/helpers/runners_helper.rb index d7a509e2bd3..d871aaa9c86 100644 --- a/app/helpers/runners_helper.rb +++ b/app/helpers/runners_helper.rb @@ -30,7 +30,7 @@ module RunnersHelper end # Due to inability of performing sorting of runners by cached "contacted_at" values we have to show uncached values if sorting by "contacted_asc" is requested. - # Please refer to the following issue for more details: https://gitlab.com/gitlab-org/gitlab-ce/issues/55920 + # Please refer to the following issue for more details: https://gitlab.com/gitlab-org/gitlab-foss/issues/55920 def runner_contacted_at(runner) if params[:sort] == 'contacted_asc' runner.uncached_contacted_at diff --git a/app/helpers/safe_params_helper.rb b/app/helpers/safe_params_helper.rb index 18bbf3347a8..72bf1377b02 100644 --- a/app/helpers/safe_params_helper.rb +++ b/app/helpers/safe_params_helper.rb @@ -3,7 +3,6 @@ module SafeParamsHelper # Rails 5.0 requires to permit `params` if they're used in url helpers. # Use this helper when generating links with `params.merge(...)` - # rubocop: disable CodeReuse/ActiveRecord def safe_params if params.respond_to?(:permit!) params.except(:host, :port, :protocol).permit! @@ -11,5 +10,4 @@ module SafeParamsHelper params end end - # rubocop: enable CodeReuse/ActiveRecord end |