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

commit.vue « components « environments « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54b9448068540bc36c23dba3e0dfa2ff77150a09 (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
<script>
import { GlAvatar, GlAvatarLink, GlLink, GlTooltipDirective as GlTooltip } from '@gitlab/ui';
import { escape } from 'lodash';

export default {
  components: {
    GlAvatar,
    GlAvatarLink,
    GlLink,
  },
  directives: {
    GlTooltip,
  },
  props: {
    commit: {
      required: true,
      type: Object,
    },
  },
  computed: {
    commitMessage() {
      return this.commit?.message;
    },
    commitAuthorPath() {
      // eslint-disable-next-line @gitlab/require-i18n-strings
      return this.commit?.author?.path || `mailto:${escape(this.commit?.authorEmail)}`;
    },
    commitAuthorAvatar() {
      return this.commit?.author?.avatarUrl || this.commit?.authorGravatarUrl;
    },
    commitAuthor() {
      return this.commit?.author?.name || this.commit?.authorName;
    },
    commitPath() {
      return this.commit?.commitPath;
    },
  },
};
</script>
<template>
  <div data-testid="deployment-commit" class="gl-display-flex gl-align-items-center">
    <gl-avatar-link v-gl-tooltip :title="commitAuthor" :href="commitAuthorPath">
      <gl-avatar :size="16" :src="commitAuthorAvatar" />
    </gl-avatar-link>
    <gl-link
      v-gl-tooltip
      :title="commitMessage"
      :href="commitPath"
      class="gl-ml-3 gl-str-truncated"
    >
      {{ commitMessage }}
    </gl-link>
  </div>
</template>