Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d6209d5
Improve synchronization of editable grid column operations
labkey-tchad May 5, 2025
7dd0e84
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 6, 2025
c8b5c95
EditableGrid.getGridDataByLabel
labkey-tchad May 6, 2025
4d3237f
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 6, 2025
efcea9e
Fix tabs and unify CSV/TSV generation
labkey-tchad May 6, 2025
63cebed
Use FieldDefinition.getEffectiveLabel
labkey-tchad May 7, 2025
b3f3f89
DetailTableEdit updates to accept fielkeys and names
labkey-tchad May 7, 2025
4d82b3e
Need tabs for editable grid
labkey-tchad May 8, 2025
acfd444
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 8, 2025
ef06f8d
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 8, 2025
90723c9
Fix some quoting for pasting
labkey-tchad May 8, 2025
50f7710
Some updates to FieldSelectionDialog
labkey-tchad May 8, 2025
784308f
Fix paste text and field key
labkey-tchad May 9, 2025
1fc0889
More cleanup of TestDataUtils
labkey-tchad May 9, 2025
6539f48
ResponsiveGrid update
labkey-tchad May 10, 2025
0057e84
Update parameter names
labkey-tchad May 10, 2025
70160fc
More fixes
labkey-tchad May 12, 2025
b059de9
EditableGrid
labkey-tchad May 12, 2025
262e0df
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 12, 2025
22f83ec
Field selection fixes
labkey-tchad May 12, 2025
1d95d6a
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 13, 2025
91807fe
Caching and file format fixes
labkey-tchad May 13, 2025
cc27e83
Use correct helper for CSVs
labkey-tchad May 14, 2025
0aedd34
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 14, 2025
d2fdaf8
Minor fixes
labkey-tchad May 14, 2025
92c2b0b
EntityBulkInsertDialog
labkey-tchad May 14, 2025
05c33bd
BatchUpdateSamplesDialog
labkey-tchad May 15, 2025
224bc24
FieldKey fixes
labkey-tchad May 15, 2025
bc49ab7
EntityBulkUpdateDialog
labkey-tchad May 15, 2025
3454ae5
File and select fixes
labkey-tchad May 15, 2025
50a82e8
DetailTable and conversion helpers
labkey-tchad May 16, 2025
8601d3d
Fix and centralize file field identifiers
labkey-tchad May 16, 2025
9b96816
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 21, 2025
974a5ca
Add more javadoc and create FieldReferenceManager
labkey-tchad May 22, 2025
0c4f390
update EditableGrid to support fieldkeys
labkey-tchad May 22, 2025
d2a9444
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 22, 2025
964fc05
FieldKey improvements and creation of FieldInfo
labkey-tchad May 22, 2025
6df25df
Add more FieldInfo examples
labkey-tchad May 23, 2025
9211010
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 23, 2025
0e20bd4
Add JavaDoc
labkey-tchad May 23, 2025
ec5a887
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 23, 2025
a59e451
Fix build after merge
labkey-tchad May 23, 2025
4f415c7
Support FieldKey in DetailTableEdit
labkey-tchad May 24, 2025
c632e09
Fix some :Date field names
labkey-tchad May 24, 2025
fded7cb
Merge remote-tracking branch 'origin/develop' into fb_trickyCharsPhase3
labkey-tchad May 27, 2025
3f08747
Minor cache fixes
labkey-tchad May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/org/labkey/test/BaseWebDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.junit.runners.model.MultipleFailureException;
import org.junit.runners.model.Statement;
import org.junit.runners.model.TestTimedOutException;
import org.labkey.api.query.QueryKey;
import org.labkey.api.query.FieldKey;
import org.labkey.junit.rules.TestWatcher;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.CommandResponse;
Expand Down Expand Up @@ -218,7 +218,7 @@ public abstract class BaseWebDriverTest extends LabKeySiteWrapper implements Cle

public static final double DELTA = 10E-10;

public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = QueryKey.ILLEGAL;
public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = FieldKey.ILLEGAL;
public static final String ALL_ILLEGAL_QUERY_KEY_CHARACTERS = StringUtils.join(ILLEGAL_QUERY_KEY_CHARACTERS, "");
// See TSVWriter.shouldQuote. Generally we are not able to use the tab and new line characters when creating field names in the UI, but including here for completeness
public static final String[] TRICKY_IMPORT_FIELD_CHARACTERS = {"\\", "\"", "\\t", ",", "\\n", "\\r"};
Expand Down
15 changes: 11 additions & 4 deletions src/org/labkey/test/TestFileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -470,7 +472,12 @@ public static File writeTempFile(String name, String contents) throws IOExceptio
*/
public static File writeFile(File file, String contents) throws IOException
{
try (Writer writer = PrintWriters.getPrintWriter(file))
return writeFile(file, contents, false);
}

public static File writeFile(File file, String contents, boolean append) throws IOException
{
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file, append), StandardCharsets.UTF_8))
{
writer.write(contents);
return file;
Expand Down Expand Up @@ -578,10 +585,10 @@ private static List<File> unTar(final File inputFile, final File outputDir) thro
{
final List<File> untaredFiles = new ArrayList<>();
try (InputStream is = new FileInputStream(inputFile);
TarArchiveInputStream inputStream = (TarArchiveInputStream) new ArchiveStreamFactory().createArchiveInputStream("tar", is))
TarArchiveInputStream inputStream = new ArchiveStreamFactory().createArchiveInputStream("tar", is))
{
TarArchiveEntry entry;
while ((entry = (TarArchiveEntry) inputStream.getNextEntry()) != null)
while ((entry = inputStream.getNextEntry()) != null)
{
final File outputFile = new File(outputDir, entry.getName());
if (entry.isDirectory())
Expand All @@ -598,7 +605,7 @@ private static List<File> unTar(final File inputFile, final File outputDir) thro
{
try (OutputStream outputFileStream = new FileOutputStream(outputFile))
{
org.apache.commons.compress.utils.IOUtils.copy(inputStream, outputFileStream);
IOUtils.copy(inputStream, outputFileStream);
}
}
untaredFiles.add(outputFile);
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/test/WebDriverWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -3434,7 +3434,7 @@ public void setFormElement(Locator l, String text)
*/
public void setFormElement(WebElement el, String text)
{
String inputType = el.getAttribute("type");
String inputType = el.getDomAttribute("type");

if ("file".equals(inputType))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public boolean isLocked()
public List<String> getStatusNames()
{
return elementCache().statusItems
.findElements(this)
.waitForElements(this, 2_000)
.stream()
.map(WebElement::getText)
.collect(Collectors.toList());
Expand Down
39 changes: 32 additions & 7 deletions src/org/labkey/test/components/react/Tabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,34 @@ public WebDriver getDriver()
return _driver;
}

public WebElement findTab(String tabText)
{
return elementCache().findTab(tabText);
}

public WebElement findPanelForTab(String tabText)
{
return elementCache().findTabPanel(tabText);
return elementCache().findTabPanel(elementCache().findTab(tabText));
}

public WebElement selectTab(String tabText)
{
WebElement tab = elementCache().findTab(tabText);
getWrapper().scrollIntoView(tab);
tab.click();
WebElement panel = findPanelForTab(tabText);
WebElement panel = elementCache().findTabPanel(tab);
getWrapper().shortWait().until(ExpectedConditions.visibilityOf(panel));
return panel;
}

public WebElement findPanelForActiveTab()
{
return elementCache().findTabPanel(elementCache().findSelectedTab());
}

public boolean isTabSelected(String tabText)
{
return Boolean.valueOf(elementCache().findTab(tabText).getAttribute("aria-selected"));
return Boolean.valueOf(elementCache().findTab(tabText).getDomAttribute("aria-selected"));
}

public List<String> getTabText()
Expand All @@ -80,6 +90,16 @@ public List<String> getTabText()
.stream().map(WebElement::getText).toList();
}

public String getSelectedTabText()
{
return elementCache().findSelectedTab().getText();
}

public String getSelectedTabKey()
{
return elementCache().findSelectedTab().getDomAttribute("data-event-key");
}

@Override
protected ElementCache newElementCache()
{
Expand All @@ -102,6 +122,11 @@ public ElementCache()
}
}

protected WebElement findSelectedTab()
{
return tabLoc.withAttribute("aria-selected", "true").findElement(this);
}

List<WebElement> findAllTabs()
{
if (tabs.isEmpty())
Expand All @@ -125,25 +150,25 @@ WebElement findTab(String tabText)
catch (NoSuchElementException ex)
{
throw new NoSuchElementException(String.format("'%s' not among available tabs: %s",
tabText, getWrapper().getTexts(findAllTabs())), ex);
tabText, getWrapper().getTexts(findAllTabs())), ex);
}
tabMap.put(tabText, tabEl);
}
return tabMap.get(tabText);
}

// Tab panels can be updated and changed when flipping between tabs. Don't persist the panel element find it each time.
WebElement findTabPanel(String tabText)
WebElement findTabPanel(WebElement tabElement)
{
String panelId = findTab(tabText).getAttribute("aria-controls");
String panelId = tabElement.getDomAttribute("aria-controls");
WebElement panelEl;
try
{
panelEl = Locator.id(panelId).findElement(tabContent);
}
catch (NoSuchElementException ex)
{
throw new NoSuchElementException("Panel not found for tab : " + tabText, ex);
throw new NoSuchElementException("Panel not found for tab : " + tabElement.getText(), ex);
}

return panelEl;
Expand Down
Loading