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

sidebar_formatted_date.vue « date « components « sidebar « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 627b84525087ee7e50f5ef458cc3a3c32bd5270c (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
<script>
import { GlButton } from '@gitlab/ui';

export default {
  components: {
    GlButton,
  },
  inject: ['canUpdate'],
  props: {
    formattedDate: {
      required: true,
      type: String,
    },
    hasDate: {
      required: true,
      type: Boolean,
    },
    resetText: {
      required: true,
      type: String,
    },
    isLoading: {
      required: true,
      type: Boolean,
    },
    canDelete: {
      required: false,
      type: Boolean,
      default: true,
    },
  },
};
</script>

<template>
  <div class="gl-display-flex gl-align-items-center hide-collapsed">
    <span
      :class="hasDate ? 'gl-text-gray-900' : 'gl-text-gray-500'"
      data-testid="sidebar-date-value"
    >
      {{ formattedDate }}
    </span>
    <div v-if="hasDate && canUpdate && canDelete" class="gl-display-flex">
      <span class="gl-px-2">-</span>
      <gl-button
        variant="link"
        class="gl-text-gray-500!"
        data-testid="reset-button"
        :disabled="isLoading"
        @click="$emit('reset-date', $event)"
      >
        {{ resetText }}
      </gl-button>
    </div>
  </div>
</template>