tdDialog: handle name/alias swaps

If you changed the name to one of its own aliases, then went into the
alias field to remove that alias, the "Done" button would remain
disabled for no obvious reason. As such, rerun the name change handler.

Also, the input error-highlight was too low specificity for current OOUI
CSS, and so we weren't showing which field had an issue.

Bug: T222543
Change-Id: I49ac0587c4b5e58ce1fc3c42e3dffeae8f986672
This commit is contained in:
David Lynch 2019-05-08 11:11:01 -05:00
parent 2058003ba0
commit f3566cece2
2 changed files with 9 additions and 1 deletions

View file

@ -21,7 +21,8 @@
padding: 0.5em 1em; padding: 0.5em 1em;
} }
.tdg-editscreen-input-error input { .tdg-editscreen-input-error input,
.tdg-editscreen-input-error.oo-ui-inputWidget input.oo-ui-inputWidget-input {
background-color: #ffa3a3; background-color: #ffa3a3;
} }

View file

@ -564,6 +564,13 @@ mw.TemplateData.Dialog.prototype.onParamPropertyInputChange = function ( propert
this.toggleNoticeMessage( 'edit', false ); this.toggleNoticeMessage( 'edit', false );
this.model.setParamProperty( this.selectedParamKey, property, value, this.language ); this.model.setParamProperty( this.selectedParamKey, property, value, this.language );
} }
// If we're changing the aliases and the name has an error, poke its change
// handler in case that error was because of a duplicate name with its own
// aliases.
if ( property === 'aliases' && this.propInputs.name.$element.hasClass( 'tdg-editscreen-input-error' ) ) {
this.onParamPropertyInputChange( 'name', this.propInputs.name.getValue() );
}
}; };
/** /**