Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
5f003678af
commit
3607cd931c
|
@ -9,7 +9,6 @@ const componentsByReferenceType = {
|
||||||
merge_request: MRPopover,
|
merge_request: MRPopover,
|
||||||
};
|
};
|
||||||
|
|
||||||
let renderedPopover;
|
|
||||||
let renderFn;
|
let renderFn;
|
||||||
|
|
||||||
const handleIssuablePopoverMouseOut = ({ target }) => {
|
const handleIssuablePopoverMouseOut = ({ target }) => {
|
||||||
|
@ -18,12 +17,10 @@ const handleIssuablePopoverMouseOut = ({ target }) => {
|
||||||
if (renderFn) {
|
if (renderFn) {
|
||||||
clearTimeout(renderFn);
|
clearTimeout(renderFn);
|
||||||
}
|
}
|
||||||
if (renderedPopover) {
|
|
||||||
renderedPopover.$destroy();
|
|
||||||
renderedPopover = null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const popoverMountedAttr = 'data-popover-mounted';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a MergeRequestPopover component to the body, hands over as much data as the target element has in data attributes.
|
* Adds a MergeRequestPopover component to the body, hands over as much data as the target element has in data attributes.
|
||||||
* loads based on data-project-path and data-iid more data about an MR from the API and sets it on the popover
|
* loads based on data-project-path and data-iid more data about an MR from the API and sets it on the popover
|
||||||
|
@ -34,13 +31,14 @@ const handleIssuablePopoverMount = ({
|
||||||
title,
|
title,
|
||||||
iid,
|
iid,
|
||||||
referenceType,
|
referenceType,
|
||||||
}) => ({ target }) => {
|
target,
|
||||||
|
}) => {
|
||||||
// Add listener to actually remove it again
|
// Add listener to actually remove it again
|
||||||
target.addEventListener('mouseleave', handleIssuablePopoverMouseOut);
|
target.addEventListener('mouseleave', handleIssuablePopoverMouseOut);
|
||||||
|
|
||||||
renderFn = setTimeout(() => {
|
renderFn = setTimeout(() => {
|
||||||
const PopoverComponent = Vue.extend(componentsByReferenceType[referenceType]);
|
const PopoverComponent = Vue.extend(componentsByReferenceType[referenceType]);
|
||||||
renderedPopover = new PopoverComponent({
|
new PopoverComponent({
|
||||||
propsData: {
|
propsData: {
|
||||||
target,
|
target,
|
||||||
projectPath,
|
projectPath,
|
||||||
|
@ -48,9 +46,9 @@ const handleIssuablePopoverMount = ({
|
||||||
cachedTitle: title,
|
cachedTitle: title,
|
||||||
},
|
},
|
||||||
apolloProvider,
|
apolloProvider,
|
||||||
});
|
}).$mount();
|
||||||
|
|
||||||
renderedPopover.$mount();
|
target.setAttribute(popoverMountedAttr, true);
|
||||||
}, 200); // 200ms delay so not every mouseover triggers Popover + API Call
|
}, 200); // 200ms delay so not every mouseover triggers Popover + API Call
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,10 +66,18 @@ export default (elements) => {
|
||||||
const title = el.dataset.mrTitle || el.title;
|
const title = el.dataset.mrTitle || el.title;
|
||||||
|
|
||||||
if (!el.getAttribute(listenerAddedAttr) && projectPath && title && iid && referenceType) {
|
if (!el.getAttribute(listenerAddedAttr) && projectPath && title && iid && referenceType) {
|
||||||
el.addEventListener(
|
el.addEventListener('mouseenter', ({ target }) => {
|
||||||
'mouseenter',
|
if (!el.getAttribute(popoverMountedAttr)) {
|
||||||
handleIssuablePopoverMount({ apolloProvider, projectPath, title, iid, referenceType }),
|
handleIssuablePopoverMount({
|
||||||
);
|
apolloProvider,
|
||||||
|
projectPath,
|
||||||
|
title,
|
||||||
|
iid,
|
||||||
|
referenceType,
|
||||||
|
target,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
el.setAttribute(listenerAddedAttr, true);
|
el.setAttribute(listenerAddedAttr, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.input-group-prepend.has-tooltip{ title: root_url }
|
.input-group-prepend.has-tooltip{ title: root_url }
|
||||||
.input-group-text
|
.input-group-text
|
||||||
= root_url
|
= root_url
|
||||||
= select_tag :group_id, namespaces_options(nil, display_path: true, groups_only: true), { class: 'select2 js-select-namespace' }
|
= select_tag :group_id, namespaces_options(params[:namespace_id], display_path: true, groups_only: true), { class: 'select2 js-select-namespace' }
|
||||||
.form-text.text-muted
|
.form-text.text-muted
|
||||||
= _('Choose the top-level group for your repository imports.')
|
= _('Choose the top-level group for your repository imports.')
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
- if manifest_import_enabled?
|
- if manifest_import_enabled?
|
||||||
%div
|
%div
|
||||||
= link_to new_import_manifest_path, class: 'gl-button btn-default btn import_manifest js-import-project-btn', data: { platform: 'manifest_file', **tracking_attrs_data(track_label, 'click_button', 'manifest_file') } do
|
= link_to new_import_manifest_path(namespace_id: namespace_id), class: 'gl-button btn-default btn import_manifest js-import-project-btn', data: { platform: 'manifest_file', **tracking_attrs_data(track_label, 'click_button', 'manifest_file') } do
|
||||||
.gl-button-icon
|
.gl-button-icon
|
||||||
= sprite_icon('doc-text')
|
= sprite_icon('doc-text')
|
||||||
Manifest file
|
Manifest file
|
||||||
|
|
|
@ -47,7 +47,7 @@ Use the built-in continuous integration in GitLab.
|
||||||
|
|
||||||
# Editing this README
|
# Editing this README
|
||||||
|
|
||||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||||
|
|
||||||
## Suggestions for a good README
|
## Suggestions for a good README
|
||||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||||
|
|
|
@ -54,7 +54,8 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def match_content_type?(env)
|
def match_content_type?(env)
|
||||||
env['CONTENT_TYPE'] == 'application/json' ||
|
env['CONTENT_TYPE'].nil? ||
|
||||||
|
env['CONTENT_TYPE'] == 'application/json' ||
|
||||||
env['CONTENT_TYPE'] == 'application/x-sentry-envelope'
|
env['CONTENT_TYPE'] == 'application/x-sentry-envelope'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module QA
|
module QA
|
||||||
RSpec.describe 'Plan', :requires_admin, :orchestrated, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/293699', type: :bug } do
|
RSpec.describe 'Plan', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/293699', type: :bug } do
|
||||||
describe 'Assignees' do
|
describe 'Assignees' do
|
||||||
let(:user1) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) }
|
let(:user1) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) }
|
||||||
let(:user2) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) }
|
let(:user2) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) }
|
||||||
|
|
|
@ -8,11 +8,12 @@ RSpec.describe Gitlab::Middleware::CompressedJson do
|
||||||
|
|
||||||
let(:app) { double(:app) }
|
let(:app) { double(:app) }
|
||||||
let(:middleware) { described_class.new(app) }
|
let(:middleware) { described_class.new(app) }
|
||||||
|
let(:content_type) { 'application/json' }
|
||||||
let(:env) do
|
let(:env) do
|
||||||
{
|
{
|
||||||
'HTTP_CONTENT_ENCODING' => 'gzip',
|
'HTTP_CONTENT_ENCODING' => 'gzip',
|
||||||
'REQUEST_METHOD' => 'POST',
|
'REQUEST_METHOD' => 'POST',
|
||||||
'CONTENT_TYPE' => 'application/json',
|
'CONTENT_TYPE' => content_type,
|
||||||
'PATH_INFO' => path,
|
'PATH_INFO' => path,
|
||||||
'rack.input' => StringIO.new(input)
|
'rack.input' => StringIO.new(input)
|
||||||
}
|
}
|
||||||
|
@ -35,6 +36,12 @@ RSpec.describe Gitlab::Middleware::CompressedJson do
|
||||||
let(:path) { '/api/v4/error_tracking/collector/1/store'}
|
let(:path) { '/api/v4/error_tracking/collector/1/store'}
|
||||||
|
|
||||||
it_behaves_like 'decompress middleware'
|
it_behaves_like 'decompress middleware'
|
||||||
|
|
||||||
|
context 'with no Content-Type' do
|
||||||
|
let(:content_type) { nil }
|
||||||
|
|
||||||
|
it_behaves_like 'decompress middleware'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with collector route under relative url' do
|
context 'with collector route under relative url' do
|
||||||
|
|
|
@ -106,17 +106,30 @@ RSpec.describe API::ErrorTracking::Collector do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'gzip body' do
|
context 'gzip body' do
|
||||||
let(:headers) do
|
let(:standard_headers) do
|
||||||
{
|
{
|
||||||
'X-Sentry-Auth' => "Sentry sentry_key=#{client_key.public_key}",
|
'X-Sentry-Auth' => "Sentry sentry_key=#{client_key.public_key}",
|
||||||
'HTTP_CONTENT_ENCODING' => 'gzip',
|
'HTTP_CONTENT_ENCODING' => 'gzip'
|
||||||
'CONTENT_TYPE' => 'application/x-sentry-envelope'
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:params) { ActiveSupport::Gzip.compress(raw_event) }
|
let(:params) { ActiveSupport::Gzip.compress(raw_event) }
|
||||||
|
|
||||||
it_behaves_like 'successful request'
|
context 'with application/x-sentry-envelope Content-Type' do
|
||||||
|
let(:headers) { standard_headers.merge({ 'CONTENT_TYPE' => 'application/x-sentry-envelope' }) }
|
||||||
|
|
||||||
|
it_behaves_like 'successful request'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with unexpected Content-Type' do
|
||||||
|
let(:headers) { standard_headers.merge({ 'CONTENT_TYPE' => 'application/gzip' }) }
|
||||||
|
|
||||||
|
it 'responds with 415' do
|
||||||
|
subject
|
||||||
|
|
||||||
|
expect(response).to have_gitlab_http_status(:unsupported_media_type)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,9 @@ module GitalySetup
|
||||||
toml ||= config_path(service)
|
toml ||= config_path(service)
|
||||||
args = service_cmd(service, toml)
|
args = service_cmd(service, toml)
|
||||||
|
|
||||||
|
# Ensure that tmp/run exists
|
||||||
|
FileUtils.mkdir_p(runtime_dir)
|
||||||
|
|
||||||
# Ensure user configuration does not affect Git
|
# Ensure user configuration does not affect Git
|
||||||
# Context: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58776#note_547613780
|
# Context: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58776#note_547613780
|
||||||
env = self.env.merge('HOME' => nil, 'XDG_CONFIG_HOME' => nil)
|
env = self.env.merge('HOME' => nil, 'XDG_CONFIG_HOME' => nil)
|
||||||
|
|
Loading…
Reference in New Issue