summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules_empty_state.vue
blob: f633ba053ee4f2250cd6b921a9dd4a8aa30afb8d (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
<script>
import scheduleSvg from '@gitlab/svgs/dist/illustrations/schedule-md.svg';
import { GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale';

export default {
  i18n: {
    pipelineSchedules: s__('PipelineSchedules|Pipeline schedules'),
    description: s__(
      'PipelineSchedules|A scheduled pipeline starts automatically at regular intervals, like daily or weekly. The pipeline: ',
    ),
    learnMore: s__(
      'PipelineSchedules|Learn more in the %{linkStart}scheduled pipelines documentation.%{linkEnd}',
    ),
    listElements: [
      s__('PipelineSchedules|Runs for a specific branch or tag.'),
      s__('PipelineSchedules|Can have custom CI/CD variables.'),
      s__('PipelineSchedules|Runs with the same project permissions as the schedule owner.'),
    ],
    createNew: s__('PipelineSchedules|Create a new pipeline schedule'),
  },
  components: {
    GlEmptyState,
    GlLink,
    GlSprintf,
  },
  computed: {
    scheduleSvgPath() {
      return `data:image/svg+xml;utf8,${encodeURIComponent(scheduleSvg)}`;
    },
    schedulesHelpPath() {
      return helpPagePath('ci/pipelines/schedules');
    },
  },
};
</script>
<template>
  <gl-empty-state
    :svg-path="scheduleSvgPath"
    :primary-button-text="$options.i18n.createNew"
    primary-button-link="#"
  >
    <template #title>
      <h3>
        {{ $options.i18n.pipelineSchedules }}
      </h3>
    </template>
    <template #description>
      <p class="gl-mb-0">{{ $options.i18n.description }}</p>
      <ul class="gl-list-style-position-inside" data-testid="pipeline-schedules-characteristics">
        <li v-for="(el, index) in $options.i18n.listElements" :key="index">{{ el }}</li>
      </ul>
      <p>
        <gl-sprintf :message="$options.i18n.learnMore">
          <template #link="{ content }">
            <gl-link :href="schedulesHelpPath" target="_blank">{{ content }}</gl-link>
          </template>
        </gl-sprintf>
      </p>
    </template>
  </gl-empty-state>
</template>