Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/plan/domain/PlanNote

Pure (DOMAIN-001): how a durable note becomes the Plan screen's state and back.

Cockpit client (features), next. Source: ui/client/features/plan/domain/PlanNote.ts.

Type Aliases#

SavedKeys#

SavedKeys = object

Defined in: ui/client/features/plan/domain/PlanNote.ts:29

What the server holds, in the two keys autosave compares against the screen.

Properties#

steps

steps: string

Defined in: ui/client/features/plan/domain/PlanNote.ts:29

text

text: string

Defined in: ui/client/features/plan/domain/PlanNote.ts:29

Functions#

counterAfter()#

counterAfter(steps): number

Defined in: ui/client/features/plan/domain/PlanNote.ts:16

The id counter that never collides with the ids a loaded plan already uses (s1, s2...).

Parameters#

steps

PlanStep[]

Returns#

number


isUnsaved()#

isUnsaved(s, saved): boolean

Defined in: ui/client/features/plan/domain/PlanNote.ts:35

Unsaved: the screen holds text or steps the server copy does not. With no note yet, anything typed counts.

Parameters#

s

Pick<ScreenState, "ticket" | "steps">

saved

SavedKeys | null

Returns#

boolean


keysOfNote()#

keysOfNote(n): SavedKeys

Defined in: ui/client/features/plan/domain/PlanNote.ts:32

Parameters#

n

Note

Returns#

SavedKeys


noteMeta()#

noteMeta(n): PlanNote

Defined in: ui/client/features/plan/domain/PlanNote.ts:7

Parameters#

n

Note

Returns#

PlanNote


planPart()#

planPart(s, saved, force): object

Defined in: ui/client/features/plan/domain/PlanNote.ts:41

What a save sends beyond the text: the plan (and its status) only when the steps changed, or when asked to keep it.

Parameters#

s

Pick<ScreenState, "ticket" | "steps">

saved

SavedKeys | null

force

boolean

Returns#

object

plan?

optional plan?: PlanDoc | null

status?

optional status?: "draft" | "plan-ready"


screenFromNote()#

screenFromNote(n): Pick<ScreenState, "ticket" | "steps" | "nextId">

Defined in: ui/client/features/plan/domain/PlanNote.ts:23

The ticket and steps a note puts on screen.

Parameters#

n

Note

Returns#

Pick<ScreenState, "ticket" | "steps" | "nextId">


stepsKey()#

stepsKey(steps): string

Defined in: ui/client/features/plan/domain/PlanNote.ts:31

Parameters#

steps

PlanStep[]

Returns#

string


stepsOf()#

stepsOf(plan): PlanStep[]

Defined in: ui/client/features/plan/domain/PlanNote.ts:10

The steps a saved plan holds; anything that is not a list of steps reads as no plan.

Parameters#

plan

unknown

Returns#

PlanStep[]


textKey()#

textKey(ticket): string

Defined in: ui/client/features/plan/domain/PlanNote.ts:30

Parameters#

ticket
body

string

title

string

Returns#

string