Skip to content
Snippets Groups Projects
Commit 95eeaa99 authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ce_upstream

parents 7117b4b9 c392b0cc
No related branches found
No related tags found
No related merge requests found
Showing
with 185 additions and 45 deletions
Loading
Loading
@@ -27,9 +27,9 @@
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: $caret-width-base dashed;
border-right: $caret-width-base solid transparent;
border-left: $caret-width-base solid transparent;
border-top: 5px dashed;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
color: $gray-darkest;
}
}
Loading
Loading
Loading
Loading
@@ -36,9 +36,42 @@
padding: 10px 0;
margin-bottom: 0;
 
.commit-options-dropdown-caret {
@media (max-width: $screen-sm) {
margin-left: 0;
@media (min-width: $screen-sm-min) {
display: flex;
align-items: center;
.commit-meta {
flex: 1;
}
}
.commit-hash-full {
@media (max-width: $screen-sm-max) {
width: 80px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
vertical-align: bottom;
}
}
.commit-action-buttons {
i {
color: $gl-icon-color;
font-size: 13px;
margin-right: 3px;
}
@media (max-width: $screen-xs-max) {
.dropdown {
width: 100%;
margin-top: 10px;
}
.dropdown-toggle {
width: 100%;
}
}
}
}
Loading
Loading
@@ -188,17 +221,6 @@
}
}
 
.commit-action-buttons {
position: relative;
top: -1px;
i {
color: $gl-icon-color;
font-size: 13px;
margin-right: 3px;
}
}
/*
* Commit message textarea for web editor and
* custom merge request message
Loading
Loading
Loading
Loading
@@ -164,7 +164,22 @@
.branch-commit {
color: $gl-gray;
 
.commit-id,
.commit-icon {
text-align: center;
display: inline-block;
svg {
height: 14px;
width: 14px;
vertical-align: middle;
fill: $table-text-gray;
}
}
.commit-id {
color: $gl-link-color;
}
.commit-row-message {
color: $gl-gray;
}
Loading
Loading
Loading
Loading
@@ -55,6 +55,10 @@
float: left;
}
 
.file-buttons {
font-size: 0;
}
.select2 {
float: right;
}
Loading
Loading
// CI icon colors
.ci-status-icon {
&-created {
fill: $gray-darkest;
}
&-skipped,
&-canceled {
fill: $gl-text-color;
}
}
Loading
Loading
@@ -85,6 +85,11 @@
}
 
.commit-link {
a {
&:focus {
text-decoration: none;
}
}
 
.ci-status {
 
Loading
Loading
@@ -439,7 +444,7 @@
}
 
.grouped-pipeline-dropdown {
padding: 8px 0;
padding: 0;
width: 186px;
left: auto;
right: -197px;
Loading
Loading
@@ -448,6 +453,14 @@
ul {
max-height: 245px;
overflow: auto;
li:first-child {
padding-top: 8px;
}
li:last-child {
padding-bottom: 8px;
}
}
 
a {
Loading
Loading
Loading
Loading
@@ -6,7 +6,8 @@
white-space: nowrap;
border-radius: 4px;
 
&:hover {
&:hover,
&:focus {
text-decoration: none;
}
 
Loading
Loading
Loading
Loading
@@ -132,7 +132,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:elasticsearch_host,
:elasticsearch_port,
:usage_ping_enabled,
:repository_storage,
repository_storages: [],
:enabled_git_access_protocol,
:repository_size_limit,
restricted_visibility_levels: [],
Loading
Loading
Loading
Loading
@@ -196,9 +196,10 @@ class ApplicationController < ActionController::Base
end
 
# JSON for infinite scroll via Pager object
def pager_json(partial, count)
def pager_json(partial, count, locals = {})
html = render_to_string(
partial,
locals: locals,
layout: false,
formats: [:html]
)
Loading
Loading
Loading
Loading
@@ -11,9 +11,13 @@ class AutocompleteController < ApplicationController
@users = @users.reorder(:name)
@users = load_users_by_ability || @users.page(params[:page])
 
if params[:todo_filter].present?
@users = @users.todo_authors(current_user.id, params[:todo_state_filter])
end
if params[:search].blank?
# Include current user if available to filter by "Me"
if params[:current_user] && current_user
if params[:current_user].present? && current_user
@users = [*@users, current_user]
end
 
Loading
Loading
Loading
Loading
@@ -26,8 +26,15 @@ class Projects::CommitsController < Projects::ApplicationController
 
respond_to do |format|
format.html
format.json { pager_json("projects/commits/_commits", @commits.size) }
format.atom { render layout: false }
format.json do
pager_json(
'projects/commits/_commits',
@commits.size,
project: @project,
ref: @ref)
end
end
end
end
Loading
Loading
@@ -7,7 +7,7 @@ class Projects::GroupLinksController < Projects::ApplicationController
@group_links = project.project_group_links.all
 
@skip_groups = @group_links.pluck(:group_id)
@skip_groups << project.group.try(:id)
@skip_groups << project.namespace_id unless project.personal?
end
 
def create
Loading
Loading
Loading
Loading
@@ -379,13 +379,23 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def branch_from
# This is always source
@source_project = @merge_request.nil? ? @project : @merge_request.source_project
@commit = @repository.commit(params[:ref]) if params[:ref].present?
if params[:ref].present?
@ref = params[:ref]
@commit = @repository.commit(@ref)
end
render layout: false
end
 
def branch_to
@target_project = selected_target_project
@commit = @target_project.commit(params[:ref]) if params[:ref].present?
if params[:ref].present?
@ref = params[:ref]
@commit = @target_project.commit(@ref)
end
render layout: false
end
 
Loading
Loading
Loading
Loading
@@ -336,6 +336,7 @@ class ProjectsController < Projects::ApplicationController
:visibility_level, :import_url, :last_activity_at, :namespace_id, :avatar,
:build_allow_git_fetch, :build_timeout_in_minutes, :build_coverage_regex,
:public_builds, :only_allow_merge_if_build_succeeds, :request_access_enabled,
:only_allow_merge_if_all_discussions_are_resolved,
:lfs_enabled, project_feature_attributes,
 
# EE-only
Loading
Loading
Loading
Loading
@@ -93,11 +93,11 @@ module ApplicationSettingsHelper
end
end
 
def repository_storage_options_for_select
def repository_storages_options_for_select
options = Gitlab.config.repositories.storages.map do |name, path|
["#{name} - #{path}", name]
end
 
options_for_select(options, @application_setting.repository_storage)
options_for_select(options, @application_setting.repository_storages)
end
end
Loading
Loading
@@ -47,17 +47,27 @@ module CiStatusHelper
'icon_play'
when 'created'
'icon_status_created'
when 'skipped'
'icon_status_skipped'
else
'icon_status_cancel'
'icon_status_canceled'
end
 
custom_icon(icon_name)
end
 
def render_commit_status(commit, tooltip_placement: 'auto left')
def render_commit_status(commit, ref: nil, tooltip_placement: 'auto left')
project = commit.project
path = pipelines_namespace_project_commit_path(project.namespace, project, commit)
render_status_with_link('commit', commit.status, path, tooltip_placement: tooltip_placement)
path = pipelines_namespace_project_commit_path(
project.namespace,
project,
commit)
render_status_with_link(
'commit',
commit.status(ref),
path,
tooltip_placement: tooltip_placement)
end
 
def render_pipeline_status(pipeline, tooltip_placement: 'auto left')
Loading
Loading
Loading
Loading
@@ -25,9 +25,11 @@ module CommitsHelper
end
end
 
def commit_to_html(commit, project, inline = true)
template = inline ? "inline_commit" : "commit"
render "projects/commits/#{template}", commit: commit, project: project unless commit.nil?
def commit_to_html(commit, ref, project)
render 'projects/commits/commit',
commit: commit,
ref: ref,
project: project
end
 
# Breadcrumb links for a Project and, if applicable, a tree path
Loading
Loading
Loading
Loading
@@ -47,7 +47,7 @@ module DropdownsHelper
default_label = data_attr[:default_label]
content_tag(:button, class: "dropdown-menu-toggle #{options[:toggle_class] if options.has_key?(:toggle_class)}", id: (options[:id] if options.has_key?(:id)), type: "button", data: data_attr) do
output = content_tag(:span, toggle_text, class: "dropdown-toggle-text #{'is-default' if toggle_text == default_label}")
output << icon('chevron-down')
output << icon('caret-down')
output.html_safe
end
end
Loading
Loading
Loading
Loading
@@ -18,6 +18,7 @@ class ApplicationSetting < ActiveRecord::Base
serialize :disabled_oauth_sign_in_sources, Array
serialize :domain_whitelist, Array
serialize :domain_blacklist, Array
serialize :repository_storages
 
cache_markdown_field :sign_in_text
cache_markdown_field :help_page_text
Loading
Loading
@@ -86,9 +87,8 @@ class ApplicationSetting < ActiveRecord::Base
presence: { message: "can't be blank when indexing is enabled" },
if: :elasticsearch_indexing?
 
validates :repository_storage,
presence: true,
inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } }
validates :repository_storages, presence: true
validate :check_repository_storages
 
validates :enabled_git_access_protocol,
inclusion: { in: %w(ssh http), allow_blank: true, allow_nil: true }
Loading
Loading
@@ -181,7 +181,7 @@ class ApplicationSetting < ActiveRecord::Base
elasticsearch_host: ENV['ELASTIC_HOST'] || 'localhost',
elasticsearch_port: ENV['ELASTIC_PORT'] || '9200',
usage_ping_enabled: true,
repository_storage: 'default',
repository_storages: ['default'],
user_default_external: false,
)
end
Loading
Loading
@@ -220,6 +220,29 @@ class ApplicationSetting < ActiveRecord::Base
self.domain_blacklist_raw = file.read
end
 
def repository_storages
value = read_attribute(:repository_storages)
value = [value] if value.is_a?(String)
value = [] if value.nil?
value
end
# repository_storage is still required in the API. Remove in 9.0
def repository_storage
repository_storages.first
end
def repository_storage=(value)
self.repository_storages = [value]
end
# Choose one of the available repository storage options. Currently all have
# equal weighting.
def pick_repository_storage
repository_storages.sample
end
def runners_registration_token
ensure_runners_registration_token!
end
Loading
Loading
@@ -227,4 +250,12 @@ class ApplicationSetting < ActiveRecord::Base
def health_check_access_token
ensure_health_check_access_token!
end
private
def check_repository_storages
invalid = repository_storages - Gitlab.config.repositories.storages.keys
errors.add(:repository_storages, "can't include: #{invalid.join(", ")}") unless
invalid.empty?
end
end
Loading
Loading
@@ -226,12 +226,19 @@ class Commit
end
 
def pipelines
@pipeline ||= project.pipelines.where(sha: sha)
project.pipelines.where(sha: sha)
end
 
def status
return @status if defined?(@status)
@status ||= pipelines.status
def status(ref = nil)
@statuses ||= {}
if @statuses.key?(ref)
@statuses[ref]
elsif ref
@statuses[ref] = pipelines.where(ref: ref).status
else
@statuses[ref] = pipelines.status
end
end
 
def revert_branch_name
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment