diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-09 09:22:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-09 09:22:41 +0000 |
commit | 65688a509249eb3be8ea4687d3fe6d1432a47392 (patch) | |
tree | dffc9c087dc2eda02e4656d5a0b16b5d7051e69f /app/controllers | |
parent | 4b8939db3d80469826a62f1409b921f96dac2498 (diff) | |
download | gitlab-ce-65688a509249eb3be8ea4687d3fe6d1432a47392.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/dashboard/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/explore/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/jira_connect/app_descriptor_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/jira_connect/branches_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 2 |
6 files changed, 11 insertions, 24 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 0a8a629cd8a..fe2ef676005 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -26,9 +26,10 @@ class Admin::UsersController < Admin::ApplicationController def show end + # rubocop: disable CodeReuse/ActiveRecord def projects - @personal_projects = user.personal_projects - @joined_projects = user.projects.joined(@user) + @personal_projects = user.personal_projects.includes(:topics) + @joined_projects = user.projects.joined(@user).includes(:topics) end def keys diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index 01bb930a51b..d861ef646f8 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -81,7 +81,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def preload_associations(projects) - projects.includes(:route, :creator, :group, namespace: [:route, :owner]).preload(:project_feature) + projects.includes(:route, :creator, :group, :topics, namespace: [:route, :owner]).preload(:project_feature) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb index 5ef973e9bf3..e0973b0f3b4 100644 --- a/app/controllers/explore/projects_controller.rb +++ b/app/controllers/explore/projects_controller.rb @@ -87,7 +87,7 @@ class Explore::ProjectsController < Explore::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def preload_associations(projects) - projects.includes(:route, :creator, :group, :project_feature, namespace: [:route, :owner]) + projects.includes(:route, :creator, :group, :project_feature, :topics, namespace: [:route, :owner]) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/controllers/jira_connect/app_descriptor_controller.rb b/app/controllers/jira_connect/app_descriptor_controller.rb index ec3327cc20e..a0f387631dd 100644 --- a/app/controllers/jira_connect/app_descriptor_controller.rb +++ b/app/controllers/jira_connect/app_descriptor_controller.rb @@ -65,17 +65,13 @@ class JiraConnect::AppDescriptorController < JiraConnect::ApplicationController # See https://developer.atlassian.com/cloud/jira/software/modules/development-tool/ def development_tool_module - actions = {} - - if JiraConnect::BranchesController.feature_enabled?(current_user) - actions[:createBranch] = { - templateUrl: new_jira_connect_branch_url + '?issue_key={issue.key}&issue_summary={issue.summary}' - } - end - { jiraDevelopmentTool: { - actions: actions, + actions: { + createBranch: { + templateUrl: new_jira_connect_branch_url + '?issue_key={issue.key}&issue_summary={issue.summary}' + } + }, key: 'gitlab-development-tool', application: { value: 'GitLab' }, name: { value: 'GitLab' }, diff --git a/app/controllers/jira_connect/branches_controller.rb b/app/controllers/jira_connect/branches_controller.rb index 97d0b75639e..12ea6560e3a 100644 --- a/app/controllers/jira_connect/branches_controller.rb +++ b/app/controllers/jira_connect/branches_controller.rb @@ -3,18 +3,12 @@ # NOTE: This controller does not inherit from JiraConnect::ApplicationController # because we don't receive a JWT for this action, so we rely on standard GitLab authentication. class JiraConnect::BranchesController < ApplicationController - before_action :feature_enabled! - feature_category :integrations def new @new_branch_data = new_branch_data end - def self.feature_enabled?(user) - Feature.enabled?(:jira_connect_create_branch, user, default_enabled: :yaml) - end - private def initial_branch_name @@ -32,8 +26,4 @@ class JiraConnect::BranchesController < ApplicationController success_state_svg_path: ActionController::Base.helpers.image_path('illustrations/merge_requests.svg') } end - - def feature_enabled! - render_404 unless self.class.feature_enabled?(current_user) - end end diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 0f00fda4687..7135c0d959e 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -99,7 +99,7 @@ class Projects::ForksController < Projects::ApplicationController current_user: current_user ).execute - forks.includes(:route, :creator, :group, namespace: [:route, :owner]) + forks.includes(:route, :creator, :group, :topics, namespace: [:route, :owner]) end def fork_service |