mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-24 18:12:48 +03:00
fix: upstream commits accordion and cards (#5044)
This commit is contained in:
parent
d8df95efc8
commit
1d4f5f6762
@ -75,7 +75,8 @@
|
|||||||
files = await listRemoteCommitFiles(project.id, commit.id);
|
files = await listRemoteCommitFiles(project.id, commit.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleFiles() {
|
function toggleFiles(e?: MouseEvent) {
|
||||||
|
e?.stopPropagation();
|
||||||
if (!filesToggleable) return;
|
if (!filesToggleable) return;
|
||||||
showDetails = !showDetails;
|
showDetails = !showDetails;
|
||||||
|
|
||||||
|
@ -25,57 +25,12 @@ function generateLineData({
|
|||||||
line.top.type = 'Upstream';
|
line.top.type = 'Upstream';
|
||||||
line.bottom.type = 'Upstream';
|
line.bottom.type = 'Upstream';
|
||||||
line.commitNode = { type: 'Upstream', commit };
|
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 }) => {
|
localBranchGroups.forEach(({ commit, line }) => {
|
||||||
line.top.type = 'Local';
|
line.top.type = 'Local';
|
||||||
line.bottom.type = 'Local';
|
line.bottom.type = 'Local';
|
||||||
line.commitNode = { type: 'Local', commit };
|
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 }) => {
|
localAndRemoteBranchGroups.forEach(({ commit, line }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user