|
17 | 17 | import org.labkey.test.components.react.ReactCheckBox; |
18 | 18 | import org.labkey.test.components.ui.grids.FieldReferenceManager.FieldReference; |
19 | 19 | import org.labkey.test.components.ui.search.FilterExpressionPanel; |
| 20 | +import org.labkey.test.components.ui.search.FilterFacetedPanel; |
20 | 21 | import org.labkey.test.params.FieldKey; |
21 | 22 | import org.labkey.test.util.selenium.WebElementUtils; |
22 | 23 | import org.openqa.selenium.Keys; |
|
46 | 47 | import static org.labkey.remoteapi.query.Filter.Operator.CONTAINS_NONE; |
47 | 48 | import static org.labkey.remoteapi.query.Filter.Operator.DOES_NOT_CONTAIN_EXACTLY; |
48 | 49 | import static org.labkey.remoteapi.query.Filter.Operator.IN; |
| 50 | +import static org.labkey.remoteapi.query.Filter.Operator.IS_EMPTY; |
| 51 | +import static org.labkey.remoteapi.query.Filter.Operator.IS_NOT_EMPTY; |
49 | 52 | import static org.labkey.test.WebDriverWrapper.waitFor; |
50 | 53 |
|
51 | 54 | public class ResponsiveGrid<T extends ResponsiveGrid<?>> extends WebDriverComponent<ResponsiveGrid<T>.ElementCache> implements UpdatingComponent |
@@ -241,17 +244,21 @@ public String filterColumnExpectingError(CharSequence columnIdentifier, Filter.O |
241 | 244 | private GridFilterModal initFilterColumn(CharSequence columnIdentifier, Filter.Operator operator, Object value) |
242 | 245 | { |
243 | 246 | List<Filter.Operator> listOperators = List.of(IN, CONTAINS_ALL, CONTAINS_ANY, CONTAINS_EXACTLY, CONTAINS_NONE, |
244 | | - DOES_NOT_CONTAIN_EXACTLY); |
| 247 | + DOES_NOT_CONTAIN_EXACTLY, IS_EMPTY, IS_NOT_EMPTY); |
245 | 248 | clickColumnMenuItem(columnIdentifier, "Filter...", false); |
246 | 249 | GridFilterModal filterModal = new GridFilterModal(getDriver(), this); |
247 | 250 | if (operator != null) |
248 | 251 | { |
249 | 252 | if (listOperators.contains(operator) && value instanceof List<?>) |
250 | 253 | { |
251 | 254 | List<String> values = (List<String>) value; |
252 | | - filterModal.selectFacetTab().selectValue(values.get(0)); |
253 | | - filterModal.selectFacetTab().checkValues(values.toArray(String[]::new)); |
254 | | - filterModal.selectFacetTab().selectFilter(operator.getDisplayValue()); |
| 255 | + FilterFacetedPanel filterPanel = filterModal.selectFacetTab(); |
| 256 | + filterPanel.selectValue(values.get(0)); |
| 257 | + filterPanel.checkValues(values.toArray(String[]::new)); |
| 258 | + if (filterPanel.isFiltersPresented()) |
| 259 | + { |
| 260 | + filterPanel.selectFilter(operator); |
| 261 | + } |
255 | 262 | } |
256 | 263 | else |
257 | 264 | filterModal.selectExpressionTab().setFilter(new FilterExpressionPanel.Expression(operator, value)); |
@@ -394,15 +401,16 @@ public T selectRow(int index, boolean checked) |
394 | 401 |
|
395 | 402 | /** |
396 | 403 | * Finds the first row with the specified texts in the specified columns, and sets its checkbox |
397 | | - * @param partialMap key-column (fieldKey, name, or label), value-text in that column |
398 | | - * @param checked the desired checkbox state |
| 404 | + * |
| 405 | + * @param partialMap key-column (fieldKey, name, or label), value-text in that column |
| 406 | + * @param checked the desired checkbox state |
399 | 407 | * @return this grid |
400 | 408 | */ |
401 | 409 | public T selectRow(Map<String, String> partialMap, boolean checked) |
402 | 410 | { |
403 | 411 | GridRow row = getRow(partialMap); |
404 | 412 | selectRowAndVerifyCheckedCounts(row, checked); |
405 | | - getWrapper().log("Row described by map ["+partialMap+"] selection state set to + ["+row.isSelected()+"]"); |
| 413 | + getWrapper().log("Row described by map [" + partialMap + "] selection state set to + [" + row.isSelected() + "]"); |
406 | 414 |
|
407 | 415 | return getThis(); |
408 | 416 | } |
|
0 commit comments