diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-23 18:07:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-23 18:07:50 +0300 |
commit | 676430584d388c5c1a59eec8ab0910ded09c1995 (patch) | |
tree | 58125a10ad92344b802424de7e6c33cfc59881cb /app/assets/javascripts/pipeline_editor | |
parent | 71355c5f36964482ae303c906505dc7138e2c7d7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
4 files changed, 52 insertions, 1 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/editor/ci_editor_header.vue b/app/assets/javascripts/pipeline_editor/components/editor/ci_editor_header.vue new file mode 100644 index 00000000000..b4e9ab81d38 --- /dev/null +++ b/app/assets/javascripts/pipeline_editor/components/editor/ci_editor_header.vue @@ -0,0 +1,38 @@ +<script> +import { GlButton } from '@gitlab/ui'; +import { __ } from '~/locale'; +import Tracking from '~/tracking'; +import { pipelineEditorTrackingOptions, TEMPLATE_REPOSITORY_URL } from '../../constants'; + +export default { + i18n: { + browseTemplates: __('Browse templates'), + }, + TEMPLATE_REPOSITORY_URL, + components: { + GlButton, + }, + mixins: [Tracking.mixin()], + methods: { + trackTemplateBrowsing() { + const { label, actions } = pipelineEditorTrackingOptions; + + this.track(actions.browse_templates, { label }); + }, + }, +}; +</script> + +<template> + <div class="gl-bg-gray-10 gl-p-3 gl-border-solid gl-border-gray-100 gl-border-1"> + <gl-button + :href="$options.TEMPLATE_REPOSITORY_URL" + size="small" + icon="external-link" + target="_blank" + @click="trackTemplateBrowsing" + > + {{ $options.i18n.browseTemplates }} + </gl-button> + </div> +</template> diff --git a/app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue b/app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue index 932f8b41b38..77ede396496 100644 --- a/app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue +++ b/app/assets/javascripts/pipeline_editor/components/editor/text_editor.vue @@ -43,7 +43,7 @@ export default { }; </script> <template> - <div class="gl-border-solid gl-border-gray-100 gl-border-1"> + <div class="gl-border-solid gl-border-gray-100 gl-border-1 gl-border-t-none!"> <source-editor ref="editor" :file-name="ciConfigPath" diff --git a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue index c3dcc00af6e..e463fcf379d 100644 --- a/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue +++ b/app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue @@ -16,6 +16,7 @@ import { } from '../constants'; import getAppStatus from '../graphql/queries/client/app_status.graphql'; import CiConfigMergedPreview from './editor/ci_config_merged_preview.vue'; +import CiEditorHeader from './editor/ci_editor_header.vue'; import TextEditor from './editor/text_editor.vue'; import CiLint from './lint/ci_lint.vue'; import EditorTab from './ui/editor_tab.vue'; @@ -49,6 +50,7 @@ export default { }, components: { CiConfigMergedPreview, + CiEditorHeader, CiLint, EditorTab, GlAlert, @@ -107,6 +109,7 @@ export default { data-testid="editor-tab" @click="setCurrentTab($options.tabConstants.CREATE_TAB)" > + <ci-editor-header /> <text-editor :value="ciFileContent" v-on="$listeners" /> </editor-tab> <editor-tab diff --git a/app/assets/javascripts/pipeline_editor/constants.js b/app/assets/javascripts/pipeline_editor/constants.js index 1467abd7289..d05b06d16db 100644 --- a/app/assets/javascripts/pipeline_editor/constants.js +++ b/app/assets/javascripts/pipeline_editor/constants.js @@ -33,3 +33,13 @@ export const BRANCH_PAGINATION_LIMIT = 20; export const BRANCH_SEARCH_DEBOUNCE = '500'; export const STARTER_TEMPLATE_NAME = 'Getting-Started'; + +export const pipelineEditorTrackingOptions = { + label: 'pipeline_editor', + actions: { + browse_templates: 'browse_templates', + }, +}; + +export const TEMPLATE_REPOSITORY_URL = + 'https://gitlab.com/gitlab-org/gitlab-foss/tree/master/lib/gitlab/ci/templates'; |