@flow-state-dev/workforce/react
Type Aliases
BoardCard
type BoardCard = object;
One row as a board publishes it.
The stored envelope carries far more — the claim, the lease, the retry
ledger, the write log — and the collection's expose withholds all of it,
so this is the whole of what arrives. Every field but id and status is
optional, because a task that has not been titled, assigned or failed simply
has not got one: read each through a == null guard.
Properties
assignee?
readonly assignee?: string;
error?
readonly error?: string;
goal?
readonly goal?: string;
id
readonly id: string;
status
readonly status: string;
title?
readonly title?: string;
BoardCardRow
type BoardCardRow = object;
A card, plus the topic it was stored under.
Properties
card
readonly card: BoardCard;
topic
readonly topic: string;
BoardColumn
type BoardColumn = object;
One column, as a slot is handed it.
Properties
isUnknown
readonly isUnknown: boolean;
True when the status is not one this version knows — see the file header.
rows
readonly rows: readonly BoardCardRow[];
status
readonly status: string;
BoardColumnsProps
type BoardColumnsProps = BoardColumnsCommonProps & BoardColumnsTransportProps;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
BoardColumnsSlots
type BoardColumnsSlots = object;
The parts of a board that belong to the host rather than to the component.
Properties
card?
readonly card?: (row) => ReactNode;
A card's body, when a host wants its own.
The body, not the row. The column renders the <li> and puts the
task's id on it; return what goes inside one. Returning an <li> of your
own nests a list item inside a list item, which is invalid markup that
keyboard and assistive-technology traversal cannot represent.
Parameters
row
Returns
ReactNode
columnHeader?
readonly columnHeader?: (column) => ReactNode;
Beside a column's heading.
Parameters
column
Returns
ReactNode
empty?
readonly empty?: () => ReactNode;
What a board holding no rows at all says.
Returns
ReactNode
BoardListProps
type BoardListProps = BoardListCommonProps & BoardListTransportProps;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
BoardListSlots
type BoardListSlots = object;
The parts of a board list that belong to the host rather than to the component.
Properties
empty?
readonly empty?: () => ReactNode;
What a board holding no rows at all says.
Returns
ReactNode
row?
readonly row?: (row) => ReactNode;
A row's body, when a host wants its own.
The body, not the row. The list renders the <li> and puts the task's
id on it; return what goes inside one.
Parameters
row
Returns
ReactNode
BoardStatus
type BoardStatus = typeof BOARD_STATUS_COLUMNS[number];
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
PanelItemSource
type PanelItemSource = object;
WorkerDetail's read is one item, not a page — the method name says which.
Properties
resources
readonly resources: Pick<ResourcesApi, "getCollectionResourceState">;
PanelLiveSource
type PanelLiveSource = PanelRowSource & object;
A live BoardList's slice: the board read, and the subscription that says
when to read it again. Both go through the one client, so the subscription
always carries the read's credential.
Type Declaration
subscribe
readonly subscribe: Client["subscribe"];
PanelRowSource
type PanelRowSource = object;
The slice of the one client a panel reads, and the type says which method.
A host passes the client it already holds — with its own fetcher, so every
request carries whatever credential that transport adds. A panel that built
its own client would read through no credential and fail against any
deployment that authenticates.
Properties
resources
readonly resources: Pick<ResourcesApi, "listCollectionResources">;
RosterProps
type RosterProps = RosterCommonProps & RosterTransportProps;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
RosterSlots
type RosterSlots = object;
The parts of the roster that belong to the host rather than to the component.
Properties
empty?
readonly empty?: () => ReactNode;
What an empty roster says, when the host would rather say it itself.
Returns
ReactNode
rowTrailing?
readonly rowTrailing?: (row) => ReactNode;
Beside a worker's name — the host's own affordances, never the component's.
Parameters
row
Returns
ReactNode
RosterWorkerRow
type RosterWorkerRow = object;
A worker row, plus the topic it was stored under.
Properties
topic
readonly topic: string;
worker
readonly worker: RosterWorker;
WorkerDetailProps
type WorkerDetailProps = object;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
Properties
client?
readonly client?: PanelItemSource;
The host's own client, so the read carries the host's transport
and its credential. Pass a STABLE reference — see Roster.
collectionRef?
readonly collectionRef?: string;
The key the session's flow declares the roster collection under. One
path segment, so it carries no slash — see RosterProps.collectionRef.
kind
readonly kind: string;
The worker's kind, from the row the host already holds (a navigator row). Rendered as given; this component never reads it.
sessionId
readonly sessionId: string;
The session the read is addressed to. Its organization is the one read.
workerId?
readonly workerId?: string;
The roster topic to read instructions from — pass this ONLY for a worker with a public, org-visible roster row.
Leave it out for a worker declared in a WORKER.md, or one hired as a
user's own: this component then shows "not published" and makes no read.
Never pass a full address (<org>.~<user>.<id> or
<org>.<workerId>) here — this is a roster TOPIC, the same string
Roster's rows carry as workerId.
Variables
BOARD_STATUS_COLUMNS
const BOARD_STATUS_COLUMNS: readonly ["pending", "in_progress", "held", "completed", "errored", "cancelled"];
The statuses a board column is drawn for, in the order work moves through them.
These are the substrate's own — @flow-state-dev/orchestration's
taskStatusSchema — listed rather than imported, because react takes only
client, contracts and core and a column layout is not worth a fourth
dependency. Listing them is safe in the one way that matters: an unknown
status still renders, in its own column, so this list going stale costs a
column's position and never a hidden row.
Functions
BoardColumns()
function BoardColumns(props): ReactNode;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
Parameters
props
Returns
ReactNode
BoardList()
function BoardList(props): ReactNode;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
Parameters
props
Returns
ReactNode
groupIntoColumns()
function groupIntoColumns(rows): BoardColumn[];
Group rows into columns: every known status in order, then any status the rows carried that this version does not know.
Exported for its test — the grouping is where a row can be lost, and that is cheaper to assert directly than through a rendered DOM.
Parameters
rows
readonly BoardCardRow[]
Returns
Roster()
function Roster(props): ReactNode;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
Parameters
props
Returns
ReactNode
WorkerDetail()
function WorkerDetail(props): ReactNode;
@flow-state-dev/workforce/react: the components that draw workforce's
records, for a workforce screen.
Roster lists a user's workers, reading the roster flow's roster view by
default; BoardColumns and BoardList draw one task board's tasks, and
WorkerDetail shows one worker. React is an optional peer: only this entry
imports it, so a server-only app that imports the package root doesn't pull
it in.
Parameters
props
Returns
ReactNode