gitlab-org--gitlab-foss/app/assets/javascripts/diffs/components/no_changes.vue

55 lines
1.4 KiB
Vue
Raw Normal View History

2018-06-21 08:22:40 -04:00
<script>
/* eslint-disable vue/no-v-html */
import { mapGetters } from 'vuex';
import { escape } from 'lodash';
import { GlButton } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
2018-06-21 08:22:40 -04:00
export default {
components: {
GlButton,
},
props: {
changesEmptyStateIllustration: {
type: String,
required: true,
},
2018-06-21 08:22:40 -04:00
},
computed: {
...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,
);
},
2018-06-21 08:22:40 -04:00
},
};
</script>
<template>
<div class="row empty-state">
<div class="col-12">
<div class="svg-content svg-250"><img :src="changesEmptyStateIllustration" /></div>
2018-06-21 08:22:40 -04:00
</div>
<div class="col-12">
2018-06-21 08:22:40 -04:00
<div class="text-content text-center">
<span v-html="emptyStateText"></span>
2018-06-21 08:22:40 -04:00
<div class="text-center">
<gl-button :href="getNoteableData.new_blob_path" variant="success" category="primary">{{
__('Create commit')
}}</gl-button>
2018-06-21 08:22:40 -04:00
</div>
</div>
</div>
</div>
</template>