Page MenuHomePhabricator

[Refactor] Allow editing main content in the CitationDialog of a sub-ref node without relying on a main node
Closed, ResolvedPublic

Description

Stalled because we want to try out another approach first where we want to create a new method for editing a reference. This ticket could than use that if we are successful.

Context

We want to move away from synthetic LDRs. So instead on depending on (main) ve.dm.MWReferenceNode to be part of the document we want to retrieve content and ve.dm.InternalItemNode directly from the InternalList.

The ve.dm.MWReferenceModel is already an abstraction which hides the MWReferenceNode and is used to edit the nodes in the MWReferenceCitationDialog, so we should be able to use this class to also work with a sub-ref that has no distinct main reference node with the main content.

Task

The edit panel used in the MWReferenceCitationDialog works with a MWReferenceModel object that's created from nodes currently. Originally the MWReferenceModel just reflects a node with one document for the content, we now have the option to load a sub-ref node in there and let the dialog work with the mainContent of the sub-ref.

  • Allow MWReferenceCitationDialog to work on sub-ref nodes in a mode where the main content is edited
  • Route the entry points from the ContextMenu and ReferencesList to the MWReferenceCitationDialog
Notes

Currently editing is happening around the MWReferenceModel class. So we always have to create that class from whatever we want to edit. At the moment we assume that we're coming from a MWReferenceNode and then convert that into a model.

Event Timeline

Change #1256099 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/Cite@master] VE: Allow editing main content that lacks a distinct ref node

https://gerrit.wikimedia.org/r/1256099

Change #1256099 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Allow editing main content that lacks a distinct ref node

https://gerrit.wikimedia.org/r/1256099

Change #1275875 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Fix typo in "mainListKey", must be "mainRefKey"

https://gerrit.wikimedia.org/r/1275875

Change #1275875 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Fix typo in "mainListKey", must be "mainRefKey"

https://gerrit.wikimedia.org/r/1275875

Tobi_WMDE_SW claimed this task.