launch: accept config.phase_teams as a valid team source
Missions created via the new multi-team wizard have neither team_id
nor team_template_id set — they carry config.phase_teams. Both the
frontend Launch button gate and the backend set_status precondition
were checking only the old two fields, disabling launch for every
new wizard-created mission with a "No team" tooltip.
- MissionCanvas: hasTeam now also returns true when
mission.config.phase_teams has at least one non-empty list.
- routes::missions::set_status: same check on the server so a
direct API caller with only config.phase_teams also gets past
the gate.
Directly unblocks the "we just finished the wizard, Launch is greyed
out" report. Agents materialize AFTER Launch — the button is the
trigger, not a post-condition of creation.
This commit is contained in:
@@ -411,8 +411,21 @@ export function MissionCanvas({
|
||||
<RefreshCw size={13} />
|
||||
</button>
|
||||
{mission.status === "draft" && (() => {
|
||||
// Launch is enabled when we have SOMETHING that can
|
||||
// materialize agents:
|
||||
// - team_id set (already materialized)
|
||||
// - team_template_id set (legacy single-team path)
|
||||
// - config.phase_teams has entries (new multi-team wizard path)
|
||||
const phaseTeams =
|
||||
(mission.config as { phase_teams?: Record<string, string[]> })
|
||||
?.phase_teams;
|
||||
const hasPhaseTeams =
|
||||
phaseTeams &&
|
||||
Object.values(phaseTeams).some((arr) => arr.length > 0);
|
||||
const hasTeam =
|
||||
mission.team_id !== null || mission.team_template_id !== null;
|
||||
mission.team_id !== null ||
|
||||
mission.team_template_id !== null ||
|
||||
Boolean(hasPhaseTeams);
|
||||
const disabled = launching || !hasTeam;
|
||||
return (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user