diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-05 18:09:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-05 18:09:49 +0000 |
commit | f9d0e8961132dce481c3eec0a7f87a534e60cb4b (patch) | |
tree | 5cd80530b8e1ceefb1025daf0acc518d8f28f29f /app | |
parent | 71da5de44f7e30be58ff1563d3d8de697e0d20c0 (diff) | |
download | gitlab-ce-f9d0e8961132dce481c3eec0a7f87a534e60cb4b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
7 files changed, 39 insertions, 2 deletions
diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index d2c0ef330e4..c9051338972 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -7,6 +7,7 @@ import BlobCiYamlSelector from './template_selectors/ci_yaml_selector'; import DockerfileSelector from './template_selectors/dockerfile_selector'; import GitignoreSelector from './template_selectors/gitignore_selector'; import LicenseSelector from './template_selectors/license_selector'; +import MetricsDashboardSelector from './template_selectors/metrics_dashboard_selector'; import toast from '~/vue_shared/plugins/global_toast'; import { __ } from '~/locale'; import initPopover from '~/blob/suggest_gitlab_ci_yml'; @@ -30,6 +31,7 @@ export default class FileTemplateMediator { this.templateSelectors = [ GitignoreSelector, BlobCiYamlSelector, + MetricsDashboardSelector, DockerfileSelector, LicenseSelector, ].map(TemplateSelectorClass => new TemplateSelectorClass({ mediator: this })); diff --git a/app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js b/app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js new file mode 100644 index 00000000000..b4accaadfa3 --- /dev/null +++ b/app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js @@ -0,0 +1,28 @@ +import FileTemplateSelector from '../file_template_selector'; + +export default class MetricsDashboardSelector extends FileTemplateSelector { + constructor({ mediator }) { + super(mediator); + this.config = { + key: 'metrics-dashboard-yaml', + name: '.metrics-dashboard.yml', + pattern: /(.metrics-dashboard.yml)/, + type: 'metrics_dashboard_ymls', + dropdown: '.js-metrics-dashboard-selector', + wrapper: '.js-metrics-dashboard-selector-wrap', + }; + } + + initDropdown() { + this.$dropdown.glDropdown({ + 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/ci_variable_list/components/ci_variable_modal.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue index c3b0e00ca38..14c71f73291 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue @@ -210,6 +210,7 @@ export default { v-model="key" :token-list="$options.tokenList" :label-text="__('Key')" + data-qa-selector="ci_variable_key_field" /> <gl-form-group v-else :label="__('Key')" label-for="ci-variable-key"> diff --git a/app/assets/javascripts/monitoring/components/dashboard_header.vue b/app/assets/javascripts/monitoring/components/dashboard_header.vue index 7ac35809b99..6fbf2084911 100644 --- a/app/assets/javascripts/monitoring/components/dashboard_header.vue +++ b/app/assets/javascripts/monitoring/components/dashboard_header.vue @@ -407,6 +407,7 @@ export default { right class="gl-flex-grow-1" data-testid="actions-menu" + data-qa-selector="actions_menu_dropdown" :title="s__('Metrics|Create dashboard')" :icon="'plus-square'" > diff --git a/app/assets/stylesheets/pages/editor.scss b/app/assets/stylesheets/pages/editor.scss index cc826bb6c21..1c88883142d 100644 --- a/app/assets/stylesheets/pages/editor.scss +++ b/app/assets/stylesheets/pages/editor.scss @@ -187,7 +187,8 @@ .gitignore-selector, .gitlab-ci-yml-selector, .dockerfile-selector, - .template-type-selector { + .template-type-selector, + .metrics-dashboard-selector { display: inline-block; vertical-align: top; font-family: $regular_font; diff --git a/app/presenters/packages/detail/package_presenter.rb b/app/presenters/packages/detail/package_presenter.rb index 4d9b3f294ed..631ee173188 100644 --- a/app/presenters/packages/detail/package_presenter.rb +++ b/app/presenters/packages/detail/package_presenter.rb @@ -50,7 +50,9 @@ module Packages user: build_user_info(pipeline_info.user), project: { name: pipeline_info.project.name, - web_url: pipeline_info.project.web_url + web_url: pipeline_info.project.web_url, + pipeline_url: Gitlab::Routing.url_helpers.project_pipeline_url(pipeline_info.project, pipeline_info), + commit_url: Gitlab::Routing.url_helpers.project_commit_url(pipeline_info.project, pipeline_info.sha) } } end diff --git a/app/views/projects/blob/_template_selectors.html.haml b/app/views/projects/blob/_template_selectors.html.haml index ba8029ac32a..2aefcdc5762 100644 --- a/app/views/projects/blob/_template_selectors.html.haml +++ b/app/views/projects/blob/_template_selectors.html.haml @@ -7,6 +7,8 @@ = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-license-selector qa-license-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: licenses_for_select(@project), project: @project.name, fullname: @project.namespace.human_name } } ) .gitignore-selector.js-gitignore-selector-wrap.js-template-selector-wrap.hidden = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitignore-selector qa-gitignore-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitignore_names(@project) } } ) + .metrics-dashboard-selector.js-metrics-dashboard-selector-wrap.js-template-selector-wrap.hidden + = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-metrics-dashboard-selector qa-metrics-dashboard-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: metrics_dashboard_ymls(@project) } } ) #gitlab-ci-yml-selector.gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.js-template-selector-wrap.hidden = dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitlab-ci-yml-selector qa-gitlab-ci-yml-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls(@project) } } ) .dockerfile-selector.js-dockerfile-selector-wrap.js-template-selector-wrap.hidden |