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
|
// Translate types
|
||||||
if ( data.type !== undefined ) {
|
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
|
// Get the deprecated value
|
||||||
|
|
|
@ -121,6 +121,9 @@
|
||||||
blah: resultDescBothLang.blah
|
blah: resultDescBothLang.blah
|
||||||
},
|
},
|
||||||
type: undefined
|
type: undefined
|
||||||
|
},
|
||||||
|
newParam5: {
|
||||||
|
type: 'wiki-page-name'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
finalJsonParams.date.description[ currLanguage ] = 'Timestamp of when the comment was posted, in YYYY-MM-DD format.';
|
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 },
|
result: { name: 'newParam4', description: resultDescBothLang },
|
||||||
description: 'Some string here in ' + currLanguage + ' language.',
|
description: 'Some string here in ' + currLanguage + ' language.',
|
||||||
msg: 'Adding parameter with language prop: original with multiple languages.'
|
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 = [
|
paramChangeTest = [
|
||||||
|
@ -568,7 +578,7 @@
|
||||||
model.reorderParamOrderKey( 'user', 3 );
|
model.reorderParamOrderKey( 'user', 3 );
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
model.paramOrder,
|
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'
|
'Final templatedata output with paramOrder'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -576,7 +586,7 @@
|
||||||
model.reorderParamOrderKey( 'month', 2 );
|
model.reorderParamOrderKey( 'month', 2 );
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
model.paramOrder,
|
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'
|
'Final templatedata output with paramOrder'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue