Skip to content

Show in-context docs when editing a record (i.e. when viewing a form in the CMS) #42

Todo

Description

@ChloeSartorelli

This is part of #29, split out so it can be reviewed in smaller pieces.

Add the in-context docs panel, and a button to open it from CMS edit forms for a specific record (e.g. editing a page in CMSMain, or editing a record in a ModelAdmin or other GridField). The button opens the docs for the class of the record being edited, using the class mapping added in #40.

These will be covered by separate issues:

  • The button in admin sections when no record is being edited (e.g. /admin/pages before selecting a page)
  • The button in the asset admin and campaign admin toolbars
  • The button in inline-editable elemental blocks
  • Keeping the panel open when navigating to a page with the same docs

Designs

Acceptance Criteria

  • Edit forms for a record have a button in the top right that opens the docs for the record's class
    • The "main page" for the class is opened. If no page names the class, the "main page" for the nearest ancestor class that a page names is opened (e.g. NewsLandingPage falls back to LandingPage, then Page, then SiteTree)
    • If there are no relevant docs, no button is shown
    • Forms that aren't for editing a DataObject record (e.g. the "Arbitrary Data Gridfield" in a kitchen sink installation) have no button
  • The button is only shown to users who can access the userdocs admin section
  • The docs open in a panel that slides in over the CMS from the right
    • Ideally the rest of the CMS can still be used while the panel is open. A modal panel is acceptable if that is considerably simpler
    • The panel is usable at narrow screen widths
  • The panel has a close button
  • The panel shows the rendered docs page without breadcrumbs
  • Links to other docs pages open in the panel, and links to headings scroll the panel to that heading
  • Clicking a link in the panel never navigates away from the current CMS page or triggers the unsaved changes warning. External links open in a new tab
  • The panel has a back button, and a way to get back to the first page that was opened, even after following several links
  • A fixed "Open user docs" link at the top of the panel opens the current page in the userdocs admin in a new tab
  • Keyboard and screen reader users can open, use and close the panel
    • Focus moves into the panel when it opens, and back to the button when it closes
    • Escape closes the panel
  • Developer docs explain which docs page opens for a record, including the ancestor class fallback

PRs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions