From 0e5ef398b2573cb80334e68e121c73d653895b31 Mon Sep 17 00:00:00 2001 From: bwang Date: Fri, 17 Feb 2023 16:53:02 -0600 Subject: [PATCH] Rename IconLink to Link Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well. Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8 --- ...ectorComponentIconLink.php => VectorComponentLink.php} | 4 ++-- includes/Components/VectorComponentMenuListItem.php | 6 +++--- includes/templates/{IconLink.mustache => Link.mustache} | 0 includes/templates/MenuListItem.mustache | 2 +- tests/jest/userLinksData.js | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) rename includes/Components/{VectorComponentIconLink.php => VectorComponentLink.php} (94%) rename includes/templates/{IconLink.mustache => Link.mustache} (100%) diff --git a/includes/Components/VectorComponentIconLink.php b/includes/Components/VectorComponentLink.php similarity index 94% rename from includes/Components/VectorComponentIconLink.php rename to includes/Components/VectorComponentLink.php index a7a43579e..933508da2 100644 --- a/includes/Components/VectorComponentIconLink.php +++ b/includes/Components/VectorComponentLink.php @@ -6,9 +6,9 @@ use Linker; use MessageLocalizer; /** - * VectorComponentIconLink component + * VectorComponentLink component */ -class VectorComponentIconLink implements VectorComponent { +class VectorComponentLink implements VectorComponent { /** @var MessageLocalizer */ private $localizer; /** @var string */ diff --git a/includes/Components/VectorComponentMenuListItem.php b/includes/Components/VectorComponentMenuListItem.php index b00bca4a9..72fc66abf 100644 --- a/includes/Components/VectorComponentMenuListItem.php +++ b/includes/Components/VectorComponentMenuListItem.php @@ -5,7 +5,7 @@ namespace MediaWiki\Skins\Vector\Components; * VectorComponentMenuListItem component */ class VectorComponentMenuListItem implements VectorComponent { - /** @var VectorComponentIconLink */ + /** @var VectorComponentLink */ private $link; /** @var string */ private $class; @@ -13,11 +13,11 @@ class VectorComponentMenuListItem implements VectorComponent { private $id; /** - * @param VectorComponentIconLink $link + * @param VectorComponentLink $link * @param string $class * @param string $id */ - public function __construct( VectorComponentIconLink $link, string $class = '', string $id = '' ) { + public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) { $this->link = $link; $this->class = $class; $this->id = $id; diff --git a/includes/templates/IconLink.mustache b/includes/templates/Link.mustache similarity index 100% rename from includes/templates/IconLink.mustache rename to includes/templates/Link.mustache diff --git a/includes/templates/MenuListItem.mustache b/includes/templates/MenuListItem.mustache index 155ecf3d0..07bb66d29 100644 --- a/includes/templates/MenuListItem.mustache +++ b/includes/templates/MenuListItem.mustache @@ -1 +1 @@ -
  • {{>IconLink}}
  • \ No newline at end of file +
  • {{>Link}}
  • diff --git a/tests/jest/userLinksData.js b/tests/jest/userLinksData.js index 8ce081009..fceb2f3e4 100644 --- a/tests/jest/userLinksData.js +++ b/tests/jest/userLinksData.js @@ -12,8 +12,8 @@ const pinnableElementOpenTemplate = fs.readFileSync( 'includes/templates/Pinnabl const pinnableElementCloseTemplate = fs.readFileSync( 'includes/templates/PinnableElement/Close.mustache', 'utf8' ); const pinnableHeaderTemplate = fs.readFileSync( 'includes/templates/PinnableHeader.mustache', 'utf8' ); const menuTemplate = fs.readFileSync( 'includes/templates/Menu.mustache', 'utf8' ); -const IconLink = fs.readFileSync( 'includes/templates/IconLink.mustache', 'utf8' ); -const MenuListItem = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' ); +const linkTemplate = fs.readFileSync( 'includes/templates/Link.mustache', 'utf8' ); +const menuListItemTemplate = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' ); const templateData = { 'is-wide': false, @@ -69,8 +69,8 @@ const dropdownPartials = { PinnableHeader: pinnableHeaderTemplate, Menu: menuTemplate, MenuContents: menuContents, - IconLink, - MenuListItem + Link: linkTemplate, + MenuListItem: menuListItemTemplate }; const renderedHTML = mustache.render( userLinksTemplate, templateData, dropdownPartials );