Behaviour SwRS-MDOKFSTUDIO-FMEDIT-037
An added field is one inserted line where its row shows, and its editor opens
When a writer adds a field, the extension SHALL insert it as one line where its row shows and open the editor of the new field once: with a schema right after the present field that precedes it in schema order or right before the next one when it comes first, without a schema after the row whose menu was used, else at the end of the block.
Step 2 of path 2 in StRS-MDOKFSTUDIO-FMEDIT-005: from “A new field is added” to “The editor of the new field is open”.
Scenarios 8
The situations the tests check; open one to read it.
nominalWith a schema, the field goes where its row shows
Givena schema listing title, owner, status and a document with title and status
Whenowner is added
Thenowner is inserted between title and status whichever row was clicked, right after the present field that precedes it in schema order
boundaryFirst in schema order and custom keys
| Added field | Insert point |
|---|---|
| a field that comes first in schema order, with a leading comment in the block | after the leading comment lines, before the first key (beforeField) |
| a schema field whose schema neighbours are absent from the document | the absent schema neighbours are skipped |
| a custom key | after the last row |
nominalWithout a schema, the field follows the row whose menu was used
| Added field | Insert point |
|---|---|
| owner, added from the menu of title, in a document without a schema with the fields title and status | directly after title |
| owner, with an afterField naming a field that does not exist | appended at the end of the block |
nominalThe editor of the added field opens by itself once
Givenan add posted for the field owner in edit mode
Whenthe re-rendered table arrives
Thenthe editor of owner opens and the pending edit is cleared when it closes
boundaryReload and later renders
| Page load | Outcome |
|---|---|
| the render that posted the add is loaded again | the pending edit is kept for the next render |
| a later render of an already opened editor | the editor is not reopened |
refusalA pending editor that cannot be used is dropped
| Situation when the table is re-rendered | Outcome |
|---|---|
| edit mode turned off | no editor opens and the pending edit is cleared |
| the row of the new field is missing | no editor opens and the pending edit is cleared |
| the add was refused by the host (error result) | the pending edit is cleared |
nominalA new custom key is saved as a plain scalar when that is safe
Givena custom key just added with the empty string as value
Whenthe writer types plain text and presses Enter
Thenthe editor is one text line, the save carries fieldValueStyle plain and the value is written unquoted
boundaryText that would not read back as the same string
| Value typed for the new custom key | Outcome |
|---|---|
| yes, on, or a date-like value | written quoted |
| any save of an existing field (a field whose current value is not the empty string) | never asks for a plain scalar; the host accepts the plain style only for a field whose current value is the empty string |
Implemented in 4
Tested by 3
Known limits (1)
- when the minimal insertion cannot be verified, the field is appended at the end of the block instead (positioned false).
Replaces
SwRS-MDOKFSTUDIO-FMEDIT-038Without a schema, an added field follows the row whose menu was used superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-037 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-040The editor of an added field opens by itself once superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-037 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-041A pending new-field editor is dropped when it cannot be used superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-037 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-042A new custom key is saved as a plain scalar when that is safe superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-037 Markdown file