diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 00:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 00:09:21 +0300 |
commit | 87af6f2e0590af0ed1bb3e5de1bb5d21855a94d2 (patch) | |
tree | 2abe2661b10cf6281bc03855b3053a072c64fbbf /app | |
parent | c43ba2677f41ad0b5fc6f3af6baf4266c70dfcb3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
10 files changed, 32 insertions, 27 deletions
diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue index 59c5586edcd..aefb31fe3d5 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue @@ -1,6 +1,6 @@ <script> import { createNamespacedHelpers, mapState, mapActions } from 'vuex'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { GlFormInput, GlFormCheckbox } from '@gitlab/ui'; import { sprintf, s__ } from '~/locale'; import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue'; @@ -133,7 +133,7 @@ export default { : s__('ClusterIntegration|Create Kubernetes cluster'); }, kubernetesIntegrationHelpText() { - const escapedUrl = _.escape(this.kubernetesIntegrationHelpPath); + const escapedUrl = esc(this.kubernetesIntegrationHelpPath); return sprintf( s__( @@ -245,7 +245,7 @@ export default { ); }, gitlabManagedHelpText() { - const escapedUrl = _.escape(this.gitlabManagedClusterHelpPath); + const escapedUrl = esc(this.gitlabManagedClusterHelpPath); return sprintf( s__( diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue index 0cfe47dafaf..47cc4e4ce67 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue @@ -1,6 +1,6 @@ <script> import { GlFormInput } from '@gitlab/ui'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { mapState, mapActions } from 'vuex'; import { sprintf, s__, __ } from '~/locale'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; @@ -42,7 +42,7 @@ export default { : s__('ClusterIntegration|Authenticate with AWS'); }, accountAndExternalIdsHelpText() { - const escapedUrl = _.escape(this.accountAndExternalIdsHelpPath); + const escapedUrl = esc(this.accountAndExternalIdsHelpPath); return sprintf( s__( @@ -59,7 +59,7 @@ export default { ); }, provisionRoleArnHelpText() { - const escapedUrl = _.escape(this.createRoleArnHelpPath); + const escapedUrl = esc(this.createRoleArnHelpPath); return sprintf( s__( diff --git a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_dropdown_mixin.js b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_dropdown_mixin.js index 43fd0cac3be..3b91ce63744 100644 --- a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_dropdown_mixin.js +++ b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_dropdown_mixin.js @@ -1,4 +1,3 @@ -import _ from 'underscore'; import { GlLoadingIcon } from '@gitlab/ui'; import DropdownSearchInput from '~/vue_shared/components/dropdown/dropdown_search_input.vue'; import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue'; @@ -49,7 +48,7 @@ export default { methods: { fetchSuccessHandler() { if (this.defaultValue) { - const itemToSelect = _.find(this.items, item => item.name === this.defaultValue); + const itemToSelect = this.items.find(item => item.name === this.defaultValue); if (itemToSelect) { this.setItem(itemToSelect.name); diff --git a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue index 6815d3629e3..6d8e6bbac11 100644 --- a/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue +++ b/app/assets/javascripts/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { mapState, mapGetters, mapActions } from 'vuex'; import { s__, sprintf } from '~/locale'; @@ -65,7 +65,7 @@ export default { s__(message), { docsLinkEnd: ' <i class="fa fa-external-link" aria-hidden="true"></i></a>', - docsLinkStart: `<a href="${_.escape( + docsLinkStart: `<a href="${esc( this.docsUrl, )}" target="_blank" rel="noopener noreferrer">`, }, @@ -119,7 +119,7 @@ export default { ...mapActions({ setItem: 'setProject' }), fetchSuccessHandler() { if (this.defaultValue) { - const projectToSelect = _.find(this.items, item => item.projectId === this.defaultValue); + const projectToSelect = this.items.find(item => item.projectId === this.defaultValue); if (projectToSelect) { this.setItem(projectToSelect); diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb index 1149b168383..e9554300075 100644 --- a/app/helpers/submodule_helper.rb +++ b/app/helpers/submodule_helper.rb @@ -38,6 +38,8 @@ module SubmoduleHelper url_helpers.namespace_project_tree_path(namespace, project, submodule_item_id)] elsif relative_self_url?(url) relative_self_links(url, submodule_item_id, repository.project) + elsif gist_github_dot_com_url?(url) + gist_github_com_tree_links(namespace, project, submodule_item_id) elsif github_dot_com_url?(url) github_com_tree_links(namespace, project, submodule_item_id) elsif gitlab_dot_com_url?(url) @@ -52,6 +54,10 @@ module SubmoduleHelper protected + def gist_github_dot_com_url?(url) + url =~ %r{gist\.github\.com[/:][^/]+/[^/]+\Z} + end + def github_dot_com_url?(url) url =~ %r{github\.com[/:][^/]+/[^/]+\Z} end @@ -78,6 +84,11 @@ module SubmoduleHelper [base, [base, '/-/tree/', commit].join('')] end + def gist_github_com_tree_links(namespace, project, commit) + base = ['https://gist.github.com/', namespace, '/', project].join('') + [base, [base, commit].join('/')] + end + def github_com_tree_links(namespace, project, commit) base = ['https://github.com/', namespace, '/', project].join('') [base, [base, '/tree/', commit].join('')] diff --git a/app/models/ability.rb b/app/models/ability.rb index 671a92632d5..514e923c380 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -44,7 +44,7 @@ class Ability # Returns an Array of MergeRequests that can be read by the given user. # - # merge_requests - MRs out of which to collect mr's readable by the user. + # merge_requests - MRs out of which to collect MRs readable by the user. # user - The User for which to check the merge_requests # filters - A hash of abilities and filters to apply if the user lacks this # ability diff --git a/app/services/commits/cherry_pick_service.rb b/app/services/commits/cherry_pick_service.rb index 91a18909e22..7e982bf7686 100644 --- a/app/services/commits/cherry_pick_service.rb +++ b/app/services/commits/cherry_pick_service.rb @@ -11,8 +11,6 @@ module Commits private def track_mr_picking(pick_sha) - return unless Feature.enabled?(:track_mr_picking, project) - merge_request = project.merge_requests.by_merge_commit_sha(@commit.sha).first return unless merge_request diff --git a/app/services/deployments/link_merge_requests_service.rb b/app/services/deployments/link_merge_requests_service.rb index 67a2230350d..eba5082e6c3 100644 --- a/app/services/deployments/link_merge_requests_service.rb +++ b/app/services/deployments/link_merge_requests_service.rb @@ -38,8 +38,6 @@ module Deployments .commits_between(from, to) .map(&:id) - track_mr_picking = Feature.enabled?(:track_mr_picking, project) - # For some projects the list of commits to deploy may be very large. To # ensure we do not end up running SQL queries with thousands of WHERE IN # values, we run one query per a certain number of commits. @@ -53,8 +51,6 @@ module Deployments deployment.link_merge_requests(merge_requests) - next unless track_mr_picking - picked_merge_requests = project.merge_requests.by_cherry_pick_sha(slice) diff --git a/app/services/system_notes/merge_requests_service.rb b/app/services/system_notes/merge_requests_service.rb index a26fc0f7d35..baf26245eb9 100644 --- a/app/services/system_notes/merge_requests_service.rb +++ b/app/services/system_notes/merge_requests_service.rb @@ -143,7 +143,7 @@ module SystemNotes def picked_into_branch(branch_name, pick_commit) link = url_helpers.project_tree_path(project, branch_name) - body = "picked this merge request into branch [`#{branch_name}`](#{link}) with commit #{pick_commit}" + body = "picked the changes into the branch [`#{branch_name}`](#{link}) with commit #{pick_commit}" summary = NoteSummary.new(noteable, project, author, body, action: 'cherry_pick') summary.note[:commit_id] = pick_commit diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml index 17ef5327341..fbfd4d0e9a9 100644 --- a/app/views/shared/_no_ssh.html.haml +++ b/app/views/shared/_no_ssh.html.haml @@ -1,9 +1,10 @@ - if show_no_ssh_key_message? - .no-ssh-key-message.alert.alert-warning - - add_ssh_key_link = link_to s_('MissingSSHKeyWarningLink|add an SSH key'), profile_keys_path, class: 'alert-link' - - ssh_message = _("You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile") % { add_ssh_key_link: add_ssh_key_link } - = ssh_message.html_safe - .alert-link-group - = link_to _("Don't show again"), profile_path(user: {hide_no_ssh_key: true}), method: :put, class: 'alert-link' - | - = link_to _('Remind later'), '#', class: 'hide-no-ssh-message alert-link' + %div{ class: 'no-ssh-key-message gl-alert gl-alert-warning', role: 'alert' } + = sprite_icon('warning', size: 16, css_class: 'gl-icon s16 gl-alert-icon gl-alert-icon-no-title') + %button{ class: 'gl-alert-dismiss hide-no-ssh-message', type: 'button', 'aria-label': 'Dismiss' } + = sprite_icon('close', size: 16, css_class: 'gl-icon s16') + .gl-alert-body + = s_("MissingSSHKeyWarningLink|You won't be able to pull or push project code via SSH until you add an SSH key to your profile").html_safe + .gl-alert-actions + = link_to s_('MissingSSHKeyWarningLink|Add SSH key'), profile_keys_path, class: "btn gl-alert-action btn-warning btn-md new-gl-button" + = link_to s_("MissingSSHKeyWarningLink|Don't show again"), profile_path(user: {hide_no_ssh_key: true}), method: :put, role: 'button', class: 'btn gl-alert-action btn-md btn-warning btn-secondary new-gl-button' |