Skip to content

Commit

Permalink
Merge branch 'master' into hotfix-sample-modal-cart
Browse files Browse the repository at this point in the history
  • Loading branch information
ericenns authored Nov 3, 2022
2 parents 73649e6 + 3115d7f commit aeede87
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
## [22.09.2]
* [UI]: Fixed bug causing associated project samples to be added to the cart with the wrong project identifier. See [PR 1395](https://github.com/phac-nml/irida/pull/1395)
* [UI]: Fixed bug preventing the removal of locked samples within a project. See [PR 1396](https://github.com/phac-nml/irida/pull/1396)
* [Developer/UI]: Fixed bug preventing managers from sharing project samples. See [PR 1398](https://github.com/phac-nml/irida/pull/1398)
* [UI]: Fixed bug where a sample added to the cart from the sample detail viewer still had a `Add to Cart` button if the viewer was closed and relaunched. See [PR 1397](https://github.com/phac-nml/irida/pull/1397)

## [22.09.1] - 2022/10/21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public Sample getSampleBySampleName(Project project, String sampleName) {
*/
@Override
@Transactional(readOnly = true)
@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SEQUENCER') or hasPermission(#project, 'canReadProject')")
@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SEQUENCER') or hasPermission(#projectIds, 'canReadProject')")
public Map<String, List<Long>> getSampleIdsBySampleNameForProjects(List<Long> projectIds,
List<String> sampleNames) {
return sampleRepository.getSampleIdsBySampleNameInProjects(projectIds, sampleNames)
Expand Down Expand Up @@ -673,8 +673,9 @@ public List<QCEntry> getQCEntriesForSample(Sample sample) {
public Map<Long, List<QCEntry>> getQCEntriesForSamples(List<Sample> samples) {
return qcEntryRepository.getQCEntriesForSamples(samples)
.stream()
.collect(Collectors.groupingBy(sampleQCEntryTuple -> (Long) sampleQCEntryTuple.get(0), Collectors
.mapping(sampleQCEntryTuple -> (QCEntry) sampleQCEntryTuple.get(1), Collectors.toList())));
.collect(Collectors.groupingBy(sampleQCEntryTuple -> (Long) sampleQCEntryTuple.get(0),
Collectors.mapping(sampleQCEntryTuple -> (QCEntry) sampleQCEntryTuple.get(1),
Collectors.toList())));
}

/**
Expand Down Expand Up @@ -835,9 +836,7 @@ public List<GenericStatModel> getSamplesCreatedGrouped(Date createdDate, Statist
public Map<Long, Long> getCoverageForSamplesInProject(Project project, List<Long> sampleIds) {
return psjRepository.calculateCoverageForSamplesInProject(project, sampleIds)
.stream()
.collect(HashMap::new,
(sampleCoverageMap, sampleCoverageTuple) -> sampleCoverageMap
.put((Long) sampleCoverageTuple.get(0), (Long) sampleCoverageTuple.get(1)),
Map::putAll);
.collect(HashMap::new, (sampleCoverageMap, sampleCoverageTuple) -> sampleCoverageMap.put(
(Long) sampleCoverageTuple.get(0), (Long) sampleCoverageTuple.get(1)), Map::putAll);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Integration test to ensure that the Project Details Page.
* </p>
*/
@DatabaseSetup("/ca/corefacility/bioinformatics/irida/ria/web/projects/ProjectSamplesView.xml")
@DatabaseSetup("/ca/corefacility/bioinformatics/irida/ria/web/projects/ProjectSamplesPage.xml")
public class ProjectSamplesPageIT extends AbstractIridaUIITChromeDriver {
String FIRST_SAMPLE_NAME = "sample55422r";
String SECOND_SAMPLE_NAME = "sample-5-fg-22";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;

@DatabaseSetup("/ca/corefacility/bioinformatics/irida/ria/web/projects/ProjectSamplesView.xml")
@DatabaseSetup("/ca/corefacility/bioinformatics/irida/ria/web/projects/ProjectShareSamples.xml")
public class ProjectShareSamplesIT extends AbstractIridaUIITChromeDriver {
private ShareSamplesPage shareSamplesPage = ShareSamplesPage.initPage(driver());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<user id="1" createdDate="2013-07-18 14:20:19.0" modifiedDate="2013-07-18 14:20:19.0" email="[email protected]" firstName="Mr." lastName="Manager" password="$2a$10$jFFix3ZyyoNy7HwavYjXauV0vByoPVbS1WnRpxPBCTKFXwEJeyXiK" phoneNumber="867-5309" username="mrtest" enabled="true" system_role="ROLE_ADMIN" credentialsNonExpired="true" />
<user id="2" createdDate="2013-07-18 14:20:19.0" modifiedDate="2013-07-18 14:20:19.0" email="[email protected]" firstName="test" lastName="User" password="$2a$10$jFFix3ZyyoNy7HwavYjXauV0vByoPVbS1WnRpxPBCTKFXwEJeyXiK" phoneNumber="867-5309" username="testUser" enabled="true" system_role="ROLE_USER" credentialsNonExpired="true" />
<user id="3" createdDate="2013-07-18 14:20:19.0" modifiedDate="2013-07-18 14:20:19.0" email="[email protected]" firstName="project1Manager" lastName="Manager" password="$2a$10$jFFix3ZyyoNy7HwavYjXauV0vByoPVbS1WnRpxPBCTKFXwEJeyXiK" phoneNumber="867-5309" username="project1Manager" enabled="true" system_role="ROLE_USER" credentialsNonExpired="true" />
<user id="4" createdDate="2013-07-18 14:20:19.0" modifiedDate="2013-07-18 14:20:19.0" email="[email protected]" firstName="Mr." lastName="Manager" password="$2a$10$jFFix3ZyyoNy7HwavYjXauV0vByoPVbS1WnRpxPBCTKFXwEJeyXiK" phoneNumber="867-5309" username="admin" enabled="true" system_role="ROLE_ADMIN" credentialsNonExpired="true" />

<client_details id="1" clientId="testClient" clientSecret="testClientSecret" token_validity="100000" createdDate="2013-07-18 14:20:19.0" />
<client_details_grant_types client_details_id="1" grant_value="authorization_code" />
<client_details_scope client_details_id="1" scope="read" />

<remote_api id="1" name="a client" serviceURI="http://localhost:8080/api" clientId="client" clientSecret="secret" createdDate="2013-07-18 14:20:19.0" />
<remote_status id="1" sync_status="SYNCHRONIZED" url="http://localhost:8080/api/projects/7" api_id="1" remote_hash_code="1" read_by="1" last_update="2013-07-18 14:20:19.0" />
<remote_status id="2" sync_status="SYNCHRONIZED" url="http://localhost:8080/api/samples/23" api_id="1" remote_hash_code="1" read_by="1" last_update="2013-07-18 14:20:19.0" />
<remote_status id="3" sync_status="SYNCHRONIZED" url="http://localhost:8080/api/samples/24" api_id="1" remote_hash_code="1" read_by="1" last_update="2013-07-18 14:20:19.0" />

<project id="7" createdDate="2013-07-18 14:20:19.0" name="test_remote" organism="test" remote_status="1" sync_frequency="DAILY" />
<project id="1" createdDate="2013-07-12 14:20:19.0" name="project" modifiedDate="2013-07-18 14:20:19.0" organism="E. coli" projectDescription="This is an interesting project description." remoteURL="http://google.ca" genome_size="1000000" minimum_coverage="20" maximum_coverage="100" />
<project id="2" createdDate="2013-07-18 14:20:19.0" name="project2" modifiedDate="2013-07-18 14:19:19.0" />
<project id="3" createdDate="2013-07-18 14:20:19.0" name="project3" modifiedDate="2013-07-18 14:18:19.0" />
<project id="4" createdDate="2013-07-18 14:21:19.0" name="project4" modifiedDate="2013-07-18 14:17:19.0" />
<project id="5" createdDate="2013-07-18 14:21:19.0" name="project5" modifiedDate="2013-07-18 14:17:19.0" />
<project id="6" createdDate="2013-07-18 14:21:19.0" name="project6" modifiedDate="2013-07-18 14:17:19.0" />
<project id="8" createdDate="2013-07-18 14:21:19.0" name="project8" modifiedDate="2013-07-18 14:17:19.0" />

<related_project id="1" subject_id="1" relatedProject_id="6" createdDate="2013-07-18 14:20:19.0" />

<project_user id="1" project_id="1" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="2" project_id="2" user_id="1" projectRole="PROJECT_USER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_1" />
<project_user id="3" project_id="3" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="4" project_id="4" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="6" project_id="1" user_id="2" projectRole="PROJECT_USER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_1" />
<project_user id="7" project_id="1" user_id="3" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="8" project_id="2" user_id="3" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="9" project_id="6" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="10" project_id="7" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="11" project_id="7" user_id="2" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="12" project_id="4" user_id="2" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />
<project_user id="13" project_id="8" user_id="1" projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0" metadataRole="LEVEL_4" />

<sample id="23" createdDate="2013-07-22 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description23" sampleName="sample23p7" remote_status="2" />
<sample id="24" createdDate="2013-07-22 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description24" sampleName="sample24p7" remote_status="3" />
<sample id="1" createdDate="2013-07-01 14:00:19.0" modifiedDate="2015-07-01 14:00:19.0" description="description1" sampleName="sample1" organism="E. coli" />
<sample id="2" createdDate="2013-07-02 14:01:19.0" modifiedDate="2015-07-02 14:00:19.0" description="description2" sampleName="sample2" organism="E. coli" />
<sample id="3" createdDate="2013-07-03 14:02:19.0" modifiedDate="2015-07-02 14:00:19.0" description="description3" sampleName="sample3" organism="E. coli" />
<sample id="4" createdDate="2013-07-04 14:03:19.0" modifiedDate="2015-07-03 14:00:19.0" description="description4" sampleName="sample4" organism="Listeria" />
<sample id="5" createdDate="2013-07-05 14:04:19.0" modifiedDate="2015-07-05 14:00:19.0" description="description5" sampleName="sample5" organism="Listeria" />
<sample id="6" createdDate="2013-07-06 14:05:19.0" modifiedDate="2015-07-06 14:00:19.0" description="description5" sampleName="sample523423" />
<sample id="7" createdDate="2013-07-07 14:06:19.0" modifiedDate="2015-07-07 14:00:19.0" description="description5" sampleName="sample534534" />
<sample id="8" createdDate="2013-07-08 14:07:19.0" modifiedDate="2015-07-08 14:00:19.0" description="description5" sampleName="sample589789" />
<sample id="9" createdDate="2013-07-09 14:08:19.0" modifiedDate="2015-07-09 14:00:19.0" description="description5" sampleName="sample52342" />
<sample id="10" createdDate="2013-07-10 14:09:19.0" modifiedDate="2015-07-10 14:00:19.0" description="description5" sampleName="sample565" />
<sample id="11" createdDate="2013-07-11 14:10:19.0" modifiedDate="2015-07-11 14:00:19.0" description="description5" sampleName="sample6735" />
<sample id="12" createdDate="2013-07-12 14:11:19.0" modifiedDate="2015-07-12 14:00:19.0" description="description5" sampleName="sample3452345" />
<sample id="13" createdDate="2013-07-13 14:12:19.0" modifiedDate="2015-07-13 14:00:19.0" description="description5" sampleName="sample3643225" />
<sample id="14" createdDate="2013-07-14 14:13:19.0" modifiedDate="2015-07-14 14:00:19.0" description="description5" sampleName="sample64565" />
<sample id="15" createdDate="2013-07-15 14:14:19.0" modifiedDate="2015-07-15 14:00:19.0" description="description5" sampleName="sample57567" />
<sample id="16" createdDate="2013-07-16 14:15:19.0" modifiedDate="2015-07-16 14:00:19.0" description="description5" sampleName="sample55422r" />
<sample id="17" createdDate="2013-07-17 14:16:19.0" modifiedDate="2015-07-17 14:00:19.0" description="description5" sampleName="sample5dt5" />
<sample id="18" createdDate="2013-07-18 14:17:19.0" modifiedDate="2015-07-18 14:00:19.0" description="description5" sampleName="sample5ddfg4" />
<sample id="19" createdDate="2013-07-19 14:18:19.0" modifiedDate="2015-07-19 14:00:19.0" description="description5" sampleName="sample554sg5" />
<sample id="20" createdDate="2013-07-20 14:19:19.0" modifiedDate="2015-07-20 14:00:19.0" description="description5" sampleName="sample5fdgr" />
<sample id="21" createdDate="2013-07-21 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description5" sampleName="sample5fg44" />
<sample id="22" createdDate="2013-07-22 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description22" sampleName="sample5fg22" />
<sample id="25" createdDate="2013-07-22 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description25" sampleName="sample_5_fg_22" />
<sample id="26" createdDate="2013-07-22 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description26" sampleName="sample-5-fg-22" />
<sample id="27" createdDate="2013-07-21 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description27" sampleName="sample5fg44" />
<sample id="28" createdDate="2013-07-21 14:20:19.0" modifiedDate="2015-07-22 14:00:19.0" description="description28" sampleName="sample5fg45" />

<project_sample id="1" project_id="1" sample_id="1" createdDate="2013-07-10 14:21:19.0" owner="true" />
<project_sample id="2" project_id="1" sample_id="2" createdDate="2013-07-12 14:22:19.0" owner="true" />
<project_sample id="3" project_id="1" sample_id="3" createdDate="2013-07-14 14:23:19.0" owner="true" />
<project_sample id="4" project_id="1" sample_id="4" createdDate="2013-07-16 14:24:19.0" owner="true" />
<project_sample id="5" project_id="1" sample_id="5" createdDate="2013-07-18 14:25:19.0" owner="true" />
<project_sample id="6" project_id="1" sample_id="6" createdDate="2013-07-18 14:26:19.0" owner="true" />
<project_sample id="7" project_id="1" sample_id="7" createdDate="2013-07-18 14:27:19.0" owner="true" />
<project_sample id="8" project_id="1" sample_id="8" createdDate="2013-07-18 14:28:19.0" owner="true" />
<project_sample id="9" project_id="1" sample_id="9" createdDate="2013-07-18 14:29:19.0" owner="true" />
<project_sample id="10" project_id="1" sample_id="10" createdDate="2013-07-18 14:31:19.0" owner="true" />
<project_sample id="11" project_id="1" sample_id="11" createdDate="2013-07-18 14:32:19.0" owner="true" />
<project_sample id="12" project_id="1" sample_id="12" createdDate="2013-07-18 14:33:19.0" owner="true" />
<project_sample id="13" project_id="1" sample_id="13" createdDate="2013-07-18 14:34:19.0" owner="true" />
<project_sample id="14" project_id="1" sample_id="14" createdDate="2013-07-18 14:35:19.0" owner="true" />
<project_sample id="15" project_id="1" sample_id="15" createdDate="2013-07-18 14:36:19.0" owner="true" />
<project_sample id="16" project_id="1" sample_id="16" createdDate="2013-07-18 14:37:19.0" owner="true" />
<project_sample id="17" project_id="1" sample_id="17" createdDate="2013-07-18 14:38:19.0" owner="true" />
<project_sample id="18" project_id="1" sample_id="18" createdDate="2013-07-18 14:39:19.0" owner="true" />
<project_sample id="19" project_id="1" sample_id="19" createdDate="2013-07-18 14:40:19.0" owner="true" />
<project_sample id="20" project_id="1" sample_id="20" createdDate="2013-07-18 14:41:19.0" owner="false" />
<project_sample id="21" project_id="1" sample_id="21" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="22" project_id="6" sample_id="27" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="23" project_id="3" sample_id="21" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="24" project_id="7" sample_id="23" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="25" project_id="7" sample_id="24" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="26" project_id="1" sample_id="25" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="27" project_id="1" sample_id="26" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="28" project_id="8" sample_id="27" createdDate="2013-07-18 14:42:19.0" owner="true" />
<project_sample id="29" project_id="6" sample_id="28" createdDate="2013-07-18 14:42:19.0" owner="true" />

<sequence_file id="1" created_date="2013-07-18 14:20:19.0" file_path="src/test/resources/files/test_file.fastq" />
<sequence_file id="2" created_date="2013-07-18 14:20:19.0" file_path="/sequenceFile2" />
<sequence_file id="3" created_date="2013-07-18 14:20:19.0" file_path="/sequenceFile3" />
<sequence_file id="4" created_date="2013-07-18 14:20:19.0" file_path="/sequenceFile4" />

<sequencing_object id="1" created_date="2013-07-18 14:20:19.0" />
<sequencing_object id="2" created_date="2013-07-18 14:20:19.0" />
<sequencing_object id="3" created_date="2013-07-18 14:20:19.0" />
<sequencing_object id="4" created_date="2013-07-18 14:20:19.0" />
<sequence_file_single_end id="1" file_id="1" />
<sequence_file_single_end id="2" file_id="2" />
<sequence_file_single_end id="3" file_id="3" />
<sequence_file_single_end id="4" file_id="4" />

<sample_sequencingobject id="1" created_date="2013-07-18 14:20:19.0" sample_id="1" sequencingobject_id="1" />
<sample_sequencingobject id="2" created_date="2013-07-18 14:20:19.0" sample_id="1" sequencingobject_id="2" />
<sample_sequencingobject id="3" created_date="2013-07-18 14:20:19.0" sample_id="1" sequencingobject_id="3" />
<sample_sequencingobject id="4" created_date="2013-07-18 14:20:19.0" sample_id="27" sequencingobject_id="4" />

<qc_entry id="1" created_date="2013-07-18 14:20:19.0" sequencingObject_id="1" DTYPE="CoverageQCEntry" total_bases="12500000" />
<qc_entry id="2" created_date="2013-07-18 14:20:19.0" sequencingObject_id="2" DTYPE="CoverageQCEntry" total_bases="7500000" />
<qc_entry id="3" created_date="2013-07-18 14:20:19.0" sequencingObject_id="3" DTYPE="CoverageQCEntry" total_bases="30000000" />
<qc_entry id="4" created_date="2013-07-18 14:20:19.0" sequencingObject_id="4" DTYPE="CoverageQCEntry" total_bases="50000000" />
</dataset>
Loading

0 comments on commit aeede87

Please sign in to comment.