diff --git a/src/components/Pullrequest/Pullrequest.scss b/src/components/Pullrequest/Pullrequest.scss index dc61162..a1de509 100644 --- a/src/components/Pullrequest/Pullrequest.scss +++ b/src/components/Pullrequest/Pullrequest.scss @@ -152,6 +152,11 @@ border-color: red; color: red; } + + &--auto-complete { + border-color: green; + color: green; + } } @media (prefers-color-scheme: dark) { diff --git a/src/components/Pullrequest/Pullrequest.svelte b/src/components/Pullrequest/Pullrequest.svelte index db167c2..21dd243 100644 --- a/src/components/Pullrequest/Pullrequest.svelte +++ b/src/components/Pullrequest/Pullrequest.svelte @@ -30,32 +30,6 @@ const openUrl = () => shell.openExternal(makeUrl(pullRequest)); - const hasStatusLabel = pullrequest => (pullrequest.mergeStatus && pullrequest.mergeStatus === "conflicts") || pullrequest.isDraft; - - const getStatusLabel = pullrequest => { - if (pullrequest.mergeStatus && pullrequest.mergeStatus === "conflicts") { - return 'Conflicts'; - } - - if (pullrequest.isDraft) { - return 'Draft'; - } - - return ''; - } - - const getStatusStyle = pullrequest => { - if (pullrequest.mergeStatus && pullrequest.mergeStatus === "conflicts") { - return '--conflicts'; - } - - if (pullrequest.isDraft) { - return '--draft'; - } - - return ''; - } - const getAvatarUrl = pr => getAvatar(pr.createdBy.id, pr.organizationName, pr.createdBy.descriptor); const getTime = pullrequest => { @@ -100,9 +74,19 @@ {pullRequest.repository.project.name}

- {#if hasStatusLabel(pullRequest)} - - {getStatusLabel(pullRequest)} + {#if pullRequest.autoCompleteSetBy} + + Auto complete + + {/if} + {#if pullRequest.isDraft} + + Draft + + {/if} + {#if pullRequest.mergeStatus && pullRequest.mergeStatus === 'conflicts'} + + Conflicts {/if} {pullRequest.title}