Add user page

This commit is contained in:
Sebastian Martinez
2024-07-31 12:33:05 -03:00
parent ab71fdcc1d
commit a1dc7fc2ef
32 changed files with 821 additions and 53 deletions
+1 -1
View File
@@ -57,7 +57,7 @@
{#each assignees as { id }}
<Badge variant="neutral" size="small">
<div class="assignee">
<Avatar inline nodeId={id} />
<Avatar variant="small" nodeId={id} />
<span>{formatNodeId(id)}</span>
</div>
</Badge>
+6 -1
View File
@@ -1,9 +1,11 @@
<script lang="ts">
import type { BaseUrl } from "@http-client";
import type { PatchReviews } from "../Patch.svelte";
import Icon from "@app/components/Icon.svelte";
import NodeId from "@app/components/NodeId.svelte";
export let baseUrl: BaseUrl;
export let reviews: PatchReviews;
</script>
@@ -69,7 +71,10 @@
<Icon name="chat" />
{/if}
</span>
<NodeId nodeId={review.author.id} alias={review.author.alias} />
<NodeId
{baseUrl}
nodeId={review.author.id}
alias={review.author.alias} />
</div>
{:else}
<div class="txt-missing no-reviews">No reviews</div>
+10 -2
View File
@@ -378,7 +378,10 @@
style:padding="0 0.375rem">
<Icon name="patch" />
</div>
<NodeId nodeId={revisionAuthor.id} alias={revisionAuthor.alias} />
<NodeId
{baseUrl}
nodeId={revisionAuthor.id}
alias={revisionAuthor.alias} />
{#if patchId === revisionId}
opened this patch on base
<Id id={revisionBase} style="commit" />
@@ -455,7 +458,10 @@
{#each timelines as element}
{#if element.type === "thread"}
<div class="connector" />
<Thread thread={element.inner} rawPath={rawPath(revisionBase)} />
<Thread
{baseUrl}
thread={element.inner}
rawPath={rawPath(revisionBase)} />
{:else if element.type === "merge"}
<div class="connector" />
<div class="action merge">
@@ -465,6 +471,7 @@
</div>
<NodeId
{baseUrl}
nodeId={element.inner.author.id}
alias={element.inner.author.alias}>
</NodeId>
@@ -489,6 +496,7 @@
class:positive-review={review.verdict === "accept"}
class:negative-review={review.verdict === "reject"}>
<CommentComponent
{baseUrl}
id={review.id}
rawPath={rawPath(revisionBase)}
authorId={author}
+8 -2
View File
@@ -181,7 +181,10 @@
{issue.state.reason}
</Badge>
{/if}
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
<NodeId
{baseUrl}
nodeId={issue.author.id}
alias={issue.author.alias} />
opened
<Id id={issue.id} />
<span title={utils.absoluteTimestamp(issue.discussion[0].timestamp)}>
@@ -228,7 +231,10 @@
<div class="connector" />
<div class="threads">
{#each threads as thread, i (thread.root.id)}
<ThreadComponent {thread} rawPath={rawPath(project.head)} />
<ThreadComponent
{baseUrl}
{thread}
rawPath={rawPath(project.head)} />
{#if i < threads.length - 1}
<div class="connector" />
{/if}
+1 -1
View File
@@ -119,7 +119,7 @@
{/if}
<div
style="display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;">
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
<NodeId {baseUrl} nodeId={issue.author.id} alias={issue.author.alias} />
opened
<Id id={issue.id} />
<span title={absoluteTimestamp(issue.discussion[0].timestamp)}>
+1 -1
View File
@@ -126,7 +126,7 @@
<Separator />
<span class="breadcrumb">
<span class="breadcrumb" title={project.id}>
<Link
route={{
resource: "project.source",
+6 -3
View File
@@ -355,7 +355,10 @@
insertions={stats.insertions}
deletions={stats.deletions} />
</Link>
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
<NodeId
{baseUrl}
nodeId={patch.author.id}
alias={patch.author.alias} />
opened
<Id id={patch.id} />
<span title={utils.absoluteTimestamp(patch.revisions[0].timestamp)}>
@@ -376,7 +379,7 @@
<div
style:margin-top="2rem"
style="display: flex; flex-direction: column; gap: 0.5rem;">
<Reviews {reviews} />
<Reviews {baseUrl} {reviews} />
<Labels labels={patch.labels} />
<Embeds embeds={uniqueEmbeds} />
</div>
@@ -500,7 +503,7 @@
</div>
<div class="metadata global-hide-on-medium-desktop-down">
<Reviews {reviews} />
<Reviews {baseUrl} {reviews} />
<Labels labels={patch.labels} />
<Embeds embeds={uniqueEmbeds} />
</div>
+4 -1
View File
@@ -133,7 +133,10 @@
{/if}
<div
style="display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;">
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
<NodeId
{baseUrl}
nodeId={patch.author.id}
alias={patch.author.alias} />
{patch.revisions.length > 1 ? "updated" : "opened"}
<Id id={patch.id} />
{#if patch.revisions.length > 1}
+2
View File
@@ -240,6 +240,7 @@
<div class="bottom">
<div class="repo box" class:expanded>
<ContextRepo
{baseUrl}
projectThreshold={project.threshold}
projectDelegates={project.delegates}
{seedingPolicy} />
@@ -286,6 +287,7 @@
<div slot="popover" class="txt-small" style:width="18rem">
<ContextRepo
{baseUrl}
projectThreshold={project.threshold}
projectDelegates={project.delegates}
{seedingPolicy} />
+10 -6
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Project, SeedingPolicy } from "@http-client";
import type { BaseUrl, Project, SeedingPolicy } from "@http-client";
import { capitalize } from "lodash";
@@ -7,6 +7,7 @@
import Icon from "@app/components/Icon.svelte";
import NodeId from "@app/components/NodeId.svelte";
export let baseUrl: BaseUrl;
export let projectThreshold: number;
export let projectDelegates: Project["delegates"];
export let seedingPolicy: SeedingPolicy;
@@ -30,6 +31,7 @@
margin-bottom: 0;
}
.nid {
height: 21.5px;
margin: 0.5rem 0;
}
</style>
@@ -55,11 +57,13 @@
changes to be included in the canonical branch.
{/if}
</div>
{#each projectDelegates as delegate}
<div class="nid">
<NodeId nodeId={delegate.id} alias={delegate.alias} />
</div>
{/each}
<div class="delegates">
{#each projectDelegates as delegate}
<div class="nid">
<NodeId {baseUrl} nodeId={delegate.id} alias={delegate.alias} />
</div>
{/each}
</div>
{/if}
<div class="item-header">
<span style:text-wrap="nowrap">Seeding Scope</span>
@@ -128,7 +128,7 @@
{#if selectedPeer}
<div class="global-flex-item">
<div class="node-id">
<Avatar nodeId={selectedPeer.id} inline />
<Avatar nodeId={selectedPeer.id} variant="small" />
{selectedPeer.alias || formatNodeId(selectedPeer.id)}
</div>
@@ -38,7 +38,10 @@
<IconButton title="Expand peer" on:click={() => (expanded = !expanded)}>
<Icon name={expanded ? "chevron-down" : "chevron-right"} />
</IconButton>
<NodeId nodeId={peer.remote.id} alias={peer.remote.alias} />
<NodeId
baseUrl={baseRoute.node}
nodeId={peer.remote.id}
alias={peer.remote.alias} />
{#if peer.remote.delegate}
<Badge size="tiny" variant="delegate">
<Icon name="badge" />
+7 -7
View File
@@ -274,7 +274,7 @@ export async function loadProjectRoute(
const [project, commit, seedingPolicy, node] = await Promise.all([
api.project.getById(route.project),
api.project.getCommitBySha(route.project, route.commit),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
api.getNode(),
]);
@@ -326,7 +326,7 @@ async function loadPatchesView(
page: 0,
perPage: PATCHES_PER_PAGE,
}),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
api.getNode(),
]);
@@ -356,7 +356,7 @@ async function loadIssuesView(
page: 0,
perPage: ISSUES_PER_PAGE,
}),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
api.getNode(),
]);
@@ -397,7 +397,7 @@ async function loadTreeView(
} else {
projectPromise = api.project.getById(route.project);
peersPromise = api.project.getAllRemotes(route.project);
seedingPolicyPromise = api.getPoliciesById(route.project);
seedingPolicyPromise = api.getPolicyById(route.project);
}
const [project, peers, seedingPolicy, node] = await Promise.all([
@@ -514,7 +514,7 @@ async function loadHistoryView(
const [project, peers, seedingPolicy, branchMap, node] = await Promise.all([
api.project.getById(route.project),
api.project.getAllRemotes(route.project),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
getPeerBranches(api, route.project, route.peer),
api.getNode(),
]);
@@ -572,7 +572,7 @@ async function loadIssueView(
const [project, issue, seedingPolicy, node] = await Promise.all([
api.project.getById(route.project),
api.project.getIssueById(route.project, route.issue),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
api.getNode(),
]);
return {
@@ -600,7 +600,7 @@ async function loadPatchView(
const [project, patch, seedingPolicy, node] = await Promise.all([
api.project.getById(route.project),
api.project.getPatchById(route.project, route.patch),
api.getPoliciesById(route.project),
api.getPolicyById(route.project),
api.getNode(),
]);
const latestRevision = patch.revisions[patch.revisions.length - 1];