Welcome to mirror list, hosted at ThFree Co, Russian Federation.

list.vue « components « comment_templates « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 52bebfd050c4ca9b9384af0132e83cef528ca610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script>
import { GlKeysetPagination, GlLoadingIcon, GlSprintf } from '@gitlab/ui';
import ListItem from './list_item.vue';

export default {
  components: {
    GlLoadingIcon,
    GlKeysetPagination,
    GlSprintf,
    ListItem,
  },
  props: {
    loading: {
      type: Boolean,
      required: false,
      default: false,
    },
    savedReplies: {
      type: Array,
      required: true,
    },
    pageInfo: {
      type: Object,
      required: true,
    },
    count: {
      type: Number,
      required: true,
    },
  },
  methods: {
    prevPage() {
      this.$emit('input', {
        before: this.pageInfo.beforeCursor,
      });
    },
    nextPage() {
      this.$emit('input', {
        after: this.pageInfo.endCursor,
      });
    },
  },
};
</script>

<template>
  <div class="gl-border-t gl-pt-4">
    <gl-loading-icon v-if="loading" size="lg" />
    <template v-else>
      <h5 class="gl-font-lg" data-testid="title">
        <gl-sprintf :message="__('My comment templates (%{count})')">
          <template #count>{{ count }}</template>
        </gl-sprintf>
      </h5>
      <ul class="gl-list-style-none gl-p-0 gl-m-0">
        <list-item v-for="template in savedReplies" :key="template.id" :template="template" />
      </ul>
      <gl-keyset-pagination
        v-if="pageInfo.hasPreviousPage || pageInfo.hasNextPage"
        v-bind="pageInfo"
        class="gl-mt-4"
        @prev="prevPage"
        @next="nextPage"
      />
    </template>
  </div>
</template>