diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-12 15:10:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-12 15:10:25 +0300 |
commit | 999f47e9e6da399de9dc1de404f073f7dd30af0d (patch) | |
tree | 926bf806abb6705632dc19ceb75269f40a4c9fac /app/controllers | |
parent | 20bd3b7d4ebb1d7ebef305656b156313d09a6674 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
4 files changed, 31 insertions, 2 deletions
diff --git a/app/controllers/groups/releases_controller.rb b/app/controllers/groups/releases_controller.rb new file mode 100644 index 00000000000..500c57a6f3e --- /dev/null +++ b/app/controllers/groups/releases_controller.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Groups + class ReleasesController < Groups::ApplicationController + def index + respond_to do |format| + format.json do + render json: ReleaseSerializer.new.represent(releases) + end + end + end + + private + + def releases + ReleasesFinder + .new(@group, current_user, { include_subgroups: true }) + .execute(preload: false) + .page(params[:page]) + .per(30) + end + end +end diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 3f2dc9b09fa..b0c6f3cc6a1 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -15,8 +15,8 @@ class Projects::CommitController < Projects::ApplicationController before_action :authorize_download_code! before_action :authorize_read_pipeline!, only: [:pipelines] before_action :commit - before_action :define_commit_vars, only: [:show, :diff_for_path, :pipelines, :merge_requests] - before_action :define_note_vars, only: [:show, :diff_for_path] + before_action :define_commit_vars, only: [:show, :diff_for_path, :diff_files, :pipelines, :merge_requests] + before_action :define_note_vars, only: [:show, :diff_for_path, :diff_files] before_action :authorize_edit_tree!, only: [:revert, :cherry_pick] BRANCH_SEARCH_LIMIT = 1000 @@ -41,6 +41,10 @@ class Projects::CommitController < Projects::ApplicationController render_diff_for_path(@commit.diffs(diff_options)) end + def diff_files + render json: { html: view_to_html_string('projects/commit/diff_files', diffs: @diffs, environment: @environment) } + end + # rubocop: disable CodeReuse/ActiveRecord def pipelines @pipelines = @commit.pipelines.order(id: :desc) diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 5076172985d..8d498af8de9 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -15,6 +15,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController push_frontend_feature_flag(:prometheus_computed_alerts) push_frontend_feature_flag(:disable_metric_dashboard_refresh_rate) push_frontend_feature_flag(:alert_runbooks) + push_frontend_feature_flag(:metrics_dashboard_new_panel_page) end before_action :authorize_read_environment!, except: [:metrics, :additional_metrics, :metrics_dashboard, :metrics_redirect] before_action :authorize_create_environment!, only: [:new, :create] diff --git a/app/controllers/projects/metrics_dashboard_controller.rb b/app/controllers/projects/metrics_dashboard_controller.rb index ff60d069061..595db86c5fe 100644 --- a/app/controllers/projects/metrics_dashboard_controller.rb +++ b/app/controllers/projects/metrics_dashboard_controller.rb @@ -11,6 +11,7 @@ module Projects push_frontend_feature_flag(:prometheus_computed_alerts) push_frontend_feature_flag(:disable_metric_dashboard_refresh_rate) push_frontend_feature_flag(:alert_runbooks) + push_frontend_feature_flag(:metrics_dashboard_new_panel_page) end def show |