Allow SelectWithInput to be marked as required and handle that dynamically
authorDavid Barratt <dbarratt@wikimedia.org>
Mon, 22 Jul 2019 22:53:14 +0000 (18:53 -0400)
committerDavid Barratt <dbarratt@wikimedia.org>
Tue, 30 Jul 2019 20:33:02 +0000 (16:33 -0400)
commit8a1f1ec631c0c5095832ae4a43d4f7b30df62018
treedd43fef64a1dc6fa8ee89dd208da3e79095438d8
parentbaa86ef14744d44df7aa333d01485b95d1f81436
Allow SelectWithInput to be marked as required and handle that dynamically

Alters the SelectWithInput to allow a required config to be passed from a
parent widget. Also handles the required state dynamically. If the widget is
an OR widget, then only the select dropdown is required. The text input will
be required when the other option is selected. If the widget is an AND widget
then both the select dropdown and the text input will be required.

Bug: T220533
Change-Id: I8479743126756f2b1bd7bcd53b100a0134f34d07
includes/htmlform/fields/HTMLSelectAndOtherField.php
includes/htmlform/fields/HTMLSelectOrOtherField.php
includes/widget/SelectWithInputWidget.php
resources/src/mediawiki.widgets/mw.widgets.SelectWithInputWidget.js