diff --git a/app/assets/javascripts/vue_shared/components/code_dropdown/code_dropdown.vue b/app/assets/javascripts/vue_shared/components/code_dropdown/code_dropdown.vue index 96a04d5c532..ac2b9744fe1 100644 --- a/app/assets/javascripts/vue_shared/components/code_dropdown/code_dropdown.vue +++ b/app/assets/javascripts/vue_shared/components/code_dropdown/code_dropdown.vue @@ -61,22 +61,37 @@ export default { Boolean(this.sshUrl) && { text: __('Visual Studio Code (SSH)'), href: `${this.$options.vsCodeBaseUrl}${this.sshUrlEncoded}`, + extraAttrs: { + isUnsafeLink: true, + }, }, Boolean(this.httpUrl) && { text: __('Visual Studio Code (HTTPS)'), href: `${this.$options.vsCodeBaseUrl}${this.httpUrlEncoded}`, + extraAttrs: { + isUnsafeLink: true, + }, }, Boolean(this.sshUrl) && { text: __('IntelliJ IDEA (SSH)'), href: `${this.$options.jetBrainsBaseUrl}${this.sshUrlEncoded}`, + extraAttrs: { + isUnsafeLink: true, + }, }, Boolean(this.httpUrl) && { text: __('IntelliJ IDEA (HTTPS)'), href: `${this.$options.jetBrainsBaseUrl}${this.httpUrlEncoded}`, + extraAttrs: { + isUnsafeLink: true, + }, }, Boolean(this.xcodeUrl) && { text: __('Xcode'), href: this.xcodeUrl, + extraAttrs: { + isUnsafeLink: true, + }, }, ].filter(Boolean); diff --git a/spec/frontend/vue_shared/components/code_dropdown/code_dropdown_spec.js b/spec/frontend/vue_shared/components/code_dropdown/code_dropdown_spec.js index 5805b4c5634..67de256396b 100644 --- a/spec/frontend/vue_shared/components/code_dropdown/code_dropdown_spec.js +++ b/spec/frontend/vue_shared/components/code_dropdown/code_dropdown_spec.js @@ -127,6 +127,7 @@ describe('Code Dropdown component', () => { expect(item.props('item').text).toBe(name); expect(item.props('item').href).toContain(href); + expect(item.props('item').extraAttrs.isUnsafeLink).toBe(true); }); it('closes the dropdown on click', () => {