fix(ui): team builder lead rule mirrors the route busy check (helper-on-PENDING is not a valid lead) (#44)
This commit is contained in:
@@ -32,8 +32,10 @@ export function TeamBuilder({ type, hopCount, roster, tasks, onQueue }: {
|
|||||||
const duration = lead ? computeDuration(type, hopCount ?? 0, lead, helpers) : null // CrewDto ⊇ CrewMember
|
const duration = lead ? computeDuration(type, hopCount ?? 0, lead, helpers) : null // CrewDto ⊇ CrewMember
|
||||||
|
|
||||||
const leadReason = (c: CrewDto) => {
|
const leadReason = (c: CrewDto) => {
|
||||||
const t = tasks.find((x) => x.leadCrewId === c.id && x.status === 'PENDING')
|
const leads = tasks.find((x) => x.leadCrewId === c.id && x.status === 'PENDING')
|
||||||
return t ? `${t.type} ALREADY QUEUED` : null
|
if (leads) return `${leads.type} ALREADY QUEUED`
|
||||||
|
const helps = tasks.find((x) => x.helperCrewIds.includes(c.id) && x.status === 'PENDING')
|
||||||
|
return helps ? `COMMITTED: ${helps.type}` : null
|
||||||
}
|
}
|
||||||
const helperReason = (c: CrewDto) => {
|
const helperReason = (c: CrewDto) => {
|
||||||
const t = tasks.find((x) => (x.leadCrewId === c.id || x.helperCrewIds.includes(c.id)) && (x.status === 'ACTIVE' || x.status === 'PENDING'))
|
const t = tasks.find((x) => (x.leadCrewId === c.id || x.helperCrewIds.includes(c.id)) && (x.status === 'ACTIVE' || x.status === 'PENDING'))
|
||||||
|
|||||||
Reference in New Issue
Block a user