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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/blob/components/blob_header_filepath.vue')
-rw-r--r--app/assets/javascripts/blob/components/blob_header_filepath.vue18
1 files changed, 15 insertions, 3 deletions
diff --git a/app/assets/javascripts/blob/components/blob_header_filepath.vue b/app/assets/javascripts/blob/components/blob_header_filepath.vue
index 90d01358451..62355306655 100644
--- a/app/assets/javascripts/blob/components/blob_header_filepath.vue
+++ b/app/assets/javascripts/blob/components/blob_header_filepath.vue
@@ -15,6 +15,11 @@ export default {
type: Object,
required: true,
},
+ showPath: {
+ type: Boolean,
+ required: false,
+ default: true,
+ },
},
computed: {
blobSize() {
@@ -26,6 +31,13 @@ export default {
showLfsBadge() {
return this.blob.storedExternally && this.blob.externalStorage === 'lfs';
},
+ fileName() {
+ if (this.showPath) {
+ return this.blob.path;
+ }
+
+ return this.blob.name;
+ },
},
};
</script>
@@ -33,12 +45,12 @@ export default {
<div class="file-header-content d-flex align-items-center lh-100">
<slot name="filepath-prepend"></slot>
- <template v-if="blob.path">
- <file-icon :file-name="blob.path" :size="16" aria-hidden="true" css-classes="mr-2" />
+ <template v-if="fileName">
+ <file-icon :file-name="fileName" :size="16" aria-hidden="true" css-classes="mr-2" />
<strong
class="file-title-name mr-1 js-blob-header-filepath"
data-qa-selector="file_title_content"
- >{{ blob.path }}</strong
+ >{{ fileName }}</strong
>
</template>