ui/client/features/plan/hooks/usePlanScreen
Cockpit client (features), next. Source: ui/client/features/plan/hooks/usePlanScreen.tsx.
Functions#
usePlanScreen()#
usePlanScreen(
onStarted):object
Defined in: ui/client/features/plan/hooks/usePlanScreen.tsx:18
Everything the Plan screen does, composed from small hooks. No model is called from here or from anything it calls: proposals are a text match on the server, the impact is a graph computation, and the plan is judged by the server's validator after every edit.
Parameters#
onStarted
() => void
Returns#
addPrefilled
addPrefilled: (
request) =>boolean
Adds a step that already has its title, tag and arguments. It is validated by the server like any other step, and nothing starts until Run plan. Returns whether the step was added (false: that flow is not in the catalogue).
Parameters
request
Returns
boolean
addStep
addStep: (
flowId) =>void
Parameters
flowId
string
Returns
void
addSuggested
addSuggested: () =>
void
Returns
void
analyse
analyse: () =>
Promise<void>
Returns
Promise<void>
canRun
canRun:
boolean
move
move: (
id,dir) =>void
Parameters
id
string
dir
-1 | 1
Returns
void
noteActions
noteActions:
object
noteActions.onKeepMine
onKeepMine: () =>
void=note.keepMine
Returns
void
noteActions.onKeepPlan
onKeepPlan: () =>
void=note.keepPlan
Returns
void
noteActions.onLoadTheirs
onLoadTheirs: () =>
void=note.loadTheirs
Returns
void
noteActions.onRetry
onRetry: () =>
void=note.retry
Returns
void
propose
propose: () =>
Promise<void>
Returns
Promise<void>
remove
remove: (
id) =>void
Parameters
id
string
Returns
void
retag
retag: (
id,e) =>void
Parameters
id
string
e
Returns
void
run
run: () =>
Promise<void>
Returns
Promise<void>
setArg
setArg: (
id,name,v) =>void
Parameters
id
string
name
string
v
string
Returns
void
setTicket
setTicket: (
t) =>void
Parameters
t
Partial<Ticket>
Returns
void
setTitle
setTitle: (
id,title) =>void
Parameters
id
string
title
string
Returns
void
stale
stale:
boolean
state
state:
ScreenState
suggestions
suggestions:
Omit<PlanStep,"id">[]
toggleAccept
toggleAccept: (
ref) =>void
Parameters
ref
string
Returns
void
togglePick
togglePick: (
ref) =>void
Parameters
ref
string
Returns
void