Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
enasequence
webin-portal
Commits
d62c5fc3
Commit
d62c5fc3
authored
Jun 14, 2021
by
Rajkumar-D
Browse files
Fixing: ENA-4304 and ENA-3879
parent
301bc560
Pipeline
#164870
passed with stages
in 3 minutes and 35 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
7 deletions
+82
-7
src/app/checklist/checklist.component.ts
src/app/checklist/checklist.component.ts
+38
-1
src/app/submission-result/submission-result.component.html
src/app/submission-result/submission-result.component.html
+19
-2
src/app/submission-result/submission-result.component.ts
src/app/submission-result/submission-result.component.ts
+14
-3
src/app/webin-rest.service.ts
src/app/webin-rest.service.ts
+11
-1
No files found.
src/app/checklist/checklist.component.ts
View file @
d62c5fc3
...
...
@@ -167,6 +167,10 @@ export class ChecklistComponent implements OnInit {
this
.
selectedChecklist
=
checklist
;
this
.
selectedFields
=
{};
this
.
mandatoryFields
=
{};
// Add sample related fields when checklist type is sample.
if
(
this
.
checklistType
===
ChecklistType
.
sample
)
{
this
.
selectedChecklist
.
fieldGroups
.
push
(
this
.
getSampleSpecificFields
())
}
this
.
selectedChecklist
.
fieldGroups
.
forEach
((
fieldGroup
)
=>
{
fieldGroup
.
fields
.
forEach
((
field
)
=>
{
this
.
selectedFields
[
field
.
label
]
=
(
field
.
mandatory
===
'
mandatory
'
);
...
...
@@ -462,7 +466,6 @@ export class ChecklistComponent implements OnInit {
}
uploadFile
(
form
)
{
const
formData
:
FormData
=
new
FormData
();
const
observable
:
Observable
<
string
>
=
...
...
@@ -482,6 +485,40 @@ export class ChecklistComponent implements OnInit {
this
.
util
.
showSubmissionResponse
(
this
,
SubmissionResultDialogComponent
,
observable
,
redirectPath
);
}
getSampleSpecificFields
()
{
let
sampleSpecificFields
=
{
name
:
"
Sample Details
"
,
fields
:
[{
name
:
"
sample_alias
"
,
label
:
"
Sample alias (unique name)
"
,
description
:
"
Unique name of the sample. If not selected system will auto generate an unique alias
"
,
mandatory
:
"
optional
"
,
textChoice
:
[],
type
:
"
TEXT_FIELD
"
,
units
:
[]
},
{
name
:
"
sample_title
"
,
label
:
"
Sample title
"
,
description
:
"
Title of the sample
"
,
mandatory
:
"
optional
"
,
textChoice
:
[],
type
:
"
TEXT_FIELD
"
,
units
:
[]
},
{
name
:
"
sample_description
"
,
label
:
"
Sample description
"
,
description
:
"
Description of the sample
"
,
mandatory
:
"
optional
"
,
textChoice
:
[],
type
:
"
TEXT_FIELD
"
,
units
:
[]
}]
}
return
sampleSpecificFields
;
}
isBroker
():
boolean
{
return
this
.
_webinAuthenticationService
.
isBroker
();
}
...
...
src/app/submission-result/submission-result.component.html
View file @
d62c5fc3
...
...
@@ -41,8 +41,25 @@
</div>
<div
*ngIf=
"webinAccessionDataSource"
>
<div
class=
"app-success"
>
<i
class=
"material-icons"
>
done
</i>
<span
*ngIf=
"!displayMessage"
>
The submission was successful.
</span>
<i
class=
"material-icons"
style=
"float:left"
>
done
</i>
<div
style=
"margin-left: 5%;"
class=
"mat-body"
*ngIf=
"!displayMessage && projectAccession"
>
<p>
Thank you for your submission.
</p>
<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'"
>
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'.
</p>
<p>
Any citations should be added by editing the study in 'Studies Report'.
</p>
<p>
If you need further assistance please contact the
<a
href=
"https://www.ebi.ac.uk/ena/browser/support"
>
ENA
helpdesk
</a></p>
</div>
<span
*ngIf=
"!displayMessage && webinAccessionDataSource.data[0].type != 'PROJECT'"
>
The submission was
successful.
</span>
<span
*ngIf=
"displayMessage"
>
{{displayMessage}}
</span>
</div>
</div>
...
...
src/app/submission-result/submission-result.component.ts
View file @
d62c5fc3
...
...
@@ -48,6 +48,9 @@ export class SubmissionResultComponent {
message
;
errorMessage
;
resultError
;
projectAccession
:
string
;
projectStatus
:
string
;
projectReleaseDateStr
:
string
;
projectLinkError
;
projectLinkMessage
;
showReceiptXml
=
false
;
...
...
@@ -97,6 +100,14 @@ export class SubmissionResultComponent {
this
.
result
=
this
.
_webinRestService
.
parseResult
(
data
);
// console.log('** Webin submission **', this.result);
// 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
);
}
if
(
this
.
result
.
isError
)
{
this
.
webinErrorDataSource
=
new
MatTableDataSource
<
WebinError
>
(
this
.
result
.
errors
);
this
.
webinErrorDataSource
.
paginator
=
this
.
webinErrorPaginator
;
...
...
@@ -136,12 +147,12 @@ export class SubmissionResultComponent {
}
else
{
// For project linking
var
projectAccession
=
this
.
result
.
accessions
.
find
(
element
=>
element
.
type
===
"
PROJECT
"
).
accession
;
projectLinkJsonForUpdate
[
"
projectId
"
]
=
projectAccession
;
this
.
projectAccession
=
this
.
result
.
accessions
.
find
(
element
=>
element
.
type
===
"
PROJECT
"
).
accession
;
projectLinkJsonForUpdate
[
"
projectId
"
]
=
this
.
projectAccession
;
// Delete projectLink before insert / update
if
(
projectLinkJsonForDelete
[
"
parentId
"
]
||
projectLinkJsonForDelete
[
"
childIds
"
].
length
>
0
)
{
projectLinkJsonForDelete
[
"
projectId
"
]
=
projectAccession
;
projectLinkJsonForDelete
[
"
projectId
"
]
=
this
.
projectAccession
;
console
.
log
(
"
Delete project link:
"
+
JSON
.
stringify
(
projectLinkJsonForDelete
))
this
.
deleteProjectLink
(
projectLinkJsonForDelete
);
}
...
...
src/app/webin-rest.service.ts
View file @
d62c5fc3
...
...
@@ -19,6 +19,7 @@ import { tap, startWith, map, debounceTime, catchError } from 'rxjs/operators';
import
{
ReportType
}
from
'
./report-type.enum
'
;
import
{
WebinRestServiceInterface
}
from
'
./webin-rest.service.interface
'
;
import
{
WebinAuthenticationService
}
from
'
./webin-authentication.service
'
;
import
{
stringify
}
from
'
@angular/compiler/src/util
'
;
@
Injectable
()
...
...
@@ -245,7 +246,10 @@ export class WebinRestService implements WebinRestServiceInterface {
xml
:
data
,
date
:
date
,
accessions
:
[],
errors
:
[]
errors
:
[],
// Fields for Project / study
releaseDate
:
String
,
releaseStatus
:
String
};
let
i
=
0
;
...
...
@@ -271,6 +275,12 @@ export class WebinRestService implements WebinRestServiceInterface {
accession
:
childNode
.
getAttribute
(
'
accession
'
),
alias
:
childNode
.
getAttribute
(
'
alias
'
)
});
// Save project details for displaying project specific message.
if
(
childNode
.
tagName
===
'
PROJECT
'
)
{
receipt
.
releaseDate
=
childNode
.
getAttribute
(
'
holdUntilDate
'
);
receipt
.
releaseStatus
=
childNode
.
getAttribute
(
'
status
'
);
}
}
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment