as it better fits an approach that seeks to support both the patch and branching modelsmaster
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 7.4 KiB |
@ -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> |
||||||
|
`; |
||||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
@ -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> |
|
||||||
`; |
|
||||||
@ -1,18 +1,18 @@ |
|||||||
<script lang="ts" context="module"> |
<script lang="ts" context="module"> |
||||||
import type { Meta } from '@storybook/svelte' |
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 { Story, Template } from '@storybook/addon-svelte-csf' |
||||||
import { PRsListItemArgsVectors as vectors } from './vectors' |
import { ProposalsListItemArgsVectors as vectors } from './vectors' |
||||||
|
|
||||||
export const meta: Meta<PRHeader> = { |
export const meta: Meta<ProposalHeader> = { |
||||||
title: 'PRs/Header', |
title: 'Proposals/Header', |
||||||
component: PRHeader, |
component: ProposalHeader, |
||||||
tags: ['autodocs'], |
tags: ['autodocs'], |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<Template let:args> |
<Template let:args> |
||||||
<PRHeader {...args} /> |
<ProposalHeader {...args} /> |
||||||
</Template> |
</Template> |
||||||
|
|
||||||
<Story name="Short Details" args={vectors.Short} /> |
<Story name="Short Details" args={vectors.Short} /> |
||||||
@ -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, |
||||||
|
}} |
||||||
|
/> |
||||||
@ -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> |
||||||
@ -1,18 +1,18 @@ |
|||||||
<script lang="ts" context="module"> |
<script lang="ts" context="module"> |
||||||
import type { Meta } from '@storybook/svelte' |
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 { Story, Template } from '@storybook/addon-svelte-csf' |
||||||
import { PRsListItemArgsVectors as vectors } from './vectors' |
import { ProposalsListItemArgsVectors as vectors } from './vectors' |
||||||
|
|
||||||
export const meta: Meta<PRsListItem> = { |
export const meta: Meta<ProposalsListItem> = { |
||||||
title: 'PRs/List/Item', |
title: 'Proposals/List/Item', |
||||||
component: PRsListItem, |
component: ProposalsListItem, |
||||||
tags: ['autodocs'], |
tags: ['autodocs'], |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<Template let:args> |
<Template let:args> |
||||||
<PRsListItem {...args} /> |
<ProposalsListItem {...args} /> |
||||||
</Template> |
</Template> |
||||||
|
|
||||||
<Story name="Short Details" args={vectors.Short} /> |
<Story name="Short Details" args={vectors.Short} /> |
||||||
@ -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', |
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: |
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', |
'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', |
||||||
@ -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, |
|
||||||
}} |
|
||||||
/> |
|
||||||
@ -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> |
|
||||||
@ -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} |
|
||||||
/> |
|
||||||
@ -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} |
||||||
|
/> |
||||||
@ -1,6 +1,6 @@ |
|||||||
export const load = ({ params }) => { |
export const load = ({ params }) => { |
||||||
return { |
return { |
||||||
repo_id: decodeURIComponent(params.repo_id), |
repo_id: decodeURIComponent(params.repo_id), |
||||||
pr_id: params.pr_id, |
proposal_id: params.proposal_id, |
||||||
} |
} |
||||||
} |
} |
||||||
@ -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} |
||||||