ui/client/features/plan/hooks/useStepActions
Cockpit client (features), v0.9. Source: ui/client/features/plan/hooks/useStepActions.tsx.
Type Aliases#
PrefilledStep#
PrefilledStep =
object
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:11
One ready-made step to add to the plan (the Blocks tab's "Run this block", #407).
Properties#
args
args:
Record<string,unknown>
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:11
executor
executor:
Executor
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:11
flow
flow:
string
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:11
title
title:
string
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:11
Functions#
useStepActions()#
useStepActions(
state,dispatch,flows):object
Defined in: ui/client/features/plan/hooks/useStepActions.tsx:14
Every edit of the step list. Each one only reshapes the list; whether the result is valid is the server's answer.
Parameters#
state
dispatch
Dispatch<ScreenAction>
flows
FlowInfo[]
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
move
move: (
id,dir) =>void
Parameters
id
string
dir
-1 | 1
Returns
void
remove
remove: (
id) =>void
Parameters
id
string
Returns
void
retag
retag: (
id,e) =>void
Parameters
id
string
e
Returns
void
setArg
setArg: (
id,name,v) =>void
Parameters
id
string
name
string
v
string
Returns
void
setTitle
setTitle: (
id,title) =>void
Parameters
id
string
title
string
Returns
void
suggestions
suggestions:
Omit<PlanStep,"id">[]