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

pipeline_editor_empty_state.vue « ui « components « pipeline_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d4f04a0d055cc8cba06815e38fd1f813fbd68d2f (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, GlSprintf } from '@gitlab/ui';
import { __ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';

export default {
  components: {
    GlButton,
    GlSprintf,
  },
  i18n: {
    title: __('Optimize your workflow with CI/CD Pipelines'),
    body: __(
      'Create a new %{codeStart}.gitlab-ci.yml%{codeEnd} file at the root of the repository to get started.',
    ),
    btnText: __('Create new CI/CD pipeline'),
  },
  mixins: [glFeatureFlagsMixin()],
  inject: {
    emptyStateIllustrationPath: {
      default: '',
    },
  },
  computed: {
    showCTAButton() {
      return this.glFeatures.pipelineEditorEmptyStateAction;
    },
  },
  methods: {
    createEmptyConfigFile() {
      this.$emit('createEmptyConfigFile');
    },
  },
};
</script>
<template>
  <div class="gl-display-flex gl-flex-direction-column gl-align-items-center gl-mt-11">
    <img :src="emptyStateIllustrationPath" />
    <h1 class="gl-font-size-h1">{{ $options.i18n.title }}</h1>
    <p class="gl-mt-3">
      <gl-sprintf :message="$options.i18n.body">
        <template #code="{ content }">
          <code>{{ content }}</code>
        </template>
      </gl-sprintf>
    </p>
    <gl-button
      v-if="showCTAButton"
      variant="confirm"
      class="gl-mt-3"
      @click="createEmptyConfigFile"
    >
      {{ $options.i18n.btnText }}
    </gl-button>
  </div>
</template>