Skip to content

Add quick-edit modal for referenced documents in Reference(s) fields#934

Closed
stevenle wants to merge 1 commit intomainfrom
codex/add-pop-up-editor-for-reference-fields-nhc1e3
Closed

Add quick-edit modal for referenced documents in Reference(s) fields#934
stevenle wants to merge 1 commit intomainfrom
codex/add-pop-up-editor-for-reference-fields-nhc1e3

Conversation

@stevenle
Copy link
Member

Motivation

  • Provide an inline quick-edit experience for documents referenced by ReferenceField and ReferencesField so editors can edit referenced docs without leaving the current page.

Description

  • Add a new ReferenceFieldEditorModal component and stylesheet to load a referenced doc into an in-memory draft controller and allow saving updates back to the draft Firestore doc while updating local cache.
  • Wire quick-edit state into ReferenceField and ReferencesField, passing a quickEditDocId to the modal and opening it when a reference preview/card is clicked with a normal left-click (modifier keys still open the doc in a new tab).
  • Update ReferenceField.Preview and ReferenceField.DocCard to accept and call an onOpenQuickEdit callback, and prevent default link navigation when opening the modal; add rel="noopener noreferrer" to external links.
  • Wrap DocPreviewCard in a clickable container for ReferencesField and add a small CSS tweak (ReferencesField__card__previewCard) to restore previous padding; also add a trailing newline in ReferenceField.css.
  • Make InMemoryDraftDocController constructor accept rootKey: string | null and treat null as using the supplied value as-is, which enables using the controller with a root object like fields.

Testing

  • Ran the project's automated test suite with yarn test and the tests passed.
  • Performed a local build with yarn build which completed successfully.
  • Ran lint/type checks with yarn lint/tsc and they passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant