Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 8 additions & 9 deletions src/org/labkey/cds/CDSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.Container;
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.CoreSchema;
Expand Down Expand Up @@ -53,7 +54,6 @@
import org.labkey.api.settings.AppProps;
import org.labkey.api.util.ContainerUtil;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.view.NotFoundException;

import java.sql.SQLException;
import java.util.ArrayList;
Expand Down Expand Up @@ -353,13 +353,12 @@ public String getAllBlogsPath(Container container)
return PageFlowUtil.decode(mp.getEffectiveValue(container));
}

public TableInfo getSiteUserTableInfo(User user)
@Nullable
public Domain getSiteUserDomain(User user)
{
UserSchema coreSchema = QueryService.get().getUserSchema(user, getUserTableContainer(), "core");
TableInfo tableInfo = coreSchema.getTable("SiteUsers");
if (tableInfo == null)
throw new NotFoundException("SiteUsers table not available. You don't have permission to the project.");
return tableInfo;
TableInfo userTable = coreSchema.getTable("SiteUsers");
return userTable != null ? userTable.getDomain() : null;
}

private Container getUserTableContainer()
Expand All @@ -370,7 +369,7 @@ private Container getUserTableContainer()
public boolean isNeedSurvey(User user)
{
String needSurveyProp = "NeedSurvey";
Domain domain = getSiteUserTableInfo(user).getDomain();
Domain domain = getSiteUserDomain(user);
if (domain == null)
return false;

Expand All @@ -392,7 +391,7 @@ public boolean isNeedSurvey(User user)

public void setNeedSurvey(User user, boolean needSurvey) throws ValidEmail.InvalidEmailException, SQLException, BatchValidationException, InvalidKeyException, QueryUpdateServiceException, ValidationException
{
Domain domain = getSiteUserTableInfo(user).getDomain();
Domain domain = getSiteUserDomain(user);
if (domain == null)
return;

Expand All @@ -408,7 +407,7 @@ public void updateSurvey(User user, String firstName, String lastName, String in
//TODO simplify code once "Issue 34721: UsersTable permission handling improvement" is fixed
updateUserName(user, firstName, lastName);

Domain domain = getSiteUserTableInfo(user).getDomain();
Domain domain = getSiteUserDomain(user);
if (domain == null)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.Arrays;

@Category({})
@BaseWebDriverTest.ClassTimeout(minutes = 5)
@BaseWebDriverTest.ClassTimeout(minutes = 10)
public class CDSLearnAboutAssayTabsSearchTest extends CDSReadOnlyTest
{
private final CDSHelper cds = new CDSHelper(this);
Expand Down
8 changes: 4 additions & 4 deletions test/src/org/labkey/test/tests/cds/CDSPlotTimeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ public void verifyDiscreteTimeVariables()
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
xaxis.confirmSelection();

pattern = Pattern.compile("^01237.*3303003000");
pattern = Pattern.compile("^01237.*2202002000");
cds.assertPlotTickText(1, pattern);

log("Choose 'Study weeks with axis type Categorical'.");
Expand All @@ -834,7 +834,7 @@ public void verifyDiscreteTimeVariables()
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
xaxis.confirmSelection();

pattern = Pattern.compile("^01234.*3303003000");
pattern = Pattern.compile("^01234.*2202002000");
cds.assertPlotTickText(1, pattern);

log("Choose 'Study months with axis type Categorical'.");
Expand All @@ -843,7 +843,7 @@ public void verifyDiscreteTimeVariables()
xaxis.setPlotType(CDSHelper.PLOT_TYPE_BOX);
xaxis.confirmSelection();

pattern = Pattern.compile("^0123.*3303003000");
pattern = Pattern.compile("^0123.*2202002000");
cds.assertPlotTickText(1, pattern);

log("Apply the time axis as a filter.");
Expand Down Expand Up @@ -882,7 +882,7 @@ public void verifyDiscreteTimeVariables()

clickButton("Filter", 0);
log("Wait for one of the other studies to disappear before moving on.");
waitForTextToDisappear("ZAP 117", 5000);
waitForTextToDisappear("ZAP 117", 8000);

pattern = Pattern.compile("^0123.*330300.*");
cds.assertPlotTickText(1, pattern);
Expand Down
8 changes: 4 additions & 4 deletions test/src/org/labkey/test/tests/cds/CDSSecurityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ public void testFirstTimeUse()
log("Validate behavior with the deleted user.");
getDriver().navigate().to(welcomeUrls[2]);
handleCreateAccount(true);
waitForText("This email address is not associated with an account.");
waitForText("Verification failed. You may have already verified.");

log("Validate behavior with the user who does not have permissions to CDS.");
getDriver().navigate().to(welcomeUrls[1]);
Expand Down Expand Up @@ -1011,7 +1011,7 @@ private void verifyInfoPaneWithLimitedAccess(boolean hasAccessToQ1Q2R4)

private String[] getWelcomeLinks()
{
String usrEmail = "", msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration";
String msgSubject = " : Welcome to the Demo Installation LabKey Server Web Site new user registration";
String[] urls = new String[_newUserAccounts.length];

goToModule("Dumbster");
Expand All @@ -1021,8 +1021,8 @@ private String[] getWelcomeLinks()
for (int index = 0; index < _newUserAccounts.length; index++)
{
emailRecordTable.clickSubject(_newUserAccounts[index] + msgSubject);
usrEmail = _newUserAccounts[index].substring(0, _newUserAccounts[index].indexOf("@"));
urls[index] = getAttribute(Locator.css("a[href*='&email=" + usrEmail + "']"), "href");
String emailBody = emailRecordTable.getMessage(_newUserAccounts[index] + msgSubject).getBody();
urls[index] = emailBody.substring(emailBody.indexOf("http:"),emailBody.lastIndexOf("\n")); //Extracting the URL from email body.
}

return urls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public void verifyBinnedPlot()

log("Validate that there are bin squares in the plot.");
int squareCount = Locator.tagWithClass("a","vis-bin vis-bin-square").findElements(getDriver()).size();
assertTrue("Expected over 2000 bin squares found: " + squareCount, squareCount > 2000);
assertTrue("Expected over 1980 bin squares found: " + squareCount, squareCount > 1980);

cds.ensureNoFilter();
}
Expand Down
4 changes: 2 additions & 2 deletions test/src/org/labkey/test/tests/cds/CDSVisualizationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,9 @@ public void verifyLogAndLinearScales()

// Exact y-axis tick text is inconsistent
String smallLogYTicks;
if (isTextPresent("0.0009"))
if (isTextPresent("0.0008"))
{
smallLogYTicks = le + "0\n0.0009\n0.009\n0.09\n0.9";
smallLogYTicks = le + "0\n0.0008\n0.008\n0.08\n0.8";
}
else
{
Expand Down