Feat: add "Import an infobox template" essential task

A new 4-step guided tool that helps wiki admins set up infobox templates on their wiki by importing prerequisites and templates from English Wikipedia and a curated template source wiki.

Tool flow (client/src/views/ImportInfoboxToolPage.vue):

  • Step 1 — Prerequisites: checks required MediaWiki extensions (ParserFunctions, Scribunto, TemplateStyles, optional WikibaseClient), required Lua modules (Module:Infobox), MediaWiki:Common.css infobox rules, and the Template:Infobox foundation page. Missing items can be imported with one click.
  • Step 2 — Article types: users pick the kinds of articles they want infoboxes for (people, places, orgs, events, nature). Already-imported types are shown as done.
  • Step 3 — Template names: users confirm or rename the target template page title for each selected type.
  • Step 4 — Create: per-type cards show description and field summary from templatedata, with a one-click import button. Persists which types have been imported via task metadata.

New Vue components (all under client/src/components/infobox/, with BEM scoped styles):

  • InfoboxStepPrerequisites, InfoboxStepArticleTypes, InfoboxStepTemplateNames, InfoboxStepCreate — the four steps.
  • InfoboxPrereqExtensions, InfoboxPrereqModules, InfoboxPrereqCommonCss, InfoboxPrereqFoundation — the four prerequisite cards.
  • InfoboxCreateItemCard — per-type import card for step 4.
  • StatusBadge — shared success/warning/error pill used across cards.

New client models (client/src/models/):

  • InfoboxArticleType — article-type definition with i18n labelKey, descriptionKey, source/effective template title getters.
  • InfoboxModule — Lua module status holder with isActionable getter and setPending / setInstalled / setError state transitions.
  • TemplateImportStatus — phase + message + error container used by InfoboxCreateItemCard.

Server side (server/routes/infobox.js + server/services/mediawiki.js):

  • New /api/infobox/* routes: modules-status, import-module, foundation-status, import-base-template, css-status, import-css, template-data, import-template. All require auth + admin (or test wiki).
  • MediaWikiAPI.importPage — interwiki import for production wikis, Special:Export + XML upload fallback for localhost targets.
  • MediaWikiAPI.importXmlFile — multipart XML import with OAuth 1.0a multipart signing (body params excluded from signature per spec).
  • MediaWikiAPI.importTemplateFromInterwiki — wraps the import API.
  • MediaWikiAPI.getTemplateData — fetches templatedata summary.
  • MediaWikiAPI.getInstalledExtensions — siteinfo extensions query.
  • New /api/wiki/extensions endpoint + store loadInstalledExtensions action for the prerequisites check.
  • server/config.js: infobox.templateWikiUrl and infobox.templatePrefix for the curated source wiki, configurable via env.

Task registry & routing:

  • New "import-infobox" entry in client/src/registry/essential-tasks.js using i18n keys.
  • New /import-infobox-tool route.

i18n:

  • 70+ new keys added to i18n/en.json with matching documentation in i18n/qqq.json — covering task card copy, every step heading and subtitle, prerequisite messages, article-type labels, and the per-card import flow. Uses PLURAL syntax where appropriate.

Misc:

  • server/services/wiki-data.js: guard against empty Wikimedia metrics response in fetchEditorStats to prevent a crash when a wiki has no editor-stats data yet.

Bug: T423631

Edited by Nik Gkountas

Merge request reports

Loading