Skip to content
Open
Changes from all commits
Commits
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
74 changes: 0 additions & 74 deletions src/org/labkey/test/components/ui/grids/GridBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,80 +295,6 @@ public AliquotViewOptions getCurrentAliquotView()
return null;
}

/**
* Set the aliquot view.
*
* @param view A {@link AliquotViewOptions} enum value.
*/
public void setAliquotView(AliquotViewOptions view)
{

// Do nothing if currently on the requested menu item.
if (getCurrentAliquotView().equals(view))
return;

// Need to identify where we are. The menu text is contextual to the page.
String url = Objects.requireNonNull(getDriver().getCurrentUrl()).toLowerCase();
boolean onSourcesPage = url.contains("#/sources/");
boolean onSamplePage = url.contains("#/samples/");

String currentButtonText = currentAliquotViewText();
final String menuChoice;

switch (view)
{
case ALL:
if(onSourcesPage)
{
if(url.endsWith("assays"))
{
menuChoice = "Derived Samples or Aliquots";
}
else if(url.endsWith("jobs"))
{
menuChoice = "Samples or Aliquots";
}
else
{
// This is the 'Samples' page for a source.
menuChoice = "Samples and Aliquots";
}
}
else if (onSamplePage)
{
menuChoice = "Sample or Aliquots";
}
else
{
menuChoice = "Samples and Aliquots";
}
break;
case SAMPLES:
if(onSourcesPage && url.endsWith("assays"))
{
menuChoice = "Derived Samples Only";
}
else if(onSamplePage)
{
menuChoice = "Sample Only";
}
else
{
menuChoice = "Samples Only";
}
break;
case ALIQUOTS:
menuChoice = "Aliquots Only";
break;
default:
menuChoice = "";
}

// Ideally should call _queryGrid.doAndWaitForUpdate(... but that causes the grid to go stale and is tricky to
// get a recover the reference to it.
doMenuAction(currentButtonText, Arrays.asList(menuChoice));
}

public GridBar searchFor(String searchStr)
{

Expand Down