Commit 736e7a6d authored by Fernando's avatar Fernando

Add tooltip to No Target text in corpus management

* Add text copy to tooltip

Changelog: added
parent 94120bc6
<script> <script>
import { GlIcon } from '@gitlab/ui'; import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
export default { export default {
components: { components: {
GlIcon, GlIcon,
}, },
directives: {
GlTooltip: GlTooltipDirective,
},
props: { props: {
target: { target: {
type: String, type: String,
...@@ -14,6 +17,7 @@ export default { ...@@ -14,6 +17,7 @@ export default {
}, },
i18n: { i18n: {
notSet: s__('CorpusManagement|Not Set'), notSet: s__('CorpusManagement|Not Set'),
noSetInfo: s__('CorpusManagement|To use this corpus, edit the corresponding YAML file'),
}, },
computed: { computed: {
hasTarget() { hasTarget() {
...@@ -24,7 +28,7 @@ export default { ...@@ -24,7 +28,7 @@ export default {
</script> </script>
<template> <template>
<span v-if="hasTarget" class="gl-text-gray-900"> {{ target }} </span> <span v-if="hasTarget" class="gl-text-gray-900"> {{ target }} </span>
<span v-else class="gl-text-gray-900"> <span v-else v-gl-tooltip.hover class="gl-text-gray-900" :title="$options.i18n.noSetInfo">
<gl-icon class="gl-mr-1" :size="16" name="information-o" /> <gl-icon class="gl-mr-1" :size="16" name="information-o" />
{{ this.$options.i18n.notSet }} {{ this.$options.i18n.notSet }}
</span> </span>
......
...@@ -11,6 +11,7 @@ exports[`Target component renders target 1`] = ` ...@@ -11,6 +11,7 @@ exports[`Target component renders target 1`] = `
exports[`Target component without target renders Not Set with icon 1`] = ` exports[`Target component without target renders Not Set with icon 1`] = `
<span <span
class="gl-text-gray-900" class="gl-text-gray-900"
title="To use this corpus, edit the corresponding YAML file"
> >
<gl-icon-stub <gl-icon-stub
class="gl-mr-1" class="gl-mr-1"
......
...@@ -9169,6 +9169,9 @@ msgstr "" ...@@ -9169,6 +9169,9 @@ msgstr ""
msgid "CorpusManagement|Target" msgid "CorpusManagement|Target"
msgstr "" msgstr ""
msgid "CorpusManagement|To use this corpus, edit the corresponding YAML file"
msgstr ""
msgid "CorpusManagement|Total Size: %{totalSize}" msgid "CorpusManagement|Total Size: %{totalSize}"
msgstr "" msgstr ""
......
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