Browse Source

feat: repo details show identifier and name

as the identifier may be useful and different from name
master
DanConwayDev 2 years ago
parent
commit
32688b87f9
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. BIN
      __snapshots__/repo-details--loading.png
  2. BIN
      __snapshots__/repo-details--long-and-no-spaces.png
  3. BIN
      __snapshots__/repo-details--long-details.png
  4. BIN
      __snapshots__/repo-details--no-clone.png
  5. BIN
      __snapshots__/repo-details--no-description.png
  6. BIN
      __snapshots__/repo-details--no-maintainers-or-relays.png
  7. BIN
      __snapshots__/repo-details--no-maintainers.png
  8. BIN
      __snapshots__/repo-details--no-name-or-description.png
  9. BIN
      __snapshots__/repo-details--no-relays.png
  10. BIN
      __snapshots__/repo-details--no-tags.png
  11. BIN
      __snapshots__/repo-details--no-web.png
  12. BIN
      __snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png
  13. BIN
      __snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png
  14. BIN
      __snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png
  15. BIN
      __snapshots__/repo-details--short-details.png
  16. 190
      __snapshots__/repo-details.test.js.snap
  17. 31
      src/lib/components/repo/RepoDetails.svelte

BIN
__snapshots__/repo-details--loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
__snapshots__/repo-details--long-and-no-spaces.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
__snapshots__/repo-details--long-details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 81 KiB

BIN
__snapshots__/repo-details--no-clone.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 50 KiB

BIN
__snapshots__/repo-details--no-description.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 52 KiB

BIN
__snapshots__/repo-details--no-maintainers-or-relays.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 36 KiB

BIN
__snapshots__/repo-details--no-maintainers.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 41 KiB

BIN
__snapshots__/repo-details--no-name-or-description.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 52 KiB

BIN
__snapshots__/repo-details--no-relays.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
__snapshots__/repo-details--no-tags.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 49 KiB

BIN
__snapshots__/repo-details--no-web.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 48 KiB

BIN
__snapshots__/repo-details--one-maintainer-s-profile-has-no-display-name-or-name.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 53 KiB

BIN
__snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
__snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 55 KiB

BIN
__snapshots__/repo-details--short-details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 41 KiB

190
__snapshots__/repo-details.test.js.snap

@ -2,12 +2,24 @@ @@ -2,12 +2,24 @@
exports[`Repo/Details Long Details smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Long Name that goes on and on and on and on and on and on and on and on and on
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
<p class="my-2 break-words text-sm">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.
Lorem ipsum dolor sit amet, con...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie.
</p>
<div>
<div class="badge badge-secondary mr-2">
@ -120,6 +132,18 @@ exports[`Repo/Details Long Details smoke-test 1`] = ` @@ -120,6 +132,18 @@ exports[`Repo/Details Long Details smoke-test 1`] = `
exports[`Repo/Details Long and No Spaces smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -237,6 +261,18 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = ` @@ -237,6 +261,18 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = `
exports[`Repo/Details No Clone smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -347,7 +383,23 @@ exports[`Repo/Details No Clone smoke-test 1`] = ` @@ -347,7 +383,23 @@ exports[`Repo/Details No Clone smoke-test 1`] = `
exports[`Repo/Details No Description smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
<div>
none
</div>
<div>
<div class="badge badge-secondary mr-2">
@ -460,6 +512,18 @@ exports[`Repo/Details No Description smoke-test 1`] = ` @@ -460,6 +512,18 @@ exports[`Repo/Details No Description smoke-test 1`] = `
exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -525,6 +589,18 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = ` @@ -525,6 +589,18 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `
exports[`Repo/Details No Maintainers smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -596,7 +672,23 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = ` @@ -596,7 +672,23 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = `
exports[`Repo/Details No Name or Description smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<div>
none
</div>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
<div>
none
</div>
<div>
<div class="badge badge-secondary mr-2">
@ -709,6 +801,18 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = ` @@ -709,6 +801,18 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = `
exports[`Repo/Details No Relays smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -820,6 +924,18 @@ exports[`Repo/Details No Relays smoke-test 1`] = ` @@ -820,6 +924,18 @@ exports[`Repo/Details No Relays smoke-test 1`] = `
exports[`Repo/Details No Tags smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -925,6 +1041,18 @@ exports[`Repo/Details No Tags smoke-test 1`] = ` @@ -925,6 +1041,18 @@ exports[`Repo/Details No Tags smoke-test 1`] = `
exports[`Repo/Details No Web smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -1033,6 +1161,18 @@ exports[`Repo/Details No Web smoke-test 1`] = ` @@ -1033,6 +1161,18 @@ exports[`Repo/Details No Web smoke-test 1`] = `
exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -1146,6 +1286,18 @@ exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke- @@ -1146,6 +1286,18 @@ exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke-
exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -1260,6 +1412,18 @@ exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = ` @@ -1260,6 +1412,18 @@ exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = `
exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -1377,6 +1541,18 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name @@ -1377,6 +1541,18 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name
exports[`Repo/Details Short Details smoke-test 1`] = `
<div class="prose w-full max-w-md">
<h4>
name
</h4>
<p class="my-2 break-words text-sm">
Short Name
</p>
<h4>
identifier
</h4>
<p class="my-2 break-words text-sm">
9ee507fc4357d7ee16a5d8901bedcd103f23c17d
</p>
<h4>
description
</h4>
@ -1448,6 +1624,18 @@ exports[`Repo/Details Short Details smoke-test 1`] = ` @@ -1448,6 +1624,18 @@ exports[`Repo/Details Short Details smoke-test 1`] = `
exports[`Repo/Details loading smoke-test 1`] = `
<div class="prose w-full max-w-md">
<div class="skeleton my-3 h-5 w-20">
</div>
<div class="skeleton my-2 h-4">
</div>
<div class="skeleton my-2 mb-3 h-4 w-2/3">
</div>
<div class="skeleton my-3 h-5 w-20">
</div>
<div class="skeleton my-2 h-4">
</div>
<div class="skeleton my-2 mb-3 h-4 w-2/3">
</div>
<div class="skeleton my-3 h-5 w-20">
</div>
<div class="skeleton my-2 h-4">

31
src/lib/components/repo/RepoDetails.svelte

@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
loading,
} = event_defaults
$: short_descrption =
description.length > 500 ? description.slice(0, 450) + '...' : description
!description && description.length > 500
? description.slice(0, 450) + '...'
: description
</script>
<div class="prose w-full max-w-md">
@ -26,8 +28,31 @@ @@ -26,8 +28,31 @@
<div class="skeleton my-3 h-5 w-20"></div>
<div class="skeleton my-2 h-4"></div>
<div class="skeleton my-2 mb-3 h-4 w-2/3"></div>
{:else if description.length == 0}
<div />
{:else if !name || name.length == 0}
<h4>name</h4>
<div>none</div>
{:else}
<h4>name</h4>
<p class="my-2 break-words text-sm">{name}</p>
{/if}
{#if loading}
<div class="skeleton my-3 h-5 w-20"></div>
<div class="skeleton my-2 h-4"></div>
<div class="skeleton my-2 mb-3 h-4 w-2/3"></div>
{:else if !identifier || identifier.length == 0}
<h4>identifier</h4>
<div>none</div>
{:else}
<h4>identifier</h4>
<p class="my-2 break-words text-sm">{identifier}</p>
{/if}
{#if loading}
<div class="skeleton my-3 h-5 w-20"></div>
<div class="skeleton my-2 h-4"></div>
<div class="skeleton my-2 mb-3 h-4 w-2/3"></div>
{:else if !short_descrption || description.length == 0}
<h4>description</h4>
<div>none</div>
{:else}
<h4>description</h4>
<p class="my-2 break-words text-sm">{short_descrption}</p>

Loading…
Cancel
Save