diff --git a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java index 63b20c3d..a8bb4cfb 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java +++ b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java @@ -6878,6 +6878,11 @@ private ExperimentAnnotations getCopiedExperimentFor(ExperimentAnnotations expAn return null; } + if (_journalSubmission.hasPendingSubmission()) + { + errors.reject(ERROR_MSG, String.format("There is a pending re-submit request for this experiment on '%s'", _journal.getName())); + return null; + } if (expAnnot.isJournalCopy()) { if (!_journalSubmission.isLatestExperimentCopy(_expAnnot.getId())) @@ -7009,12 +7014,10 @@ public void validateCommand(PublicationDetailsForm form, Errors errors) return; } } - if (!form.hasNewPublicationDetails(_copiedExperiment)) - { - errors.reject(ERROR_MSG, String.format("Publication details are the same as the ones associated with the data on %s at %s", - _journal.getName(), _copiedExperiment.getShortUrl().renderShortURL())); - return; - } + // Validation removed: no need to ensure that publication details entered in the form differ from the + // publication details already associated with the experiment. The user may have entered the + // correct PubMedID etc. when submitting but forgot to make the data public. + // (See commit history for the original logic.) } else if (_copiedExperiment.isPublic()) { @@ -7358,13 +7361,6 @@ public boolean hasLinkAndCitation() { return !(StringUtils.isBlank(_link) || StringUtils.isBlank(_citation)); } - - public boolean hasNewPublicationDetails(ExperimentAnnotations copiedExperiment) - { - return !(Objects.equals(_pubmedId, copiedExperiment.getPubmedId()) - && Objects.equals(_link, copiedExperiment.getPublicationLink()) - && Objects.equals(_citation, copiedExperiment.getCitation())); - } } public static abstract class PanoramaPublicExperimentAction extends FormViewAction @@ -9851,7 +9847,7 @@ private MessageExampleBean createExampleMessage(List experimentIds, Pan { continue; } - Announcement announcement = announcementSvc.getAnnouncement(announcementsContainer, getUser(), submission.getAnnouncementId()); + Announcement announcement = submission.getAnnouncement(announcementSvc, announcementsContainer, getUser()); if (announcement == null) { continue; // old data before we started posting submission requests to a message board diff --git a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicNotification.java b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicNotification.java index 5b077402..b8633b12 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicNotification.java +++ b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicNotification.java @@ -396,14 +396,15 @@ public static String getDataStatusReminderMessage(@NotNull ExperimentAnnotations message.append("Dear ").append(getUserName(submitter)).append(",").append(NL2) .append("We are reaching out regarding your data on Panorama Public (").append(shortUrl).append("), which has been private since ") .append(dateString).append(".") - .append("\n\n**Is the paper associated with this work already published?**") - .append("\n- If yes: Please make your data public by clicking the \"Make Public\" button in your folder or by clicking this link: ") + .append(NL2).append(bold("Title:")).append(" ").append(escape(exptAnnotations.getTitle())) + .append(NL2).append(bold("Is the paper associated with this work already published?")) + .append(NL).append("- If yes: Please make your data public by clicking the \"Make Public\" button in your folder or by clicking this link: ") .append(bold(link("Make Data Public", makePublicLink))) .append(". This helps ensure that your valuable research is easily accessible to the community.") - .append("\n- If not: You have a couple of options:") - .append("\n - **Request an Extension** - If your paper is still under review, or you need additional time, please let us know by clicking ") + .append(NL).append("- If not: You have a couple of options:") + .append(NL).append(" - ").append(bold("Request an Extension")).append(" - If your paper is still under review, or you need additional time, please let us know by clicking ") .append(bold(link("Request Extension", requestExtensionUrl.getURIString()))).append(".") - .append("\n - **Delete from Panorama Public** - If you no longer wish to host your data on Panorama Public, please click ") + .append(NL).append(" - ").append(bold("Delete from Panorama Public")).append(" - If you no longer wish to host your data on Panorama Public, please click ") .append(bold(link("Request Deletion", requesDeletionUrl.getURIString()))).append(". ") .append("We will remove your data from Panorama Public."); if (sourceExperiment != null) @@ -413,9 +414,9 @@ public static String getDataStatusReminderMessage(@NotNull ExperimentAnnotations .append(") will remain intact, allowing you to resubmit your data in the future if you wish."); } - message.append("\n\nIf you have any questions or need further assistance, please do not hesitate to respond to this message by ") + message.append(NL2).append("If you have any questions or need further assistance, please do not hesitate to respond to this message by ") .append(bold(link("clicking here", respondToMessageUrl.getURIString()))).append(".") - .append("\n\nThank you for sharing your research on Panorama Public. We appreciate your commitment to open science and your contributions to the research community.") + .append(NL2).append("Thank you for sharing your research on Panorama Public. We appreciate your commitment to open science and your contributions to the research community.") .append(NL2).append("Best regards,") .append(NL).append(getUserName(journalAdmin)); return message.toString(); diff --git a/panoramapublic/src/org/labkey/panoramapublic/model/ExperimentAnnotations.java b/panoramapublic/src/org/labkey/panoramapublic/model/ExperimentAnnotations.java index 68ba3aee..f3a5646b 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/model/ExperimentAnnotations.java +++ b/panoramapublic/src/org/labkey/panoramapublic/model/ExperimentAnnotations.java @@ -224,6 +224,11 @@ public List getInstruments() return instruments; } + public String getInstrumentsCommaSeparated() + { + return StringUtils.join(getInstruments(), ", "); + } + public void setInstrument(String instrument) { _instrument = instrument; @@ -504,12 +509,12 @@ public DataLicense getDataLicense() /** * Returns true if the experiment is in an 'Experimental Data' folder that is public and the experiment is - * associated with a published paper. + * associated with a peer-reviewed paper (excludes biorxiv and medrxiv preprint servers). */ public boolean isFinal() { TargetedMSService.FolderType folderType = TargetedMSService.get().getFolderType(getContainer()); - return Experiment.equals(folderType) && isPublic() && isPublished(); + return Experiment.equals(folderType) && isPublic() && isPeerReviewed(); } public boolean hasCompletePublicationInfo() diff --git a/panoramapublic/src/org/labkey/panoramapublic/model/JournalSubmission.java b/panoramapublic/src/org/labkey/panoramapublic/model/JournalSubmission.java index 5760be33..8151aea3 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/model/JournalSubmission.java +++ b/panoramapublic/src/org/labkey/panoramapublic/model/JournalSubmission.java @@ -2,6 +2,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.labkey.api.announcements.api.Announcement; +import org.labkey.api.announcements.api.AnnouncementService; +import org.labkey.api.data.Container; +import org.labkey.api.security.User; import org.labkey.api.view.ShortURLRecord; import org.labkey.panoramapublic.query.SubmissionManager; @@ -69,11 +73,20 @@ public int getModifiedBy() return _journalExperiment.getModifiedBy(); } - public Integer getAnnouncementId() + public @Nullable Integer getAnnouncementId() { return _journalExperiment.getAnnouncementId(); } + public @Nullable Announcement getAnnouncement(@NotNull AnnouncementService announcementSvc, + @NotNull Container announcementsContainer, + @NotNull User user) + { + return (getAnnouncementId() != null) + ? announcementSvc.getAnnouncement(announcementsContainer, user, getAnnouncementId()) + : null; // old data before we started posting submission requests to a message board + } + public Integer getReviewerId() { return _journalExperiment.getReviewer(); diff --git a/panoramapublic/src/org/labkey/panoramapublic/pipeline/PostPanoramaPublicMessageJob.java b/panoramapublic/src/org/labkey/panoramapublic/pipeline/PostPanoramaPublicMessageJob.java index 39ce8c35..c0b6b287 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/pipeline/PostPanoramaPublicMessageJob.java +++ b/panoramapublic/src/org/labkey/panoramapublic/pipeline/PostPanoramaPublicMessageJob.java @@ -102,7 +102,8 @@ private void postMessage() continue; } - Announcement announcement = announcementSvc.getAnnouncement(announcementsContainer, getUser(), submission.getAnnouncementId()); + Announcement announcement = submission.getAnnouncement(announcementSvc, announcementsContainer, getUser()); + if (announcement == null) { getLogger().error("Could not find the message thread for experiment Id: " + experimentAnnotationsId diff --git a/panoramapublic/src/org/labkey/panoramapublic/pipeline/PrivateDataReminderJob.java b/panoramapublic/src/org/labkey/panoramapublic/pipeline/PrivateDataReminderJob.java index 9510d23e..e65a453a 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/pipeline/PrivateDataReminderJob.java +++ b/panoramapublic/src/org/labkey/panoramapublic/pipeline/PrivateDataReminderJob.java @@ -100,6 +100,13 @@ private static ReminderDecision getReminderDecision(@NotNull ExperimentAnnotatio return ReminderDecision.skip("Not the current version of the experiment"); } + // Make sure the data does not have a pending re-submission request + JournalSubmission journalSubmission = SubmissionManager.getSubmissionForJournalCopy(exptAnnotations); + if (journalSubmission != null && journalSubmission.hasPendingSubmission()) + { + return ReminderDecision.skip("Data has a pending re-submission request"); + } + DatasetStatus datasetStatus = DatasetStatusManager.getForExperiment(exptAnnotations); if (datasetStatus != null) { @@ -244,7 +251,7 @@ private void processExperiment(Integer experimentAnnotationsId, ProcessingContex } Container announcementsFolder = context.getAnnouncementsFolder(); - Announcement announcement = context.getAnnouncementService().getAnnouncement(announcementsFolder, getUser(), submission.getAnnouncementId()); + Announcement announcement = submission.getAnnouncement(context.getAnnouncementService(), context.getAnnouncementsFolder(), getUser()); if (announcement == null) { processingResults.addAnnouncementNotFound(experimentAnnotationsId, submission, announcementsFolder); diff --git a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxHtmlWriter.java b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxHtmlWriter.java index 4909c241..f1248390 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxHtmlWriter.java +++ b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxHtmlWriter.java @@ -301,7 +301,7 @@ void writePublicationList(ExperimentAnnotations experimentAnnotations) HtmlList publicationList = new HtmlList(); if(experimentAnnotations.isPublished()) { - publicationList.addItem("Link: ", experimentAnnotations.getPublicationLink(), false); + publicationList.addItem("Link", experimentAnnotations.getPublicationLink(), false); if(experimentAnnotations.hasPubmedId()) { diff --git a/panoramapublic/src/org/labkey/panoramapublic/view/expannotations/experimentDetails.jsp b/panoramapublic/src/org/labkey/panoramapublic/view/expannotations/experimentDetails.jsp index 7216d8e5..38426cad 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/view/expannotations/experimentDetails.jsp +++ b/panoramapublic/src/org/labkey/panoramapublic/view/expannotations/experimentDetails.jsp @@ -337,7 +337,7 @@
  • Organism: <%=h(annot.getOrganismsNoTaxId())%>
  • <%}%> <%if(annot.getInstrument() != null){%> -
  • Instrument: <%=h(annot.getInstrument())%>
  • +
  • Instrument: <%=h(annot.getInstrumentsCommaSeparated())%>
  • <%}%> <%if(annot.getSpikeIn() != null){%>
  • SpikeIn: diff --git a/panoramapublic/src/org/labkey/panoramapublic/view/publish/copyExperimentForm.jsp b/panoramapublic/src/org/labkey/panoramapublic/view/publish/copyExperimentForm.jsp index 9b957e5b..c8616713 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/view/publish/copyExperimentForm.jsp +++ b/panoramapublic/src/org/labkey/panoramapublic/view/publish/copyExperimentForm.jsp @@ -52,6 +52,7 @@ CopyExperimentForm form = bean.getForm(); ExperimentAnnotations expAnnot = form.lookupExperiment(); Journal journal = form.lookupJournal(); + Container folderTreeRoot = journal.getProject(); JournalSubmission js = bean.getJournalSubmission(); Submission currentSubmission = js.getLatestSubmission(); ExperimentAnnotations previousCopy = ExperimentAnnotationsManager.getLatestCopyForSubmission(js); @@ -93,15 +94,20 @@ var folderTreeStore = Ext4.create('Ext.data.TreeStore', { proxy: { type: 'ajax', - url: LABKEY.ActionURL.buildURL('core', 'getExtContainerAdminTree.api'), - extraParams: {move: false, requiredPermission: <%=q(RoleManager.getPermission(AdminPermission.class).getUniqueName())%>, showContainerTabs: false} + url: LABKEY.ActionURL.buildURL('core', 'getExtContainerTree.api'), + extraParams: { + annotateLeaf: true, + requiredPermission: <%=q(RoleManager.getPermission(AdminPermission.class).getUniqueName())%>, + } }, root: { - expanded: false + id : <%=folderTreeRoot.getRowId()%>, + expanded : true, + expandable : false, + text : <%=q(folderTreeRoot.getName())%> }, folderSort: false, - autoLoad: true, - defaultRootId: <%=ContainerManager.getRoot().getRowId()%> + autoLoad: true }); var form = Ext4.create('Ext.form.Panel', { @@ -158,9 +164,9 @@ xtype: 'treepanel', fieldLabel: 'Destination', store: folderTreeStore, - rootVisible: false, + rootVisible: true, enableDrag: false, - useArrows : false, + useArrows : true, autoScroll: true, title : '', border: true, @@ -168,15 +174,23 @@ height:150, listeners: { select: function(node, record, index, eOpts){ - //console.log("the record is..."); - //console.log(record.get('id')); - //console.log(record.get('text')); - - var displayField = Ext4.ComponentQuery.query('#destParentContainer_DisplayField')[0]; - displayField.setValue(record.get('text')); + const displayField = Ext4.ComponentQuery.query('#destParentContainer_DisplayField')[0]; + if (displayField) { + displayField.setValue(record.getPath('text', '/')); + } - var hiddenField = Ext4.ComponentQuery.query('#destParentContainer_Input')[0]; - hiddenField.setValue(record.get('id')); + const hiddenField = Ext4.ComponentQuery.query('#destParentContainer_Input')[0]; + if (hiddenField) { + hiddenField.setValue(record.get('id')); + } + }, + load : function(store, node) { + // Data on Panorama Public is organized by year. Select the subfolder for the current year. + const currentYear = new Date().getFullYear().toString(); + const target = store.getRootNode().findChild('text', currentYear, true); + if (target) { + this.getSelectionModel().select(target); + } } } }, diff --git a/panoramapublic/src/org/labkey/panoramapublic/view/publish/dataDownloadInfo.jsp b/panoramapublic/src/org/labkey/panoramapublic/view/publish/dataDownloadInfo.jsp index 878b9c42..7c141e69 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/view/publish/dataDownloadInfo.jsp +++ b/panoramapublic/src/org/labkey/panoramapublic/view/publish/dataDownloadInfo.jsp @@ -23,17 +23,20 @@ %>

    Select one or more files or folders in the browser above and click the download icon ( ). +
    +
    Data can also be downloaded by mapping this folder as a network drive in Windows Explorer, or by using a <%=simpleLink("WebDAV", "https://en.wikipedia.org/wiki/WebDAV")%> client such as <%=simpleLink("CyberDuck", "https://cyberduck.io")%> or <%=simpleLink("WinSCP", "https://winscp.net/eng/docs/introduction")%>. - For details look at <%=simpleLink("Download data from Panorama Public", downloadDataDocHref)%>. - Use the following URL, login email and password to connect to this folder: -
    + WebDAV downloads require an account on the PanoramaWeb server. Information on obtaining an account and other download options + is available on the <%=simpleLink("Download data from Panorama Public", downloadDataDocHref)%> help page. + Use the following URL to connect to this folder for WebDAV downloads:
    URL: <%=h(webdavUrl)%>
    - Login email: <%=h(publicDataUser.getEmail())%>
    - Password: <%=h(publicDataUser.getPassword())%> + Note: If you plan to download large volumes of data or datasets from multiple projects via WebDAV, + please contact the PanoramaWeb team in advance so that we can coordinate the download to minimize load on the server + and ensure reliable access.

    diff --git a/panoramapublic/test/src/org/labkey/test/components/panoramapublic/TargetedMsExperimentWebPart.java b/panoramapublic/test/src/org/labkey/test/components/panoramapublic/TargetedMsExperimentWebPart.java index 53d523b5..f610c43c 100644 --- a/panoramapublic/test/src/org/labkey/test/components/panoramapublic/TargetedMsExperimentWebPart.java +++ b/panoramapublic/test/src/org/labkey/test/components/panoramapublic/TargetedMsExperimentWebPart.java @@ -2,10 +2,16 @@ import org.labkey.test.BaseWebDriverTest; import org.labkey.test.Locator; +import org.labkey.test.WebTest; +import org.labkey.test.WebTestHelper; import org.labkey.test.components.BodyWebPart; import org.labkey.test.util.DataRegionTable; import org.openqa.selenium.WebElement; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Map; + import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -83,6 +89,24 @@ public void clickMakePublic() clickLink(elementCache().makePublicButton, "Expected to see a \"Make Public\" button"); } + public Integer getExperimentAnnotationsId() + { + WebElement moreDetailsLink = elementCache().moreDetailsLink; + if (moreDetailsLink != null) + { + String href = moreDetailsLink.getAttribute("href"); + try + { + return Integer.parseInt(WebTestHelper.parseUrlQuery(new URL(href)).get("id")); + } + catch (MalformedURLException e) + { + throw new RuntimeException(e); + } + } + return null; + } + public void clickAddPublication() { clickLink(elementCache().addPublicationButton, "Expected to see a \"Add Publication\" button"); diff --git a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMakePublicTest.java b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMakePublicTest.java index 8126f246..1b0d8ea7 100644 --- a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMakePublicTest.java +++ b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMakePublicTest.java @@ -18,11 +18,13 @@ import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.labkey.test.util.PermissionsHelper.READER_ROLE; @@ -46,24 +48,38 @@ public void testExperimentCopy() verifyIsPublicColumn(PANORAMA_PUBLIC, experimentTitle, false); verifyPermissions(projectName, folderName, PANORAMA_PUBLIC, targetFolder); - // Verify that the submitter can make the data public - verifyMakePublic(PANORAMA_PUBLIC, targetFolder, SUBMITTER, true); // Verify that a folder admin in the source folder, who is not the submitter or lab head will not see the // "Make Public" button in the Panorama Public copy. - verifyMakePublic(PANORAMA_PUBLIC, targetFolder, ADMIN_2, false); + verifyMakePublicButtonIsNotVisible(PANORAMA_PUBLIC, targetFolder, ADMIN_2, + "Make Public button should not be visible in the Panorama Public copy to a user who is neither submitter nor lab head"); + + // Verify that the submitter can make the data public + verifyMakePublic(PANORAMA_PUBLIC, targetFolder, SUBMITTER, true); // Resubmit the folder. This is still possible since the Panorama Public copy is not yet associated with a publication. resubmitFolder(projectName, folderName, SUBMITTER, true); + // Data copy is pending. Verify that the "Make Public" button in not visible in the source folder or the copied folder + verifyMakePublicButtonIsNotVisible(PANORAMA_PUBLIC, targetFolder, SUBMITTER, + "Make Public button should not be visible in the Panorama Public copy if data copy is pending"); + verifyMakePublicButtonIsNotVisible(projectName, folderName, SUBMITTER, + "Make Public button should not be visible in the source folder if data copy is pending"); + + // Verify that the submitter cannot enter the MakePublicAction URL in the browser to make the data public + verifyCannotMakePublicPendingResubmit(PANORAMA_PUBLIC, targetFolder, SUBMITTER); // In the target folder + verifyCannotMakePublicPendingResubmit(projectName, folderName, SUBMITTER); // In the source folder + // Re-copy the experiment to the Panorama Public project. Do not delete the previous copy makeCopy(shortAccessUrl, experimentTitle, targetFolder, true, false); // Verify that the "Make Public button is not visible in the older copy of the data. String v1Folder = targetFolder + " V.1"; - verifyMakePublic(PANORAMA_PUBLIC, v1Folder, SUBMITTER, true); - // Verify that the submitter can make data public, and add publication details + verifyMakePublicButtonIsNotVisible(PANORAMA_PUBLIC, v1Folder, SUBMITTER, + "Make Public button should not be visible in an older copy of the data"); + verifyCannotMakePublicOldCopy(PANORAMA_PUBLIC, v1Folder, SUBMITTER); + + // Verify that the submitter can make the latest copy of the data public, and add publication details verifyMakePublic(PANORAMA_PUBLIC, targetFolder, SUBMITTER, true, true); - verifyMakePublic(PANORAMA_PUBLIC, v1Folder, ADMIN_2, false); verifyIsPublicColumn(PANORAMA_PUBLIC, experimentTitle, true); @@ -282,6 +298,64 @@ private void verifyMakePublic(String projectName, String folderName, String user stopImpersonating(); } + private void verifyMakePublicButtonVisible(boolean expectVisible, String projectName, String folderName, String user, String errorMessage) + { + if (isImpersonating()) + { + stopImpersonating(true); + } + goToProjectFolder(projectName, folderName); + impersonate(user); + goToDashboard(); + TargetedMsExperimentWebPart expWebPart = new TargetedMsExperimentWebPart(this); + + if (expectVisible) + { + assertTrue(errorMessage, expWebPart.hasMakePublicButton()); + } + else + { + assertFalse(errorMessage, expWebPart.hasMakePublicButton()); + } + } + + private void verifyMakePublicButtonIsVisible(String projectName, String folderName, String user, String errorMessage) + { + verifyMakePublicButtonVisible(true, projectName, folderName, user, errorMessage); + } + + private void verifyMakePublicButtonIsNotVisible(String projectName, String folderName, String user, String errorMessage) + { + verifyMakePublicButtonVisible(false, projectName, folderName, user, errorMessage); + } + + private void verifyCannotMakePublicOldCopy(String projectName, String folderName, String user) + { + verifyCannotMakePublic(projectName, folderName, user, "not the most recent copy of the data"); + } + + private void verifyCannotMakePublicPendingResubmit(String projectName, String folderName, String user) + { + verifyCannotMakePublic(projectName, folderName, user, "There is a pending re-submit request for this experiment"); + } + + private void verifyCannotMakePublic(String projectName, String folderName, String user, String expectedMessage) + { + if (isImpersonating()) + { + stopImpersonating(true); + } + goToProjectFolder(projectName, folderName); + impersonate(user); + goToDashboard(); + TargetedMsExperimentWebPart expWebPart = new TargetedMsExperimentWebPart(this); + Integer expAnnotationsId = expWebPart.getExperimentAnnotationsId(); + assertNotNull(expAnnotationsId); + beginAt(WebTestHelper.buildURL("panoramapublic", getCurrentContainerPath(), "makePublic", Map.of("id", expAnnotationsId))); + waitForText(expectedMessage); + } + + private void makeDataPublic() { makeDataPublic(true); diff --git a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java index 04786226..5833d33d 100644 --- a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java +++ b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java @@ -7,6 +7,7 @@ import org.labkey.test.BaseWebDriverTest; import org.labkey.test.categories.External; import org.labkey.test.categories.MacCossLabModules; +import org.labkey.test.components.WebPartPanel; import org.labkey.test.util.ApiPermissionsHelper; import org.labkey.test.util.DataRegionTable; import org.openqa.selenium.By; @@ -191,7 +192,10 @@ private void verifyColumnValues(DataRegionTable table, int catalogEntryCol, int @NotNull private DataRegionTable myDataView() { - var table = new DataRegionTable("Targeted MS Experiment List", getDriver()); + // The "Panorama Public Search" webpart re-renders the "Targeted MS Experiment List" webpart with a different + // title which can cause a StaleElementReferenceException. Find the dataregion by the updated webpart title. + var table = new DataRegionTable.DataRegionFinder(getDriver()) + .find(WebPartPanel.WebPart(getDriver()).withTitle("Panorama Public Experiments").waitFor()); assertTrue(table.hasHeaderMenu("My Data")); table.clickHeaderButtonAndWait("My Data"); return new DataRegionTable.DataRegionFinder(getDriver()).refindWhenNeeded();