Commit c4201f10 authored by Phil Hughes's avatar Phil Hughes

Added changes count to web IDE folder

#44846
parent 8a1b6b78
<script> <script>
import { mapActions } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import skeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue'; import skeletonLoadingContainer from '~/vue_shared/components/skeleton_loading_container.vue';
import fileIcon from '~/vue_shared/components/file_icon.vue'; import fileIcon from '~/vue_shared/components/file_icon.vue';
import router from '../ide_router'; import router from '../ide_router';
...@@ -29,6 +29,10 @@ export default { ...@@ -29,6 +29,10 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(['getChangesInFolder']),
folderChangedCount() {
return this.getChangesInFolder(this.file.path);
},
isTree() { isTree() {
return this.file.type === 'tree'; return this.file.type === 'tree';
}, },
...@@ -101,9 +105,14 @@ export default { ...@@ -101,9 +105,14 @@ export default {
<mr-file-icon <mr-file-icon
v-if="file.mrChange" v-if="file.mrChange"
/> />
<span
v-if="isTree && folderChangedCount > 0"
>
{{ folderChangedCount }}
</span>
<changed-file-icon <changed-file-icon
v-else-if="file.changed || file.tempFile"
:file="file" :file="file"
v-if="file.changed || file.tempFile"
/> />
</span> </span>
<new-dropdown <new-dropdown
......
...@@ -35,3 +35,6 @@ export const currentIcon = state => ...@@ -35,3 +35,6 @@ export const currentIcon = state =>
export const hasChanges = state => !!state.changedFiles.length; export const hasChanges = state => !!state.changedFiles.length;
export const hasMergeRequest = state => !!state.currentMergeRequestId; export const hasMergeRequest = state => !!state.currentMergeRequestId;
export const getChangesInFolder = state => path =>
state.changedFiles.filter(f => f.path.indexOf(path) === 0 && !f.tempFile).length;
...@@ -601,11 +601,11 @@ ...@@ -601,11 +601,11 @@
} }
.multi-file-addition { .multi-file-addition {
fill: $green-500; color: $green-500;
} }
.multi-file-modified { .multi-file-modified {
fill: $orange-500; color: $orange-500;
} }
.multi-file-commit-list-collapsed { .multi-file-commit-list-collapsed {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment