diff --git a/cypress/e2e/project.spec.ts b/cypress/e2e/project.spec.ts index 768506b53..262879f79 100644 --- a/cypress/e2e/project.spec.ts +++ b/cypress/e2e/project.spec.ts @@ -139,12 +139,15 @@ describe("Project view", () => { cy.wrap($el).each((commit, commitIndex) => { expect(Cypress.$(commit).find(".hash").text()).to.eq(groupedCommits[index].commits[commitIndex].header.sha); expect(Cypress.$(commit).find(".summary").text()).to.eq(groupedCommits[index].commits[commitIndex].header.summary); - expect(Cypress.$(commit).find(".committer").text()).to.eq(groupedCommits[index].commits[commitIndex].header.committer.name); + expect(Cypress.$(commit).find(".committer").first().text()).to.eq(groupedCommits[index].commits[commitIndex].header.committer.name); }); }); // Checking that the initial commit has the Verified badge - cy.get(".badge").last().should("have.text", "Verified"); + cy.get(".verified-popup-body").should("have.text", "This commit was signed\n with the committer's radicle key."); + cy.get(".verified-popup-peer").should("have.text", "hyyg555wwkkutaysg6yr67qnu5d5ji54iur3n5uzzszndh8dp7ofue"); + cy.get(".verified-popup .verified-committer").should("have.text", "dabit3"); + cy.get(".commit").last().click(); }); @@ -183,3 +186,4 @@ describe("Project view", () => { cy.get("div.stat.patch-count").should("have.class", "active"); }); }); + diff --git a/public/index.css b/public/index.css index fd9235e95..8f8539511 100644 --- a/public/index.css +++ b/public/index.css @@ -329,7 +329,7 @@ label.input { background-color: var(--color-negative); } -.dropdown { +.dropdown, .popup { background-color: var(--color-foreground-background); margin-top: 0.5rem; position: absolute; @@ -449,6 +449,9 @@ span.small, .text-xsmall { text-overflow: ellipsis; overflow-x: hidden; } +.text-faded { + color: var(--color-foreground-faded); +} .notice { font-size: 0.875rem; diff --git a/src/Popup.svelte b/src/Popup.svelte new file mode 100644 index 000000000..bf6bd4f6c --- /dev/null +++ b/src/Popup.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/base/projects/Commit/CommitAuthorship.svelte b/src/base/projects/Commit/CommitAuthorship.svelte index df5d82fdb..1f20f64f2 100644 --- a/src/base/projects/Commit/CommitAuthorship.svelte +++ b/src/base/projects/Commit/CommitAuthorship.svelte @@ -3,6 +3,8 @@ import { formatTimestamp, gravatarURL } from "@app/utils"; export let commit: CommitMetadata; + export let showTime = true; + export let showAuthor = true; - avatar {#if commit.header.author.email === commit.header.committer.email} + avatar {#if commit.context?.committer} {commit.context?.committer.peer.person.name} @@ -46,8 +48,11 @@  committed {/if} {:else} - {commit.header.author.name} -  authored  + {#if showAuthor} + avatar + {commit.header.author.name} +  authored  + {/if} avatar {#if commit.context?.committer} @@ -61,6 +66,8 @@  committed {/if} {/if} -   - {formatTimestamp(commit.header.committerTime)} + {#if showTime} +   + {formatTimestamp(commit.header.committerTime)} + {/if} diff --git a/src/base/projects/Commit/CommitTeaser.svelte b/src/base/projects/Commit/CommitTeaser.svelte index f403316f2..57cea8cd9 100644 --- a/src/base/projects/Commit/CommitTeaser.svelte +++ b/src/base/projects/Commit/CommitTeaser.svelte @@ -5,6 +5,7 @@ import Icon from "@app/Icon.svelte"; import CommitAuthorship from "./CommitAuthorship.svelte"; + import CommitVerifiedBadge from "./CommitVerifiedBadge.svelte"; export let commit: CommitMetadata; @@ -57,9 +58,6 @@ text-overflow: ellipsis; padding-right: 1rem; } - .badge { - margin: 0; - } .browse { display: flex; z-index: 10; @@ -74,7 +72,7 @@ .column-left { overflow: hidden; } - .badge, .browse { + .browse { display: none !important; } .summary { @@ -96,9 +94,7 @@
- {#if commit.context.committer} - Verified - {/if} + {formatCommit(commit.header.sha1)}
browseCommit(commit.header.sha1)}> diff --git a/src/base/projects/Commit/CommitVerifiedBadge.svelte b/src/base/projects/Commit/CommitVerifiedBadge.svelte new file mode 100644 index 000000000..9fd9231e0 --- /dev/null +++ b/src/base/projects/Commit/CommitVerifiedBadge.svelte @@ -0,0 +1,69 @@ + + + + +{#if commit.context.committer} + + Verified +
+ +
+
+ ✔ +
+
+ This commit was signed + with the committer's radicle key.
+
+
+ +
+ {commit.context.committer?.peer.id} +
+
+
+
+
+{/if} diff --git a/tsconfig.json b/tsconfig.json index f9272b5a1..7f77544b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,7 @@ "skipLibCheck": true, "paths": { "@public/*": ["./public/*"], - "@app/*": ["./src/*"], + "@app/*": ["./src/*"] } }, "noEmit": true