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:
authorPhil Hughes <me@iamphill.com>2019-01-08 12:31:23 +0300
committerPhil Hughes <me@iamphill.com>2019-01-08 12:31:23 +0300
commit12edecd002163e7dedff6fcdf10043b7d1967962 (patch)
tree45bd3c1eee15e911fd43733f1af77a10e4f0fc98 /app/assets/javascripts/vue_shared/components/file_row_header.vue
parent1d2ef4c6557846eb531f4d0e80cf43dea99b037b (diff)
Add headers to files in the tree list on merge requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54807
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/file_row_header.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/file_row_header.vue25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/file_row_header.vue b/app/assets/javascripts/vue_shared/components/file_row_header.vue
new file mode 100644
index 00000000000..301fd8116a9
--- /dev/null
+++ b/app/assets/javascripts/vue_shared/components/file_row_header.vue
@@ -0,0 +1,25 @@
+<script>
+import { truncatePathMiddleToLength } from '~/lib/utils/text_utility';
+
+const MAX_PATH_LENGTH = 40;
+
+export default {
+ props: {
+ path: {
+ type: String,
+ required: true,
+ },
+ },
+ computed: {
+ truncatedPath() {
+ return truncatePathMiddleToLength(this.path, MAX_PATH_LENGTH);
+ },
+ },
+};
+</script>
+
+<template>
+ <div class="file-row-header bg-white sticky-top p-2 js-file-row-header">
+ <span class="bold">{{ truncatedPath }}</span>
+ </div>
+</template>