Skip to content

Commit

Permalink
#45 show contributor indication on directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Grochni committed May 9, 2023
1 parent f2bbdfc commit d3b300d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class Sunburst extends React.Component {
return (
<div>
<svg ref={svg => this.chartRef = svg}></svg>
<div class="fileName">{this.state.selectedFile}</div>
<div className="fileName">{this.state.selectedFile}</div>
</div>
);
}
Expand Down
12 changes: 8 additions & 4 deletions ui/src/visualizations/file-tree-evolution/sagas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ function applyCommit(fileTree, commit, commitIndex, contributor) {
function modifyFile(fileTree, path, file, commitIndex, contributor, prevPath = '', parentPaths = []) {
if (path.length === 0) {
fileTree.size = file.lineCount;
fileTree.contributor = contributor;
fileTree.changeIteration = commitIndex;
} else {
const fullPath = !prevPath ? path[0] : prevPath + '/' + path[0]
if (!fileTree.children) {
Expand All @@ -91,12 +89,18 @@ function modifyFile(fileTree, path, file, commitIndex, contributor, prevPath = '
name: path[0],
creationIteration: commitIndex,
fullPath: fullPath,
parentPaths: parentPaths
parentPaths: parentPaths,
contributor: contributor,
changeIteration: commitIndex,
});
fileTree.childIndexMap[path[0]] = fileTree.children.length - 1;
}
const currentNode = fileTree.children[fileTree.childIndexMap[path[0]]];
// Add those two lines to highlight changes on directory level already, instead of file level only.
// currentNode.contributor = contributor;
// currentNode.changeIteration = commitIndex;
modifyFile(
fileTree.children[fileTree.childIndexMap[path[0]]],
currentNode,
path.slice(1),
file,
commitIndex,
Expand Down

0 comments on commit d3b300d

Please sign in to comment.