Merge "Create dialog elements from "type", not from element name"

This commit is contained in:
jenkins-bot 2022-12-29 00:57:03 +00:00 committed by Gerrit Code Review
commit b0cb613a58

View file

@ -1156,8 +1156,8 @@ Dialog.prototype.createParamDetails = function () {
config.autosize = true;
}
// Create the property inputs
switch ( property ) {
case 'type':
switch ( paramProperties[ property ].type ) {
case 'select':
propInput = new OO.ui.DropdownWidget( config );
var typeItemArray = [];
for ( var i in paramProperties[ property ].children ) {
@ -1172,18 +1172,15 @@ Dialog.prototype.createParamDetails = function () {
// * templatedata-doc-param-type-url, templatedata-doc-param-type-wiki-file-name,
// * templatedata-doc-param-type-wiki-page-name, templatedata-doc-param-type-wiki-template-name,
// * templatedata-doc-param-type-wiki-user-name
label: mw.msg( 'templatedata-doc-param-type-' + paramProperties[ property ].children[ i ] )
label: mw.msg( 'templatedata-doc-param-' + property + '-' + paramProperties[ property ].children[ i ] )
} ) );
}
propInput.getMenu().addItems( typeItemArray );
break;
case 'deprecated':
case 'required':
case 'suggested':
case 'boolean':
propInput = new OO.ui.CheckboxInputWidget( config );
break;
case 'aliases':
case 'suggestedvalues':
case 'array':
config.allowArbitrary = true;
// FIXME: Rename the …suggestedvalues… message key to be generic
config.placeholder = mw.msg( 'templatedata-modal-table-param-suggestedvalues-placeholder' );