summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile.lock2
-rw-r--r--app/assets/javascripts/merge_request_tabs.js10
-rw-r--r--app/views/layouts/_head.html.haml1
-rw-r--r--changelogs/unreleased/57813-merge-request-tabs-do-not-handle-ctrl-click-correctly.yml5
-rw-r--r--doc/ci/variables/where_variables_can_be_used.md9
-rw-r--r--doc/ci/yaml/README.md25
-rw-r--r--doc/user/application_security/dependency_scanning/index.md2
-rw-r--r--doc/user/project/repository/reducing_the_repo_size_using_git.md6
-rw-r--r--package.json2
-rwxr-xr-xscripts/review_apps/review-apps.sh1
-rwxr-xr-xscripts/trigger-build1
-rw-r--r--spec/javascripts/merge_request_tabs_spec.js46
-rw-r--r--yarn.lock8
13 files changed, 71 insertions, 47 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 0159d1f96e8..05a926b1b6c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -505,7 +505,7 @@ GEM
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
- msgpack (1.2.6)
+ msgpack (1.2.10)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index e5cf43e8289..b6868e63716 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -147,14 +147,14 @@ export default class MergeRequestTabs {
e.stopImmediatePropagation();
e.preventDefault();
- const { action } = e.currentTarget.dataset;
+ const { action } = e.currentTarget.dataset || {};
- if (action) {
- const href = e.currentTarget.getAttribute('href');
- this.tabShown(action, href);
- } else if (isMetaClick(e)) {
+ if (isMetaClick(e)) {
const targetLink = e.currentTarget.getAttribute('href');
window.open(targetLink, '_blank');
+ } else if (action) {
+ const href = e.currentTarget.getAttribute('href');
+ this.tabShown(action, href);
}
}
}
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index c357207054b..7535aee83a3 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -78,3 +78,4 @@
= render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render_if_exists 'layouts/snowplow'
+ = render_if_exists 'layouts/pendo' if Feature.enabled?(:pendo_tracking) && !Rails.env.test?
diff --git a/changelogs/unreleased/57813-merge-request-tabs-do-not-handle-ctrl-click-correctly.yml b/changelogs/unreleased/57813-merge-request-tabs-do-not-handle-ctrl-click-correctly.yml
new file mode 100644
index 00000000000..272faa67fcf
--- /dev/null
+++ b/changelogs/unreleased/57813-merge-request-tabs-do-not-handle-ctrl-click-correctly.yml
@@ -0,0 +1,5 @@
+---
+title: Allow command/control click to open link in new tab on Merge Request tabs
+merge_request: 29506
+author:
+type: fixed
diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md
index 7d3f39a8c19..b5296f26269 100644
--- a/doc/ci/variables/where_variables_can_be_used.md
+++ b/doc/ci/variables/where_variables_can_be_used.md
@@ -89,13 +89,14 @@ Supported:
- In `script`, it will work in the following lines of `script`.
- In `after_script`, it will work in following lines of `after_script`.
-Please notice the specific case of `after_script` scripts, that can:
+In the case of `after_script` scripts, they can:
-- Only use variables defined before the script within the same `after_script` section.
+- Only use variables defined before the script within the same `after_script`
+ section.
- Not use variables defined in `before_script` and `script`.
-Both restrictions are caused by the fact, that `after_script` script is executed in a
-[separated shell context](https://docs.gitlab.com/ee/ci/yaml/README.html#before_script-and-after_script).
+These restrictions are because `after_script` scripts are executed in a
+[separated shell context](../yaml/README.md#before_script-and-after_script).
## Persisted variables
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index b3aa1bcfad2..4c170056a49 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -215,20 +215,25 @@ This can be an array or a multi-line string.
`after_script` is used to define the command that will be run after all
jobs, including failed ones. This has to be an array or a multi-line string.
-Script specified in `before_script` is:
+Scripts specified in `before_script` are:
-- Concatenated with script specified in the main `script`. Job-level `before_script` definition
- override global-level `before_script` definition when concatenated with `script` definition.
-- Executed together with main `script` script as one script in a single shell context.
+- Concatenated with scripts specified in the main `script`. Job-level
+ `before_script` definition override global-level `before_script` definition
+ when concatenated with `script` definition.
+- Executed together with main `script` script as one script in a single shell
+ context.
-Script specified in `after_script`:
+Scripts specified in `after_script`:
- Have a current working directory set back to the default.
-- Is executed in a shell context separated from `before_script` and `script` scripts.
-- Because of separated context, cannot see changes done by scripts defined in `before_script` or `script` scripts:
- - in shell - for example, command aliases and variables exported in `script` script,
- - outside of the working tree (depending on the Runner executor) - for example, software installed
- by a `before_script` or `script` script.
+- Are executed in a shell context separated from `before_script` and `script`
+ scripts.
+- Because of separated context, cannot see changes done by scripts defined
+ in `before_script` or `script` scripts, either:
+ - In shell. For example, command aliases and variables exported in `script`
+ scripts.
+ - Outside of the working tree (depending on the Runner executor). For example,
+ software installed by a `before_script` or `script` scripts.
It's possible to overwrite the globally defined `before_script` and `after_script`
if you set it per-job:
diff --git a/doc/user/application_security/dependency_scanning/index.md b/doc/user/application_security/dependency_scanning/index.md
index f3bf743ad03..b220d7197f4 100644
--- a/doc/user/application_security/dependency_scanning/index.md
+++ b/doc/user/application_security/dependency_scanning/index.md
@@ -384,7 +384,7 @@ in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.0.
An additional benefit of Dependency Scanning is the ability to get a list of your project's dependencies with their versions.
-This list can be generated only for [supported languages and package managers](#supported-languages-and-package-managers).
+This list can be generated only for [languages and package managers](#supported-languages-and-package-managers) supported by [Gemnasium](https://gitlab.com/gitlab-org/security-products/gemnasium/general).
To see the generated dependency list, navigate to the Dependency List page under your project's left sidebar menu **Project > Dependency List**.
diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md
index e3d771524ce..35ceb76dc0d 100644
--- a/doc/user/project/repository/reducing_the_repo_size_using_git.md
+++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md
@@ -101,9 +101,9 @@ up its own internal state, maximizing the space saved.
This process will remove some copies of the rewritten commits from GitLab's
cache and database, but there are still numerous gaps in coverage - at present,
-some of the copies may persist indefinitely. [Clearing the instance cache]
-(../../../administration/raketasks/maintenance.md#clear-redis-cache) may help to
-remove some of them, but it should not be depended on for security purposes!
+some of the copies may persist indefinitely. [Clearing the instance cache](../../../administration/raketasks/maintenance.md#clear-redis-cache)
+may help to remove some of them, but it should not be depended on for security
+purposes!
## Using `git filter-branch`
diff --git a/package.json b/package.json
index 9770116b5b2..752f9835fcd 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
"@babel/preset-env": "^7.4.4",
"@gitlab/csslab": "^1.9.0",
"@gitlab/svgs": "^1.65.0",
- "@gitlab/ui": "^4.0.0",
+ "@gitlab/ui": "^4.1.0",
"apollo-cache-inmemory": "^1.5.1",
"apollo-client": "^2.5.1",
"apollo-link": "^1.2.11",
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index 9455e462617..3bae2e08a6f 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -209,6 +209,7 @@ HELM_CMD=$(cat << EOF
--timeout 600 \
--set global.appConfig.enableUsagePing=false \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
+ --set global.imagePullPolicy=Always \
--set global.hosts.hostSuffix="$HOST_SUFFIX" \
--set global.hosts.domain="$REVIEW_APPS_DOMAIN" \
--set certmanager.install=false \
diff --git a/scripts/trigger-build b/scripts/trigger-build
index 9c5fc3c76a5..52bc61cac56 100755
--- a/scripts/trigger-build
+++ b/scripts/trigger-build
@@ -142,6 +142,7 @@ module Trigger
"GITLAB_VERSION" => ENV['CI_COMMIT_REF_NAME'],
"GITLAB_TAG" => ENV['CI_COMMIT_TAG'],
"GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : ENV['CI_COMMIT_REF_SLUG'],
+ "FORCE_RAILS_IMAGE_BUILDS" => 'true',
"#{edition}_PIPELINE" => 'true'
}
end
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js
index 1295d900de7..3a53ecacb88 100644
--- a/spec/javascripts/merge_request_tabs_spec.js
+++ b/spec/javascripts/merge_request_tabs_spec.js
@@ -46,15 +46,30 @@ describe('MergeRequestTabs', function() {
describe('opensInNewTab', function() {
var tabUrl;
var windowTarget = '_blank';
+ let clickTabParams;
beforeEach(function() {
loadFixtures('merge_requests/merge_request_with_task_list.html');
tabUrl = $('.commits-tab a').attr('href');
+
+ clickTabParams = {
+ metaKey: false,
+ ctrlKey: false,
+ which: 1,
+ stopImmediatePropagation: function() {},
+ preventDefault: function() {},
+ currentTarget: {
+ getAttribute: function(attr) {
+ return attr === 'href' ? tabUrl : null;
+ },
+ },
+ };
});
describe('meta click', () => {
let metakeyEvent;
+
beforeEach(function() {
metakeyEvent = $.Event('click', { keyCode: 91, ctrlKey: true });
});
@@ -67,6 +82,8 @@ describe('MergeRequestTabs', function() {
this.class.bindEvents();
$('.merge-request-tabs .commits-tab a').trigger(metakeyEvent);
+
+ expect(window.open).toHaveBeenCalled();
});
it('opens page when commits badge is clicked', function() {
@@ -77,6 +94,8 @@ describe('MergeRequestTabs', function() {
this.class.bindEvents();
$('.merge-request-tabs .commits-tab a .badge').trigger(metakeyEvent);
+
+ expect(window.open).toHaveBeenCalled();
});
});
@@ -86,12 +105,9 @@ describe('MergeRequestTabs', function() {
expect(name).toEqual(windowTarget);
});
- this.class.clickTab({
- metaKey: false,
- ctrlKey: true,
- which: 1,
- stopImmediatePropagation: function() {},
- });
+ this.class.clickTab({ ...clickTabParams, metaKey: true });
+
+ expect(window.open).toHaveBeenCalled();
});
it('opens page tab in a new browser tab with Cmd+Click - Mac', function() {
@@ -100,12 +116,9 @@ describe('MergeRequestTabs', function() {
expect(name).toEqual(windowTarget);
});
- this.class.clickTab({
- metaKey: true,
- ctrlKey: false,
- which: 1,
- stopImmediatePropagation: function() {},
- });
+ this.class.clickTab({ ...clickTabParams, ctrlKey: true });
+
+ expect(window.open).toHaveBeenCalled();
});
it('opens page tab in a new browser tab with Middle-click - Mac/PC', function() {
@@ -114,12 +127,9 @@ describe('MergeRequestTabs', function() {
expect(name).toEqual(windowTarget);
});
- this.class.clickTab({
- metaKey: false,
- ctrlKey: false,
- which: 2,
- stopImmediatePropagation: function() {},
- });
+ this.class.clickTab({ ...clickTabParams, which: 2 });
+
+ expect(window.open).toHaveBeenCalled();
});
});
diff --git a/yarn.lock b/yarn.lock
index 5daff8ba49d..0b24bfff95a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -705,10 +705,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.65.0.tgz#48a3a64c0b5524de4e57d51b82a71274af17744d"
integrity sha512-GC9JgVu4/2Ysc3hKFmX6TQV6tqvHZDcfd/DzBzYjy3rHO9qYMZFnw/CKCGa8LkU9F79vfDo3G8NSja7FDXMccw==
-"@gitlab/ui@^4.0.0":
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-4.0.0.tgz#998a94d4ff91c5baa68d0591763e467a18293081"
- integrity sha512-Z8T3xK3EV1eC2eBmnuO/cvcuLfH5TskGJsc2Hdxar+iUVxACbzs3bfjpFjslVHCCGzSRnewZCoRPO7GJO3miIg==
+"@gitlab/ui@^4.1.0":
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-4.1.0.tgz#bc80ba7846862a336b9f285c42c3fd0f29147c82"
+ integrity sha512-YVIOVtKSjuhQX3ZWA1DBT75Q9rMPvpJIVko5X3yzfRSc9KsPSgVRiOKieDtAviO7LLaeTxMZNzT4J3oY7ejGCw==
dependencies:
"@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.2.1"