Commit fd21d1b7 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-to-ee-2018-08-08' into 'master'

CE upstream - 2018-08-08 15:24 UTC

See merge request gitlab-org/gitlab-ee!6841
parents 13b41035 7fc0ca84
module RepositorySettingsRedirect module RepositorySettingsRedirect
extend ActiveSupport::Concern extend ActiveSupport::Concern
def redirect_to_repository_settings(project) def redirect_to_repository_settings(project, anchor: nil)
redirect_to project_settings_repository_path(project) redirect_to project_settings_repository_path(project, anchor: anchor)
end end
end end
...@@ -86,7 +86,7 @@ class GroupsController < Groups::ApplicationController ...@@ -86,7 +86,7 @@ class GroupsController < Groups::ApplicationController
def update def update
if Groups::UpdateService.new(@group, current_user, group_params).execute if Groups::UpdateService.new(@group, current_user, group_params).execute
redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated." redirect_to edit_group_path(@group, anchor: params[:update_section]), notice: "Group '#{@group.name}' was successfully updated."
else else
@group.restore_path! @group.restore_path!
......
...@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController ...@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project.save @project.save
redirect_to edit_project_path(@project), status: :found redirect_to edit_project_path(@project, anchor: 'js-general-project-settings'), status: :found
end end
end end
...@@ -10,7 +10,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -10,7 +10,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
def index def index
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(@project) } format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
format.json do format.json do
render json: Projects::Settings::DeployKeysPresenter.new(@project, current_user: current_user).as_json render json: Projects::Settings::DeployKeysPresenter.new(@project, current_user: current_user).as_json
end end
...@@ -18,7 +18,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -18,7 +18,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
end end
def new def new
redirect_to_repository_settings(@project) redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
end end
def create def create
...@@ -30,7 +30,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -30,7 +30,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
flash[:alert] = @key.errors.full_messages.join(', ').html_safe flash[:alert] = @key.errors.full_messages.join(', ').html_safe
end end
redirect_to_repository_settings(@project) redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
end end
def edit def edit
...@@ -39,7 +39,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -39,7 +39,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
def update def update
if deploy_key.update(update_params) if deploy_key.update(update_params)
flash[:notice] = 'Deploy key was successfully updated.' flash[:notice] = 'Deploy key was successfully updated.'
redirect_to_repository_settings(@project) redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings')
else else
render 'edit' render 'edit'
end end
...@@ -51,7 +51,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -51,7 +51,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
log_audit_event(@key.title, action: :create) log_audit_event(@key.title, action: :create)
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(@project) } format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
format.json { head :ok } format.json { head :ok }
end end
end end
...@@ -65,7 +65,7 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -65,7 +65,7 @@ class Projects::DeployKeysController < Projects::ApplicationController
log_audit_event(@key.title, action: :destroy) log_audit_event(@key.title, action: :destroy)
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(@project) } format.html { redirect_to_repository_settings(@project, anchor: 'js-deploy-keys-settings') }
format.json { head :ok } format.json { head :ok }
end end
end end
......
...@@ -5,6 +5,6 @@ class Projects::DeployTokensController < Projects::ApplicationController ...@@ -5,6 +5,6 @@ class Projects::DeployTokensController < Projects::ApplicationController
@token = @project.deploy_tokens.find(params[:id]) @token = @project.deploy_tokens.find(params[:id])
@token.revoke! @token.revoke!
redirect_to project_settings_repository_path(project) redirect_to project_settings_repository_path(project, anchor: 'js-deploy-tokens')
end end
end end
...@@ -11,7 +11,7 @@ class Projects::MirrorsController < Projects::ApplicationController ...@@ -11,7 +11,7 @@ class Projects::MirrorsController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
def show def show
redirect_to_repository_settings(project) redirect_to_repository_settings(project, anchor: 'js-push-remote-settings')
end end
def update def update
...@@ -24,7 +24,7 @@ class Projects::MirrorsController < Projects::ApplicationController ...@@ -24,7 +24,7 @@ class Projects::MirrorsController < Projects::ApplicationController
end end
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(project) } format.html { redirect_to_repository_settings(project, anchor: 'js-push-remote-settings') }
format.json do format.json do
if project.errors.present? if project.errors.present?
render json: project.errors, status: :unprocessable_entity render json: project.errors, status: :unprocessable_entity
...@@ -41,7 +41,7 @@ class Projects::MirrorsController < Projects::ApplicationController ...@@ -41,7 +41,7 @@ class Projects::MirrorsController < Projects::ApplicationController
flash[:notice] = "The remote repository is being updated..." flash[:notice] = "The remote repository is being updated..."
end end
redirect_to_repository_settings(project) redirect_to_repository_settings(project, anchor: 'js-push-remote-settings')
end end
private private
......
...@@ -19,7 +19,7 @@ class Projects::ProtectedRefsController < Projects::ApplicationController ...@@ -19,7 +19,7 @@ class Projects::ProtectedRefsController < Projects::ApplicationController
flash[:alert] = protected_ref.errors.full_messages.join(', ').html_safe flash[:alert] = protected_ref.errors.full_messages.join(', ').html_safe
end end
redirect_to_repository_settings(@project) redirect_to_repository_settings(@project, anchor: params[:update_section])
end end
def show def show
...@@ -40,7 +40,7 @@ class Projects::ProtectedRefsController < Projects::ApplicationController ...@@ -40,7 +40,7 @@ class Projects::ProtectedRefsController < Projects::ApplicationController
destroy_service_class.new(@project, current_user).execute(@protected_ref) destroy_service_class.new(@project, current_user).execute(@protected_ref)
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(@project) } format.html { redirect_to_repository_settings(@project, anchor: params[:update_section]) }
format.js { head :ok } format.js { head :ok }
end end
end end
......
...@@ -63,7 +63,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -63,7 +63,7 @@ class ProjectsController < Projects::ApplicationController
flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name } flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name }
format.html do format.html do
redirect_to(edit_project_path(@project)) redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings'))
end end
else else
flash.now[:alert] = result[:message] flash.now[:alert] = result[:message]
...@@ -176,7 +176,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -176,7 +176,7 @@ class ProjectsController < Projects::ApplicationController
) )
rescue ::Projects::HousekeepingService::LeaseTaken => ex rescue ::Projects::HousekeepingService::LeaseTaken => ex
redirect_to( redirect_to(
edit_project_path(@project), edit_project_path(@project, anchor: 'js-project-advanced-settings'),
alert: ex.to_s alert: ex.to_s
) )
end end
...@@ -185,7 +185,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -185,7 +185,7 @@ class ProjectsController < Projects::ApplicationController
@project.add_export_job(current_user: current_user) @project.add_export_job(current_user: current_user)
redirect_to( redirect_to(
edit_project_path(@project), edit_project_path(@project, anchor: 'js-export-project'),
notice: _("Project export started. A download link will be sent by email.") notice: _("Project export started. A download link will be sent by email.")
) )
end end
...@@ -197,7 +197,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -197,7 +197,7 @@ class ProjectsController < Projects::ApplicationController
send_file export_project_path, disposition: 'attachment' send_file export_project_path, disposition: 'attachment'
else else
redirect_to( redirect_to(
edit_project_path(@project), edit_project_path(@project, anchor: 'js-export-project'),
alert: _("Project export link has expired. Please generate a new export from your project settings.") alert: _("Project export link has expired. Please generate a new export from your project settings.")
) )
end end
...@@ -210,7 +210,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -210,7 +210,7 @@ class ProjectsController < Projects::ApplicationController
flash[:alert] = _("Project export could not be deleted.") flash[:alert] = _("Project export could not be deleted.")
end end
redirect_to(edit_project_path(@project)) redirect_to(edit_project_path(@project, anchor: 'js-export-project'))
end end
def generate_new_export def generate_new_export
...@@ -218,7 +218,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -218,7 +218,7 @@ class ProjectsController < Projects::ApplicationController
export export
else else
redirect_to( redirect_to(
edit_project_path(@project), edit_project_path(@project, anchor: 'js-export-project'),
alert: _("Project export could not be deleted.") alert: _("Project export could not be deleted.")
) )
end end
......
# frozen_string_literal: true
# == AccessRequestable concern # == AccessRequestable concern
# #
# Contains functionality related to objects that can receive request for access. # Contains functionality related to objects that can receive request for access.
......
# frozen_string_literal: true
# Adapter class to unify the interface between mounted uploaders and the # Adapter class to unify the interface between mounted uploaders and the
# Ci::Artifact model # Ci::Artifact model
# Meant to be prepended so the interface can stay the same # Meant to be prepended so the interface can stay the same
......
# frozen_string_literal: true
# Include atomic internal id generation scheme for a model # Include atomic internal id generation scheme for a model
# #
# This allows us to atomically generate internal ids that are # This allows us to atomically generate internal ids that are
......
# frozen_string_literal: true
module Avatarable module Avatarable
extend ActiveSupport::Concern extend ActiveSupport::Concern
...@@ -57,7 +59,8 @@ module Avatarable ...@@ -57,7 +59,8 @@ module Avatarable
only_path = false only_path = false
end end
url_base = "" url_base = []
if use_asset_host if use_asset_host
url_base << asset_host unless only_path url_base << asset_host unless only_path
else else
...@@ -65,7 +68,7 @@ module Avatarable ...@@ -65,7 +68,7 @@ module Avatarable
url_base << gitlab_config.relative_url_root url_base << gitlab_config.relative_url_root
end end
url_base + avatar.local_url + query_params url_base.join + avatar.local_url + query_params
end end
# Path that is persisted in the tracking Upload model. Used to fetch the # Path that is persisted in the tracking Upload model. Used to fetch the
......
# frozen_string_literal: true
module Awardable module Awardable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Provides a way to work around Rails issue where dependent objects are all # Provides a way to work around Rails issue where dependent objects are all
# loaded into memory before destroyed: https://github.com/rails/rails/issues/22510. # loaded into memory before destroyed: https://github.com/rails/rails/issues/22510.
# #
......
# frozen_string_literal: true
module BlobLike module BlobLike
extend ActiveSupport::Concern extend ActiveSupport::Concern
include Linguist::BlobHelper include Linguist::BlobHelper
......
# frozen_string_literal: true
# Overrides `as_json` and `to_json` to raise an exception when called in order # Overrides `as_json` and `to_json` to raise an exception when called in order
# to prevent accidentally exposing attributes # to prevent accidentally exposing attributes
# #
......
# frozen_string_literal: true
# Returns and caches in thread max member access for a resource # Returns and caches in thread max member access for a resource
# #
module BulkMemberAccessLoad module BulkMemberAccessLoad
......
# frozen_string_literal: true
# This module takes care of updating cache columns for Markdown-containing # This module takes care of updating cache columns for Markdown-containing
# fields. Use like this in the body of your class: # fields. Use like this in the body of your class:
# #
......
# frozen_string_literal: true
module CacheableAttributes module CacheableAttributes
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Concern for querying columns with specific case sensitivity handling. # Concern for querying columns with specific case sensitivity handling.
module CaseSensitivity module CaseSensitivity
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ChronicDurationAttribute module ChronicDurationAttribute
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module CreatedAtFilterable module CreatedAtFilterable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DeploymentPlatform module DeploymentPlatform
# EE would override this and utilize environment argument # EE would override this and utilize environment argument
# rubocop:disable Gitlab/ModuleWithInstanceVariables # rubocop:disable Gitlab/ModuleWithInstanceVariables
......
# frozen_string_literal: true
module DiffFile module DiffFile
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Contains functionality shared between `DiffDiscussion` and `LegacyDiffDiscussion`. # Contains functionality shared between `DiffDiscussion` and `LegacyDiffDiscussion`.
module DiscussionOnDiff module DiscussionOnDiff
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EachBatch module EachBatch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Editable module Editable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EnumWithNil module EnumWithNil
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Expirable module Expirable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
## ##
# This module is for replacing `dependent: :destroy` and `before_destroy` hooks. # This module is for replacing `dependent: :destroy` and `before_destroy` hooks.
# #
......
# frozen_string_literal: true
module FasterCacheKeys module FasterCacheKeys
# A faster version of Rails' "cache_key" method. # A faster version of Rails' "cache_key" method.
# #
......
# frozen_string_literal: true
module FeatureGate module FeatureGate
def flipper_id def flipper_id
return nil if new_record? return nil if new_record?
......
# frozen_string_literal: true
module GhostUser module GhostUser
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module GroupDescendant module GroupDescendant
# Returns the hierarchy of a project or group in the from of a hash upto a # Returns the hierarchy of a project or group in the from of a hash upto a
# given top. # given top.
......
# frozen_string_literal: true
module HasStatus module HasStatus
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module HasVariable module HasVariable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Module that can be included into a model to make it easier to ignore database # Module that can be included into a model to make it easier to ignore database
# columns. # columns.
# #
......
# frozen_string_literal: true
module IidRoutes module IidRoutes
## ##
# This automagically enforces all related routes to use `iid` instead of `id` # This automagically enforces all related routes to use `iid` instead of `id`
......
# frozen_string_literal: true
module Importable module Importable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == Issuable concern # == Issuable concern
# #
# Contains common functionality shared between Issues and MergeRequests # Contains common functionality shared between Issues and MergeRequests
......
# frozen_string_literal: true
module LoadedInGroupList module LoadedInGroupList
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ManualInverseAssociation module ManualInverseAssociation
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == Mentionable concern # == Mentionable concern
# #
# Contains functionality related to objects that can mention Users, Issues, MergeRequests, Commits or Snippets by # Contains functionality related to objects that can mention Users, Issues, MergeRequests, Commits or Snippets by
......
# frozen_string_literal: true
module Mentionable module Mentionable
module ReferenceRegexes module ReferenceRegexes
def self.reference_pattern(link_patterns, issue_pattern) def self.reference_pattern(link_patterns, issue_pattern)
......
# frozen_string_literal: true
module Milestoneish module Milestoneish
def closed_items_count(user) def closed_items_count(user)
memoize_per_user(user, :closed_items_count) do memoize_per_user(user, :closed_items_count) do
......
# frozen_string_literal: true
# Contains functionality shared between `DiffNote` and `LegacyDiffNote`. # Contains functionality shared between `DiffNote` and `LegacyDiffNote`.
module NoteOnDiff module NoteOnDiff
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Noteable module Noteable
# Names of all implementers of `Noteable` that support resolvable notes. # Names of all implementers of `Noteable` that support resolvable notes.
RESOLVABLE_TYPES = %w(MergeRequest).freeze RESOLVABLE_TYPES = %w(MergeRequest).freeze
......
# frozen_string_literal: true
# == Participable concern # == Participable concern
# #
# Contains functionality related to objects that can have participants, such as # Contains functionality related to objects that can have participants, such as
......
# frozen_string_literal: true
module Presentable module Presentable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Makes api V4 compatible with old project features permissions methods # Makes api V4 compatible with old project features permissions methods
# #
# After migrating issues_enabled merge_requests_enabled builds_enabled snippets_enabled and wiki_enabled # After migrating issues_enabled merge_requests_enabled builds_enabled snippets_enabled and wiki_enabled
......
# frozen_string_literal: true
module PrometheusAdapter module PrometheusAdapter
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ProtectedBranchAccess module ProtectedBranchAccess
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ProtectedRef module ProtectedRef
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ProtectedRefAccess module ProtectedRefAccess
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ProtectedTagAccess module ProtectedTagAccess
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# The ReactiveCaching concern is used to fetch some data in the background and # The ReactiveCaching concern is used to fetch some data in the background and
# store it in the Rails cache, keeping it up-to-date for as long as it is being # store it in the Rails cache, keeping it up-to-date for as long as it is being
# requested. If the data hasn't been requested for +reactive_cache_lifetime+, # requested. If the data hasn't been requested for +reactive_cache_lifetime+,
......
# frozen_string_literal: true
module ReactiveService module ReactiveService
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module RedisCacheable module RedisCacheable
extend ActiveSupport::Concern extend ActiveSupport::Concern
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
# == Referable concern # == Referable concern
# #
# Contains functionality related to making a model referable in Markdown, such # Contains functionality related to making a model referable in Markdown, such
......
# frozen_string_literal: true
module RelativePositioning module RelativePositioning
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ResolvableDiscussion module ResolvableDiscussion
extend ActiveSupport::Concern extend ActiveSupport::Concern
include ::Gitlab::Utils::StrongMemoize include ::Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module ResolvableNote module ResolvableNote
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Store object full path in separate table for easy lookup and uniq validation # Store object full path in separate table for easy lookup and uniq validation
# Object must have name and path db fields and respond to parent and parent_changed? methods. # Object must have name and path db fields and respond to parent and parent_changed? methods.
module Routable module Routable
......
# frozen_string_literal: true
module SelectForProjectAuthorization module SelectForProjectAuthorization
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ShaAttribute module ShaAttribute
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == Sortable concern # == Sortable concern
# #
# Set default scope for ordering objects # Set default scope for ordering objects
......
# frozen_string_literal: true
module Spammable module Spammable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Storage module Storage
module LegacyNamespace module LegacyNamespace
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Storage module Storage
module LegacyProjectWiki module LegacyProjectWiki
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Storage module Storage
module LegacyRepository module LegacyRepository
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == Strip Attribute module # == Strip Attribute module
# #
# Contains functionality to clean attributes before validation # Contains functionality to clean attributes before validation
......
# frozen_string_literal: true
# == Subscribable concern # == Subscribable concern
# #
# Users can subscribe to these models. # Users can subscribe to these models.
......
# frozen_string_literal: true
require 'task_list' require 'task_list'
require 'task_list/filter' require 'task_list/filter'
......
# frozen_string_literal: true
# ThrottledTouch can be used to throttle the number of updates triggered by # ThrottledTouch can be used to throttle the number of updates triggered by
# calling "touch" on an ActiveRecord model. # calling "touch" on an ActiveRecord model.
module ThrottledTouch module ThrottledTouch
......
# frozen_string_literal: true
# == TimeTrackable concern # == TimeTrackable concern
# #
# Contains functionality related to objects that support time tracking. # Contains functionality related to objects that support time tracking.
......
# frozen_string_literal: true
module TokenAuthenticatable module TokenAuthenticatable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module TriggerableHooks module TriggerableHooks
AVAILABLE_TRIGGERS = { AVAILABLE_TRIGGERS = {
repository_update_hooks: :repository_update_events, repository_update_hooks: :repository_update_events,
......
# frozen_string_literal: true
# Uniquify # Uniquify
# #
# Return a version of the given 'base' string that is unique # Return a version of the given 'base' string that is unique
......
# frozen_string_literal: true
module UpdatedAtFilterable module UpdatedAtFilterable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ValidAttribute module ValidAttribute
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# Mounted uploaders are destroyed by carrierwave's after_commit # Mounted uploaders are destroyed by carrierwave's after_commit
# hook. This hook fetches upload location (local vs remote) from # hook. This hook fetches upload location (local vs remote) from
# Upload model. So it's neccessary to make sure that during that # Upload model. So it's neccessary to make sure that during that
......
# frozen_string_literal: true
module ConversationalDevelopmentIndex module ConversationalDevelopmentIndex
class Card class Card
attr_accessor :metric, :title, :description, :feature, :blog, :docs attr_accessor :metric, :title, :description, :feature, :blog, :docs
......
# frozen_string_literal: true
module ConversationalDevelopmentIndex module ConversationalDevelopmentIndex
class IdeaToProductionStep class IdeaToProductionStep
attr_accessor :metric, :title, :features attr_accessor :metric, :title, :features
......
# frozen_string_literal: true
module ConversationalDevelopmentIndex module ConversationalDevelopmentIndex
class Metric < ActiveRecord::Base class Metric < ActiveRecord::Base
include Presentable include Presentable
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Added < Base class Added < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Base class Base
PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
module ClientSide module ClientSide
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Deleted < Base class Deleted < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Image < Base class Image < Base
include Rich include Rich
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class ModeChanged < Base class ModeChanged < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class NoPreview < Base class NoPreview < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class NotDiffable < Base class NotDiffable < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Renamed < Base class Renamed < Base
include Simple include Simple
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
module Rich module Rich
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
module ServerSide module ServerSide
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
module Simple module Simple
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
module Static module Static
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffViewer module DiffViewer
class Text < Base class Text < Base
include Simple include Simple
......
# frozen_string_literal: true
class ProjectHook < WebHook class ProjectHook < WebHook
include CustomModelNaming include CustomModelNaming
include TriggerableHooks include TriggerableHooks
......
# frozen_string_literal: true
class ServiceHook < WebHook class ServiceHook < WebHook
belongs_to :service belongs_to :service
validates :service, presence: true validates :service, presence: true
......
# frozen_string_literal: true
class SystemHook < WebHook class SystemHook < WebHook
include TriggerableHooks include TriggerableHooks
......
# frozen_string_literal: true
class WebHook < ActiveRecord::Base class WebHook < ActiveRecord::Base
include Sortable include Sortable
......
# frozen_string_literal: true
class WebHookLog < ActiveRecord::Base class WebHookLog < ActiveRecord::Base
belongs_to :web_hook belongs_to :web_hook
......
# frozen_string_literal: true
class Issue::Metrics < ActiveRecord::Base class Issue::Metrics < ActiveRecord::Base
belongs_to :issue belongs_to :issue
......
# frozen_string_literal: true
class GroupMember < Member class GroupMember < Member
SOURCE_TYPE = 'Namespace'.freeze SOURCE_TYPE = 'Namespace'.freeze
......
# frozen_string_literal: true
class ProjectMember < Member class ProjectMember < Member
SOURCE_TYPE = 'Project'.freeze SOURCE_TYPE = 'Project'.freeze
......
# frozen_string_literal: true
class MergeRequest::Metrics < ActiveRecord::Base class MergeRequest::Metrics < ActiveRecord::Base
belongs_to :merge_request belongs_to :merge_request
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id
......
# frozen_string_literal: true
module Network module Network
class Commit class Commit
include ActionView::Helpers::TagHelper include ActionView::Helpers::TagHelper
......
# frozen_string_literal: true
module Network module Network
class Graph class Graph
attr_reader :days, :commits, :map, :notes, :repo attr_reader :days, :commits, :map, :notes, :repo
......
= form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f| = form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-general-settings' }
= form_errors(@group) = form_errors(@group)
%fieldset %fieldset
......
= form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f| = form_for @group, html: { multipart: true, class: 'gl-show-field-errors' }, authenticity_token: true do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-permissions-settings' }
= form_errors(@group) = form_errors(@group)
%fieldset %fieldset
......
- expanded = Rails.env.test? - expanded = Rails.env.test?
%section.qa-deploy-keys-settings.settings.no-animate{ class: ('expanded' if expanded) } %section.qa-deploy-keys-settings.settings.no-animate#js-deploy-keys-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
Deploy Keys Deploy Keys
......
%p.profile-settings-content %p.profile-settings-content
= s_("DeployTokens|Pick a name for the application, and we'll give you a unique deploy token.") = s_("DeployTokens|Pick a name for the application, and we'll give you a unique deploy token.")
= form_for token, url: create_deploy_token_namespace_project_settings_repository_path(project.namespace, project), method: :post do |f| = form_for token, url: create_deploy_token_namespace_project_settings_repository_path(project.namespace, project, anchor: 'js-deploy-tokens'), method: :post do |f|
= form_errors(token) = form_errors(token)
.form-group .form-group
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
.settings-content .settings-content
.project-edit-errors .project-edit-errors
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-general-project-settings' }
%fieldset %fieldset
.row .row
.form-group.col-md-9 .form-group.col-md-9
...@@ -75,6 +76,7 @@ ...@@ -75,6 +76,7 @@
Enable or disable certain project features and choose access levels. Enable or disable certain project features and choose access levels.
.settings-content .settings-content
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' }
-# haml-lint:disable InlineJavaScript -# haml-lint:disable InlineJavaScript
%script.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data(@project) %script.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data(@project)
.js-project-permissions-form .js-project-permissions-form
...@@ -94,6 +96,7 @@ ...@@ -94,6 +96,7 @@
= render_if_exists 'shared/promotions/promote_mr_features' = render_if_exists 'shared/promotions/promote_mr_features'
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
= render 'projects/merge_request_settings', form: f = render 'projects/merge_request_settings', form: f
= f.submit 'Save changes', class: "btn btn-save qa-save-merge-request-changes" = f.submit 'Save changes', class: "btn btn-save qa-save-merge-request-changes"
......
= form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'new-protected-branch js-new-protected-branch' } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'new-protected-branch js-new-protected-branch' } do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-protected-branches-settings' }
.card .card
.card-header .card-header
%h3.card-title %h3.card-title
......
- expanded = Rails.env.test? - expanded = Rails.env.test?
%section.qa-protected-branches-settings.settings.no-animate{ class: ('expanded' if expanded) } %section.qa-protected-branches-settings.settings.no-animate#js-protected-branches-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
Protected Branches Protected Branches
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
- if can_admin_project - if can_admin_project
%td %td
= link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, protected_branch], disabled: local_assigns[:disabled], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-warning" = link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, protected_branch, { update_section: 'js-protected-branches-settings' }], disabled: local_assigns[:disabled], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-warning"
= form_for [@project.namespace.becomes(Namespace), @project, @protected_tag], html: { class: 'new-protected-tag js-new-protected-tag' } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @protected_tag], html: { class: 'new-protected-tag js-new-protected-tag' } do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-protected-tags-settings' }
.card .card
.card-header .card-header
%h3.card-title %h3.card-title
......
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
%td %td
= link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, protected_tag], data: { confirm: 'Tag will be writable for developers. Are you sure?' }, method: :delete, class: 'btn btn-warning' = link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, protected_tag, { update_section: 'js-protected-tags-settings' }], data: { confirm: 'Tag will be writable for developers. Are you sure?' }, method: :delete, class: 'btn btn-warning'
- if @project.valid? - if @project.valid?
:plain :plain
location.href = "#{edit_project_path(@project)}"; location.href = "#{edit_project_path(@project, anchor: params[:update_section])}";
location.reload();
- else - else
:plain :plain
$(".project-edit-errors").html("#{escape_javascript(render('errors'))}"); $(".project-edit-errors").html("#{escape_javascript(render('errors'))}");
......
---
title: Remove redundant ci_builds (status) index
merge_request: 21070
author:
type: performance
# frozen_string_literal: true
class RemoveRedundantStatusIndexOnCiBuilds < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
remove_concurrent_index :ci_builds, :status
end
def down
add_concurrent_index :ci_builds, :status
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180803001726) do ActiveRecord::Schema.define(version: 20180807153545) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -441,7 +441,6 @@ ActiveRecord::Schema.define(version: 20180803001726) do ...@@ -441,7 +441,6 @@ ActiveRecord::Schema.define(version: 20180803001726) do
add_index "ci_builds", ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)", using: :btree add_index "ci_builds", ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)", using: :btree
add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree
add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree
add_index "ci_builds", ["status"], name: "index_ci_builds_on_status", using: :btree
add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree add_index "ci_builds", ["token"], name: "index_ci_builds_on_token", unique: true, using: :btree
add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree add_index "ci_builds", ["updated_at"], name: "index_ci_builds_on_updated_at", using: :btree
add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
......
...@@ -38,7 +38,7 @@ module EE ...@@ -38,7 +38,7 @@ module EE
end end
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository_settings(project) } format.html { redirect_to_repository_settings(project, anchor: 'js-push-remote-settings') }
format.json do format.json do
if project.errors.present? if project.errors.present?
render json: project.errors, status: :unprocessable_entity render json: project.errors, status: :unprocessable_entity
......
...@@ -199,7 +199,7 @@ describe Projects::MirrorsController do ...@@ -199,7 +199,7 @@ describe Projects::MirrorsController do
it 'processes a successful update' do it 'processes a successful update' do
do_put(project, username_only_import_url: "https://updated.example.com") do_put(project, username_only_import_url: "https://updated.example.com")
expect(response).to redirect_to(project_settings_repository_path(project)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-push-remote-settings'))
expect(flash[:notice]).to match(/successfully updated/) expect(flash[:notice]).to match(/successfully updated/)
end end
end end
...@@ -208,7 +208,7 @@ describe Projects::MirrorsController do ...@@ -208,7 +208,7 @@ describe Projects::MirrorsController do
it 'processes an unsuccessful update' do it 'processes an unsuccessful update' do
do_put(project, username_only_import_url: "ftp://invalid.invalid'") do_put(project, username_only_import_url: "ftp://invalid.invalid'")
expect(response).to redirect_to(project_settings_repository_path(project)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-push-remote-settings'))
expect(flash[:alert]).to match(/is blocked/) expect(flash[:alert]).to match(/is blocked/)
end end
end end
......
...@@ -25,7 +25,7 @@ describe Projects::MirrorsController do ...@@ -25,7 +25,7 @@ describe Projects::MirrorsController do
} }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(project_settings_repository_path(project)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-push-remote-settings'))
expect(flash[:alert]).to include("Import url can't be blank") expect(flash[:alert]).to include("Import url can't be blank")
end end
end end
......
...@@ -19,7 +19,7 @@ describe Projects::DeployKeysController do ...@@ -19,7 +19,7 @@ describe Projects::DeployKeysController do
it 'redirects to blob' do it 'redirects to blob' do
get :index, params get :index, params
expect(response).to redirect_to(namespace_project_settings_repository_path(params)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-deploy-keys-settings'))
end end
end end
......
...@@ -36,7 +36,7 @@ describe Projects::MirrorsController do ...@@ -36,7 +36,7 @@ describe Projects::MirrorsController do
it 'processes a successful update' do it 'processes a successful update' do
do_put(project, remote_mirrors_attributes: remote_mirror_attributes) do_put(project, remote_mirrors_attributes: remote_mirror_attributes)
expect(response).to redirect_to(project_settings_repository_path(project)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-push-remote-settings'))
expect(flash[:notice]).to match(/successfully updated/) expect(flash[:notice]).to match(/successfully updated/)
end end
...@@ -53,7 +53,7 @@ describe Projects::MirrorsController do ...@@ -53,7 +53,7 @@ describe Projects::MirrorsController do
it 'processes an unsuccessful update' do it 'processes an unsuccessful update' do
do_put(project, remote_mirrors_attributes: remote_mirror_attributes) do_put(project, remote_mirrors_attributes: remote_mirror_attributes)
expect(response).to redirect_to(project_settings_repository_path(project)) expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-push-remote-settings'))
expect(flash[:alert]).to match(/Only allowed protocols are/) expect(flash[:alert]).to match(/Only allowed protocols are/)
end end
......
...@@ -145,10 +145,8 @@ describe Notes::CreateService do ...@@ -145,10 +145,8 @@ describe Notes::CreateService do
let(:note_text) { %(HELLO\n/close\n/assign @#{user.username}\nWORLD) } let(:note_text) { %(HELLO\n/close\n/assign @#{user.username}\nWORLD) }
it 'saves the note and does not alter the note text' do it 'saves the note and does not alter the note text' do
service = instance_double('Issues::UpdateService', :service) service = double(:service)
allow(Issues::UpdateService).to receive(:new).and_return(service) allow(Issues::UpdateService).to receive(:new).and_return(service)
expect(service).to receive(:execute) expect(service).to receive(:execute)
note = described_class.new(project, user, opts.merge(note: note_text)).execute note = described_class.new(project, user, opts.merge(note: note_text)).execute
......
...@@ -4,10 +4,8 @@ shared_examples 'issues move service' do |group| ...@@ -4,10 +4,8 @@ shared_examples 'issues move service' do |group|
let(:params) { { board_id: board1.id, from_list_id: list1.id, to_list_id: list2.id } } let(:params) { { board_id: board1.id, from_list_id: list1.id, to_list_id: list2.id } }
it 'delegates the label changes to Issues::UpdateService' do it 'delegates the label changes to Issues::UpdateService' do
service = instance_double('Issues::UpdateService', :service) service = double(:service)
expect(Issues::UpdateService).to receive(:new).and_return(service)
allow(Issues::UpdateService).to receive(:new).and_return(service)
expect(service).to receive(:execute).with(issue).once expect(service).to receive(:execute).with(issue).once
described_class.new(parent, user, params).execute(issue) described_class.new(parent, user, params).execute(issue)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment