fix: upstream commits accordion and cards (#5044)

This commit is contained in:
Nico Domino 2024-10-04 17:42:04 +02:00 committed by GitHub
parent d8df95efc8
commit 1d4f5f6762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 46 deletions

View File

@ -75,7 +75,8 @@
files = await listRemoteCommitFiles(project.id, commit.id);
}
function toggleFiles() {
function toggleFiles(e?: MouseEvent) {
e?.stopPropagation();
if (!filesToggleable) return;
showDetails = !showDetails;

View File

@ -25,57 +25,12 @@ function generateLineData({
line.top.type = 'Upstream';
line.bottom.type = 'Upstream';
line.commitNode = { type: 'Upstream', commit };
// If there are local commits we want to fill in a local dashed line
if (localBranchGroups.length > 0) {
line.commitNode.type = 'Local';
line.top.type = 'Local';
line.bottom.type = 'Local';
line.top.style = 'dashed';
line.bottom.style = 'dashed';
}
});
let localCommitWithChangeIdFound = false;
localBranchGroups.forEach(({ commit, line }) => {
line.top.type = 'Local';
line.bottom.type = 'Local';
line.commitNode = { type: 'Local', commit };
if (localCommitWithChangeIdFound) {
// If a commit with a change ID has been found above this commit, use the leftStyle
line.top.type = 'LocalShadow';
line.bottom.type = 'LocalShadow';
if (commit.relatedRemoteCommit) {
line.commitNode = {
type: 'LocalShadow',
commit
};
}
} else {
if (commit.relatedRemoteCommit) {
// For the first commit with a change ID found, only set the top if there are any remote commits
if (remoteBranchGroups.length > 0) {
line.top.type = 'LocalShadow';
}
line.commitNode = {
type: 'LocalShadow',
commit
};
line.bottom.type = 'LocalShadow';
localCommitWithChangeIdFound = true;
} else {
// If there are any remote commits, continue the line
if (remoteBranchGroups.length > 0) {
line.top.type = 'LocalRemote';
line.bottom.type = 'LocalRemote';
line.commitNode.type = 'LocalRemote';
}
}
}
});
localAndRemoteBranchGroups.forEach(({ commit, line }) => {