Exclude deprecated params from search list

Only show param info if the exact field name/alias is entered

Bug: T207897
Change-Id: Ic5be8b8cd7698b88ab89d771769f2e9ba407dfa9
This commit is contained in:
Ed Sanders 2018-12-11 14:56:16 +00:00
parent 27fdbe0581
commit ae1095d313

View file

@ -116,7 +116,8 @@ ve.ui.MWParameterSearchWidget.prototype.buildIndex = function () {
name: name,
label: label,
aliases: aliases,
description: description
description: description,
deprecated: spec.isParameterDeprecated( name )
} );
}
@ -146,6 +147,10 @@ ve.ui.MWParameterSearchWidget.prototype.addResults = function () {
nameMatch = item.names.indexOf( query ) >= 0;
}
if ( !hasQuery || textMatch || nameMatch ) {
// Only show exact matches for deprecated params
if ( item.deprecated && query !== item.name && item.aliases.indexOf( query ) === -1 ) {
continue;
}
items.push( new ve.ui.MWParameterResultWidget( { data: item } ) );
if ( hasQuery && nameMatch ) {
exactMatch = true;