Commit af4a7b3e authored by Himanshu Kapoor's avatar Himanshu Kapoor

Show tooltip on link button

parent 424c1127
......@@ -6,6 +6,7 @@ import {
GlFormInputGroup,
GlDropdownDivider,
GlDropdownItem,
GlTooltipDirective as GlTooltip,
} from '@gitlab/ui';
import { Editor as TiptapEditor } from '@tiptap/vue-2';
import { hasSelection } from '../services/utils';
......@@ -21,6 +22,9 @@ export default {
GlDropdownItem,
GlButton,
},
directives: {
GlTooltip,
},
props: {
tiptapEditor: {
type: TiptapEditor,
......@@ -68,6 +72,9 @@ export default {
</script>
<template>
<gl-dropdown
v-gl-tooltip
:aria-label="__('Insert link')"
:title="__('Insert link')"
:toggle-class="{ active: isActive }"
size="small"
category="tertiary"
......
......@@ -73,6 +73,7 @@ export default {
@execute="trackToolbarControlExecution"
/>
<toolbar-link-button
data-testid="link"
:tiptap-editor="contentEditor.tiptapEditor"
@execute="trackToolbarControlExecution"
/>
......
......@@ -17495,6 +17495,9 @@ msgstr ""
msgid "Insert inline code"
msgstr ""
msgid "Insert link"
msgstr ""
msgid "Insert suggestion"
msgstr ""
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`content_editor/components/toolbar_link_button renders dropdown component 1`] = `
"<div class=\\"dropdown b-dropdown gl-new-dropdown btn-group\\">
"<div class=\\"dropdown b-dropdown gl-new-dropdown btn-group\\" aria-label=\\"Insert link\\" title=\\"Insert link\\">
<!----><button aria-haspopup=\\"true\\" aria-expanded=\\"false\\" type=\\"button\\" class=\\"btn dropdown-toggle btn-default btn-sm gl-button gl-dropdown-toggle btn-default-tertiary dropdown-icon-only\\">
<!----> <svg data-testid=\\"link-icon\\" role=\\"img\\" aria-hidden=\\"true\\" class=\\"dropdown-icon gl-icon s16\\">
<use href=\\"#link\\"></use>
......
......@@ -48,6 +48,7 @@ describe('content_editor/components/top_toolbar', () => {
${'ordered-list'} | ${{ contentType: 'orderedList', iconName: 'list-numbered', label: 'Add a numbered list', editorCommand: 'toggleOrderedList' }}
${'code-block'} | ${{ contentType: 'codeBlock', iconName: 'doc-code', label: 'Insert a code block', editorCommand: 'toggleCodeBlock' }}
${'text-styles'} | ${{}}
${'link'} | ${{}}
`('given a $testId toolbar control', ({ testId, controlProps }) => {
beforeEach(() => {
buildWrapper();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment