mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-09-25 03:09:28 +00:00
GUI data: Actually do something useful with the normalized type
Nothing uses normalizedType Bug: T131971 Change-Id: Ic3103a1d6022cc35602dc7f13b8762eac8af7f80
This commit is contained in:
parent
cd5006bb46
commit
ba36cf6cfe
|
@ -420,7 +420,8 @@ mw.TemplateData.Model.prototype.addParam = function ( key, paramData ) {
|
|||
|
||||
// Translate types
|
||||
if ( data.type !== undefined ) {
|
||||
this.params[ key ].normalizedType = this.constructor.static.translateObsoleteParamTypes( this.params[ key ].type );
|
||||
data.type = this.constructor.static.translateObsoleteParamTypes( data.type );
|
||||
this.params[ key ].type = data.type;
|
||||
}
|
||||
|
||||
// Get the deprecated value
|
||||
|
|
|
@ -121,6 +121,9 @@
|
|||
blah: resultDescBothLang.blah
|
||||
},
|
||||
type: undefined
|
||||
},
|
||||
newParam5: {
|
||||
type: 'wiki-page-name'
|
||||
}
|
||||
};
|
||||
finalJsonParams.date.description[ currLanguage ] = 'Timestamp of when the comment was posted, in YYYY-MM-DD format.';
|
||||
|
@ -426,6 +429,13 @@
|
|||
result: { name: 'newParam4', description: resultDescBothLang },
|
||||
description: 'Some string here in ' + currLanguage + ' language.',
|
||||
msg: 'Adding parameter with language prop: original with multiple languages.'
|
||||
},
|
||||
{
|
||||
key: 'newParam5',
|
||||
data: { type: 'string/wiki-page-name' },
|
||||
result: { name: 'newParam5', type: 'wiki-page-name' },
|
||||
description: '',
|
||||
msg: 'Adding parameter with obsolete type'
|
||||
}
|
||||
],
|
||||
paramChangeTest = [
|
||||
|
@ -568,7 +578,7 @@
|
|||
model.reorderParamOrderKey( 'user', 3 );
|
||||
assert.deepEqual(
|
||||
model.paramOrder,
|
||||
[ 'date', 'year', 'user', 'month', 'comment', 'newParam1', 'newParam2', 'newParam3', 'newParam4' ],
|
||||
[ 'date', 'year', 'user', 'month', 'comment', 'newParam1', 'newParam2', 'newParam3', 'newParam4', 'newParam5' ],
|
||||
'Final templatedata output with paramOrder'
|
||||
);
|
||||
|
||||
|
@ -576,7 +586,7 @@
|
|||
model.reorderParamOrderKey( 'month', 2 );
|
||||
assert.deepEqual(
|
||||
model.paramOrder,
|
||||
[ 'date', 'year', 'month', 'user', 'comment', 'newParam1', 'newParam2', 'newParam3', 'newParam4' ],
|
||||
[ 'date', 'year', 'month', 'user', 'comment', 'newParam1', 'newParam2', 'newParam3', 'newParam4', 'newParam5' ],
|
||||
'Final templatedata output with paramOrder'
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue