made path prop in dropdown optional

added computed prop for showing loading indicator
This commit is contained in:
Phil Hughes 2018-05-02 15:30:51 +01:00
parent 06eb127b5b
commit 3c9439acd7
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
5 changed files with 9 additions and 7 deletions

View File

@ -26,7 +26,6 @@ export default {
<new-dropdown
:project-id="currentProject.name_with_namespace"
:branch="currentBranchId"
path=""
/>
</template>
</ide-tree-list>

View File

@ -31,6 +31,9 @@ export default {
computed: {
...mapState(['currentBranchId']),
...mapGetters(['currentProject', 'currentTree']),
showLoading() {
return !this.currentTree || this.currentTree.loading;
},
},
mounted() {
this.updateViewer(this.viewerType);
@ -45,7 +48,7 @@ export default {
<div
class="ide-file-list"
>
<template v-if="!currentTree || currentTree.loading">
<template v-if="showLoading">
<div
class="multi-file-loading-container"
v-for="n in 3"

View File

@ -17,7 +17,8 @@ export default {
},
path: {
type: String,
required: true,
required: false,
default: '',
},
},
data() {

View File

@ -24,7 +24,7 @@ export default {
...mapGetters([
'currentMergeRequest',
'getStagedFile',
'isReviewModeActive',
'isEditModeActive',
'isCommitModeActive',
]),
shouldHideEditor() {
@ -191,8 +191,7 @@ export default {
<div class="ide-mode-tabs clearfix" >
<ul
class="nav-links pull-left"
v-if="!shouldHideEditor"
v-show="!isReviewModeActive && !isCommitModeActive"
v-if="!shouldHideEditor && isEditModeActive"
>
<li :class="editTabCSS">
<a

View File

@ -54,7 +54,7 @@ export const allBlobs = state =>
export const getStagedFile = state => path => state.stagedFiles.find(f => f.path === path);
export const isReviewModeActive = state => state.currentActivityView === activityBarViews.review;
export const isEditModeActive = state => state.currentActivityView === activityBarViews.edit;
export const isCommitModeActive = state => state.currentActivityView === activityBarViews.commit;
// prevent babel-plugin-rewire from generating an invalid default during karma tests