Fix settings button not working on reference previews

Apparently caused by a mistake in I8697232, and the QA for T340256 not
covering the full functionality of what was changed in the patch.

Bug: T345829
Change-Id: I482d32183ef7f2226c7ad114be0fbaf97bc7b898
This commit is contained in:
thiemowmde 2023-09-07 17:48:16 +02:00 committed by Jdlrobson
parent b0d1ce6d75
commit ce78add7e4
5 changed files with 7 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View file

@ -304,7 +304,7 @@ export function bindBehavior( preview, behavior ) {
preview.el.addEventListener( 'click', behavior.click );
const button = preview.el.querySelector( '.mwe-popups-settings-button' );
const button = preview.el.querySelector( 'a.mwe-popups-settings-button' );
if ( button ) {
button.href = behavior.settingsUrl;
button.addEventListener( 'click', ( event ) => {
@ -312,6 +312,9 @@ export function bindBehavior( preview, behavior ) {
behavior.showSettings( event );
} );
} else {
const err = new Error( 'Page previews: No settings button found in preview.' );
mw.errorLogger.logError( err, 'error.web-team' );
}
}

View file

@ -106,7 +106,7 @@ export function renderReferencePreview(
// TODO: Remove when not in Beta any more
if ( !mw.config.get( 'wgPopupsReferencePreviewsBetaFeature' ) ) {
// TODO: Do not remove this but move it up into the templateHTML constant!
const settingsButton = document.createElement( 'button' );
const settingsButton = document.createElement( 'a' );
settingsButton.classList.add( 'cdx-button', 'cdx-button--fake-button', 'cdx-button--fake-button--enabled', 'cdx-button--weight-quiet', 'cdx-button--icon-only', 'mwe-popups-settings-button' );
const settingsIcon = document.createElement( 'span' );
settingsIcon.classList.add( 'popups-icon', 'popups-icon--size-small', 'mw-ui-icon-settings' );

View file

@ -118,8 +118,8 @@ module.exports = ( env, argv ) => ( {
// Minified uncompressed size limits for chunks / assets and entrypoints. Keep these numbers
// up-to-date and rounded to the nearest 10th of a kibibyte so that code sizing costs are
// well understood. Related to bundlesize minified, gzipped compressed file size tests.
maxAssetSize: 46.5 * 1024,
maxEntrypointSize: 46.5 * 1024,
maxAssetSize: 46.7 * 1024,
maxEntrypointSize: 46.7 * 1024,
// The default filter excludes map files but we rename ours.
assetFilter: ( filename ) => !filename.endsWith( srcMapExt )