Commit 1576dca8 authored by Lee Tickett's avatar Lee Tickett Committed by David O'Regan

Add tooltips to design buttons

parent f061a542
<script> <script>
/* global Mousetrap */ /* global Mousetrap */
import 'mousetrap'; import 'mousetrap';
import { GlButton, GlButtonGroup } from '@gitlab/ui'; import { GlButton, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import allDesignsMixin from '../../mixins/all_designs'; import allDesignsMixin from '../../mixins/all_designs';
import { DESIGN_ROUTE_NAME } from '../../router/constants'; import { DESIGN_ROUTE_NAME } from '../../router/constants';
...@@ -11,6 +11,9 @@ export default { ...@@ -11,6 +11,9 @@ export default {
GlButton, GlButton,
GlButtonGroup, GlButtonGroup,
}, },
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [allDesignsMixin], mixins: [allDesignsMixin],
props: { props: {
id: { id: {
...@@ -68,6 +71,7 @@ export default { ...@@ -68,6 +71,7 @@ export default {
{{ paginationText }} {{ paginationText }}
<gl-button-group class="gl-mx-5"> <gl-button-group class="gl-mx-5">
<gl-button <gl-button
v-gl-tooltip.bottom
:disabled="!previousDesign" :disabled="!previousDesign"
:title="s__('DesignManagement|Go to previous design')" :title="s__('DesignManagement|Go to previous design')"
icon="angle-left" icon="angle-left"
...@@ -75,6 +79,7 @@ export default { ...@@ -75,6 +79,7 @@ export default {
@click="navigateToDesign(previousDesign)" @click="navigateToDesign(previousDesign)"
/> />
<gl-button <gl-button
v-gl-tooltip.bottom
:disabled="!nextDesign" :disabled="!nextDesign"
:title="s__('DesignManagement|Go to next design')" :title="s__('DesignManagement|Go to next design')"
icon="angle-right" icon="angle-right"
......
<script> <script>
import { GlButton, GlIcon } from '@gitlab/ui'; import { GlButton, GlIcon, GlTooltipDirective } from '@gitlab/ui';
import permissionsQuery from 'shared_queries/design_management/design_permissions.query.graphql'; import permissionsQuery from 'shared_queries/design_management/design_permissions.query.graphql';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
...@@ -14,6 +14,9 @@ export default { ...@@ -14,6 +14,9 @@ export default {
DesignNavigation, DesignNavigation,
DeleteButton, DeleteButton,
}, },
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [timeagoMixin], mixins: [timeagoMixin],
props: { props: {
id: { id: {
...@@ -112,14 +115,21 @@ export default { ...@@ -112,14 +115,21 @@ export default {
</div> </div>
</div> </div>
<design-navigation :id="id" class="gl-ml-auto gl-flex-shrink-0" /> <design-navigation :id="id" class="gl-ml-auto gl-flex-shrink-0" />
<gl-button :href="image" icon="download" /> <gl-button
v-gl-tooltip.bottom
:href="image"
icon="download"
:title="s__('DesignManagement|Download design')"
/>
<delete-button <delete-button
v-if="isLatestVersion && canDeleteDesign" v-if="isLatestVersion && canDeleteDesign"
v-gl-tooltip.bottom
class="gl-ml-3" class="gl-ml-3"
:is-deleting="isDeleting" :is-deleting="isDeleting"
button-variant="warning" button-variant="warning"
button-icon="archive" button-icon="archive"
button-category="secondary" button-category="secondary"
:title="s__('DesignManagement|Archive design')"
@deleteSelectedDesigns="$emit('delete')" @deleteSelectedDesigns="$emit('delete')"
/> />
</header> </header>
......
---
title: Add tooltips to design buttons
merge_request: 46922
author: Lee Tickett
type: added
...@@ -9207,6 +9207,9 @@ msgstr "" ...@@ -9207,6 +9207,9 @@ msgstr ""
msgid "DesignManagement|Adding a design with the same filename replaces the file in a new version." msgid "DesignManagement|Adding a design with the same filename replaces the file in a new version."
msgstr "" msgstr ""
msgid "DesignManagement|Archive design"
msgstr ""
msgid "DesignManagement|Archive designs" msgid "DesignManagement|Archive designs"
msgstr "" msgstr ""
...@@ -9264,6 +9267,9 @@ msgstr "" ...@@ -9264,6 +9267,9 @@ msgstr ""
msgid "DesignManagement|Discard comment" msgid "DesignManagement|Discard comment"
msgstr "" msgstr ""
msgid "DesignManagement|Download design"
msgstr ""
msgid "DesignManagement|Error uploading a new design. Please try again." msgid "DesignManagement|Error uploading a new design. Please try again."
msgstr "" msgstr ""
......
...@@ -46,6 +46,7 @@ exports[`Design management toolbar component renders design and updated data 1`] ...@@ -46,6 +46,7 @@ exports[`Design management toolbar component renders design and updated data 1`]
href="/-/designs/306/7f747adcd4693afadbe968d7ba7d983349b9012d" href="/-/designs/306/7f747adcd4693afadbe968d7ba7d983349b9012d"
icon="download" icon="download"
size="medium" size="medium"
title="Download design"
variant="default" variant="default"
/> />
...@@ -57,6 +58,7 @@ exports[`Design management toolbar component renders design and updated data 1`] ...@@ -57,6 +58,7 @@ exports[`Design management toolbar component renders design and updated data 1`]
buttonvariant="warning" buttonvariant="warning"
class="gl-ml-3" class="gl-ml-3"
hasselecteddesigns="true" hasselecteddesigns="true"
title="Archive design"
/> />
</header> </header>
`; `;
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