Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMEDIT-024

A click on a field name renames the key

When a writer clicks a field name in edit mode, the extension SHALL open a key editor in the name cell whose suggestion list offers the schema keys not yet used, and rename the key from it on Enter or on leaving with a changed name, changing only the key text and keeping the comments.

Step 1 of path 1 in StRS-MDOKFSTUDIO-FMEDIT-005: from “The properties table is shown in edit mode” to “The key editor is open”.

Part of StRS-MDOKFSTUDIO-FMEDIT-008, outside the paths drawn on its map.

Scenarios 6

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

nominalClick on a field name opens the key editor
Givenedit mode on and a schema whose keys include owner, absent from the document
Whenthe writer clicks the name cell of the title field
Thenan input labelled "Frontmatter key title" opens with the caret at the end and its datalist offers owner
boundaryKey editor without a schema
Givena document without a schema
Whenthe writer clicks a name cell
Thenthe key editor opens with an empty suggestion list
nominalEnter or leaving renames only the key text
Givena key editor for title holding the new name heading, the field being followed by a trailing comment
Whenthe writer presses Enter (or leaves the editor with the changed name)
Thena save with fieldName title and newFieldName heading is posted and the written line keeps its trailing comment
boundaryUnchanged name and Escape
Givena key editor whose name was not changed
Whenthe writer presses Enter or leaves it
Thenthe editor closes and nothing is posted; Escape cancels the edit
refusalThe key editor refuses an empty or padded name
Name typed in the key editorOutcome after Enter
emptythe status shows "Enter a non-empty key without leading or trailing spaces." in the error state and nothing is posted
" owner" (leading space)the same message shows and nothing is posted

A flush does not refuse: it trims the key and an empty key keeps the old one (see SwRS-MDOKFSTUDIO-FMEDIT-067).

refusalThe host refuses a rename to a used or invalid name
Rename request received by the hostAnswer, document unchanged
title renamed to count, in a document with the fields title and count'A frontmatter field named "count" already exists.'
a name with surrounding spaces, or an empty name, sent directly to the host"Enter a non-empty frontmatter key without leading or trailing spaces."

Implemented in 3

Tested by 6

Replaces

SwRS-MDOKFSTUDIO-FMEDIT-025Enter or leaving the key editor renames the key superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-024 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-026An empty or padded key name is refused in the key editor superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-024 Markdown file
SwRS-MDOKFSTUDIO-FMEDIT-027The host refuses a rename to a name already used superseded superseded by SwRS-MDOKFSTUDIO-FMEDIT-024 Markdown file