no_changes.vue 1.32 KB
Newer Older
Felipe Artur's avatar
Felipe Artur committed
1
<script>
Phil Hughes's avatar
Phil Hughes committed
2 3 4 5
import { mapGetters } from 'vuex';
import _ from 'underscore';
import { GlButton } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
Felipe Artur's avatar
Felipe Artur committed
6 7

export default {
Phil Hughes's avatar
Phil Hughes committed
8 9 10 11 12 13 14 15
  components: {
    GlButton,
  },
  props: {
    changesEmptyStateIllustration: {
      type: String,
      required: true,
    },
Felipe Artur's avatar
Felipe Artur committed
16 17
  },
  computed: {
Phil Hughes's avatar
Phil Hughes committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
    ...mapGetters(['getNoteableData']),
    emptyStateText() {
      return sprintf(
        __(
          'No changes between %{ref_start}%{source_branch}%{ref_end} and %{ref_start}%{target_branch}%{ref_end}',
        ),
        {
          ref_start: '<span class="ref-name">',
          ref_end: '</span>',
          source_branch: _.escape(this.getNoteableData.source_branch),
          target_branch: _.escape(this.getNoteableData.target_branch),
        },
        false,
      );
    },
Felipe Artur's avatar
Felipe Artur committed
33 34 35 36 37
  },
};
</script>

<template>
Phil Hughes's avatar
Phil Hughes committed
38 39 40
  <div class="row empty-state">
    <div class="col-12">
      <div class="svg-content svg-250"><img :src="changesEmptyStateIllustration" /></div>
Felipe Artur's avatar
Felipe Artur committed
41
    </div>
Phil Hughes's avatar
Phil Hughes committed
42
    <div class="col-12">
Felipe Artur's avatar
Felipe Artur committed
43
      <div class="text-content text-center">
Phil Hughes's avatar
Phil Hughes committed
44
        <span v-html="emptyStateText"></span>
Felipe Artur's avatar
Felipe Artur committed
45
        <div class="text-center">
Phil Hughes's avatar
Phil Hughes committed
46 47 48
          <gl-button :href="getNoteableData.new_blob_path" variant="success">{{
            __('Create commit')
          }}</gl-button>
Felipe Artur's avatar
Felipe Artur committed
49 50 51 52 53
        </div>
      </div>
    </div>
  </div>
</template>