Skip to content

Commit 2e92de0

Browse files
Apply suggestions from code review
Co-authored-by: Trey Chadick <tchad@labkey.com>
1 parent 2c1b113 commit 2e92de0

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

src/org/labkey/test/components/domain/DomainFormPanel.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,8 @@ else if (validator instanceof FieldDefinition.TextChoiceValidator textChoiceVali
236236
throw new IllegalArgumentException("TextChoice fields cannot have additional validators.");
237237
}
238238
fieldRow.setTextChoiceValues(textChoiceValidator.getValues());
239-
fieldRow.setAllowMultipleSelections(false);
239+
fieldRow.setAllowMultipleSelections(fieldDefinition.getType() == FieldDefinition.ColumnType.MultiValueTextChoice);
240240
}
241-
else if (validator instanceof FieldDefinition.MultiValueTextChoiceValidator multiValueTextChoiceValidator)
242-
{
243-
// MultiValueTextChoice is a field type; implemented using a special validator. TextChoice field cannot have other validators.
244-
if (validators.size() > 1)
245-
{
246-
throw new IllegalArgumentException("TextChoice fields cannot have additional validators.");
247-
}
248-
fieldRow.setTextChoiceValues(multiValueTextChoiceValidator.getValues());
249-
fieldRow.setAllowMultipleSelections(true);
250241
}
251242
else
252243
{

src/org/labkey/test/components/ui/search/FilterFacetedPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public boolean isFiltersPresented()
6464
* Select a filer by clicking its label. Right now this method relevant only for multi-value text choice.
6565
* @param operator desired filter value
6666
*/
67-
public void selectFilter(Filter.Operator operator)
67+
public void selectArrayFilterOperator(Filter.Operator operator)
6868
{
6969
elementCache().filterTypeSelects.select(operator.getDisplayValue());
7070
}
@@ -144,7 +144,7 @@ protected class ElementCache extends Component<?>.ElementCache
144144
{
145145
protected final Input filterInput =
146146
Input(Locator.id("filter-faceted__typeahead-input"), getDriver()).findWhenNeeded(this);
147-
protected final ReactSelect filterTypeSelects =
147+
protected final ReactSelect arrayFilterOperatorSelect =
148148
new ReactSelect.ReactSelectFinder(getDriver()).index(0).findWhenNeeded(this);
149149
protected final WebElement checkboxSection =
150150
Locator.byClass("labkey-wizard-pills").index(0).refindWhenNeeded(this);

src/org/labkey/test/pages/query/UpdateQueryRowPage.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,9 @@ public UpdateQueryRowPage setField(String fieldName, String value)
116116

117117
public UpdateQueryRowPage setField(String fieldName, List<String> values)
118118
{
119-
WebElement field = elementCache().findField(fieldName, true);
120-
List<WebElement> options = field.findElements(By.tagName("option"));
121-
//unselect all options that selected but shouldn't be selected
122-
options.forEach(option ->
123-
{
124-
if (!values.contains(option.getText()) && option.getAttribute("selected") != null) option.click();
125-
});
126-
values.forEach(value -> selectOptionByText(field, value));
119+
WebElement field = new Select(elementCache().findField(fieldName, true));
120+
field.deselectAll();
121+
values.forEach(value -> field.selectByVisibleText(value));
127122
return this;
128123
}
129124

0 commit comments

Comments
 (0)