Feat v0.9.6 stage mode collapse (#80)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m49s
CI/CD / test-sqlite (push) Successful in 3m4s
CI/CD / build-and-deploy (push) Successful in 1m15s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #80.
This commit is contained in:
2026-04-03 18:00:33 +00:00
committed by xcaliber
parent 75d7abc089
commit ac7286f83b
27 changed files with 1231 additions and 228 deletions

View File

@@ -13,15 +13,13 @@
const { html } = window;
const { useState, useEffect } = hooks;
export const STAGE_MODES = ['form', 'review', 'delegated', 'automated'];
export const STAGE_TYPES = ['simple', 'dynamic', 'automated'];
export const STAGE_MODES = ['form', 'delegated', 'automated'];
export const AUDIENCES = ['team', 'public', 'system'];
export function StageForm({ stage, teams, onSave, onCancel }) {
const [name, setName] = useState(stage?.name || '');
const [mode, setMode] = useState(stage?.stage_mode || 'form');
const [audience, setAudience] = useState(stage?.audience || 'team');
const [stageType, setStageType] = useState(stage?.stage_type || 'simple');
const [starlarkHook, setStarlarkHook] = useState(stage?.starlark_hook || '');
const [assignTeam, setAssignTeam] = useState(stage?.assignment_team_id || '');
const [autoTransition, setAutoTransition] = useState(stage?.auto_transition || false);
@@ -60,7 +58,6 @@ export function StageForm({ stage, teams, onSave, onCancel }) {
name,
stage_mode: mode,
audience,
stage_type: stageType,
starlark_hook: starlarkHook || null,
assignment_team_id: assignTeam || null,
auto_transition: autoTransition,
@@ -91,14 +88,8 @@ export function StageForm({ stage, teams, onSave, onCancel }) {
${AUDIENCES.map(a => html`<option key=${a} value=${a}>${a}</option>`)}
</select>
</div>
<div class="form-group">
<label>Stage Type</label>
<select value=${stageType} onChange=${e => setStageType(e.target.value)}>
${STAGE_TYPES.map(t => html`<option key=${t} value=${t}>${t}</option>`)}
</select>
</div>
</div>
${stageType !== 'simple' && html`
${mode === 'automated' && html`
<div class="form-row">
<div class="form-group" style="flex:1;">
<label>Starlark Hook</label>