summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/pipelines_list/empty_state.vue
blob: c3bcfcb18fb6bc8da8d3d32e8f12632d5c32eb43 (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
<script>
import { GlEmptyState } from '@gitlab/ui';
import Experiment from '~/experimentation/components/experiment.vue';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale';
import PipelinesCiTemplates from './pipelines_ci_templates.vue';

export default {
  i18n: {
    title: s__('Pipelines|Build with confidence'),
    description: s__(`Pipelines|GitLab CI/CD can automatically build,
      test, and deploy your code. Let GitLab take care of time
      consuming tasks, so you can spend more time creating.`),
    btnText: s__('Pipelines|Get started with CI/CD'),
    noCiDescription: s__('Pipelines|This project is not currently set up to run pipelines.'),
  },
  name: 'PipelinesEmptyState',
  components: {
    GlEmptyState,
    Experiment,
    PipelinesCiTemplates,
  },
  props: {
    emptyStateSvgPath: {
      type: String,
      required: true,
    },
    canSetCi: {
      type: Boolean,
      required: true,
    },
  },
  computed: {
    ciHelpPagePath() {
      return helpPagePath('ci/quick_start/index.md');
    },
  },
};
</script>
<template>
  <div>
    <experiment name="pipeline_empty_state_templates">
      <template #control>
        <gl-empty-state
          v-if="canSetCi"
          :title="$options.i18n.title"
          :svg-path="emptyStateSvgPath"
          :description="$options.i18n.description"
          :primary-button-text="$options.i18n.btnText"
          :primary-button-link="ciHelpPagePath"
        />
        <gl-empty-state
          v-else
          title=""
          :svg-path="emptyStateSvgPath"
          :description="$options.i18n.noCiDescription"
        />
      </template>
      <template #candidate>
        <pipelines-ci-templates />
      </template>
    </experiment>
  </div>
</template>