Use convertPermissionToBoolean to get a boolean

This commit is contained in:
Phil Hughes 2018-10-23 19:24:48 +01:00
parent b07a0167d0
commit 3b3aa28c4c
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
2 changed files with 7 additions and 2 deletions

View File

@ -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,
};
},

View File

@ -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)}`;
},