-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6050 from gitbutlerapp/sc-review-ui-tweaks
Lots of Review UI updates
- Loading branch information
Showing
15 changed files
with
251 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
PUBLIC_APP_HOST=https://app.gitbutler.com/ | ||
PUBLIC_CLOUD_HOST=https://cloud.gitbutler.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/web/src/lib/components/review/BranchStatusBadge.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import Badge from '@gitbutler/ui/Badge.svelte'; | ||
import type { Branch, Patch } from '@gitbutler/shared/branches/types'; | ||
type Props = { | ||
branch: Branch; | ||
}; | ||
const { branch }: Props = $props(); | ||
const patches = branch.patches; | ||
let anyRejected = patches.some((patch: Patch) => patch.reviewAll.rejected.length > 0); | ||
let someApproved = patches.some((patch: Patch) => patch.reviewAll.signedOff.length > 0); | ||
let allApproved = !patches.some((patch: Patch) => patch.reviewAll.signedOff.length === 0); | ||
</script> | ||
|
||
<div class="container"> | ||
{#if anyRejected} | ||
<Badge style="error">Changes Requested</Badge> | ||
{:else if allApproved} | ||
<Badge style="success">Approved</Badge> | ||
{:else if someApproved} | ||
<Badge style="warning">In Discussion</Badge> | ||
{:else} | ||
<Badge style="neutral" kind="soft">Unreviewed</Badge> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script lang="ts"> | ||
import type { Branch, Patch } from '@gitbutler/shared/branches/types'; | ||
type Props = { | ||
branch: Branch; | ||
}; | ||
const { branch }: Props = $props(); | ||
const patches = branch.patches; | ||
function getClass(patch: Patch) { | ||
if (patch.reviewAll.rejected.length > 0) { | ||
return 'block rejected'; | ||
} | ||
if (patch.reviewAll.signedOff.length > 0) { | ||
return 'block signoff'; | ||
} | ||
return 'block'; | ||
} | ||
</script> | ||
|
||
<div class="container"> | ||
<p class="fact">{branch.stackSize}</p> | ||
<table class="graph" width="100%"> | ||
<tbody> | ||
<tr> | ||
{#each patches as patch} | ||
<td class="patch"><div class={getClass(patch)}> </div></td> | ||
{/each} | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
font-size: 0.8em; | ||
color: var(--clr-text-2); | ||
} | ||
.fact { | ||
margin-right: 8px; | ||
} | ||
.rejected { | ||
background-color: var(--clr-scale-err-50); | ||
} | ||
.signoff { | ||
background-color: var(--clr-scale-succ-50); | ||
} | ||
.discuss { | ||
background-color: var(--clr-scale-warn-50); | ||
} | ||
.block { | ||
margin-left: 0.5px; | ||
} | ||
</style> |
27 changes: 27 additions & 0 deletions
27
apps/web/src/lib/components/review/PatchReviewersGroup.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import AvatarGroup from '@gitbutler/ui/avatar/AvatarGroup.svelte'; | ||
import { gravatarUrlFromEmail } from '@gitbutler/ui/avatar/gravatar'; | ||
import type { Patch } from '@gitbutler/shared/branches/types'; | ||
type Props = { | ||
patch: Patch; | ||
}; | ||
const { patch }: Props = $props(); | ||
async function getContributorsWithAvatars(patch: Patch) { | ||
return await Promise.all( | ||
patch.reviewAll.viewed.map(async (contributor) => { | ||
return { | ||
srcUrl: await gravatarUrlFromEmail(contributor), | ||
name: contributor | ||
}; | ||
}) | ||
); | ||
} | ||
const avatars = $derived(getContributorsWithAvatars(patch)); | ||
</script> | ||
|
||
{#await avatars then avatars} | ||
<div class="container"><AvatarGroup {avatars} /></div> | ||
{/await} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.