This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { timeFormat } from '$ui/stores/time-zone.js';
|
||||
import { tick } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { canOperate } from '$lib/auth.js';
|
||||
import { contextHref } from '$lib/navigation-context.js';
|
||||
import type { BetaDeploymentServer } from '$ui/betas.js';
|
||||
import Badge from './primitives/Badge.svelte';
|
||||
@@ -52,13 +53,14 @@
|
||||
evidenceKind = $state(''),
|
||||
evidenceQuery = $state('');
|
||||
let evidenceSection = $state<HTMLDetailsElement>();
|
||||
const editable = $derived(canOperate($page.data?.user?.role));
|
||||
const hasDeletedServers = $derived(
|
||||
deletedParticipants ||
|
||||
test.servers.some((server) => server.server_deleted_at) ||
|
||||
deployments?.some((server) => server.server_deleted_at)
|
||||
);
|
||||
const canSign = $derived(
|
||||
!closed && !hasDeletedServers && ['active', 'passed'].includes(test.outcome)
|
||||
editable && !closed && !hasDeletedServers && ['active', 'passed'].includes(test.outcome)
|
||||
);
|
||||
const expired = $derived(
|
||||
test.outcome === 'inconclusive' ||
|
||||
@@ -139,6 +141,7 @@
|
||||
evidenceLimit = 25;
|
||||
});
|
||||
export async function action(action: string, extra: Record<string, string> = {}) {
|
||||
if (!editable) return;
|
||||
if (
|
||||
action === 'retry' &&
|
||||
!(await confirmAction({
|
||||
@@ -197,7 +200,7 @@
|
||||
{#if !deployments}<StatusBadge state={test.outcome} />{/if}
|
||||
</div>
|
||||
{#if !closed && !deployments}
|
||||
{#if !hasDeletedServers}<div class="actions">
|
||||
{#if editable && !hasDeletedServers}<div class="actions">
|
||||
{#if test.outcome === 'paused' && !expired}<Button
|
||||
size="sm"
|
||||
disabled={busy}
|
||||
@@ -502,7 +505,7 @@
|
||||
value={Math.min(progress.current, progress.target)}
|
||||
max={progress.target}
|
||||
></progress>{/if}
|
||||
{#if requirement.kind === 'manual' && !progress.passed && !closed && !hasDeletedServers}
|
||||
{#if editable && requirement.kind === 'manual' && !progress.passed && !closed && !hasDeletedServers}
|
||||
{#if canSign && server.observingAt}<div class="signoff">
|
||||
<label
|
||||
>Tester name and observation<textarea
|
||||
|
||||
Reference in New Issue
Block a user