Commit f499fcc9 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'mw-vsa-limit-warnings-icon-refactor' into 'master'

Replace fa-warning icon in VSA limit warning

See merge request gitlab-org/gitlab!43262
parents d5d72b58 bb0d3305
---
title: 'VSA: Replace fa-warning with GitLab SVG'
merge_request: 43262
author:
type: changed
<script> <script>
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { n__ } from '~/locale';
import { EVENTS_LIST_ITEM_LIMIT } from '../constants'; import { EVENTS_LIST_ITEM_LIMIT } from '../constants';
export default { export default {
components: {
GlIcon,
},
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
...@@ -12,27 +16,18 @@ export default { ...@@ -12,27 +16,18 @@ export default {
required: true, required: true,
}, },
}, },
data() { eventsListItemLimit: EVENTS_LIST_ITEM_LIMIT,
return { EVENTS_LIST_ITEM_LIMIT }; tooltipTitle: n__(
}, 'Limited to showing %d event at most',
'Limited to showing %d events at most',
EVENTS_LIST_ITEM_LIMIT,
),
}; };
</script> </script>
<template> <template>
<!-- TODO: im not sure why this is rendered only for exactly 50 items, why not >= 50? --> <!-- TODO: im not sure why this is rendered only for exactly 50 items, why not >= 50? -->
<span v-if="count >= EVENTS_LIST_ITEM_LIMIT" class="events-info float-right"> <span v-if="count >= $options.eventsListItemLimit" class="events-info float-right">
<i <gl-icon v-gl-tooltip="{ title: $options.tooltipTitle }" name="warning" aria-hidden="true" />
v-gl-tooltip {{ n__('Showing %d event', 'Showing %d events', $options.eventsListItemLimit) }}
:title="
n__(
'Limited to showing %d event at most',
'Limited to showing %d events at most',
EVENTS_LIST_ITEM_LIMIT,
)
"
class="fa fa-warning"
aria-hidden="true"
>
</i>
{{ n__('Showing %d event', 'Showing %d events', EVENTS_LIST_ITEM_LIMIT) }}
</span> </span>
</template> </template>
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