Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-171

An open inline thread offers Reply and Delete thread

When a preview shows an inline thread, the page SHALL add once to the body of the thread a reply text area labelled "Reply to this thread" with the placeholder Reply, a Reply button and a Delete thread button titled "Delete the whole thread from the document", and send a reply or a delete of the thread to the host with its source lines.

Step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-015: from “The thread chip is open with its messages” to “The reply is sent with the lines of the thread”.

Scenarios 6

The situations the tests check; open one to read it.

nominalControls added once
Givena thread and the content applied twice
Whenthe page runs the controls
Thenthe thread holds one set of controls (one element with data-okf-thread-actions in its body)
refusalPage without controls
Givena page whose host gave the controls disabled (the module is installed with controls off, as in a test host)
Whenthe thread is shown
Thenthe messages show and no control is added; see SwRS-MDOKFSTUDIO-TRUST-001
nominalReply sends the trimmed text and the source lines
Givena reply box holding " Thanks " in a thread on lines 5 to 8
Whenthe writer presses Reply, or Cmd+Enter or Ctrl+Enter in the box
Thenthe host is asked for a reply with the lines 5 and 8 and the text Thanks, the controls are disabled until the answer and the box is emptied on success; the keys typed in the box never reach the page
nominalDelete thread asks without confirmation
Givena thread on lines 5 to 8
Whenthe writer presses Delete thread
Thenthe host is asked to delete lines 5 to 8 with no text and no question is shown; the writer undoes the deletion in the editor in one undo step
refusalNothing is sent
InputOutcome
Reply with an empty reply boxNo request is sent, the message "Write a reply first." appears and the box takes the focus
Reply with a box holding only spacesThe same
Reply or Delete thread on a thread element without valid source lines (no data-line)No request is sent and the status line says "The thread has no source position. Refresh the preview."
Reply or Delete thread while a block or frontmatter editor is openNo request is sent and the status line holds the reason of the open edit, see SwRS-MDOKFSTUDIO-BLOCK-041
refusalThe host refuses the change

The answer is matched to the request, see SwRS-MDOKFSTUDIO-TRUST-090.

InputOutcome
The host answers a reply or a delete with ok false and a reasonThe typed text stays and the reason is shown in the status line next to the buttons
The host answers with ok false and no reasonThe status line reads "The change was not saved."

Implemented in 1

Tested by 2