Added changes count to web IDE folder

#44846
This commit is contained in:
Phil Hughes 2018-04-18 12:55:24 +01:00
parent 8a1b6b78cc
commit c4201f1036
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
3 changed files with 16 additions and 4 deletions

View file

@ -1,5 +1,5 @@
<script>
import { mapActions } from 'vuex';
import { mapActions, mapGetters } from 'vuex';
import skeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue';
import fileIcon from '~/vue_shared/components/file_icon.vue';
import router from '../ide_router';
@ -29,6 +29,10 @@ export default {
},
},
computed: {
...mapGetters(['getChangesInFolder']),
folderChangedCount() {
return this.getChangesInFolder(this.file.path);
},
isTree() {
return this.file.type === 'tree';
},
@ -101,9 +105,14 @@ export default {
<mr-file-icon
v-if="file.mrChange"
/>
<span
v-if="isTree && folderChangedCount > 0"
>
{{ folderChangedCount }}
</span>
<changed-file-icon
v-else-if="file.changed || file.tempFile"
:file="file"
v-if="file.changed || file.tempFile"
/>
</span>
<new-dropdown

View file

@ -35,3 +35,6 @@ export const currentIcon = state =>
export const hasChanges = state => !!state.changedFiles.length;
export const hasMergeRequest = state => !!state.currentMergeRequestId;
export const getChangesInFolder = state => path =>
state.changedFiles.filter(f => f.path.indexOf(path) === 0 && !f.tempFile).length;

View file

@ -601,11 +601,11 @@
}
.multi-file-addition {
fill: $green-500;
color: $green-500;
}
.multi-file-modified {
fill: $orange-500;
color: $orange-500;
}
.multi-file-commit-list-collapsed {