~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless

git that lives in your Atmosphere account

Forked from chadtmiller.com/knotless

0
0
42 lines · 1.5 KB Raw History
<script lang="ts">
	import { repoHref } from '#lib/format.ts';
	import EjectedList from '#lib/organisms/EjectedList.svelte';
	import LandedList from '#lib/organisms/LandedList.svelte';
	import QueueLine from '#lib/organisms/QueueLine.svelte';
	import RepoPage from '#lib/templates/RepoPage.svelte';
	import Empty from '#lib/molecules/Empty.svelte';
	let { data } = $props();
	const q = $derived(data.queue);
	const base = $derived(repoHref(data.authority, data.repo.name));
	// Who sees its Settings tab, as RepoPage says.
	const may = $derived(
		data.viewer?.actor?.did === data.repo.owner.did || !!data.repo.viewer?.admin
	);
</script>

<RepoPage repo={data.repo} tab="pulls" title="Merge queue · {data.repo.name}">
	<h2 class="item-title">Merge queue</h2>
	<div class="queue">
		{#each q.branches as line (line.branch)}
			<QueueLine {line} {base} typical={q.typical} />
		{:else}
			<div class="box">
				{#if data.repo.mergeQueue}
					<Empty title="Nothing queued"
						>Add a pull with Add to merge queue on its page. The repository's runner lands it once
						its batch passes its checks.</Empty
					>
				{:else}
					<Empty title="No branch uses the merge queue"
						>Pulls in this repository merge directly.{#if may}{' '}<a
								href={repoHref(data.authority, data.repo.name, '/settings/branches')}
								>Turn it on for a branch in settings</a
							>.{/if}</Empty
					>
				{/if}
			</div>
		{/each}
		{#if q.ejected.length}<EjectedList ejected={q.ejected} {base} />{/if}
		{#if q.landed.length}<LandedList landed={q.landed} {base} />{/if}
	</div>
</RepoPage>