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

pipeline_editor_empty_state.vue « ui « components « pipeline_editor « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f927498fa132007f5b60fa93acff996b33cd5c1 (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
<script>
import { GlButton, GlSprintf, GlEmptyState } from '@gitlab/ui';
import { __ } from '~/locale';
import PipelineEditorFileNav from '~/ci/pipeline_editor/components/file_nav/pipeline_editor_file_nav.vue';

export default {
  components: {
    GlButton,
    GlSprintf,
    GlEmptyState,
    PipelineEditorFileNav,
  },
  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: __('Configure pipeline'),
    externalCiNote: __("This project's pipeline configuration is located outside this repository"),
    externalCiInstructions: __(
      'To edit the pipeline configuration, you must go to the project or external site that hosts the file.',
    ),
  },
  inject: {
    emptyStateIllustrationPath: {
      default: '',
    },
    usesExternalConfig: {
      default: false,
      type: Boolean,
      required: false,
    },
  },
  methods: {
    createEmptyConfigFile() {
      this.$emit('createEmptyConfigFile');
    },
  },
};
</script>
<template>
  <div>
    <pipeline-editor-file-nav v-on="$listeners" />
    <gl-empty-state
      v-if="usesExternalConfig"
      :title="$options.i18n.externalCiNote"
      :description="$options.i18n.externalCiInstructions"
      :svg-path="emptyStateIllustrationPath"
    />

    <gl-empty-state v-else :title="$options.i18n.title" :svg-path="emptyStateIllustrationPath">
      <template #description>
        <gl-sprintf :message="$options.i18n.body">
          <template #code="{ content }">
            <code>{{ content }}</code>
          </template>
        </gl-sprintf>
      </template>
      <template #actions>
        <gl-button
          variant="confirm"
          class="gl-mt-3"
          data-testid="create-new-ci-button"
          @click="createEmptyConfigFile"
        >
          {{ $options.i18n.btnText }}
        </gl-button>
      </template>
    </gl-empty-state>
  </div>
</template>