MBS-5772: Add support for adding examples to relationship documentation

Merged
#160 · Created  · Last updated

Description

This review completes the new features requested in MBS-5772. There are a few things going on in this commit:

  • It extends the Edit::Relationship::EditLinkType edit type with a new 'examples' section (which is optional to allow existing edits to load). This section contains a serialization of relationships that are to be used in examples, along with the metadata for the example - whether it is published, and what the name of this example.

  • The Relationship::LinkType->edit action has been extended in order to provide new interaction with this edit type. Specifically, the Admin::LinkType form has been extended for editing via the Admin::LinkType::Edit form, which allows a Repeatable of examples. The user only submits relationship IDs and example names - the controller looks up what that submission is in order to provide a richer UI than just relationship IDs.

  • The relationship/linktype/form.tt template has been heavily extended to provide a UI for managing examples. I chose to use Knockout for this, but I don't think it uses any particularly advanced features of it. The UI is a little crappy at the moment - users have to paste an MBID of one end of the relationship and then click 'Find relationships', but it does the job.

While the editor UI is not great, I would like to focus on ironing any bugs out/shipping this before improving it as it's a very hidden part of the website.

0 attachments

0 comments

Loading commits...