Merge "Add logging to the add topic button when it's promoted to the header"

This commit is contained in:
jenkins-bot 2023-03-10 11:11:35 +00:00 committed by Gerrit Code Review
commit 927680906f
2 changed files with 10 additions and 3 deletions

View file

@ -15,23 +15,28 @@ class VectorComponentButton implements VectorComponent {
private $href;
/** @var string|null */
private $icon;
/** @var string|null */
private $event;
/**
* @param string $label
* @param string|null $id
* @param string|null $href
* @param string|null $icon
* @param string|null $event
*/
public function __construct(
string $label,
$id = null,
$href = null,
$icon = null
$icon = null,
$event = null
) {
$this->id = $id;
$this->href = $href;
$this->label = $label;
$this->icon = $icon;
$this->event = $event;
}
/**
@ -44,7 +49,8 @@ class VectorComponentButton implements VectorComponent {
'html-vector-button-icon' => Hooks::makeIcon( $this->icon ),
'label' => $this->label,
'is-quiet' => true,
'class' => 'mw-ui-primary mw-ui-progressive'
'class' => 'mw-ui-primary mw-ui-progressive',
'event' => $this->event,
];
}
}

View file

@ -394,7 +394,8 @@ class SkinVector22 extends SkinMustache {
$this->msg( [ 'vector-2022-action-addsection', 'skin-action-addsection' ] )->text(),
'ca-addsection',
$this->getTitle()->getLocalURL( 'action=edit&section=new' ),
'wikimedia-speechBubbleAdd-progressive'
'wikimedia-speechBubbleAdd-progressive',
'addsection-header'
) : null,
'data-vector-variants' => new VectorComponentMenuVariants(
// @phan-suppress-next-line PhanTypeInvalidDimOffset, PhanTypeMismatchArgument