diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/assets/javascripts/blob | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/assets/javascripts/blob')
4 files changed, 19 insertions, 31 deletions
diff --git a/app/assets/javascripts/blob/components/blob_content.vue b/app/assets/javascripts/blob/components/blob_content.vue index f5f06436bcc..60729c11002 100644 --- a/app/assets/javascripts/blob/components/blob_content.vue +++ b/app/assets/javascripts/blob/components/blob_content.vue @@ -6,6 +6,7 @@ import BlobContentError from './blob_content_error.vue'; import { BLOB_RENDER_EVENT_LOAD, BLOB_RENDER_EVENT_SHOW_SOURCE } from './constants'; export default { + name: 'BlobContent', components: { GlLoadingIcon, BlobContentError, diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index 77910850908..59ab84bf208 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -7,7 +7,6 @@ import toast from '~/vue_shared/plugins/global_toast'; import { deprecatedCreateFlash as Flash } from '../flash'; -import BlobCiSyntaxYamlSelector from './template_selectors/ci_syntax_yaml_selector'; import BlobCiYamlSelector from './template_selectors/ci_yaml_selector'; import DockerfileSelector from './template_selectors/dockerfile_selector'; import GitignoreSelector from './template_selectors/gitignore_selector'; @@ -34,7 +33,6 @@ export default class FileTemplateMediator { this.templateSelectors = [ GitignoreSelector, BlobCiYamlSelector, - BlobCiSyntaxYamlSelector, MetricsDashboardSelector, DockerfileSelector, LicenseSelector, diff --git a/app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js b/app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js deleted file mode 100644 index c30ff4f1290..00000000000 --- a/app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js +++ /dev/null @@ -1,29 +0,0 @@ -import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown'; -import FileTemplateSelector from '../file_template_selector'; - -export default class BlobCiSyntaxYamlSelector extends FileTemplateSelector { - constructor({ mediator }) { - super(mediator); - this.config = { - key: 'gitlab-ci-yaml', - name: '.gitlab-ci.yml', - pattern: /(.gitlab-ci.yml)/, - type: 'gitlab_ci_syntax_ymls', - dropdown: '.js-gitlab-ci-syntax-yml-selector', - wrapper: '.js-gitlab-ci-syntax-yml-selector-wrap', - }; - } - - initDropdown() { - initDeprecatedJQueryDropdown(this.$dropdown, { - data: this.$dropdown.data('data'), - filterable: true, - selectable: true, - search: { - fields: ['name'], - }, - clicked: (options) => this.reportSelectionName(options), - text: (item) => item.name, - }); - } -} diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js index 4741152afce..22c6b31143f 100644 --- a/app/assets/javascripts/blob/viewer/index.js +++ b/app/assets/javascripts/blob/viewer/index.js @@ -1,6 +1,12 @@ import $ from 'jquery'; import '~/behaviors/markdown/render_gfm'; import { __ } from '~/locale'; +import { + REPO_BLOB_LOAD_VIEWER_START, + REPO_BLOB_LOAD_VIEWER_FINISH, + REPO_BLOB_LOAD_VIEWER, +} from '~/performance/constants'; +import { performanceMarkAndMeasure } from '~/performance/utils'; import { fixTitle } from '~/tooltips'; import { deprecatedCreateFlash as Flash } from '../../flash'; import axios from '../../lib/utils/axios_utils'; @@ -130,6 +136,9 @@ export default class BlobViewer { } switchToViewer(name) { + performanceMarkAndMeasure({ + mark: REPO_BLOB_LOAD_VIEWER_START, + }); const newViewer = this.$fileHolder[0].querySelector(`.blob-viewer[data-type='${name}']`); if (this.activeViewer === newViewer) return; @@ -163,6 +172,15 @@ export default class BlobViewer { handleLocationHash(); this.toggleCopyButtonState(); + performanceMarkAndMeasure({ + mark: REPO_BLOB_LOAD_VIEWER_FINISH, + measures: [ + { + name: REPO_BLOB_LOAD_VIEWER, + start: REPO_BLOB_LOAD_VIEWER_START, + }, + ], + }); }) .catch(() => new Flash(__('Error loading viewer'))); } |