Browse Source

feat: rename pr as proposal

as it better fits an approach that seeks to support
both the patch and branching models
master
DanConwayDev 2 years ago
parent
commit
47a66f2fb6
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. BIN
      __snapshots__/proposals-header--author-loading.png
  2. 0
      __snapshots__/proposals-header--loading.png
  3. BIN
      __snapshots__/proposals-header--long-and-no-spaces.png
  4. BIN
      __snapshots__/proposals-header--long-details.png
  5. BIN
      __snapshots__/proposals-header--short-details.png
  6. 46
      __snapshots__/proposals-header.test.js.snap
  7. BIN
      __snapshots__/proposals-list-item--author-loading.png
  8. 0
      __snapshots__/proposals-list-item--loading.png
  9. BIN
      __snapshots__/proposals-list-item--long-and-no-spaces.png
  10. 0
      __snapshots__/proposals-list-item--long-details.png
  11. BIN
      __snapshots__/proposals-list-item--short-details.png
  12. 0
      __snapshots__/proposals-list-item--status-closed.png
  13. 0
      __snapshots__/proposals-list-item--status-draft.png
  14. 0
      __snapshots__/proposals-list-item--status-loading.png
  15. 0
      __snapshots__/proposals-list-item--status-merged.png
  16. 36
      __snapshots__/proposals-list-item.test.js.snap
  17. BIN
      __snapshots__/proposals-list-list--default.png
  18. BIN
      __snapshots__/proposals-list-list--empty.png
  19. BIN
      __snapshots__/proposals-list-list--loading.png
  20. 0
      __snapshots__/proposals-list-list--no-title.png
  21. BIN
      __snapshots__/proposals-list-list--partially-loaded.png
  22. 40
      __snapshots__/proposals-list-list.test.js.snap
  23. BIN
      __snapshots__/proposals-status--closed.png
  24. BIN
      __snapshots__/proposals-status--draft.png
  25. BIN
      __snapshots__/proposals-status--loading.png
  26. BIN
      __snapshots__/proposals-status--merged.png
  27. BIN
      __snapshots__/proposals-status--open-edit-mode.png
  28. BIN
      __snapshots__/proposals-status--open.png
  29. 60
      __snapshots__/proposals-status.test.js.snap
  30. BIN
      __snapshots__/prs-header--author-loading.png
  31. BIN
      __snapshots__/prs-header--long-and-no-spaces.png
  32. BIN
      __snapshots__/prs-header--long-details.png
  33. BIN
      __snapshots__/prs-header--short-details.png
  34. BIN
      __snapshots__/prs-list-item--author-loading.png
  35. BIN
      __snapshots__/prs-list-item--long-and-no-spaces.png
  36. BIN
      __snapshots__/prs-list-item--short-details.png
  37. BIN
      __snapshots__/prs-list-list--default.png
  38. BIN
      __snapshots__/prs-list-list--empty.png
  39. BIN
      __snapshots__/prs-list-list--loading.png
  40. BIN
      __snapshots__/prs-list-list--partially-loaded.png
  41. BIN
      __snapshots__/prs-status--closed.png
  42. BIN
      __snapshots__/prs-status--draft.png
  43. BIN
      __snapshots__/prs-status--merged.png
  44. BIN
      __snapshots__/prs-status--open-edit-mode.png
  45. 95
      __snapshots__/prs-status.test.js.snap
  46. 2
      src/lib/components/events/content/Kind19851985.svelte
  47. 2
      src/lib/components/proposals/ProposalDetails.svelte
  48. 12
      src/lib/components/proposals/ProposalHeader.stories.svelte
  49. 0
      src/lib/components/proposals/ProposalHeader.svelte
  50. 56
      src/lib/components/proposals/ProposalsList.stories.svelte
  51. 31
      src/lib/components/proposals/ProposalsList.svelte
  52. 12
      src/lib/components/proposals/ProposalsListItem.stories.svelte
  53. 12
      src/lib/components/proposals/ProposalsListItem.svelte
  54. 2
      src/lib/components/proposals/Status.stories.svelte
  55. 10
      src/lib/components/proposals/Status.svelte
  56. 29
      src/lib/components/proposals/StatusSelector.svelte
  57. 2
      src/lib/components/proposals/icons.ts
  58. 20
      src/lib/components/proposals/type.ts
  59. 20
      src/lib/components/proposals/vectors.ts
  60. 56
      src/lib/components/prs/PRsList.stories.svelte
  61. 31
      src/lib/components/prs/PRsList.svelte
  62. 2
      src/lib/kinds.ts
  63. 96
      src/lib/stores/Proposal.ts
  64. 61
      src/lib/stores/Proposals.ts
  65. 12
      src/lib/wrappers/Compose.svelte
  66. 4
      src/lib/wrappers/EventCard.svelte
  67. 14
      src/lib/wrappers/OpenPRs.svelte
  68. 17
      src/lib/wrappers/OpenProposals.svelte
  69. 2
      src/routes/+page.svelte
  70. 4
      src/routes/repo/[repo_id]/+page.svelte
  71. 54
      src/routes/repo/[repo_id]/proposal/[proposal_id]/+page.svelte
  72. 2
      src/routes/repo/[repo_id]/proposal/[proposal_id]/+page.ts
  73. 121
      src/routes/repo/[repo_id]/proposal/[proposal_id]/page.svelte

BIN
__snapshots__/proposals-header--author-loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

0
__snapshots__/prs-header--loading.png → __snapshots__/proposals-header--loading.png

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
__snapshots__/proposals-header--long-and-no-spaces.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
__snapshots__/proposals-header--long-details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
__snapshots__/proposals-header--short-details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

46
__snapshots__/prs-header.test.js.snap → __snapshots__/proposals-header.test.js.snap

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PRs/Header Author Loading smoke-test 1`] = `
exports[`Proposals/Header Author Loading smoke-test 1`] = `
<div class="grow overflow-hidden border-b border-accent-content bg-base-200 pb-4 pt-2 text-xs text-neutral-content">
<div class="mx-auto lg:container">
<div class="px-3">
@ -11,15 +11,8 @@ exports[`PRs/Header Author Loading smoke-test 1`] = ` @@ -11,15 +11,8 @@ exports[`PRs/Header Author Loading smoke-test 1`] = `
<div class="mr-3 inline align-middle">
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle cursor-default"
class="btn btn-sm align-middle cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
</div>
</div>
@ -36,7 +29,7 @@ exports[`PRs/Header Author Loading smoke-test 1`] = ` @@ -36,7 +29,7 @@ exports[`PRs/Header Author Loading smoke-test 1`] = `
</div>
`;
exports[`PRs/Header Long Details smoke-test 1`] = `
exports[`Proposals/Header Long Details smoke-test 1`] = `
<div class="grow overflow-hidden border-b border-accent-content bg-base-200 pb-4 pt-2 text-xs text-neutral-content">
<div class="mx-auto lg:container">
<div class="px-3">
@ -47,15 +40,8 @@ exports[`PRs/Header Long Details smoke-test 1`] = ` @@ -47,15 +40,8 @@ exports[`PRs/Header Long Details smoke-test 1`] = `
<div class="mr-3 inline align-middle">
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
class="btn btn-sm align-middle cursor-default"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
</div>
</div>
@ -71,7 +57,7 @@ exports[`PRs/Header Long Details smoke-test 1`] = ` @@ -71,7 +57,7 @@ exports[`PRs/Header Long Details smoke-test 1`] = `
</div>
`;
exports[`PRs/Header Long and No Spaces smoke-test 1`] = `
exports[`Proposals/Header Long and No Spaces smoke-test 1`] = `
<div class="grow overflow-hidden border-b border-accent-content bg-base-200 pb-4 pt-2 text-xs text-neutral-content">
<div class="mx-auto lg:container">
<div class="px-3">
@ -82,15 +68,8 @@ exports[`PRs/Header Long and No Spaces smoke-test 1`] = ` @@ -82,15 +68,8 @@ exports[`PRs/Header Long and No Spaces smoke-test 1`] = `
<div class="mr-3 inline align-middle">
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle cursor-default"
class="btn btn-sm align-middle cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
</div>
</div>
@ -106,7 +85,7 @@ exports[`PRs/Header Long and No Spaces smoke-test 1`] = ` @@ -106,7 +85,7 @@ exports[`PRs/Header Long and No Spaces smoke-test 1`] = `
</div>
`;
exports[`PRs/Header Short Details smoke-test 1`] = `
exports[`Proposals/Header Short Details smoke-test 1`] = `
<div class="grow overflow-hidden border-b border-accent-content bg-base-200 pb-4 pt-2 text-xs text-neutral-content">
<div class="mx-auto lg:container">
<div class="px-3">
@ -117,15 +96,8 @@ exports[`PRs/Header Short Details smoke-test 1`] = ` @@ -117,15 +96,8 @@ exports[`PRs/Header Short Details smoke-test 1`] = `
<div class="mr-3 inline align-middle">
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
class="btn btn-sm align-middle cursor-default"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
</div>
</div>
@ -141,7 +113,7 @@ exports[`PRs/Header Short Details smoke-test 1`] = ` @@ -141,7 +113,7 @@ exports[`PRs/Header Short Details smoke-test 1`] = `
</div>
`;
exports[`PRs/Header loading smoke-test 1`] = `
exports[`Proposals/Header loading smoke-test 1`] = `
<div class="grow overflow-hidden border-b border-accent-content bg-base-200 pb-4 pt-2 text-xs text-neutral-content">
<div class="mx-auto lg:container">
<div class="px-3">

BIN
__snapshots__/proposals-list-item--author-loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

0
__snapshots__/prs-list-item--loading.png → __snapshots__/proposals-list-item--loading.png

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
__snapshots__/proposals-list-item--long-and-no-spaces.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

0
__snapshots__/prs-list-item--long-details.png → __snapshots__/proposals-list-item--long-details.png

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
__snapshots__/proposals-list-item--short-details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

0
__snapshots__/prs-list-item--status-closed.png → __snapshots__/proposals-list-item--status-closed.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
__snapshots__/prs-list-item--status-draft.png → __snapshots__/proposals-list-item--status-draft.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
__snapshots__/prs-list-item--status-loading.png → __snapshots__/proposals-list-item--status-loading.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
__snapshots__/prs-list-item--status-merged.png → __snapshots__/proposals-list-item--status-merged.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

36
__snapshots__/prs-list-item.test.js.snap → __snapshots__/proposals-list-item.test.js.snap

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PRs/List/Item Author Loading smoke-test 1`] = `
exports[`Proposals/List/Item Author Loading smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -9,7 +9,7 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = ` @@ -9,7 +9,7 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -48,7 +48,7 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = ` @@ -48,7 +48,7 @@ exports[`PRs/List/Item Author Loading smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Long Details smoke-test 1`] = `
exports[`Proposals/List/Item Long Details smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -57,7 +57,7 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = ` @@ -57,7 +57,7 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -89,7 +89,7 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = ` @@ -89,7 +89,7 @@ exports[`PRs/List/Item Long Details smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = `
exports[`Proposals/List/Item Long and No Spaces smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -98,7 +98,7 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = ` @@ -98,7 +98,7 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -140,7 +140,7 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = ` @@ -140,7 +140,7 @@ exports[`PRs/List/Item Long and No Spaces smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Short Details smoke-test 1`] = `
exports[`Proposals/List/Item Short Details smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -149,7 +149,7 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = ` @@ -149,7 +149,7 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -191,7 +191,7 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = ` @@ -191,7 +191,7 @@ exports[`PRs/List/Item Short Details smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Status Closed smoke-test 1`] = `
exports[`Proposals/List/Item Status Closed smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -200,7 +200,7 @@ exports[`PRs/List/Item Status Closed smoke-test 1`] = ` @@ -200,7 +200,7 @@ exports[`PRs/List/Item Status Closed smoke-test 1`] = `
<path d="M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75m-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97l.97-.97a.748.748 0 0 1 1.265.332a.75.75 0 0 1-.205.729l-.97.97l.97.97a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018l-.97-.97l-.97.97a.749.749 0 0 1-1.275-.326a.749.749 0 0 1 .215-.734l.97-.97l-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -242,7 +242,7 @@ exports[`PRs/List/Item Status Closed smoke-test 1`] = ` @@ -242,7 +242,7 @@ exports[`PRs/List/Item Status Closed smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Status Draft smoke-test 1`] = `
exports[`Proposals/List/Item Status Draft smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -251,7 +251,7 @@ exports[`PRs/List/Item Status Draft smoke-test 1`] = ` @@ -251,7 +251,7 @@ exports[`PRs/List/Item Status Draft smoke-test 1`] = `
<path d="M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 14a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5M14 7.5a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0m0-4.25a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -293,11 +293,11 @@ exports[`PRs/List/Item Status Draft smoke-test 1`] = ` @@ -293,11 +293,11 @@ exports[`PRs/List/Item Status Draft smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Status Loading smoke-test 1`] = `
exports[`Proposals/List/Item Status Loading smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -339,7 +339,7 @@ exports[`PRs/List/Item Status Loading smoke-test 1`] = ` @@ -339,7 +339,7 @@ exports[`PRs/List/Item Status Loading smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item Status Merged smoke-test 1`] = `
exports[`Proposals/List/Item Status Merged smoke-test 1`] = `
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
@ -348,7 +348,7 @@ exports[`PRs/List/Item Status Merged smoke-test 1`] = ` @@ -348,7 +348,7 @@ exports[`PRs/List/Item Status Merged smoke-test 1`] = `
<path d="M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218M4.25 13.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5m8.5-4.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M5 3.25a.75.75 0 1 0 0 .005z">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -390,11 +390,11 @@ exports[`PRs/List/Item Status Merged smoke-test 1`] = ` @@ -390,11 +390,11 @@ exports[`PRs/List/Item Status Merged smoke-test 1`] = `
</li>
`;
exports[`PRs/List/Item loading smoke-test 1`] = `
exports[`Proposals/List/Item loading smoke-test 1`] = `
<li class="flex p-2 pt-4 ">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="skeleton h-5 w-60 flex-none pt-1">

BIN
__snapshots__/proposals-list-list--default.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
__snapshots__/proposals-list-list--empty.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
__snapshots__/proposals-list-list--loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

0
__snapshots__/prs-list-list--no-title.png → __snapshots__/proposals-list-list--no-title.png

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

BIN
__snapshots__/proposals-list-list--partially-loaded.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

40
__snapshots__/prs-list-list.test.js.snap → __snapshots__/proposals-list-list.test.js.snap

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PRs/List/List Default smoke-test 1`] = `
exports[`Proposals/List/List Default smoke-test 1`] = `
<div class>
<div class="prose">
<h4>
Open PRs
Open Proposals
</h4>
</div>
<ul class="divide-y divide-neutral-600">
@ -16,7 +16,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` @@ -16,7 +16,7 @@ exports[`PRs/List/List Default smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -64,7 +64,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` @@ -64,7 +64,7 @@ exports[`PRs/List/List Default smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -102,7 +102,7 @@ exports[`PRs/List/List Default smoke-test 1`] = ` @@ -102,7 +102,7 @@ exports[`PRs/List/List Default smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -146,11 +146,11 @@ exports[`PRs/List/List Default smoke-test 1`] = ` @@ -146,11 +146,11 @@ exports[`PRs/List/List Default smoke-test 1`] = `
</div>
`;
exports[`PRs/List/List Empty smoke-test 1`] = `
exports[`Proposals/List/List Empty smoke-test 1`] = `
<div class>
<div class="prose">
<h4>
Open PRs
Open Proposals
</h4>
</div>
<p class="prose">
@ -161,18 +161,18 @@ exports[`PRs/List/List Empty smoke-test 1`] = ` @@ -161,18 +161,18 @@ exports[`PRs/List/List Empty smoke-test 1`] = `
</div>
`;
exports[`PRs/List/List Loading smoke-test 1`] = `
exports[`Proposals/List/List Loading smoke-test 1`] = `
<div class>
<div class="prose">
<h4>
Open PRs
Open Proposals
</h4>
</div>
<ul class="divide-y divide-neutral-600">
<li class="flex p-2 pt-4 ">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="skeleton h-5 w-60 flex-none pt-1">
@ -184,7 +184,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = ` @@ -184,7 +184,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = `
<li class="flex p-2 pt-4 ">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="skeleton h-5 w-60 flex-none pt-1">
@ -196,7 +196,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = ` @@ -196,7 +196,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = `
<li class="flex p-2 pt-4 ">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="skeleton h-5 w-60 flex-none pt-1">
@ -209,7 +209,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = ` @@ -209,7 +209,7 @@ exports[`PRs/List/List Loading smoke-test 1`] = `
</div>
`;
exports[`PRs/List/List No Title smoke-test 1`] = `
exports[`Proposals/List/List No Title smoke-test 1`] = `
<div class>
<ul class="divide-y divide-neutral-600">
<li class="flex p-2 pt-4 cursor-pointer hover:bg-neutral-700">
@ -220,7 +220,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` @@ -220,7 +220,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -268,7 +268,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` @@ -268,7 +268,7 @@ exports[`PRs/List/List No Title smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -302,11 +302,11 @@ exports[`PRs/List/List No Title smoke-test 1`] = ` @@ -302,11 +302,11 @@ exports[`PRs/List/List No Title smoke-test 1`] = `
</div>
`;
exports[`PRs/List/List Partially Loaded smoke-test 1`] = `
exports[`Proposals/List/List Partially Loaded smoke-test 1`] = `
<div class>
<div class="prose">
<h4>
Open PRs
Open Proposals
</h4>
</div>
<ul class="divide-y divide-neutral-600">
@ -318,7 +318,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` @@ -318,7 +318,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -366,7 +366,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` @@ -366,7 +366,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = `
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="text-sm text-base-content">
@ -399,7 +399,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = ` @@ -399,7 +399,7 @@ exports[`PRs/List/List Partially Loaded smoke-test 1`] = `
<li class="flex p-2 pt-4 ">
<div class="skeleton h-5 w-5 flex-none pt-1">
</div>
<a href="/repo//pr/"
<a href="/repo//proposal/"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
<div class="skeleton h-5 w-60 flex-none pt-1">

BIN
__snapshots__/proposals-status--closed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
__snapshots__/prs-list-item--no-details.png → __snapshots__/proposals-status--draft.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
__snapshots__/prs-status--loading.png → __snapshots__/proposals-status--loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
__snapshots__/proposals-status--merged.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
__snapshots__/proposals-status--open-edit-mode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
__snapshots__/prs-status--open.png → __snapshots__/proposals-status--open.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

60
__snapshots__/proposals-status.test.js.snap

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Proposals/Status Closed smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle cursor-default"
>
Closed
</div>
`;
exports[`Proposals/Status Draft smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle cursor-default"
>
Draft
</div>
`;
exports[`Proposals/Status Loading smoke-test 1`] = `
<div class="skeleton inline-block h-8 w-24 rounded-md align-middle">
</div>
`;
exports[`Proposals/Status Merged smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle cursor-default"
>
Merged
</div>
`;
exports[`Proposals/Status Open Edit Mode smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle"
>
Open
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
class="h-5 w-5 flex-none fill-success-content"
>
<path fill="currentColor"
d="M11.646 15.146L5.854 9.354a.5.5 0 0 1 .353-.854h11.586a.5.5 0 0 1 .353.854l-5.793 5.792a.5.5 0 0 1-.707 0"
>
</path>
</svg>
</div>
`;
exports[`Proposals/Status Open smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle cursor-default"
>
Open
</div>
`;

BIN
__snapshots__/prs-header--author-loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
__snapshots__/prs-header--long-and-no-spaces.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
__snapshots__/prs-header--long-details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
__snapshots__/prs-header--short-details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
__snapshots__/prs-list-item--author-loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

BIN
__snapshots__/prs-list-item--long-and-no-spaces.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
__snapshots__/prs-list-item--short-details.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
__snapshots__/prs-list-list--default.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

BIN
__snapshots__/prs-list-list--empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

BIN
__snapshots__/prs-list-list--loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

BIN
__snapshots__/prs-list-list--partially-loaded.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

BIN
__snapshots__/prs-status--closed.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

BIN
__snapshots__/prs-status--draft.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

BIN
__snapshots__/prs-status--merged.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

BIN
__snapshots__/prs-status--open-edit-mode.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

95
__snapshots__/prs-status.test.js.snap

@ -1,95 +0,0 @@ @@ -1,95 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PRs/Status Closed smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle btn-neutral cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
>
<path d="M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75m-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97l.97-.97a.748.748 0 0 1 1.265.332a.75.75 0 0 1-.205.729l-.97.97l.97.97a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018l-.97-.97l-.97.97a.749.749 0 0 1-1.275-.326a.749.749 0 0 1 .215-.734l.97-.97l-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5">
</path>
</svg>
Closed
</div>
`;
exports[`PRs/Status Draft smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle btn-neutral cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
>
<path d="M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 14a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5M14 7.5a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0m0-4.25a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0">
</path>
</svg>
Draft
</div>
`;
exports[`PRs/Status Loading smoke-test 1`] = `
<div class="skeleton inline-block h-8 w-24 rounded-md align-middle">
</div>
`;
exports[`PRs/Status Merged smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-sm align-middle btn-primary cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 16 16"
class="h-5 w-5 flex-none fill-primary-content pt-1"
>
<path d="M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218M4.25 13.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5m8.5-4.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M5 3.25a.75.75 0 1 0 0 .005z">
</path>
</svg>
Merged
</div>
`;
exports[`PRs/Status Open Edit Mode smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
class="h-5 w-5 flex-none fill-success-content"
>
<path fill="currentColor"
d="M11.646 15.146L5.854 9.354a.5.5 0 0 1 .353-.854h11.586a.5.5 0 0 1 .353.854l-5.793 5.792a.5.5 0 0 1-.707 0"
>
</path>
</svg>
</div>
`;
exports[`PRs/Status Open smoke-test 1`] = `
<div tabindex="0"
role="button"
class="btn btn-success btn-sm align-middle cursor-default"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
>
<path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0">
</path>
</svg>
Open
</div>
`;

2
src/lib/components/events/content/Kind19851985.svelte

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<script lang="ts">
import type { NDKTag } from '@nostr-dev-kit/ndk'
import Status from '$lib/components/prs/Status.svelte'
import Status from '$lib/components/proposals/Status.svelte'
export let tags: NDKTag[] = []

2
src/lib/components/prs/PRDetails.svelte → src/lib/components/proposals/ProposalDetails.svelte

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
<StatusSelector
status={summary.status}
repo_id={summary.repo_id}
pr_id={summary.id}
proposal_id={summary.id}
/>
{/if}
</div>

12
src/lib/components/prs/PRHeader.stories.svelte → src/lib/components/proposals/ProposalHeader.stories.svelte

@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
<script lang="ts" context="module">
import type { Meta } from '@storybook/svelte'
import PRHeader from './PRHeader.svelte'
import ProposalHeader from './ProposalHeader.svelte'
import { Story, Template } from '@storybook/addon-svelte-csf'
import { PRsListItemArgsVectors as vectors } from './vectors'
import { ProposalsListItemArgsVectors as vectors } from './vectors'
export const meta: Meta<PRHeader> = {
title: 'PRs/Header',
component: PRHeader,
export const meta: Meta<ProposalHeader> = {
title: 'Proposals/Header',
component: ProposalHeader,
tags: ['autodocs'],
}
</script>
<Template let:args>
<PRHeader {...args} />
<ProposalHeader {...args} />
</Template>
<Story name="Short Details" args={vectors.Short} />

0
src/lib/components/prs/PRHeader.svelte → src/lib/components/proposals/ProposalHeader.svelte

56
src/lib/components/proposals/ProposalsList.stories.svelte

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
<script lang="ts" context="module">
import type { Meta } from '@storybook/svelte'
import ProposalsList from './ProposalsList.svelte'
import { Story, Template } from '@storybook/addon-svelte-csf'
import { ProposalsListItemArgsVectors as vectors } from './vectors'
export const meta: Meta<ProposalsList> = {
title: 'Proposals/List/List',
component: ProposalsList,
tags: ['autodocs'],
}
</script>
<Template let:args>
<ProposalsList {...args} />
</Template>
<Story
name="Default"
args={{
title: 'Open Proposals',
proposals: [vectors.Short, vectors.Long, vectors.LongNoSpaces],
}}
/>
<Story
name="No Title"
args={{
proposals: [vectors.Short, vectors.Long],
}}
/>
<Story
name="Empty"
args={{
title: 'Open Proposals',
proposals: [],
}}
/>
<Story
name="Loading"
args={{
title: 'Open Proposals',
proposals: [],
loading: true,
}}
/>
<Story
name="Partially Loaded"
args={{
title: 'Open Proposals',
proposals: [vectors.Short, vectors.Long],
loading: true,
}}
/>

31
src/lib/components/proposals/ProposalsList.svelte

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
<script lang="ts">
import ProposalsListItem from '$lib/components/proposals/ProposalsListItem.svelte'
import type { ProposalSummary } from './type'
export let title: string = ''
export let proposals: ProposalSummary[] = []
export let loading: boolean = false
</script>
<div class="">
{#if title.length > 0}
<div class="prose">
<h4>{title}</h4>
</div>
{/if}
{#if proposals.length == 0 && !loading}
<p class="prose">None</p>
{/if}
<ul class=" divide-y divide-neutral-600">
{#each proposals as proposal}
<ProposalsListItem {...proposal} />
{/each}
{#if loading}
<ProposalsListItem loading={true} />
{#if proposals.length == 0}
<ProposalsListItem loading={true} />
<ProposalsListItem loading={true} />
{/if}
{/if}
</ul>
</div>

12
src/lib/components/prs/PRsListItem.stories.svelte → src/lib/components/proposals/ProposalsListItem.stories.svelte

@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
<script lang="ts" context="module">
import type { Meta } from '@storybook/svelte'
import PRsListItem from './PRsListItem.svelte'
import ProposalsListItem from './ProposalsListItem.svelte'
import { Story, Template } from '@storybook/addon-svelte-csf'
import { PRsListItemArgsVectors as vectors } from './vectors'
import { ProposalsListItemArgsVectors as vectors } from './vectors'
export const meta: Meta<PRsListItem> = {
title: 'PRs/List/Item',
component: PRsListItem,
export const meta: Meta<ProposalsListItem> = {
title: 'Proposals/List/Item',
component: ProposalsListItem,
tags: ['autodocs'],
}
</script>
<Template let:args>
<PRsListItem {...args} />
<ProposalsListItem {...args} />
</Template>
<Story name="Short Details" args={vectors.Short} />

12
src/lib/components/prs/PRsListItem.svelte → src/lib/components/proposals/ProposalsListItem.svelte

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
import relativeTime from 'dayjs/plugin/relativeTime'
import { summary_defaults } from './type'
import { getName } from '../users/type'
import { pr_icon_path } from './icons'
import { proposal_icon_path } from './icons'
import UserHeader from '../users/UserHeader.svelte'
dayjs.extend(relativeTime)
@ -46,32 +46,32 @@ @@ -46,32 +46,32 @@
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-success pt-1"
><path d={pr_icon_path.open} /></svg
><path d={proposal_icon_path.open} /></svg
>
{:else if status === 'Closed'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
><path d={pr_icon_path.close} /></svg
><path d={proposal_icon_path.close} /></svg
>
{:else if status === 'Draft'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
><path d={pr_icon_path.draft} /></svg
><path d={proposal_icon_path.draft} /></svg
>
{:else if status === 'Merged'}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-primary pt-1"
><path d={pr_icon_path.merge} /></svg
><path d={proposal_icon_path.merge} /></svg
>
{/if}
<a
href="/repo/{repo_id}/pr/{id}"
href="/repo/{repo_id}/proposal/{id}"
class="ml-3 grow overflow-hidden text-xs text-neutral-content"
>
{#if loading}

2
src/lib/components/prs/Status.stories.svelte → src/lib/components/proposals/Status.stories.svelte

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
import { Story, Template } from '@storybook/addon-svelte-csf'
export const meta: Meta<Status> = {
title: 'PRs/Status',
title: 'Proposals/Status',
component: Status,
tags: ['autodocs'],
}

10
src/lib/components/prs/Status.svelte → src/lib/components/proposals/Status.svelte

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
proposal_status_draft,
proposal_status_open,
} from '$lib/kinds'
import { pr_icon_path } from './icons'
import { proposal_icon_path } from './icons'
export let status: number | undefined = undefined
export let edit_mode = false
@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 18 18"
class="h-5 w-5 flex-none fill-success-content pt-1"
><path d={pr_icon_path.open} />
><path d={proposal_icon_path.open} />
</svg>
Open
{:else if status === proposal_status_applied}
@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-primary-content pt-1"
><path d={pr_icon_path.merge} /></svg
><path d={proposal_icon_path.merge} /></svg
>
Merged
{:else if status === proposal_status_closed}
@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
><path d={pr_icon_path.close} /></svg
><path d={proposal_icon_path.close} /></svg
>
Closed
{:else if status === proposal_status_draft}
@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
class="h-5 w-5 flex-none fill-neutral-content pt-1"
><path d={pr_icon_path.draft} /></svg
><path d={proposal_icon_path.draft} /></svg
>
Draft
{:else}

29
src/lib/components/prs/StatusSelector.svelte → src/lib/components/proposals/StatusSelector.svelte

@ -1,7 +1,10 @@ @@ -1,7 +1,10 @@
<script lang="ts">
import { ndk } from '$lib/stores/ndk'
import { NDKEvent, NDKRelaySet } from '@nostr-dev-kit/ndk'
import { selected_pr_full, selected_pr_replies } from '$lib/stores/PR'
import {
selected_proposal_full,
selected_proposal_replies,
} from '$lib/stores/Proposal'
import {
proposal_status_applied,
proposal_status_closed,
@ -11,11 +14,11 @@ @@ -11,11 +14,11 @@
} from '$lib/kinds'
import { getUserRelays, logged_in_user } from '$lib/stores/users'
import { selected_repo } from '$lib/stores/repo'
import Status from '$lib/components/prs/Status.svelte'
import Status from '$lib/components/proposals/Status.svelte'
export let status: number | undefined = undefined
export let repo_id: string = ''
export let pr_id: string = ''
export let proposal_id: string = ''
let loading = false
@ -29,10 +32,10 @@ @@ -29,10 +32,10 @@
if (!$logged_in_user) return
let event = new NDKEvent(ndk)
event.kind = new_status_kind
// tag pr event
event.tags.push(['e', pr_id, 'root'])
// tag pr revision event
$selected_pr_replies
// tag proposal event
event.tags.push(['e', proposal_id, 'root'])
// tag proposal revision event
$selected_proposal_replies
.filter((reply) =>
reply.tags.some((t) => t.length > 1 && t[1] === 'revision-root')
)
@ -54,19 +57,19 @@ @@ -54,19 +57,19 @@
...(user_relays.ndk_relays
? user_relays.ndk_relays.writeRelayUrls
: []),
// TODO: pr event pubkey relays
// TODO: proposal event pubkey relays
]
} catch {
alert('failed to get user relays')
}
try {
let _ = await event.publish(NDKRelaySet.fromRelayUrls(relays, ndk))
selected_pr_full.update((pr_full) => {
if (pr_full.summary.id !== pr_id) return pr_full
selected_proposal_full.update((proposal_full) => {
if (proposal_full.summary.id !== proposal_id) return proposal_full
return {
...pr_full,
...proposal_full,
summary: {
...pr_full.summary,
...proposal_full.summary,
status: new_status_kind,
status_date: event.created_at || 0,
},
@ -115,7 +118,7 @@ @@ -115,7 +118,7 @@
on:click={() => {
changeStatus(proposal_status_applied)
}}
class="btn btn-primary btn-sm mx-2 align-middle"
class="btn-proposalimary btn btn-sm mx-2 align-middle"
>{statusKindtoText(proposal_status_applied)}</button
>
</li>

2
src/lib/components/prs/icons.ts → src/lib/components/proposals/icons.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
export const pr_icon_path = {
export const proposal_icon_path = {
open: 'M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0',
close:
'M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75m-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97l.97-.97a.748.748 0 0 1 1.265.332a.75.75 0 0 1-.205.729l-.97.97l.97.97a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018l-.97-.97l-.97.97a.749.749 0 0 1-1.275-.326a.749.749 0 0 1 .215-.734l.97-.97l-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5',

20
src/lib/components/prs/type.ts → src/lib/components/proposals/type.ts

@ -3,7 +3,7 @@ import { defaults as user_defaults } from '../users/type' @@ -3,7 +3,7 @@ import { defaults as user_defaults } from '../users/type'
import type { Event } from '../events/type'
import type { NDKEvent } from '@nostr-dev-kit/ndk'
export interface PRSummary {
export interface ProposalSummary {
title: string
descritpion: string
repo_id: string
@ -16,7 +16,7 @@ export interface PRSummary { @@ -16,7 +16,7 @@ export interface PRSummary {
loading: boolean
}
export const summary_defaults: PRSummary = {
export const summary_defaults: ProposalSummary = {
title: '',
descritpion: '',
repo_id: '',
@ -29,29 +29,29 @@ export const summary_defaults: PRSummary = { @@ -29,29 +29,29 @@ export const summary_defaults: PRSummary = {
loading: true,
}
export interface PRSummaries {
export interface ProposalSummaries {
id: string
summaries: PRSummary[]
summaries: ProposalSummary[]
loading: boolean
}
export const summaries_defaults: PRSummaries = {
export const summaries_defaults: ProposalSummaries = {
id: '',
summaries: [],
loading: true,
}
export interface PRFull {
summary: PRSummary
pr_event: NDKEvent | undefined
export interface ProposalFull {
summary: ProposalSummary
proposal_event: NDKEvent | undefined
labels: string[]
events: Event[]
loading: boolean
}
export const full_defaults: PRFull = {
export const full_defaults: ProposalFull = {
summary: { ...summary_defaults },
pr_event: undefined,
proposal_event: undefined,
labels: [],
events: [],
loading: true,

20
src/lib/components/prs/vectors.ts → src/lib/components/proposals/vectors.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import type { PRSummary } from './type'
import type { ProposalSummary } from './type'
import { UserVectors } from '../users/vectors'
dayjs.extend(relativeTime)
@ -12,9 +12,9 @@ const Short = { @@ -12,9 +12,9 @@ const Short = {
comments: 2,
status: 'Open',
loading: false,
} as PRSummary
} as ProposalSummary
export const PRsListItemArgsVectors = {
export const ProposalsListItemArgsVectors = {
Short,
Long: {
title:
@ -24,7 +24,7 @@ export const PRsListItemArgsVectors = { @@ -24,7 +24,7 @@ export const PRsListItemArgsVectors = {
comments: 0,
status: 'Open',
loading: false,
} as PRSummary,
} as ProposalSummary,
LongNoSpaces: {
title:
'LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName',
@ -33,7 +33,7 @@ export const PRsListItemArgsVectors = { @@ -33,7 +33,7 @@ export const PRsListItemArgsVectors = {
comments: 1,
status: 'Open',
loading: false,
} as PRSummary,
} as ProposalSummary,
AuthorLoading: {
title: 'short title',
author: { ...UserVectors.loading },
@ -41,21 +41,21 @@ export const PRsListItemArgsVectors = { @@ -41,21 +41,21 @@ export const PRsListItemArgsVectors = {
comments: 1,
status: 'Open',
loading: false,
} as PRSummary,
} as ProposalSummary,
StatusLoading: {
...Short,
status: undefined,
} as PRSummary,
} as ProposalSummary,
StatusDraft: {
...Short,
status: 'Draft',
} as PRSummary,
} as ProposalSummary,
StatusClosed: {
...Short,
status: 'Closed',
} as PRSummary,
} as ProposalSummary,
StatusMerged: {
...Short,
status: 'Merged',
} as PRSummary,
} as ProposalSummary,
}

56
src/lib/components/prs/PRsList.stories.svelte

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
<script lang="ts" context="module">
import type { Meta } from '@storybook/svelte'
import PRsList from './PRsList.svelte'
import { Story, Template } from '@storybook/addon-svelte-csf'
import { PRsListItemArgsVectors as vectors } from './vectors'
export const meta: Meta<PRsList> = {
title: 'PRs/List/List',
component: PRsList,
tags: ['autodocs'],
}
</script>
<Template let:args>
<PRsList {...args} />
</Template>
<Story
name="Default"
args={{
title: 'Open PRs',
prs: [vectors.Short, vectors.Long, vectors.LongNoSpaces],
}}
/>
<Story
name="No Title"
args={{
prs: [vectors.Short, vectors.Long],
}}
/>
<Story
name="Empty"
args={{
title: 'Open PRs',
prs: [],
}}
/>
<Story
name="Loading"
args={{
title: 'Open PRs',
prs: [],
loading: true,
}}
/>
<Story
name="Partially Loaded"
args={{
title: 'Open PRs',
prs: [vectors.Short, vectors.Long],
loading: true,
}}
/>

31
src/lib/components/prs/PRsList.svelte

@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
<script lang="ts">
import PRsListItem from '$lib/components/prs/PRsListItem.svelte'
import type { PRSummary } from './type'
export let title: string = ''
export let prs: PRSummary[] = []
export let loading: boolean = false
</script>
<div class="">
{#if title.length > 0}
<div class="prose">
<h4>{title}</h4>
</div>
{/if}
{#if prs.length == 0 && !loading}
<p class="prose">None</p>
{/if}
<ul class=" divide-y divide-neutral-600">
{#each prs as pr}
<PRsListItem {...pr} />
{/each}
{#if loading}
<PRsListItem loading={true} />
{#if prs.length == 0}
<PRsListItem loading={true} />
<PRsListItem loading={true} />
{/if}
{/if}
</ul>
</div>

2
src/lib/kinds.ts

@ -4,7 +4,7 @@ export const proposal_status_open: number = 1630 @@ -4,7 +4,7 @@ export const proposal_status_open: number = 1630
export const proposal_status_applied: number = 1631
export const proposal_status_closed: number = 1632
export const proposal_status_draft: number = 1633
export const pr_status_kinds: number[] = [
export const proposal_status_kinds: number[] = [
proposal_status_open,
proposal_status_applied,
proposal_status_closed,

96
src/lib/stores/PR.ts → src/lib/stores/Proposal.ts

@ -3,62 +3,67 @@ import { writable, type Unsubscriber, type Writable } from 'svelte/store' @@ -3,62 +3,67 @@ import { writable, type Unsubscriber, type Writable } from 'svelte/store'
import { ndk } from './ndk'
import type { User } from '$lib/components/users/type'
import { ensureUser } from './users'
import { type PRFull, full_defaults } from '$lib/components/prs/type'
import { pr_status_kinds, proposal_status_open } from '$lib/kinds'
import {
type ProposalFull,
full_defaults,
} from '$lib/components/proposals/type'
import { proposal_status_kinds, proposal_status_open } from '$lib/kinds'
import { ensureSelectedRepo } from './repo'
import { extractPatchMessage } from '$lib/components/events/content/utils'
import { goto } from '$app/navigation'
export const selected_pr_full: Writable<PRFull> = writable({ ...full_defaults })
export const selected_proposal_full: Writable<ProposalFull> = writable({
...full_defaults,
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let selected_pr_repo_id: string = ''
let selected_pr_id: string = ''
let pr_summary_author_unsubsriber: Unsubscriber | undefined
let selected_proposal_repo_id: string = ''
let selected_proposal_id: string = ''
let proposal_summary_author_unsubsriber: Unsubscriber | undefined
export const selected_pr_replies: Writable<NDKEvent[]> = writable([])
export const selected_proposal_replies: Writable<NDKEvent[]> = writable([])
let selected_pr_status_date = 0
let selected_proposal_status_date = 0
let sub: NDKSubscription
let sub_replies: NDKSubscription
export const ensurePRFull = (repo_id: string, pr_id: string) => {
if (selected_pr_id == pr_id) return
if (pr_id == '') {
selected_pr_full.set({ ...full_defaults })
selected_pr_replies.set([])
export const ensureProposalFull = (repo_id: string, proposal_id: string) => {
if (selected_proposal_id == proposal_id) return
if (proposal_id == '') {
selected_proposal_full.set({ ...full_defaults })
selected_proposal_replies.set([])
return
}
if (sub) sub.stop()
if (sub_replies) sub_replies.stop()
selected_pr_repo_id = repo_id
selected_pr_id = pr_id
selected_pr_status_date = 0
selected_pr_replies.set([])
selected_proposal_repo_id = repo_id
selected_proposal_id = proposal_id
selected_proposal_status_date = 0
selected_proposal_replies.set([])
selected_pr_full.set({
selected_proposal_full.set({
...full_defaults,
summary: {
...full_defaults.summary,
id: pr_id,
id: proposal_id,
repo_id: repo_id,
loading: true,
},
loading: true,
})
if (pr_summary_author_unsubsriber) pr_summary_author_unsubsriber()
pr_summary_author_unsubsriber = undefined
if (proposal_summary_author_unsubsriber) proposal_summary_author_unsubsriber()
proposal_summary_author_unsubsriber = undefined
new Promise(async (r) => {
const repo = await ensureSelectedRepo(repo_id)
sub = ndk.subscribe(
{
ids: [pr_id],
ids: [proposal_id],
limit: 50,
},
{
@ -71,15 +76,17 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -71,15 +76,17 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
sub.on('event', (event: NDKEvent) => {
try {
if (event.id == pr_id) {
if (event.id == proposal_id) {
const event_repo_id = event.tagValue('a')?.split(':')[2]
if (event_repo_id && event_repo_id !== repo_id) {
goto(`/repo/${encodeURIComponent(event_repo_id)}/pr/${pr_id}`)
goto(
`/repo/${encodeURIComponent(event_repo_id)}/proposal/${proposal_id}`
)
}
selected_pr_full.update((full) => {
selected_proposal_full.update((full) => {
return {
...full,
pr_event: event,
proposal_event: event,
summary: {
...full.summary,
title: (
@ -101,26 +108,25 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -101,26 +108,25 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
}
})
pr_summary_author_unsubsriber = ensureUser(event.pubkey).subscribe(
(u: User) => {
selected_pr_full.update((full) => {
proposal_summary_author_unsubsriber = ensureUser(
event.pubkey
).subscribe((u: User) => {
selected_proposal_full.update((full) => {
return {
...full,
summary: {
...full.summary,
author:
event.pubkey == u.hexpubkey ? u : full.summary.author,
author: event.pubkey == u.hexpubkey ? u : full.summary.author,
},
}
})
}
)
})
}
} catch {}
})
sub.on('eose', () => {
selected_pr_full.update((full) => {
selected_proposal_full.update((full) => {
const updated = {
...full,
summary: {
@ -137,7 +143,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -137,7 +143,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
sub_replies = ndk.subscribe(
{
'#e': [pr_id],
'#e': [proposal_id],
},
{
closeOnEose: false,
@ -147,15 +153,15 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -147,15 +153,15 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
: undefined
)
const process_replies = (event: NDKEvent) => {
const proposalocess_replies = (event: NDKEvent) => {
if (
event.kind &&
pr_status_kinds.includes(event.kind) &&
proposal_status_kinds.includes(event.kind) &&
event.created_at &&
selected_pr_status_date < event.created_at
selected_proposal_status_date < event.created_at
) {
selected_pr_status_date = event.created_at
selected_pr_full.update((full) => {
selected_proposal_status_date = event.created_at
selected_proposal_full.update((full) => {
return {
...full,
summary: {
@ -167,7 +173,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -167,7 +173,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
}
})
}
selected_pr_replies.update((replies) => {
selected_proposal_replies.update((replies) => {
return [...replies, event].sort(
(a, b) => (a.created_at || 0) - (b.created_at || 0)
)
@ -175,7 +181,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -175,7 +181,7 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
if (event.tags.some((t) => t.length > 1 && t[1] === 'revision-root')) {
const sub_revision_replies = ndk.subscribe(
{
ids: [pr_id],
ids: [proposal_id],
limit: 50,
},
{
@ -186,17 +192,17 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => { @@ -186,17 +192,17 @@ export const ensurePRFull = (repo_id: string, pr_id: string) => {
: undefined
)
sub_revision_replies.on('event', (event: NDKEvent) => {
process_replies(event)
proposalocess_replies(event)
})
}
}
sub_replies.on('event', (event: NDKEvent) => {
process_replies(event)
proposalocess_replies(event)
})
sub_replies.on('eose', () => {
selected_pr_full.update((full) => {
selected_proposal_full.update((full) => {
const updated = {
...full,
summary: {

61
src/lib/stores/PRs.ts → src/lib/stores/Proposals.ts

@ -6,21 +6,21 @@ import { @@ -6,21 +6,21 @@ import {
} from '@nostr-dev-kit/ndk'
import { writable, type Unsubscriber, type Writable } from 'svelte/store'
import { ndk } from './ndk'
import { summary_defaults } from '$lib/components/prs/type'
import { summary_defaults } from '$lib/components/proposals/type'
import type { User } from '$lib/components/users/type'
import { ensureUser } from './users'
import type { PRSummaries } from '$lib/components/prs/type'
import type { ProposalSummaries } from '$lib/components/proposals/type'
import { ensureSelectedRepo } from './repo'
import {
patch_kind,
pr_status_kinds,
proposal_status_kinds,
proposal_status_open,
repo_kind,
} from '$lib/kinds'
import type { Repo } from '$lib/components/repo/type'
import { extractPatchMessage } from '$lib/components/events/content/utils'
export const pr_summaries: Writable<PRSummaries> = writable({
export const proposal_summaries: Writable<ProposalSummaries> = writable({
id: '',
summaries: [],
loading: false,
@ -32,9 +32,9 @@ let authors_unsubscribers: Unsubscriber[] = [] @@ -32,9 +32,9 @@ let authors_unsubscribers: Unsubscriber[] = []
let sub: NDKSubscription
export const ensurePRSummaries = async (repo_id: string) => {
export const ensureProposalSummaries = async (repo_id: string) => {
if (selected_repo_id == repo_id) return
pr_summaries.set({
proposal_summaries.set({
id: repo_id,
summaries: [],
loading: repo_id !== '',
@ -85,11 +85,11 @@ export const ensurePRSummaries = async (repo_id: string) => { @@ -85,11 +85,11 @@ export const ensurePRSummaries = async (repo_id: string) => {
event.content.length > 0 &&
!event.tags.some((t) => t.length > 1 && t[1] === 'revision-root')
) {
pr_summaries.update((prs) => {
proposal_summaries.update((proposals) => {
return {
...prs,
...proposals,
summaries: [
...prs.summaries,
...proposals.summaries,
{
...summary_defaults,
id: event.id,
@ -117,10 +117,10 @@ export const ensurePRSummaries = async (repo_id: string) => { @@ -117,10 +117,10 @@ export const ensurePRSummaries = async (repo_id: string) => {
authors_unsubscribers.push(
ensureUser(event.pubkey).subscribe((u: User) => {
pr_summaries.update((prs) => {
proposal_summaries.update((proposals) => {
return {
...prs,
summaries: prs.summaries.map((o) => ({
...proposals,
summaries: proposals.summaries.map((o) => ({
...o,
author: event.pubkey === o.author.hexpubkey ? u : o.author,
})),
@ -131,10 +131,10 @@ export const ensurePRSummaries = async (repo_id: string) => { @@ -131,10 +131,10 @@ export const ensurePRSummaries = async (repo_id: string) => {
} catch {}
})
sub.on('eose', () => {
pr_summaries.update((prs) => {
getAndUpdatePRStatus(prs, repo)
proposal_summaries.update((proposals) => {
getAndUpdateProposalStatus(proposals, repo)
return {
...prs,
...proposals,
loading: false,
}
})
@ -143,13 +143,16 @@ export const ensurePRSummaries = async (repo_id: string) => { @@ -143,13 +143,16 @@ export const ensurePRSummaries = async (repo_id: string) => {
let sub_statuses: NDKSubscription
function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void {
function getAndUpdateProposalStatus(
proposals: ProposalSummaries,
repo: Repo
): void {
if (sub_statuses) sub_statuses.stop()
sub_statuses = ndk.subscribe(
{
kinds: pr_status_kinds,
'#e': prs.summaries.map((pr) => pr.id),
'#r': [`r-${prs.id}`],
kinds: proposal_status_kinds,
'#e': proposals.summaries.map((proposal) => proposal.id),
'#r': [`r-${proposals.id}`],
},
{
closeOnEose: false,
@ -157,19 +160,19 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void { @@ -157,19 +160,19 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void {
NDKRelaySet.fromRelayUrls(repo.relays, ndk)
)
sub_statuses.on('event', (event: NDKEvent) => {
const tagged_pr_event = event.tagValue('e')
const tagged_proposal_event = event.tagValue('e')
if (
event.kind &&
pr_status_kinds.includes(event.kind) &&
tagged_pr_event &&
proposal_status_kinds.includes(event.kind) &&
tagged_proposal_event &&
event.created_at
) {
pr_summaries.update((prs) => {
proposal_summaries.update((proposals) => {
return {
...prs,
summaries: prs.summaries.map((o) => {
...proposals,
summaries: proposals.summaries.map((o) => {
if (
o.id === tagged_pr_event &&
o.id === tagged_proposal_event &&
event.created_at &&
o.status_date < event.created_at
) {
@ -188,10 +191,10 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void { @@ -188,10 +191,10 @@ function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void {
})
sub_statuses.on('eose', () => {
pr_summaries.update((prs) => {
proposal_summaries.update((proposals) => {
return {
...prs,
summaries: prs.summaries.map((o) => ({
...proposals,
summaries: proposals.summaries.map((o) => ({
...o,
status: o.status || proposal_status_open,
})),

12
src/lib/wrappers/Compose.svelte

@ -5,28 +5,28 @@ @@ -5,28 +5,28 @@
import { getUserRelays, logged_in_user } from '$lib/stores/users'
import { selected_repo } from '$lib/stores/repo'
import Compose from '$lib/components/events/Compose.svelte'
import { selected_pr_full } from '$lib/stores/PR'
import { selected_proposal_full } from '$lib/stores/Proposal'
export let reply_to_event_id = ''
let repo_id: string
let pr_id: string
let proposal_id: string
let submitting = false
let submitted = false
let edit_mode = false
$: {
repo_id = $selected_repo.repo_id
pr_id = $selected_pr_full.summary.id
proposal_id = $selected_proposal_full.summary.id
edit_mode = repo_id.length > 0 && pr_id.length > 0 && !submitted
edit_mode = repo_id.length > 0 && proposal_id.length > 0 && !submitted
}
async function sendReply(content: string) {
if (!$logged_in_user) return
let event = new NDKEvent(ndk)
event.kind = reply_kind
event.tags.push(['e', pr_id, 'root'])
event.tags.push(['e', proposal_id, 'root'])
if (reply_to_event_id.length > 0) {
event.tags.push(['e', reply_to_event_id, 'reply'])
}
@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
...(user_relays.ndk_relays
? user_relays.ndk_relays.writeRelayUrls
: []),
// TODO: pr event pubkey relays
// TODO: proposal event pubkey relays
]
} catch {
alert('failed to get user relays')

4
src/lib/wrappers/EventCard.svelte

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
import Patch from '$lib/components/events/content/Patch.svelte'
import ParsedContent from '$lib/components/events/content/ParsedContent.svelte'
import { defaults as user_defaults } from '$lib/components/users/type'
import { patch_kind, pr_status_kind } from '$lib/kinds'
import { patch_kind, proposal_status_kind } from '$lib/kinds'
import { ensureUser } from '$lib/stores/users'
import type { NDKEvent } from '@nostr-dev-kit/ndk'
import { onDestroy } from 'svelte'
@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
>
{#if event.kind == patch_kind}
<Patch content={event.content} tags={event.tags} />
{:else if event.kind === pr_status_kind}
{:else if event.kind === proposal_status_kind}
<Kind19851985 tags={event.tags} />
{:else}
<ParsedContent content={event.content} tags={event.tags} />

14
src/lib/wrappers/OpenPRs.svelte

@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
<script lang="ts">
import PRsList from '$lib/components/prs/PRsList.svelte'
import { ensurePRSummaries, pr_summaries } from '$lib/stores/PRs'
export let repo_id: string = ''
ensurePRSummaries(repo_id)
</script>
<PRsList
title="Open PRs"
prs={$pr_summaries.summaries}
loading={$pr_summaries.loading}
/>

17
src/lib/wrappers/OpenProposals.svelte

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<script lang="ts">
import ProposalsList from '$lib/components/proposals/ProposalsList.svelte'
import {
ensureProposalSummaries,
proposal_summaries,
} from '$lib/stores/Proposals'
export let repo_id: string = ''
ensureProposalSummaries(repo_id)
</script>
<ProposalsList
title="Open Proposals"
proposals={$proposal_summaries.summaries}
loading={$proposal_summaries.loading}
/>

2
src/routes/+page.svelte

@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
<div class="prose">
a command-line tool to <span class="badge">create</span>,
<span class="badge">list</span> and
<span class="badge">apply</span> PRs and patches
<span class="badge">apply</span> Proposals and patches
<div class="card-actions mt-3 flex">
<div class="flex-grow">
<a href="/ngit" class="btn btn-neutral">install ngit</a>

4
src/routes/repo/[repo_id]/+page.svelte

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<script lang="ts">
import RepoDetails from '$lib/wrappers/RepoDetails.svelte'
import OpenPRs from '$lib/wrappers/OpenPRs.svelte'
import OpenProposals from '$lib/wrappers/OpenProposals.svelte'
import { ensureSelectedRepo, selected_repo } from '$lib/stores/repo'
import RepoHeader from '$lib/components/repo/RepoHeader.svelte'
import Container from '$lib/components/Container.svelte'
@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
<Container>
<div class="mt-2 md:flex">
<div class="md:mr-2 md:w-2/3">
<OpenPRs {repo_id} />
<OpenProposals {repo_id} />
</div>
<div class="prose ml-2 hidden w-1/3 md:flex">
<RepoDetails {repo_id} />

54
src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte → src/routes/repo/[repo_id]/proposal/[proposal_id]/+page.svelte

@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
<script lang="ts">
import { ensureSelectedRepo, selected_repo } from '$lib/stores/repo'
import {
ensurePRFull,
selected_pr_full,
selected_pr_replies,
} from '$lib/stores/PR'
import PrHeader from '$lib/components/prs/PRHeader.svelte'
ensureProposalFull,
selected_proposal_full,
selected_proposal_replies,
} from '$lib/stores/Proposal'
import ProposalHeader from '$lib/components/proposals/ProposalHeader.svelte'
import RepoHeader from '$lib/components/repo/RepoHeader.svelte'
import Thread from '$lib/wrappers/Thread.svelte'
import PrDetails from '$lib/components/prs/PRDetails.svelte'
import ProposalDetails from '$lib/components/proposals/ProposalDetails.svelte'
import Container from '$lib/components/Container.svelte'
import ParsedContent from '$lib/components/events/content/ParsedContent.svelte'
import Compose from '$lib/wrappers/Compose.svelte'
@ -17,22 +17,22 @@ @@ -17,22 +17,22 @@
export let data: {
repo_id: string
pr_id: string
proposal_id: string
}
let repo_id = data.repo_id
let pr_id = data.pr_id
let proposal_id = data.proposal_id
ensureSelectedRepo(repo_id)
ensurePRFull(repo_id, pr_id)
ensureProposalFull(repo_id, proposal_id)
let repo_error = false
let pr_error = false
let proposal_error = false
$: {
repo_error = !$selected_repo.loading && $selected_repo.name.length === 0
pr_error =
!$selected_pr_full.summary.loading &&
$selected_pr_full.summary.created_at === 0
proposal_error =
!$selected_proposal_full.summary.loading &&
$selected_proposal_full.summary.created_at === 0
}
</script>
@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
<RepoHeader {...$selected_repo} />
{/if}
{#if pr_error}
{#if proposal_error}
<Container>
<div role="alert" class="alert alert-error m-auto mt-6 w-full max-w-xs">
<svg
@ -55,11 +55,13 @@ @@ -55,11 +55,13 @@
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
/></svg
>
<span>Error! cannot find PR {repo_error ? 'or repo ' : ''}event</span>
<span
>Error! cannot find Proposal {repo_error ? 'or repo ' : ''}event</span
>
</div>
</Container>
{:else}
<PrHeader {...$selected_pr_full.summary} />
<ProposalHeader {...$selected_proposal_full.summary} />
<Container>
<div class="md:flex">
<div class="md:mr-2 md:w-2/3">
@ -89,16 +91,18 @@ @@ -89,16 +91,18 @@
</div>
</div>
<div class="prose my-3">
{#if $selected_pr_full.pr_event && $selected_pr_full.pr_event.kind === patch_kind}
{#if $selected_proposal_full.proposal_event && $selected_proposal_full.proposal_event.kind === patch_kind}
<Patch
content={$selected_pr_full.pr_event.content}
tags={$selected_pr_full.pr_event.tags}
content={$selected_proposal_full.proposal_event.content}
tags={$selected_proposal_full.proposal_event.tags}
/>
{:else}
<ParsedContent content={$selected_pr_full.summary.descritpion} />
<ParsedContent
content={$selected_proposal_full.summary.descritpion}
/>
{/if}
</div>
{#each $selected_pr_replies as event}
{#each $selected_proposal_replies as event}
<Thread {event} replies={[]} />
{/each}
<div class="my-3">
@ -106,10 +110,10 @@ @@ -106,10 +110,10 @@
</div>
</div>
<div class="prose ml-2 hidden w-1/3 md:flex">
<PrDetails
summary={$selected_pr_full.summary}
labels={$selected_pr_full.labels}
loading={$selected_pr_full.loading}
<ProposalDetails
summary={$selected_proposal_full.summary}
labels={$selected_proposal_full.labels}
loading={$selected_proposal_full.loading}
/>
</div>
</div>

2
src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts → src/routes/repo/[repo_id]/proposal/[proposal_id]/+page.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
export const load = ({ params }) => {
return {
repo_id: decodeURIComponent(params.repo_id),
pr_id: params.pr_id,
proposal_id: params.proposal_id,
}
}

121
src/routes/repo/[repo_id]/proposal/[proposal_id]/page.svelte

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
<script lang="ts">
import { ensureSelectedRepo, selected_repo } from '$lib/stores/repo'
import {
ensureProposalFull,
selected_proposal_full,
selected_proposal_replies,
} from '$lib/stores/Proposal'
import ProposalHeader from '$lib/components/proposals/ProposalHeader.svelte'
import RepoHeader from '$lib/components/repo/RepoHeader.svelte'
import Thread from '$lib/wrappers/Thread.svelte'
import ProposalDetails from '$lib/components/proposals/ProposalDetails.svelte'
import Container from '$lib/components/Container.svelte'
import ParsedContent from '$lib/components/events/content/ParsedContent.svelte'
import Compose from '$lib/wrappers/Compose.svelte'
import { patch_kind } from '$lib/kinds'
import Patch from '$lib/components/events/content/Patch.svelte'
export let data: {
repo_id: string
proposal_id: string
}
let repo_id = data.repo_id
let proposal_id = data.proposal_id
ensureSelectedRepo(repo_id)
ensureProposalFull(repo_id, proposal_id)
let repo_error = false
let proposal_error = false
$: {
repo_error = !$selected_repo.loading && $selected_repo.name.length === 0
proposal_error =
!$selected_proposal_full.summary.loading &&
$selected_proposal_full.summary.created_at === 0
}
</script>
{#if !repo_error}
<RepoHeader {...$selected_repo} />
{/if}
{#if proposal_error}
<Container>
<div role="alert" class="alert alert-error m-auto mt-6 w-full max-w-xs">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 shrink-0 stroke-current"
fill="none"
viewBox="0 0 24 24"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
/></svg
>
<span
>Error! cannot find Proposal {repo_error ? 'or repo ' : ''}event</span
>
</div>
</Container>
{:else}
<ProposalHeader {...$selected_proposal_full.summary} />
<Container>
<div class="md:flex">
<div class="md:mr-2 md:w-2/3">
<div role="alert" class="alert mt-3">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="h-6 w-6 shrink-0 stroke-info"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
></path></svg
>
<div>
<h3 class="prose mb-2 text-sm font-bold">
view proposal in local git repository
</h3>
<p class="prose text-xs">
<a href="/ngit">install ngit</a>, run
<span class="rounded bg-neutral p-1 font-mono"
><span class="py-3">ngit list</span></span
> from the local repository and select the proposal title
</p>
</div>
</div>
<div class="prose my-3">
{#if $selected_proposal_full.proposal_event && $selected_proposal_full.proposal_event.kind === patch_kind}
<Patch
content={$selected_proposal_full.proposal_event.content}
tags={$selected_proposal_full.proposal_event.tags}
/>
{:else}
<ParsedContent
content={$selected_proposal_full.summary.descritpion}
/>
{/if}
</div>
{#each $selected_proposal_replies as event}
<Thread {event} replies={[]} />
{/each}
<div class="my-3">
<Compose />
</div>
</div>
<div class="prose ml-2 hidden w-1/3 md:flex">
<ProposalDetails
summary={$selected_proposal_full.summary}
labels={$selected_proposal_full.labels}
loading={$selected_proposal_full.loading}
/>
</div>
</div>
</Container>
{/if}
Loading…
Cancel
Save