diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 18:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 18:10:07 +0300 |
commit | b21276806d34b8cc0ec7ac7854ec62f70d408b3c (patch) | |
tree | 128fb345bb3d656e4ee862355df4ff2f4274317c /app | |
parent | a84766a28a87c0342c6b048f5ea2eab2f3216fcf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
6 files changed, 40 insertions, 9 deletions
diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue index 09ac60c94c7..5b4589f9884 100644 --- a/app/assets/javascripts/repository/components/blob_content_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue @@ -8,6 +8,7 @@ import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { isLoggedIn } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; +import getRefMixin from '../mixins/get_ref'; import blobInfoQuery from '../queries/blob_info.query.graphql'; import BlobButtonGroup from './blob_button_group.vue'; import BlobEdit from './blob_edit.vue'; @@ -21,6 +22,12 @@ export default { BlobContent, GlLoadingIcon, }, + mixins: [getRefMixin], + inject: { + originalBranch: { + default: '', + }, + }, apollo: { project: { query: blobInfoQuery, @@ -28,6 +35,7 @@ export default { return { projectPath: this.projectPath, filePath: this.path, + ref: this.originalBranch || this.ref, }; }, result() { diff --git a/app/assets/javascripts/repository/queries/blob_info.query.graphql b/app/assets/javascripts/repository/queries/blob_info.query.graphql index a8f263941e2..4dba6869194 100644 --- a/app/assets/javascripts/repository/queries/blob_info.query.graphql +++ b/app/assets/javascripts/repository/queries/blob_info.query.graphql @@ -1,11 +1,11 @@ -query getBlobInfo($projectPath: ID!, $filePath: String!) { +query getBlobInfo($projectPath: ID!, $filePath: String!, $ref: String!) { project(fullPath: $projectPath) { userPermissions { pushCode } repository { empty - blobs(paths: [$filePath]) { + blobs(paths: [$filePath], ref: $ref) { nodes { webPath name diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index a7140cc0718..02ebcfa7c0a 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -30,7 +30,7 @@ class ApplicationSetting < ApplicationRecord def self.kroki_formats_attributes { blockdiag: { - label: 'BlockDiag (includes BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag and RackDiag)' + label: 'BlockDiag (includes BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, and RackDiag)' }, bpmn: { label: 'BPMN' diff --git a/app/services/projects/overwrite_project_service.rb b/app/services/projects/overwrite_project_service.rb index 6be3b1b5a6f..f35370c427f 100644 --- a/app/services/projects/overwrite_project_service.rb +++ b/app/services/projects/overwrite_project_service.rb @@ -5,6 +5,8 @@ module Projects def execute(source_project) return unless source_project && source_project.namespace == @project.namespace + start_time = ::Gitlab::Metrics::System.monotonic_time + Project.transaction do move_before_destroy_relationships(source_project) # Reset is required in order to get the proper @@ -25,10 +27,25 @@ module Projects else raise end + + ensure + track_service(start_time, source_project, e) end private + def track_service(start_time, source_project, exception) + return if ::Feature.disabled?(:project_overwrite_service_tracking, source_project, default_enabled: :yaml) + + duration = ::Gitlab::Metrics::System.monotonic_time - start_time + + Gitlab::AppJsonLogger.info(class: self.class.name, + namespace_id: source_project.namespace.id, + project_id: source_project.id, + duration_s: duration.to_f, + error: exception.class.name) + end + def move_before_destroy_relationships(source_project) options = { remove_remaining_elements: false } diff --git a/app/views/admin/application_settings/_kroki.html.haml b/app/views/admin/application_settings/_kroki.html.haml index b9da2047453..b22eef83876 100644 --- a/app/views/admin/application_settings/_kroki.html.haml +++ b/app/views/admin/application_settings/_kroki.html.haml @@ -6,7 +6,8 @@ %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' } = expanded ? _('Collapse') : _('Expand') %p - = _('Allow rendering of diagrams in AsciiDoc and Markdown documents using %{link}.').html_safe % { link: link_to('Kroki', 'https://kroki.io', target: '_blank') } + = _('Users can render diagrams in AsciiDoc, Markdown, reStructuredText, and Textile documents using Kroki.') + = link_to _('Learn more.'), help_page_path('administration/integration/kroki.md'), target: '_blank', rel: 'noopener noreferrer' .settings-content = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-kroki-settings'), html: { class: 'fieldset-form', id: 'kroki-settings' } do |f| = form_errors(@application_setting) if expanded @@ -20,11 +21,15 @@ = f.label :kroki_url, 'Kroki URL', class: 'label-bold' = f.text_field :kroki_url, class: 'form-control gl-form-input', placeholder: 'http://your-kroki-instance:8000' .form-text.text-muted - = (_('When Kroki is enabled, GitLab sends diagrams to an instance of Kroki to display them as images. You can use the free public cloud instance %{kroki_public_url} or you can %{install_link} on your own infrastructure. Once you\'ve installed Kroki, make sure to update the server URL to point to your instance.') % { kroki_public_url: '<code>https://kroki.io</code>', install_link: link_to('install Kroki', 'https://docs.kroki.io/kroki/setup/install/', target: '_blank') }).html_safe + - install_link_url = 'https://docs.kroki.io/kroki/setup/install/' + - install_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: install_link_url } + = html_escape(_('Use the public cloud instance URL (%{kroki_public_url}) or %{install_link_start}install Kroki%{install_link_end} on your own infrastructure and use your own instance URL.')) % { kroki_public_url: '<code>https://kroki.io</code>'.html_safe, install_link_start: install_link_start, install_link_end: '</a>'.html_safe } .form-group = f.label :kroki_formats, 'Additional diagram formats', class: 'label-bold' .form-text.text-muted - = (_('Using additional formats requires starting the companion containers. Make sure that all %{kroki_images} are running.') % { kroki_images: link_to('required containers', 'https://docs.kroki.io/kroki/setup/install/#_images', target: '_blank') }).html_safe + - container_link_url = 'https://docs.kroki.io/kroki/setup/install/#images' + - container_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: container_link_url } + = html_escape(_('To use the additional formats, you must start the required %{container_link_start}companion containers%{container_link_end}.')) % { container_link_start: container_link_start, container_link_end: '</a>'.html_safe } - kroki_available_formats.each do |format| .form-check = f.check_box format[:name], class: 'form-check-input' diff --git a/app/views/jira_connect/subscriptions/index.html.haml b/app/views/jira_connect/subscriptions/index.html.haml index 43672551caf..cbe9a860210 100644 --- a/app/views/jira_connect/subscriptions/index.html.haml +++ b/app/views/jira_connect/subscriptions/index.html.haml @@ -24,9 +24,10 @@ %p.jira-connect-app-body.gl-px-5.gl-mt-7.gl-font-base.gl-text-center %strong= s_('Integrations|Browser limitations') - - firefox_link_url = 'https://www.mozilla.org/en-US/firefox/' - - firefox_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: firefox_link_url } - = s_('Integrations|Adding a namespace works only in browsers that allow cross‑site cookies. Use %{firefox_link_start}Firefox%{firefox_link_end}, or enable cross‑site cookies in your browser, when adding a namespace.').html_safe % { firefox_link_start: firefox_link_start, firefox_link_end: '</a>'.html_safe } + - browser_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">' + - firefox_link_start = browser_link_start.html_safe % { url: 'https://www.mozilla.org/en-US/firefox/' } + - chrome_link_start = browser_link_start.html_safe % { url: 'https://www.google.com/chrome/' } + = s_('Integrations|Adding a namespace works only in browsers that allow cross‑site cookies. Use %{firefox_link_start}Firefox%{link_end}, %{chrome_link_start}Google Chrome%{link_end}, or enable cross‑site cookies in your browser, when adding a namespace.').html_safe % { firefox_link_start: firefox_link_start, chrome_link_start: chrome_link_start, link_end: '</a>'.html_safe } = link_to _('Learn more'), 'https://gitlab.com/gitlab-org/gitlab/-/issues/284211', target: '_blank', rel: 'noopener noreferrer' = webpack_bundle_tag 'performance_bar' if performance_bar_enabled? |