summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issues/components/empty_state.vue
blob: e6aa9c6a77bb10576cb315c58bcf4856bfc3d32e (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
68
69
70
71
72
73
74
75
76
77
78
<script>
import { GlEmptyState } from '@gitlab/ui';
import { ISSUE_STATES } from '../constants';

export default {
  components: {
    GlEmptyState,
  },
  props: {
    hasFilters: {
      type: Boolean,
      required: true,
    },
    state: {
      type: String,
      required: true,
    },
    buttonPath: {
      type: String,
      required: true,
    },
    loadingDisabled: {
      type: Boolean,
      required: true,
    },
    svgImagePath: {
      type: String,
      required: true,
    },
    svgLoadingDisabledImagePath: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      ISSUE_STATES,
    };
  },
};
</script>

<template>
  <gl-empty-state
    v-if="loadingDisabled"
    :title="__('Please select at least one filter to see results')"
    :svg-path="svgLoadingDisabledImagePath"
  />
  <gl-empty-state
    v-else-if="hasFilters"
    :title="__('Sorry, your filter produced no results')"
    :description="__('To widen your search, change or remove filters above')"
    :svg-path="svgImagePath"
  />
  <gl-empty-state
    v-else-if="state === ISSUE_STATES.OPENED"
    :title="__('There are no open issues')"
    :description="__('To keep this project going, create a new issue')"
    :primary-button-link="buttonPath"
    :primary-button-text="__('New issue')"
    :svg-path="svgImagePath"
  />
  <gl-empty-state
    v-else-if="state === ISSUE_STATES.CLOSED"
    :title="__('There are no closed issues')"
    :svg-path="svgImagePath"
  />
  <gl-empty-state
    v-else
    :title="__('There are no issues to show')"
    :description="
      __(
        'The Issue Tracker is the place to add things that need to be improved or solved in a project. You can register or sign in to create issues for this project.',
      )
    "
    :svg-path="svgImagePath"
  />
</template>