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

contribution_event_approved.vue « contribution_event « components « contribution_events « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a7787ae84bcd07165a0e00fce5e78f9e50a707d5 (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
<script>
import { GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale';
import TargetLink from '../target_link.vue';
import ResourceParentLink from '../resource_parent_link.vue';
import ContributionEventBase from './contribution_event_base.vue';

export default {
  name: 'ContributionEventApproved',
  i18n: {
    message: s__(
      'ContributionEvent|Approved merge request %{targetLink} in %{resourceParentLink}.',
    ),
  },
  components: { ContributionEventBase, GlSprintf, TargetLink, ResourceParentLink },
  props: {
    /**
     * Expected format
     * {
     *   created_at: string;
     *   action: "approved"
     *   author: {
     *     id: number;
     *     username: string;
     *     name: string;
     *     state: string;
     *     avatar_url: string;
     *     web_url: string;
     *   };
     *   target: {
     *     id: number;
     *     type: "MergeRequest"
     *     title: string;
     *     reference_link_text: string;
     *     web_url: string;
     *   };
     *   resource_parent: {
     *     type: "project";
     *     full_name: string;
     *     full_path: string;
     *     web_url: string;
     *     avatar_url: string;
     *   };
     * };
     */
    event: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <contribution-event-base :event="event" icon-name="approval-solid" icon-class="gl-text-green-500">
    <gl-sprintf :message="$options.i18n.message">
      <template #targetLink>
        <target-link :event="event" />
      </template>
      <template #resourceParentLink>
        <resource-parent-link :event="event" />
      </template>
    </gl-sprintf>
  </contribution-event-base>
</template>