Page MenuHomePhabricator

Refactor code for dashboard lists
Closed, ResolvedPublic

Description

Currently, on our dashboard, there are three lists - Suggestions (configurable), In progress and Published. First list is inside ext.cx.suggestionlist.js file and later two are in ext.cx.translationlist.js file. Both of these lists are defined as separate entities in extension.json and loaded as dependencies of ext.cx.dashboard, which is in ext.cx.dashboard.js file.

Some parts of those distinct types of dashboard lists are shared and can be factored out into a common parent of both ext.cx.suggestionlist and ext.cx.translationlist. Since both list types are used in ext.cx.dashboard module with same applyFilters() interface, and have some other common init/show/hide logic (or parts of the logic are same), it makes sense to introduce abstract parent to both of these list classes. Inside of abstract parent, common methods between two lists can be defined, like logic to show dialog when user session expires - T200646: Communicate session has expired on dashboard when switching between lists.

Additionally, we can load all list classes needed for ext.cx.dashboard from a single Resource Loader module to reduce the burden on the Resource Loader (see T193612#4199278). Or maybe we can defer the loading of ext.cx.suggestionlist, since that list is configurable with $wgContentTranslationEnableSuggestions, which defaults to true since 1.30.0-wmf.19.

Finally, ext.cx... is the naming convention of yesterday, we can take the opportunity and rename to the mw.cx... pattern used nowadays.

Event Timeline

Change 449727 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Introduce common class for translation and suggestion lists

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

Petar.petkovic moved this task from QA to In Review on the Language-2018-July-September board.
Petar.petkovic moved this task from Needs Triage to Enhancements on the ContentTranslation board.

Change 449727 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Introduce common class for translation and suggestion lists

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

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptSep 5 2018, 7:53 AM
Petar.petkovic moved this task from In Review to QA on the Language-2018-July-September board.
Petar.petkovic removed a subscriber: gerritbot.
Etonkovidova closed this task as Resolved.Sep 22 2018, 12:13 AM