Skip to content

Commit

Permalink
Merge 25.1 to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-teamcity committed Jan 30, 2025
2 parents 33730ce + 3bb32fc commit 14cbb06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.labkey.test.components.ui.entities;

import org.jetbrains.annotations.Nullable;
import org.labkey.test.BootstrapLocators;
import org.labkey.test.Locator;
import org.labkey.test.WebDriverWrapper;
Expand Down Expand Up @@ -221,20 +222,24 @@ public String getFieldWithId(String id)
* object to use the picker to set the field. If a text value is passed in it is used as a literal and jut typed
* into the textbox.
*
* @param fieldKey Field to update.
* @param fieldName Field to update.
* @param dateTime A LocalDateTime, LocalDate, LocalTime or String.
* @return A reference to this page.
*/
public EntityBulkInsertDialog setDateTimeField(String fieldKey, Object dateTime)
public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime)
{
ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldKey);
return setDateTimeField(fieldName, dateTime, null);
}
public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime, @Nullable String fieldKey)
{
ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldName, fieldKey);
dateTimePicker.select(dateTime);
return this;
}

public String getDateTimeField(String fieldKey)
public String getDateTimeField(String fieldName, @Nullable String fieldKey)
{
return elementCache().dateInput(fieldKey).get();
return elementCache().dateInput(fieldName, fieldKey).get();
}

public EntityBulkInsertDialog setBooleanField(String fieldKey, boolean checked)
Expand Down Expand Up @@ -381,10 +386,13 @@ public Input numericInput(String fieldKey)
return new Input(inputEl, getDriver());
}

public ReactDateTimePicker dateInput(String fieldKey)
public ReactDateTimePicker dateInput(String fieldName, @Nullable String fieldKey)
{
if (fieldKey == null)
fieldKey = fieldName;

return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver())
.withInputId(fieldKey).find(formRow(fieldKey));
.withInputId(fieldKey).find(formRow(fieldName));
}

public List<WebElement> fieldNames()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ private String expandAvailableFields(String... fields)

while(iterator.hasNext())
{
String field = iterator.next().trim();
String fieldEncoded = field.contains("$D") ? field : EscapeUtil.fieldKeyEncodePart(field);
fieldKey.append(fieldEncoded);
fieldKey.append(iterator.next().trim());

// If this isn't the last item in the collection keep expanding and building the expected data-fieldkey value.
if(iterator.hasNext())
Expand Down

0 comments on commit 14cbb06

Please sign in to comment.