From 4bf860075a4519ade70201d9cb17de1d7eb4e5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Boukorras?= Date: Thu, 28 May 2020 11:05:22 +0200 Subject: [PATCH 1/2] fix(PullRequest): Draft and confilcts display --- src/components/Pullrequest/Pullrequest.svelte | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/src/components/Pullrequest/Pullrequest.svelte b/src/components/Pullrequest/Pullrequest.svelte index db167c2..62e36bd 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,14 @@ {pullRequest.repository.project.name}

- {#if hasStatusLabel(pullRequest)} - - {getStatusLabel(pullRequest)} + {#if pullRequest.isDraft} + + Draft + + {/if} + {#if pullRequest.mergeStatus && pullRequest.mergeStatus === 'conflicts'} + + Conflicts {/if} {pullRequest.title} From ad24efe22f484bf4ae54830766303a30f6a46aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Boukorras?= Date: Thu, 28 May 2020 14:36:37 +0200 Subject: [PATCH 2/2] feat(PullRequest): Auto complete status --- src/components/Pullrequest/Pullrequest.scss | 5 +++++ src/components/Pullrequest/Pullrequest.svelte | 5 +++++ 2 files changed, 10 insertions(+) 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 62e36bd..21dd243 100644 --- a/src/components/Pullrequest/Pullrequest.svelte +++ b/src/components/Pullrequest/Pullrequest.svelte @@ -74,6 +74,11 @@ {pullRequest.repository.project.name}

+ {#if pullRequest.autoCompleteSetBy} + + Auto complete + + {/if} {#if pullRequest.isDraft} Draft