mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Improve UX on issue and patches stats
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -122,8 +122,8 @@
|
||||
{#if seed.api.host}
|
||||
<div
|
||||
class="stat seed clickable widget"
|
||||
on:click={() => navigate(`/seeds/${seed.api.host}`)}
|
||||
title="Project data is fetched from this seed">
|
||||
on:click={() => navigate(`/seeds/${seed.api.host}`)}
|
||||
<span>{seed.api.host}</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -134,29 +134,25 @@
|
||||
on:click={() => toggleContent(ProjectContent.History, true)}>
|
||||
<strong>{tree.stats.commits}</strong> commit(s)
|
||||
</div>
|
||||
{#if project.issues > 0}
|
||||
{#if project.issues}
|
||||
<div
|
||||
class="stat issue-count clickable widget"
|
||||
class:active={content === ProjectContent.Issues}
|
||||
class:not-allowed={project.issues === 0}
|
||||
class:clickable={project.issues > 0}
|
||||
on:click={() => toggleContent(ProjectContent.Issues, false)}>
|
||||
<strong>{project.issues}</strong> issue(s)
|
||||
</div>
|
||||
{:else}
|
||||
<div class="stat issue-count not-allowed widget" title="Not supported">
|
||||
0 issue(s)
|
||||
</div>
|
||||
{/if}
|
||||
{#if project.patches > 0}
|
||||
{#if project.patches}
|
||||
<div
|
||||
class="stat patch-count clickable widget"
|
||||
class:active={content === ProjectContent.Patches}
|
||||
class:not-allowed={project.patches === 0}
|
||||
class:clickable={project.patches > 0}
|
||||
on:click={() => toggleContent(ProjectContent.Patches, false)}>
|
||||
<strong>{project.patches}</strong> patch(es)
|
||||
</div>
|
||||
{:else}
|
||||
<div class="stat patch-count not-allowed widget" title="Not supported">
|
||||
0 patch(es)
|
||||
</div>
|
||||
{/if}
|
||||
<div class="stat contributor-count widget">
|
||||
<strong>{tree.stats.contributors}</strong> contributor(s)
|
||||
|
||||
+5
-4
@@ -57,8 +57,8 @@ export interface ProjectInfo {
|
||||
defaultBranch: string;
|
||||
delegates: Delegate[];
|
||||
remotes: PeerId[];
|
||||
patches: number;
|
||||
issues: number;
|
||||
patches?: number;
|
||||
issues?: number;
|
||||
}
|
||||
|
||||
export interface Tree {
|
||||
@@ -267,8 +267,9 @@ export class Project implements ProjectInfo {
|
||||
branches: Branches;
|
||||
profile: Profile | null;
|
||||
anchors: string[];
|
||||
patches: number;
|
||||
issues: number;
|
||||
// At the moment we still have seed nodes which won't return neither patches or issues
|
||||
patches?: number;
|
||||
issues?: number;
|
||||
|
||||
constructor(urn: string, info: ProjectInfo, seed: Seed, peers: Peer[], branches: Branches, profile: Profile | null, anchors: string[]) {
|
||||
this.urn = urn;
|
||||
|
||||
Reference in New Issue
Block a user