diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/assets/javascripts/vue_shared/components/web_ide_link.vue | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/web_ide_link.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/web_ide_link.vue | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/web_ide_link.vue b/app/assets/javascripts/vue_shared/components/web_ide_link.vue index 82022d1f4d6..199516b3eb3 100644 --- a/app/assets/javascripts/vue_shared/components/web_ide_link.vue +++ b/app/assets/javascripts/vue_shared/components/web_ide_link.vue @@ -8,6 +8,7 @@ import ConfirmForkModal from '~/vue_shared/components/confirm_fork_modal.vue'; const KEY_EDIT = 'edit'; const KEY_WEB_IDE = 'webide'; const KEY_GITPOD = 'gitpod'; +const KEY_PIPELINE_EDITOR = 'pipeline_editor'; export default { components: { @@ -64,6 +65,11 @@ export default { required: false, default: false, }, + showPipelineEditorButton: { + type: Boolean, + required: false, + default: false, + }, userPreferencesGitpodPath: { type: String, required: false, @@ -79,6 +85,11 @@ export default { required: false, default: '', }, + pipelineEditorUrl: { + type: String, + required: false, + default: '', + }, webIdeUrl: { type: String, required: false, @@ -117,14 +128,19 @@ export default { }, data() { return { - selection: KEY_WEB_IDE, + selection: this.showPipelineEditorButton ? KEY_PIPELINE_EDITOR : KEY_WEB_IDE, showEnableGitpodModal: false, showForkModal: false, }; }, computed: { actions() { - return [this.webIdeAction, this.editAction, this.gitpodAction].filter((action) => action); + return [ + this.pipelineEditorAction, + this.webIdeAction, + this.editAction, + this.gitpodAction, + ].filter((action) => action); }, editAction() { if (!this.showEditButton) { @@ -162,7 +178,7 @@ export default { if (this.webIdeText) { return this.webIdeText; } else if (this.isBlob) { - return __('Edit in Web IDE'); + return __('Open in Web IDE'); } else if (this.isFork) { return __('Edit fork in Web IDE'); } @@ -202,6 +218,9 @@ export default { }; }, gitpodActionText() { + if (this.isBlob) { + return __('Open in Gitpod'); + } return this.gitpodText || __('Gitpod'); }, computedShowGitpodButton() { @@ -209,11 +228,28 @@ export default { this.showGitpodButton && this.userPreferencesGitpodPath && this.userProfileEnableGitpodPath ); }, + pipelineEditorAction() { + if (!this.showPipelineEditorButton) { + return null; + } + + const secondaryText = __('Edit, lint, and visualize your pipeline.'); + + return { + key: KEY_PIPELINE_EDITOR, + text: __('Edit in pipeline editor'), + secondaryText, + tooltip: secondaryText, + attrs: { + 'data-qa-selector': 'pipeline_editor_button', + }, + href: this.pipelineEditorUrl, + }; + }, gitpodAction() { if (!this.computedShowGitpodButton) { return null; } - const handleOptions = this.gitpodEnabled ? { href: this.gitpodUrl } : { |