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

Bug: T330191
Change-Id: If3ccbe82e85fdedcbb34b43f6d34c83caa08eae3
This commit is contained in:
David Lynch 2023-03-07 16:03:23 -06:00
parent 091705df88
commit d041a7334e
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