-
this.setState({ showContent: true })}
- onMouseOut={handleContentClose}>
-
-
- Detected conflicts with {conflicts.length} {participantsTag}
-
-
+ {this.renderConflictIndicator()}
{this.state.showContent &&
{conflicts.map((conflict, i) =>
diff --git a/ui/src/visualizations/team-awareness/components/ConflictOverview/ConflictOverview.scss b/ui/src/visualizations/team-awareness/components/ConflictOverview/ConflictOverview.scss
index 5763ac14..6849c124 100644
--- a/ui/src/visualizations/team-awareness/components/ConflictOverview/ConflictOverview.scss
+++ b/ui/src/visualizations/team-awareness/components/ConflictOverview/ConflictOverview.scss
@@ -4,6 +4,22 @@
position: absolute;
}
+.indicator {
+ margin: 0 4px;
+ font-size: 1.1rem;
+ align-self: center;
+}
+.loadingIndicator {
+ animation: rotation 2s infinite linear;
+}
+@keyframes rotation {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(359deg);
+ }
+}
.conflictOverviewIcon {
height: 25px;
width: 25px;
diff --git a/ui/src/visualizations/team-awareness/sagas/conflictCalculations.js b/ui/src/visualizations/team-awareness/sagas/conflictCalculations.js
index 6fdb5bc4..c13ca1b3 100644
--- a/ui/src/visualizations/team-awareness/sagas/conflictCalculations.js
+++ b/ui/src/visualizations/team-awareness/sagas/conflictCalculations.js
@@ -35,7 +35,7 @@ const analyseConflictsFromAppState = async appState => {
if (conflictingStakeholders.length === 0) continue;
for (const s of conflictingStakeholders) {
- const { conflictStakeholder, otherStakeholder, hunks, changes } = s;
+ const { conflictStakeholder, otherStakeholder, changes } = s;
const combined = `${conflictStakeholder.stakeholder.id}${otherStakeholder.stakeholder.id}`;
if (!stakeholders.has(combined)) {
diff --git a/ui/src/visualizations/team-awareness/sagas/conflictDetailsOperation.js b/ui/src/visualizations/team-awareness/sagas/conflictDetailsOperation.js
index 5d320539..ea83f1e3 100644
--- a/ui/src/visualizations/team-awareness/sagas/conflictDetailsOperation.js
+++ b/ui/src/visualizations/team-awareness/sagas/conflictDetailsOperation.js
@@ -17,14 +17,14 @@ const analyseFileConflictDetails = async appState => {
const { selectedConflict: { files, selectedBranch, conflictBranch, selectedFile } } = fileDetails;
const { file, changes } = files.get(selectedFile);
-
+ console.log(fileDetails.selectedConflict.selectedFile, selectedFile, files.get(selectedFile));
const blobIndex = file.url.indexOf('blob/');
if (!githubExpression.test(file.url) || blobIndex === -1) {
- console.log('No tu wien binocular url');
+ console.log('Only GitHub content supported');
return {
fileDetails: {
selectedConflict: fileDetails.selectedConflict,
- fetchError: 'No Github file detected'
+ error: 'No Github file detected'
}
};
}
@@ -32,28 +32,31 @@ const analyseFileConflictDetails = async appState => {
const repositoryUrl = file.url.substring(0, blobIndex);
const githubContentUrl = repositoryUrl.replace('github.com', 'raw.githubusercontent.com');
- const results = await Promise.all([
- fetch(`${githubContentUrl}${conflictBranch}/${file.path}`, { mode: 'cors' })
- ]);
+ const results = await Promise.all([fetch(`${githubContentUrl}${conflictBranch}/${file.path}`, { mode: 'cors' })]);
if (results.filter(response => response.status >= 400).length >= 1) {
return {
fileDetails: {
selectedConflict: fileDetails.selectedConflict,
- fetchError: 'Could not fetch files from Github'
+ error: 'Could not fetch files from Github'
}
};
}
const resultData = await Promise.all(results.map(r => r.text()));
try {
const trees = resultData.map(d => MyParser.parse(d, { ecmaVersion: 2020, sourceType: 'module', locations: true }));
- const changedNodes = getChangedAstNodes(trees[0], changes, conflictBranch);
-
+ const changeDescriptions = [];
+ for (const changedNode of getChangedAstNodes(trees[0], changes, selectedBranch)) {
+ changeDescriptions.push({
+ type: splitPascalCase(changedNode.type).reduce((a, b) => `${a} ${b}`),
+ start: changedNode.loc.start.line,
+ end: changedNode.loc.end.line
+ });
+ }
- fileDetails.changes = changedNodes;
+ fileDetails.changes = changeDescriptions;
} catch (e) {
- fileDetails.parsingError = e;
- console.error(e);
+ fileDetails.error = e;
}
fileDetails.repositoryUrl = repositoryUrl + 'blob/';
return { fileDetails };