debian-mirror-gitlab/app/assets/javascripts/notes/components/discussion_filter_note.vue

53 lines
1.3 KiB
Vue
Raw Normal View History

2019-07-07 11:18:12 +05:30
<script>
2020-11-24 15:15:51 +05:30
/* eslint-disable vue/no-v-html */
import { GlButton, GlIcon } from '@gitlab/ui';
2019-07-07 11:18:12 +05:30
import { __, sprintf } from '~/locale';
import notesEventHub from '../event_hub';
export default {
components: {
2020-10-24 23:57:45 +05:30
GlButton,
2020-11-24 15:15:51 +05:30
GlIcon,
2019-07-07 11:18:12 +05:30
},
computed: {
timelineContent() {
return sprintf(
__(
"You're only seeing %{startTag}other activity%{endTag} in the feed. To add a comment, switch to one of the following options.",
),
{
startTag: `<b>`,
endTag: `</b>`,
},
false,
);
},
},
methods: {
selectFilter(value) {
notesEventHub.$emit('dropdownSelect', value);
},
},
};
</script>
<template>
<li class="timeline-entry note note-wrapper discussion-filter-note js-discussion-filter-note">
<div class="timeline-icon d-none d-lg-flex">
2020-11-24 15:15:51 +05:30
<gl-icon name="comment" />
2019-07-07 11:18:12 +05:30
</div>
<div class="timeline-content">
2020-03-13 15:44:24 +05:30
<div ref="timelineContent" v-html="timelineContent"></div>
2019-07-07 11:18:12 +05:30
<div class="discussion-filter-actions mt-2">
2020-10-24 23:57:45 +05:30
<gl-button ref="showAllActivity" variant="default" @click="selectFilter(0)">
2019-07-07 11:18:12 +05:30
{{ __('Show all activity') }}
2020-10-24 23:57:45 +05:30
</gl-button>
<gl-button ref="showComments" variant="default" @click="selectFilter(1)">
2019-07-07 11:18:12 +05:30
{{ __('Show comments only') }}
2020-10-24 23:57:45 +05:30
</gl-button>
2019-07-07 11:18:12 +05:30
</div>
</div>
</li>
</template>