YAMLField

The YAMLField component displays a single YAML field for editing using the appropriate input option.

Props

Name Type Default value Required? Description
field Field - Yes YAML Field to display.
saveStatusLinger Number 1000 No Display duration (ms) for the save indicator.

Data

Name Type Default value Description
currentValue any null Current value of the YAML field.
valueChanged Boolean false Whether the current value matches the value saved in the store.
loadingFileList Boolean true Whether the list of files required for the field's options is being fetched.
fileList Array.<String> [] List of filenames for files required for the field's options.
saveStatus String '' Description of the current save status. "clean" = unchanged, "saved" = freshly saved to store, "dirty" = changes pending save
saveStatusTimeout Number null Timeout handle for the event cancelling the 'recently saved' display.

Computed

Name Type Description
value any Value of the YAML field in the store.
status String The Buefy style class for displaying the field's save status.

Events

Name Payload Type Description
save Object Indicate that a new value should be saved as this field's value.

Methods

getFileList() → {Array.<String>|null}

Search through a repository's path to determine the files that are valid completion values for the field. This is triggered when the component is mounted.
Returns:
Array.<String> | null

save()

Save the value of the field to the store.

setSaveStatus(status)

Set the save status of the field. Setting the status to "saved" will set the status back to "clean" after a delay.
Parameters:
Name Type Description
status String Status ("clean", "dirty", or "saved") to set the save status to.

toBackendValue(v) → {any}

Convert values to the format in which they are saved in the store.
Parameters:
Name Type Description
v any Value to convert.
Returns:
any - Value in the format expected by the back end.

validTime(tag) → {boolean}

Check whether a string is a valid 12h60m format string.
Parameters:
Name Type Description
tag String Time string to check.
Returns:
boolean