Skip to content
Snippets Groups Projects

Prepare common Vue app for Repository header area

All threads resolved!
4 files
+ 184
41
Compare changes
  • Side-by-side
  • Inline
Files
4
<script>
import { GlButton } from '@gitlab/ui';
import { escapeFileUrl } from '~/lib/utils/url_utility';
import Breadcrumbs from '~/repository/components/header_area/breadcrumbs.vue';
import BlobControls from '~/repository/components/header_area/blob_controls.vue';
export default {
name: 'HeaderArea',
components: {
GlButton,
Breadcrumbs,
BlobControls,
},
props: {
// for blob controls
projectPath: {
type: String,
required: true,
},
refType: {
type: String,
required: false,
default: null,
},
historyLink: {
type: String,
required: true,
},
},
computed: {
historyPath() {
const url = new URL(window.location.href);
url.pathname = `${this.historyLink}/${
this.$route.params.path ? escapeFileUrl(this.$route.params.path) : ''
}`;
url.searchParams.set('ref_type', this.$route.meta.refType || this.$route.query.ref_type);
return url.href;
},
},
};
</script>
<template>
<section>
<breadcrumbs />
<gl-button :href="historyPath">{{ __('History') }}</gl-button>
<blob-controls :project-path="projectPath" :ref-type="refType" />
</section>
</template>
Loading