Commit b0215286 authored by Rajkumar-D's avatar Rajkumar-D
Browse files

FIxing ENA-3879 and ENA-4304

parent d62c5fc3
Pipeline #278392 passed with stages
in 5 minutes and 15 seconds
......@@ -47,7 +47,7 @@
<p>Please use the project accession {{projectAccession}} when <a
href="https://ena-docs.readthedocs.io/en/latest/submit/general-guide/accessions.html#how-to-cite-your-ena-study">citing
your data in publications</a></p>
<p *ngIf="projectStatus == 'PRIVATE'">
<p *ngIf="projectStatus === 'PRIVATE'">
Your study will be held private until {{projectReleaseDateStr}}. You must release this study once data
associated with it has been published. The release date can be changed by editing the study in 'Studies
Report'.
......
......@@ -103,9 +103,7 @@ export class SubmissionResultComponent {
// Find project submission and used its response for displaying different success message.
let projectResult = this.result.accessions.find(element => element.type === "PROJECT")
if (projectResult) {
this.projectAccession = projectResult.accession;
this.projectStatus = this.result.releaseStatus;
this.projectReleaseDateStr = this.result.releaseDate.slice(0, 10);
this.setProjectDetails(projectResult);
}
if (this.result.isError) {
......@@ -147,8 +145,11 @@ export class SubmissionResultComponent {
} else {
// For project linking
this.projectAccession = this.result.accessions.find(element => element.type === "PROJECT").accession;
projectLinkJsonForUpdate["projectId"] = this.projectAccession;
// Find project submission and used its response for displaying different success message.
let projectResult = this.result.accessions.find(element => element.type === "PROJECT")
if (projectResult) {
this.setProjectDetails(projectResult);
}
// Delete projectLink before insert / update
if (projectLinkJsonForDelete["parentId"] || projectLinkJsonForDelete["childIds"].length > 0) {
......@@ -183,6 +184,15 @@ export class SubmissionResultComponent {
}
}
// Set project details beeded for displaying message.
setProjectDetails(projectResult) {
this.projectAccession = projectResult.accession;
this.projectStatus = this.result.releaseStatus;
if (this.result.releaseDate) {
this.projectReleaseDateStr = this.result.releaseDate.slice(0, 10);
}
}
createProjectLink(projectLinkJson: object, projectAccessions) {
this.active = true;
// Project link will be created if there is no record exist for the given parent and child id.
......
......@@ -430,7 +430,9 @@ export class XmlService {
getFormatedReleseDate(date) {
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2);
if (date.getFullYear()) { //check if valid date
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment