Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Improve UX on issue and patches stats
Sebastian Martinez committed 3 years ago
commit e5f9317436f24f73f521484c5fcdd832d9d56699
parent 0d6179d283388cb857be5c8fc8ad8e57e866a4bd
2 files changed +12 -15
modified src/base/projects/Header.svelte
@@ -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)
modified src/project.ts
@@ -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;