Commit e19e8a08 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-09-07

# Conflicts:
#	app/assets/javascripts/pages/projects/project.js
#	app/views/projects/_flash_messages.html.haml
#	config/sidekiq_queues.yml
#	locale/gitlab.pot

[ci skip]
parents 722ac944 07d5ee36
......@@ -440,7 +440,7 @@ group :ed25519 do
end
# Gitaly GRPC client
gem 'gitaly-proto', '~> 0.113.0', require: 'gitaly'
gem 'gitaly-proto', '~> 0.117.0', require: 'gitaly'
gem 'grpc', '~> 1.11.0'
# Locked until https://github.com/google/protobuf/issues/4210 is closed
......
......@@ -300,7 +300,7 @@ GEM
gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0)
rails (>= 3.2.0)
gitaly-proto (0.113.0)
gitaly-proto (0.117.0)
google-protobuf (~> 3.1)
grpc (~> 1.10)
github-linguist (5.3.3)
......@@ -1072,7 +1072,7 @@ DEPENDENCIES
gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3)
gitaly-proto (~> 0.113.0)
gitaly-proto (~> 0.117.0)
github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2)
......
......@@ -303,7 +303,7 @@ GEM
gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0)
rails (>= 3.2.0)
gitaly-proto (0.113.0)
gitaly-proto (0.117.0)
google-protobuf (~> 3.1)
grpc (~> 1.10)
github-linguist (5.3.3)
......@@ -1081,7 +1081,7 @@ DEPENDENCIES
gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3)
gitaly-proto (~> 0.113.0)
gitaly-proto (~> 0.117.0)
github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2)
......
......@@ -7,6 +7,19 @@ import axios from './lib/utils/axios_utils';
Dropzone.autoDiscover = false;
/**
* Return the error message string from the given response.
*
* @param {String|Object} res
*/
function getErrorMessage(res) {
if (!res || _.isString(res)) {
return res;
}
return res.message;
}
export default function dropzoneInput(form) {
const divHover = '<div class="div-dropzone-hover"></div>';
const iconPaperclip = '<i class="fa fa-paperclip div-dropzone-icon"></i>';
......@@ -18,7 +31,7 @@ export default function dropzoneInput(form) {
const $uploadingErrorContainer = form.find('.uploading-error-container');
const $uploadingErrorMessage = form.find('.uploading-error-message');
const $uploadingProgressContainer = form.find('.uploading-progress-container');
const uploadsPath = window.uploads_path || null;
const uploadsPath = form.data('uploads-path') || window.uploads_path || null;
const maxFileSize = gon.max_file_size || 10;
const formTextarea = form.find('.js-gfm-input');
let handlePaste;
......@@ -42,7 +55,7 @@ export default function dropzoneInput(form) {
if (!uploadsPath) {
$formDropzone.addClass('js-invalid-dropzone');
return;
return null;
}
const dropzone = $formDropzone.dropzone({
......@@ -84,9 +97,7 @@ export default function dropzoneInput(form) {
// xhr object (xhr.responseText is error message).
// On error we hide the 'Attach' and 'Cancel' buttons
// and show an error.
// If there's xhr error message, let's show it instead of dropzone's one.
const message = xhr ? xhr.responseText : errorMessage;
const message = getErrorMessage(errorMessage || xhr.responseText);
$uploadingErrorContainer.removeClass('hide');
$uploadingErrorMessage.html(message);
......@@ -274,4 +285,6 @@ export default function dropzoneInput(form) {
$(this).closest('.gfm-form').find('.div-dropzone').click();
formTextarea.focus();
});
return Dropzone.forElement($formDropzone.get(0));
}
......@@ -66,6 +66,7 @@ export default class Project {
.remove();
return e.preventDefault();
});
<<<<<<< HEAD
$('.hide-shared-runner-limit-message').on('click', function(e) {
var $alert = $(this).parents('.shared-runner-quota-message');
var scope = $alert.data('scope');
......@@ -73,6 +74,8 @@ export default class Project {
$alert.remove();
e.preventDefault();
});
=======
>>>>>>> upstream/master
$('.hide-auto-devops-implicitly-enabled-banner').on('click', function(e) {
const projectId = $(this).data('project-id');
const cookieKey = `hide_auto_devops_implicitly_enabled_banner_${projectId}`;
......
......@@ -6,3 +6,13 @@ gl-emoji {
font-size: 1.4em;
line-height: 1em;
}
.user-status-emoji {
margin-right: $gl-padding-4;
gl-emoji {
font-size: 1em;
line-height: 16px;
vertical-align: baseline;
}
}
......@@ -713,6 +713,10 @@
align-self: center;
overflow: hidden;
text-overflow: ellipsis;
.user-status-emoji {
margin: 0 $gl-padding-8 0 $gl-padding-4;
}
}
.js-issuable-selector-wrap {
......
......@@ -176,13 +176,12 @@ module IssuablesHelper
author_output << link_to_member(project, issuable.author, size: 24, by_username: true, avatar: false, mobile_classes: "d-block d-sm-none")
if status = user_status(issuable.author)
author_output << "&ensp; #{status}".html_safe
author_output << "#{status}".html_safe
end
author_output
end
output << "&ensp;".html_safe
output << content_tag(:span, (issuable_first_contribution_icon if issuable.first_contribution?), class: 'has-tooltip', title: _('1st contribution!'))
output << content_tag(:span, (issuable.task_status if issuable.tasks?), id: "task_status", class: "d-none d-sm-none d-md-inline-block")
......
......@@ -5,7 +5,7 @@
System OAuth applications don't belong to any user and can only be managed by admins
%hr
%p= link_to 'New application', new_admin_application_path, class: 'btn btn-success'
%table.table.table-striped
%table.table
%thead
%tr
%th Name
......
......@@ -5,7 +5,11 @@
- if current_user && can?(current_user, :download_code, project)
= render 'shared/no_ssh'
= render 'shared/no_password'
<<<<<<< HEAD
= render 'shared/shared_runners_minutes_limit', project: project
= render 'shared/auto_devops_implicitly_enabled_banner', project: project
- if project.above_size_limit?
= render 'above_size_limit_warning'
=======
= render 'shared/auto_devops_implicitly_enabled_banner', project: project
>>>>>>> upstream/master
......@@ -13,6 +13,6 @@
.tree-content-holder
.table-holder
%table.table.files-slider{ class: "table_#{@hex_path} tree-table table-striped" }
%table.table.files-slider{ class: "table_#{@hex_path} tree-table" }
%tbody
= spinner nil, true
......@@ -7,7 +7,7 @@
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post,
html: { class: 'wiki-form common-note-form prepend-top-default js-quick-submit' },
data: { markdown_version: markdown_version } do |f|
data: { markdown_version: markdown_version, uploads_path: uploads_path } do |f|
= form_errors(@page)
- if @page.persisted?
......
......@@ -36,13 +36,8 @@
type: 'button' }
= _('Delete')
= render 'form'
= render 'form', uploads_path: wiki_attachment_upload_url
= render 'sidebar'
#delete-wiki-modal.modal.fade
- content_for :scripts_body do
-# haml-lint:disable InlineJavaScript
:javascript
window.uploads_path = "#{wiki_attachment_upload_url}";
---
title: Make cluster page settings easier to read
merge_request: 21550
author:
type: other
---
title: Make margin of user status emoji consistent
merge_request: 21268
author:
type: other
---
title: Remove striped table styling of Find files and Admin Area Applications views
merge_request: 21560
author: Andreas Kämmerle
type: other
......@@ -79,6 +79,7 @@
- [delete_diff_files, 1]
- [detect_repository_languages, 1]
- [auto_devops, 2]
<<<<<<< HEAD
# EE-specific queues
- [ldap_group_sync, 2]
......@@ -100,3 +101,5 @@
- geo_file_download
- geo_project_sync
- geo_repository_shard_sync
=======
>>>>>>> upstream/master
......@@ -7,10 +7,14 @@ class RenameLoginRootNamespaces < ActiveRecord::Migration
# We're taking over the /login namespace as part of a fix for the Jira integration
def up
rename_root_paths 'login'
disable_statement_timeout do
rename_root_paths 'login'
end
end
def down
revert_renames
disable_statement_timeout do
revert_renames
end
end
end
......@@ -666,6 +666,14 @@ module Gitlab
end
end
def find_remote_root_ref(remote_name)
return unless remote_name.present?
wrapped_gitaly_errors do
gitaly_remote_client.find_remote_root_ref(remote_name)
end
end
AUTOCRLF_VALUES = {
"true" => true,
"false" => false,
......
......@@ -52,6 +52,18 @@ module Gitlab
response.result
end
def find_remote_root_ref(remote_name)
request = Gitaly::FindRemoteRootRefRequest.new(
repository: @gitaly_repo,
remote: remote_name
)
response = GitalyClient.call(@storage, :remote_service,
:find_remote_root_ref, request)
response.ref.presence
end
def update_remote_mirror(ref_name, only_branches_matching)
req_enum = Enumerator.new do |y|
y.yield Gitaly::UpdateRemoteMirrorRequest.new(
......
......@@ -1751,9 +1751,12 @@ msgstr ""
msgid "ClusterIntegration|Kubernetes cluster details"
msgstr ""
<<<<<<< HEAD
msgid "ClusterIntegration|Kubernetes cluster health"
msgstr ""
=======
>>>>>>> upstream/master
msgid "ClusterIntegration|Kubernetes cluster integration"
msgstr ""
......
import $ from 'jquery';
import dropzoneInput from '~/dropzone_input';
import { TEST_HOST } from 'spec/test_constants';
const TEST_FILE = {
upload: {},
};
const TEST_UPLOAD_PATH = `${TEST_HOST}/upload/file`;
const TEST_ERROR_MESSAGE = 'A big error occurred!';
const TEMPLATE = (
`<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}">
<textarea class="js-gfm-input"></textarea>
<div class="uploading-error-message"></div>
</form>`
);
describe('dropzone_input', () => {
let form;
let dropzone;
let xhr;
let oldXMLHttpRequest;
beforeEach(() => {
form = $(TEMPLATE);
dropzone = dropzoneInput(form);
xhr = jasmine.createSpyObj(Object.keys(XMLHttpRequest.prototype));
oldXMLHttpRequest = window.XMLHttpRequest;
window.XMLHttpRequest = () => xhr;
});
afterEach(() => {
window.XMLHttpRequest = oldXMLHttpRequest;
});
it('shows error message, when AJAX fails with json', () => {
xhr = {
...xhr,
statusCode: 400,
readyState: 4,
responseText: JSON.stringify({ message: TEST_ERROR_MESSAGE }),
getResponseHeader: () => 'application/json',
};
dropzone.processFile(TEST_FILE);
xhr.onload();
expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE);
});
it('shows error message, when AJAX fails with text', () => {
xhr = {
...xhr,
statusCode: 400,
readyState: 4,
responseText: TEST_ERROR_MESSAGE,
getResponseHeader: () => 'text/plain',
};
dropzone.processFile(TEST_FILE);
xhr.onload();
expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE);
});
});
......@@ -583,6 +583,33 @@ describe Gitlab::Git::Repository, :seed_helper do
end
end
describe '#find_remote_root_ref' do
it 'gets the remote root ref from GitalyClient' do
expect_any_instance_of(Gitlab::GitalyClient::RemoteService)
.to receive(:find_remote_root_ref).and_call_original
expect(repository.find_remote_root_ref('origin')).to eq 'master'
end
it 'returns nil when remote name is nil' do
expect_any_instance_of(Gitlab::GitalyClient::RemoteService)
.not_to receive(:find_remote_root_ref)
expect(repository.find_remote_root_ref(nil)).to be_nil
end
it 'returns nil when remote name is empty' do
expect_any_instance_of(Gitlab::GitalyClient::RemoteService)
.not_to receive(:find_remote_root_ref)
expect(repository.find_remote_root_ref('')).to be_nil
end
it_behaves_like 'wrapping gRPC errors', Gitlab::GitalyClient::RemoteService, :find_remote_root_ref do
subject { repository.find_remote_root_ref('origin') }
end
end
describe "#log" do
shared_examples 'repository log' do
let(:commit_with_old_name) do
......
......@@ -45,6 +45,17 @@ describe Gitlab::GitalyClient::RemoteService do
end
end
describe '#find_remote_root_ref' do
it 'sends an find_remote_root_ref message and returns the root ref' do
expect_any_instance_of(Gitaly::RemoteService::Stub)
.to receive(:find_remote_root_ref)
.with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
.and_return(double(ref: 'master'))
expect(client.find_remote_root_ref('origin')).to eq 'master'
end
end
describe '#update_remote_mirror' do
let(:ref_name) { 'remote_mirror_1' }
let(:only_branches_matching) { ['my-branch', 'master'] }
......
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