Browse Source

feat(RepoPage): display git server

display the git-server present in the repo event.

fix a bug where with would spill over if 1/3 the page was larger than
tailwinds md
master
DanConwayDev 2 years ago
parent
commit
17a35f0fda
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-description.png
  5. BIN
      __snapshots__/repo-details--no-git-server.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--one-maintainer-s-profile-has-no-display-name-or-name.png
  12. BIN
      __snapshots__/repo-details--one-maintainer-s-profile-not-loaded.png
  13. BIN
      __snapshots__/repo-details--one-maintainer-s-profile-only-has-display-name-but-no-name.png
  14. BIN
      __snapshots__/repo-details--short-details.png
  15. 251
      __snapshots__/repo-details.test.js.snap
  16. 2
      src/lib/components/repo/RepoDetails.stories.svelte
  17. 19
      src/lib/components/repo/RepoDetails.svelte
  18. 1
      src/lib/components/repo/vectors.ts
  19. 2
      src/lib/stores/repo.ts

BIN
__snapshots__/repo-details--loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 60 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 72 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
__snapshots__/repo-details--no-git-server.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 29 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 37 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 32 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 36 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 40 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 38 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: 38 KiB

After

Width:  |  Height:  |  Size: 43 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 28 KiB

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

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Repo/Details Long Details smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -23,6 +23,17 @@ exports[`Repo/Details Long Details smoke-test 1`] = ` @@ -23,6 +23,17 @@ exports[`Repo/Details Long Details smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -85,7 +96,7 @@ exports[`Repo/Details Long Details smoke-test 1`] = ` @@ -85,7 +96,7 @@ exports[`Repo/Details Long Details smoke-test 1`] = `
`;
exports[`Repo/Details Long and No Spaces smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -106,6 +117,17 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = ` @@ -106,6 +117,17 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -168,7 +190,7 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = ` @@ -168,7 +190,7 @@ exports[`Repo/Details Long and No Spaces smoke-test 1`] = `
`;
exports[`Repo/Details No Description smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<div>
</div>
<div>
@ -185,6 +207,104 @@ exports[`Repo/Details No Description smoke-test 1`] = ` @@ -185,6 +207,104 @@ exports[`Repo/Details No Description smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
</h4>
<div class="flex my-2">
<div class="avatar flex-none">
<div class="w-8 h-8 rounded">
<img class="my-0"
src="../test-profile-image.jpg"
alt="carole"
>
</div>
</div>
<div class="flex-auto pl-3 m-auto">
carole
</div>
</div>
<div class="flex my-2">
<div class="avatar flex-none">
<div class="w-8 h-8 rounded">
<img class="my-0"
src="../test-profile-image.jpg"
alt="bob"
>
</div>
</div>
<div class="flex-auto pl-3 m-auto">
bob
</div>
</div>
<div class="flex my-2">
<div class="avatar flex-none">
<div class="w-8 h-8 rounded">
<img class="my-0"
src="../test-profile-image.jpg"
alt="steve"
>
</div>
</div>
<div class="flex-auto pl-3 m-auto">
steve
</div>
</div>
</div>
<div>
<h4>
relays
</h4>
<div class="badge badge-secondary block my-2">
relay.damus.io
</div>
<div class="badge badge-secondary block my-2">
relay.snort.social
</div>
<div class="badge badge-secondary block my-2">
relayable.org
</div>
</div>
</div>
`;
exports[`Repo/Details No Git Server smoke-test 1`] = `
<div class="max-w-md prose w-full">
<h4>
description
</h4>
<p class="text-sm my-2 break-words">
short description
</p>
<div>
<div class="badge badge-secondary mr-2">
svelte
</div>
<div class="badge badge-secondary mr-2">
nostr
</div>
<div class="badge badge-secondary mr-2">
code-collaboration
</div>
<div class="badge badge-secondary mr-2">
git
</div>
</div>
<div>
<div>
</div>
</div>
<div>
<h4>
maintainers
@ -247,7 +367,7 @@ exports[`Repo/Details No Description smoke-test 1`] = ` @@ -247,7 +367,7 @@ exports[`Repo/Details No Description smoke-test 1`] = `
`;
exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -268,6 +388,17 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = ` @@ -268,6 +388,17 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<div>
</div>
@ -280,7 +411,7 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = ` @@ -280,7 +411,7 @@ exports[`Repo/Details No Maintainers or Relays smoke-test 1`] = `
`;
exports[`Repo/Details No Maintainers smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -301,6 +432,17 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = ` @@ -301,6 +432,17 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<div>
</div>
@ -323,7 +465,7 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = ` @@ -323,7 +465,7 @@ exports[`Repo/Details No Maintainers smoke-test 1`] = `
`;
exports[`Repo/Details No Name or Description smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<div>
</div>
<div>
@ -340,6 +482,17 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = ` @@ -340,6 +482,17 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -402,7 +555,7 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = ` @@ -402,7 +555,7 @@ exports[`Repo/Details No Name or Description smoke-test 1`] = `
`;
exports[`Repo/Details No Relays smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -423,6 +576,17 @@ exports[`Repo/Details No Relays smoke-test 1`] = ` @@ -423,6 +576,17 @@ exports[`Repo/Details No Relays smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -475,7 +639,7 @@ exports[`Repo/Details No Relays smoke-test 1`] = ` @@ -475,7 +639,7 @@ exports[`Repo/Details No Relays smoke-test 1`] = `
`;
exports[`Repo/Details No Tags smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -484,6 +648,17 @@ exports[`Repo/Details No Tags smoke-test 1`] = ` @@ -484,6 +648,17 @@ exports[`Repo/Details No Tags smoke-test 1`] = `
</p>
<div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -546,7 +721,7 @@ exports[`Repo/Details No Tags smoke-test 1`] = ` @@ -546,7 +721,7 @@ exports[`Repo/Details No Tags smoke-test 1`] = `
`;
exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -567,6 +742,17 @@ exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke- @@ -567,6 +742,17 @@ exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke-
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -625,7 +811,7 @@ exports[`Repo/Details One Maintainer's Profile Has No displayName or Name smoke- @@ -625,7 +811,7 @@ 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="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -646,6 +832,17 @@ exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = ` @@ -646,6 +832,17 @@ exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -705,7 +902,7 @@ exports[`Repo/Details One Maintainer's Profile Not Loaded smoke-test 1`] = ` @@ -705,7 +902,7 @@ 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="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -726,6 +923,17 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name @@ -726,6 +923,17 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<h4>
maintainers
@ -788,7 +996,7 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name @@ -788,7 +996,7 @@ exports[`Repo/Details One Maintainer's Profile Only Has displayName But No Name
`;
exports[`Repo/Details Short Details smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<h4>
description
</h4>
@ -809,6 +1017,17 @@ exports[`Repo/Details Short Details smoke-test 1`] = ` @@ -809,6 +1017,17 @@ exports[`Repo/Details Short Details smoke-test 1`] = `
git
</div>
</div>
<div>
<h4>
git server
</h4>
<a href="github.com/example/example"
target="_blank"
class="link link-primary break-words my-2"
>
github.com/example/example
</a>
</div>
<div>
<div>
</div>
@ -831,7 +1050,7 @@ exports[`Repo/Details Short Details smoke-test 1`] = ` @@ -831,7 +1050,7 @@ exports[`Repo/Details Short Details smoke-test 1`] = `
`;
exports[`Repo/Details loading smoke-test 1`] = `
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
<div class="h-5 my-3 skeleton w-20">
</div>
<div class="h-4 my-2 skeleton">
@ -844,6 +1063,12 @@ exports[`Repo/Details loading smoke-test 1`] = ` @@ -844,6 +1063,12 @@ exports[`Repo/Details loading smoke-test 1`] = `
<div class="badge skeleton w-20">
</div>
</div>
<div>
<div class="h-5 my-3 skeleton w-20">
</div>
<div class="badge skeleton my-2 w-60 block">
</div>
</div>
<div>
<div class="h-5 my-3 skeleton w-20">
</div>

2
src/lib/components/repo/RepoDetails.stories.svelte

@ -27,6 +27,8 @@ @@ -27,6 +27,8 @@
<Story name="No Tags" args={vectors.NoTags} />
<Story name="No Git Server" args={vectors.NoGitServer} />
<Story name="No Maintainers" args={vectors.NoMaintainers} />
<Story

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

@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
: description;
</script>
<div class="max-w-md prose">
<div class="max-w-md prose w-full">
{#if loading}
<div class="h-5 my-3 skeleton w-20"></div>
<div class="h-4 my-2 skeleton"></div>
@ -50,6 +50,23 @@ @@ -50,6 +50,23 @@
{/each}
{/if}
</div>
<div>
{#if loading}
<div class="h-5 my-3 skeleton w-20"></div>
<div class="badge skeleton my-2 w-60 block"></div>
{:else if git_server.length == 0}
<div />
{:else}
<h4>git server</h4>
<a
href={git_server}
target="_blank"
class="link link-primary break-words my-2"
>
{git_server}
</a>
{/if}
</div>
<div>
{#if loading}
<div class="h-5 my-3 skeleton w-20"></div>

1
src/lib/components/repo/vectors.ts

@ -56,6 +56,7 @@ export let RepoDetailsArgsVectors = { @@ -56,6 +56,7 @@ export let RepoDetailsArgsVectors = {
NoNameOrDescription: { ...base, name: "", description: "" } as Repo,
NoDescription: { ...base, description: "" } as Repo,
NoTags: { ...base, tags: [] } as Repo,
NoGitServer: { ...base, git_server: "" } as Repo,
MaintainersOneProfileNotLoaded: {
...base, maintainers: [
{ ...base.maintainers[0] },

2
src/lib/stores/repo.ts

@ -51,7 +51,7 @@ export let ensureSelectedRepo = async (repo_id: string): Promise<Repo> => { @@ -51,7 +51,7 @@ export let ensureSelectedRepo = async (repo_id: string): Promise<Repo> => {
repo_id: event.replaceableDTag(),
name: event.tagValue("name") || "",
description: event.tagValue("description") || "",
git_server: event.tagValue("git_server") || "",
git_server: event.tagValue("git-server") || "",
tags: event.getMatchingTags("t") || [],
maintainers: event.getMatchingTags("p").map(
(t: string[]) =>

Loading…
Cancel
Save