diff options
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2f86b945b06..f0ddd62e996 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -34,6 +34,12 @@ class ProjectsController < Projects::ApplicationController # Project Export Rate Limit before_action :export_rate_limit, only: [:export, :download_export, :generate_new_export] + # Experiments + before_action only: [:new, :create] do + frontend_experimentation_tracking_data(:new_create_project_ui, 'click_tab') + push_frontend_feature_flag(:new_create_project_ui) if experiment_enabled?(:new_create_project_ui) + end + layout :determine_layout def index @@ -310,12 +316,11 @@ class ProjectsController < Projects::ApplicationController render 'projects/empty' if @project.empty_repo? else if can?(current_user, :read_wiki, @project) - @project_wiki = @project.wiki - @wiki_home = @project_wiki.find_page('home', params[:version_id]) + @wiki = @project.wiki + @wiki_home = @wiki.find_page('home', params[:version_id]) elsif @project.feature_available?(:issues, current_user) @issues = issuables_collection.page(params[:page]) - @collection_type = 'Issue' - @issuable_meta_data = issuable_meta_data(@issues, @collection_type, current_user) + @issuable_meta_data = Gitlab::IssuableMetadata.new(current_user, @issues).data end render :show @@ -357,6 +362,7 @@ class ProjectsController < Projects::ApplicationController def project_params_attributes [ + :allow_merge_on_skipped_pipeline, :avatar, :build_allow_git_fetch, :build_coverage_regex, @@ -483,11 +489,12 @@ class ProjectsController < Projects::ApplicationController def export_rate_limit prefixed_action = "project_#{params[:action]}".to_sym - if rate_limiter.throttled?(prefixed_action, scope: [current_user, prefixed_action, @project]) + project_scope = params[:action] == :download_export ? @project : nil + + if rate_limiter.throttled?(prefixed_action, scope: [current_user, project_scope].compact) rate_limiter.log_request(request, "#{prefixed_action}_request_limit".to_sym, current_user) - flash[:alert] = _('This endpoint has been requested too many times. Try again later.') - redirect_to edit_project_path(@project) + render plain: _('This endpoint has been requested too many times. Try again later.'), status: :too_many_requests end end |