Page MenuHomePhabricator

[Refactor] Implement a method to find Citation commands from InternalItems
Closed, ResolvedPublic

Description

Context

We need to be able to find the right citation command for opening the CitationDialog when editing sub-refs and their main content. Currently the main node is used to achieve that. With the main node gone in some cases, we need to find a way to connect the existing commands with the InternalItem of the main content.

Background

In ve.ui.MWReference.init.js the commands will be build add-hoc for the configured citation tool templates. The name of the template that should be loaded is weird here and used to setup the right parameters when opening the CitationDialog.

Solution

We could try to identify the existing tools and iterate over the template names to get to the fitting command for a template inside of an InterntalItem.

Next steps

Event Timeline

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

[mediawiki/extensions/Cite@master] VE: Move init code for the CitationTools to own file

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

Change #1260746 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Move init code for the CitationTools to own file

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

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

[mediawiki/extensions/Cite@master] Move global ve.ui.mwCitationTools into new file

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

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

[mediawiki/extensions/Cite@master] VE: Add helper methods to create Citation tool commands

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

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

[mediawiki/extensions/Cite@master] VE: Extract method to check for Citation template to helper class

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

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

[mediawiki/extensions/Cite@master] VE: Add nodeToEdit support for CitationDialog

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

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

[mediawiki/extensions/Cite@master] VE: Add more documentation to Citation Tool code

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

Change #1261443 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Move global ve.ui.mwCitationTools into new file

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

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

[mediawiki/extensions/Cite@master] VE: Allow getting a command from an InternalItem

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

Change #1261446 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Add helper methods to create Citation tool commands

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

Change #1266951 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Add more documentation to CitationTools code

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

Change #1261517 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Extract method to check for Citation template content

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

Change #1266977 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] VE: Allow getting the command from a ref's InternalItem

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