summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-23 19:24:48 +0100
committerPhil Hughes <me@iamphill.com>2018-10-23 19:24:48 +0100
commit3b3aa28c4cf73ec166d915117b589afb87cbd8ab (patch)
tree2c9741ca409fc16ee54ec79a79a909e379eaf77a
parentb07a0167d03f792c9e44152d96d9245d252538db (diff)
downloadgitlab-ce-mr-file-list.tar.gz
Use convertPermissionToBoolean to get a booleanmr-file-list
-rw-r--r--app/assets/javascripts/diffs/components/tree_list.vue5
-rw-r--r--app/assets/javascripts/vue_shared/components/file_row.vue4
2 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue
index a801dbedb12..34e836a570a 100644
--- a/app/assets/javascripts/diffs/components/tree_list.vue
+++ b/app/assets/javascripts/diffs/components/tree_list.vue
@@ -1,6 +1,7 @@
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
import { TooltipDirective as Tooltip } from '@gitlab-org/gitlab-ui';
+import { convertPermissionToBoolean } from '~/lib/utils/common_utils';
import Icon from '~/vue_shared/components/icon.vue';
import FileRow from '~/vue_shared/components/file_row.vue';
import FileRowStats from './file_row_stats.vue';
@@ -17,10 +18,12 @@ export default {
},
data() {
const treeListStored = localStorage.getItem(treeListStorageKey);
+ const renderTreeList = treeListStored !== null ?
+ convertPermissionToBoolean(treeListStored) : true;
return {
search: '',
- renderTreeList: treeListStored !== null ? treeListStored === 'true' : true,
+ renderTreeList,
focusSearch: false,
};
},
diff --git a/app/assets/javascripts/vue_shared/components/file_row.vue b/app/assets/javascripts/vue_shared/components/file_row.vue
index 510c5eb5fca..2d89a156117 100644
--- a/app/assets/javascripts/vue_shared/components/file_row.vue
+++ b/app/assets/javascripts/vue_shared/components/file_row.vue
@@ -74,7 +74,9 @@ export default {
outputText() {
const text = this.file[this.displayTextKey];
- if (this.truncateStart === 0) return text;
+ if (this.truncateStart === 0) {
+ return text;
+ }
return `...${text.substring(this.truncateStart, text.length)}`;
},