Skip to main content

Module fields

Module fields 

Source
Expand description

Step fields: what the person doing the work records at a step.

An author adds any number of fields to a step (crate::model::Step::fields): a box to tick, a choice among options, a line or a box of text, a measurement with its limits, a serial number. The players show them as inputs and the printed pages as a paper form (a choice prints every option as its own box to mark). The values are a build’s record, never the document’s: the players keep them, and a jobs floor stores them with the step’s sign-off.

A value is plain JSON, the same in the page, the app and a server:

kindvalue
checktrue / false
choicethe option’s text; with multiple, an array of them; with other, any text
text, serialtext
numbera number (or text that reads as one)

evaluate reads one value against its field and blocking says why a step cannot be completed yet, so every player and every server apply the same rule.

Structs§

Evaluated
One value read against its field.
StepField
One field of a step.

Enums§

FieldKind
What a field records.

Constants§

MAX_DECIMALS
The most decimals a measurement shows.
MAX_OPTIONS
The most options a choice offers.
MAX_TEXT_LINES
The most lines a text field’s box holds.
MAX_VALUE_CHARS
The longest text a value holds, in characters.

Functions§

blocking
Why field keeps its step from being completed with this value, if it does: a required field left empty, or a measurement outside limits that must be inside.
evaluate
Read value (absent: nothing entered) against field. An Err is a value the field cannot hold (text for a tick, an option the choice does not offer, something that is no number): a server refuses it.
format_number
value with decimals decimals, or as short as it reads when none is set.
missing
Everything that keeps a step with fields from being completed, given the values entered (looked up by field id): one reason per field, in order. A value its field cannot hold is a reason too.