From 4f9426d61a95462aabab300b85d3feadac7efbe5 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Mon, 16 Aug 2021 14:56:27 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20=E2=80=A6ParameterCheckboxLayout=20now?= =?UTF-8?q?=20that=20it's=20an=20actual=20Widget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a direct follow-up for Idc5e048. Bug: T285323 Change-Id: Ia03d594386a9a59a4819bf78c7d2edcd465dfd52 --- .jsduck/categories.json | 1 - .jsduck/mw-categories.json | 1 - extension.json | 4 ++-- ...TransclusionOutlineParameterWidget.test.js} | 8 ++++---- ...ui.MWTransclusionOutlineParameterWidget.js} | 18 +++++++++--------- ...e.ui.MWTransclusionOutlineTemplateWidget.js | 8 ++++---- 6 files changed, 19 insertions(+), 21 deletions(-) rename modules/ve-mw/tests/ui/widgets/{ve.ui.MWTemplateOutlineParameterCheckboxLayout.test.js => ve.ui.MWTransclusionOutlineParameterWidget.test.js} (68%) rename modules/ve-mw/ui/widgets/{ve.ui.MWTemplateOutlineParameterCheckboxLayout.js => ve.ui.MWTransclusionOutlineParameterWidget.js} (73%) diff --git a/.jsduck/categories.json b/.jsduck/categories.json index a9a135dccf..66bb04afe3 100644 --- a/.jsduck/categories.json +++ b/.jsduck/categories.json @@ -19,7 +19,6 @@ { "name": "User Interface", "classes": [ - "ve.ui.MW*Layout", "ve.ui.MW*Page", "ve.ui.MW*Window", "ve.ui.MWTransclusionsBooklet" diff --git a/.jsduck/mw-categories.json b/.jsduck/mw-categories.json index 1d4e0e00a1..05976fcd86 100644 --- a/.jsduck/mw-categories.json +++ b/.jsduck/mw-categories.json @@ -19,7 +19,6 @@ { "name": "User Interface", "classes": [ - "ve.ui.MW*Layout", "ve.ui.MW*Page", "ve.ui.MW*Window", "ve.ui.MWTransclusionsBooklet" diff --git a/extension.json b/extension.json index e4c7caabd0..c3963f6fdd 100644 --- a/extension.json +++ b/extension.json @@ -2156,7 +2156,7 @@ "modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js", "modules/ve-mw/ui/contextitems/ve.ui.MWTransclusionContextItem.js", "modules/ve-mw/ui/contextitems/ve.ui.MWDefinedTransclusionContextItem.js", - "modules/ve-mw/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.js", + "modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js", "modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineButtonWidget.js", "modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlinePartWidget.js", "modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js", @@ -2808,7 +2808,7 @@ "lib/ve/tests/ui/inspectors/ve.ui.FragmentInspector.test.js", "modules/ve-mw/tests/ui/inspectors/ve.ui.FragmentInspector.test.js", "modules/ve-mw/tests/ui/widgets/ve.ui.MWParameterSearchWidget.test.js", - "modules/ve-mw/tests/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.test.js", + "modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js", "modules/ve-mw/tests/ui/widgets/ve.ui.MWTemplateTitleInputWidget.test.js", "lib/ve/tests/ce/ve.ce.TestRunner.js", "lib/ve/tests/ce/ve.ce.imetests.test.js", diff --git a/modules/ve-mw/tests/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.test.js b/modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js similarity index 68% rename from modules/ve-mw/tests/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.test.js rename to modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js index cd784f45b0..3829d62e6a 100644 --- a/modules/ve-mw/tests/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.test.js +++ b/modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js @@ -1,8 +1,8 @@ ( function () { - QUnit.module( 've.ui.MWTemplateOutlineParameterCheckboxLayout', ve.test.utils.mwEnvironment ); + QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget', ve.test.utils.mwEnvironment ); QUnit.test( 'interprets param with no attributes', ( assert ) => { - const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( {} ); + const layout = new ve.ui.MWTransclusionOutlineParameterWidget( {} ); assert.strictEqual( layout.checkbox.isDisabled(), false ); assert.strictEqual( layout.checkbox.isSelected(), false ); @@ -10,7 +10,7 @@ } ); QUnit.test( 'interprets required param', ( assert ) => { - const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( { required: true } ); + const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } ); assert.strictEqual( layout.checkbox.isDisabled(), true ); assert.strictEqual( layout.checkbox.isSelected(), true ); @@ -18,7 +18,7 @@ } ); QUnit.test( 'interprets selected param', ( assert ) => { - const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( { selected: true } ); + const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } ); assert.strictEqual( layout.checkbox.isDisabled(), false ); assert.strictEqual( layout.checkbox.isSelected(), true ); diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.js b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js similarity index 73% rename from modules/ve-mw/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.js rename to modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js index bc841d7b05..55b0965a2c 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWTemplateOutlineParameterCheckboxLayout.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js @@ -1,5 +1,5 @@ /*! - * VisualEditor user interface MWTemplateOutlineParameterCheckboxLayout class. + * VisualEditor user interface MWTransclusionOutlineParameterWidget class. * * @license The MIT License (MIT); see LICENSE.txt */ @@ -17,7 +17,7 @@ * @cfg {boolean} [required] * @cfg {boolean} [selected] */ -ve.ui.MWTemplateOutlineParameterCheckboxLayout = function VeUiMWTemplateOutlineParameterCheckboxLayout( config ) { +ve.ui.MWTransclusionOutlineParameterWidget = function VeUiMWTransclusionOutlineParameterWidget( config ) { this.checkbox = new OO.ui.CheckboxInputWidget( { title: config.required ? ve.msg( 'visualeditor-dialog-transclusion-required-parameter' ) : null, disabled: config.required, @@ -28,7 +28,7 @@ ve.ui.MWTemplateOutlineParameterCheckboxLayout = function VeUiMWTemplateOutlineP this.checkbox.$input.on( 'keydown', this.onKeyDown.bind( this ) ); // Parent constructor - ve.ui.MWTemplateOutlineParameterCheckboxLayout.super.call( this, ve.extendObject( config, { + ve.ui.MWTransclusionOutlineParameterWidget.super.call( this, ve.extendObject( config, { $label: $( '