Skip to content

Commit

Permalink
Merge pull request #1348 from phac-nml/fix-delete-project
Browse files Browse the repository at this point in the history
Fix delete project
  • Loading branch information
ericenns committed Aug 5, 2022
2 parents 859ab17 + 5cce6cc commit edc2d16
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@
* [UI]: Updated share samples review page to list the actual samples which will not be shared with the target project either due to the same sample identifiers or the same samples names already in the target project. See [PR 1343](https://github.com/phac-nml/irida/pull/1343)
* [REST]: Updated synchronizing of sample data to remove sequencing objects and assemblies that no longer exist on the remote sample. See [PR 1345](https://github.com/phac-nml/irida/pull/1345)
* [UI]: Fixed issue with filtering samples by files using a windows encoded text file causing sample name truncation. See [PR 1346](https://github.com/phac-nml/irida/pull/1346)
* [Developer]: Fixed deleting a project with project subscriptions. See [PR 1348](https://github.com/phac-nml/irida/pull/1348)

## [22.05.5] - 2022/06/28
* [UI]: Fixed bug preventing export of project samples table due to invalid url. [PR 1331](https://github.com/phac-nml/irida/pull/1331)
Expand Down
Expand Up @@ -139,7 +139,7 @@ public class Project extends IridaRepresentationModel
@OneToMany(cascade = CascadeType.REMOVE, mappedBy = "project")
private List<NcbiExportSubmission> ncbiSubmissions;

@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, mappedBy = "user")
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, mappedBy = "project")
private List<ProjectSubscription> projectSubscriptions;
//End of cascade deletion properties

Expand Down
Expand Up @@ -351,7 +351,6 @@ INSERT INTO project_subscription (`created_date`, `project_id`, `user_id`, `emai
INSERT INTO project_subscription (`created_date`, `project_id`, `user_id`, `email_subscription`) VALUES (now(), 50, 1, 0);
INSERT INTO project_subscription (`created_date`, `project_id`, `user_id`, `email_subscription`) VALUES (now(), 50, 2, 0);
INSERT INTO project_subscription (`created_date`, `project_id`, `user_id`, `email_subscription`) VALUES (now(), 50, 3, 0);
>>>>>>> development

-- genome assembly
INSERT INTO `genome_assembly` (id,created_date) VALUES (1, '2014-07-30 08:24:35');
Expand Down
Expand Up @@ -45,10 +45,14 @@ export default function DeleteProject() {
}
/>

<Checkbox onChange={(e) => setDisabled(!e.target.checked)}>
<Checkbox
className="t-confirm-delete-project"
onChange={(e) => setDisabled(!e.target.checked)}
>
{i18n("DeleteProject.confirm")}
</Checkbox>
<Button
className="t-delete-project-button"
type="primary"
danger
disabled={disabled}
Expand Down
Expand Up @@ -12,10 +12,10 @@
*/
public class ProjectDeletePage extends AbstractPage {

@FindBy(id = "confirm-deletion")
@FindBy(className = "t-confirm-delete-project")
private WebElement confirmCheckbox;

@FindBy(id = "submit-delete")
@FindBy(className = "t-delete-project-button")
private WebElement submitDelete;

public ProjectDeletePage(WebDriver driver) {
Expand All @@ -28,11 +28,11 @@ public static ProjectDeletePage goTo(WebDriver driver, Long projectId) {
return PageFactory.initElements(driver, ProjectDeletePage.class);
}

public boolean canClickDelete(){
public boolean canClickDelete() {
return submitDelete.isEnabled();
}

public void clickConfirm(){
public void clickConfirm() {
confirmCheckbox.click();
}

Expand Down
@@ -1,6 +1,5 @@
package ca.corefacility.bioinformatics.irida.ria.integration.projects;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import ca.corefacility.bioinformatics.irida.ria.integration.AbstractIridaUIITChromeDriver;
Expand All @@ -24,7 +23,6 @@ public class ProjectDeletePageIT extends AbstractIridaUIITChromeDriver {
private ProjectDeletePage page;

@Test
@Disabled
public void deleteProjectAsAdmin() {
LoginPage.loginAsAdmin(driver());

Expand All @@ -48,7 +46,6 @@ public void deleteProjectAsAdmin() {
}

@Test
@Disabled
public void deleteProjectAsOwner() {
LoginPage.loginAsManager(driver());

Expand Down
Expand Up @@ -62,6 +62,24 @@
projectRole="PROJECT_OWNER" createdDate="2013-07-18 14:20:19.0"
metadataRole="LEVEL_4"/>

<project_subscription id="1" project_id="1" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="2" project_id="2" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="true"/>
<project_subscription id="3" project_id="3" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="4" project_id="4" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="5" project_id="1" user_id="2"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="6" project_id="2" user_id="2"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="7" project_id="6" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="8" project_id="7" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>
<project_subscription id="9" project_id="8" user_id="1"
created_date="2013-07-18 14:20:19.0" email_subscription="false"/>

<related_project id="1" subject_id="1" relatedProject_id="2" createdDate="2013-07-18 14:20:19.0"/>
<related_project id="2" subject_id="1" relatedProject_id="3" createdDate="2013-07-18 14:20:19.0"/>
Expand Down

0 comments on commit edc2d16

Please sign in to comment.