Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(participants): show annotation number
Browse files Browse the repository at this point in the history
Closes #418
  • Loading branch information
Christine Yu committed Mar 5, 2015
1 parent db60737 commit 9ac045e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/scripts/participant/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module ngApp.participants {
"project.code",
"project.primary_site",
"project.program.name",
"annotations.annotation_id",
"summary.experimental_strategies.experimental_strategy",
"summary.experimental_strategies.file_count",
"summary.data_types.file_count",
Expand All @@ -42,7 +41,8 @@ module ngApp.participants {
"samples.portions.analytes.amount",
"samples.portions.analytes.analyte_type",
"samples.portions.analytes.aliquots.aliquot_id",
"samples.portions.analytes.aliquots.submitter_id"
"samples.portions.analytes.aliquots.submitter_id",
"samples.portions.annotations.annotation_id"
]
});
}
Expand Down
13 changes: 11 additions & 2 deletions app/scripts/participant/participants.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ module ngApp.participants.controllers {
}

class ParticipantController implements IParticipantController {
annotationIds: string[];
/* @ngInject */
constructor(public participant: IParticipant,
private CoreService: ICoreService,
private LocationService: ILocationService,
private config: IGDCConfig) {
CoreService.setPageTitle("Participant " + participant.participant_id);

this.annotationIds = _.map(this.participant.annotations, (annotation) => {
return annotation.annotation_id;
var annotationIds = [];
_.forEach(this.participant.samples, function(sample){
_.forEach(sample.portions, function(p) {
if(_.has(p, 'annotations')) {
_.forEach(p.annotations, function(annotation){
annotationIds.push(annotation.annotation_id);
});
}
});
});
this.annotationIds = annotationIds;
}

DownloadClinicalXML(): void {
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/participant/templates/participant.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ <h3 class="panel-title" data-translate>Summary</h3>
<tr>
<th scope="row" data-translate>Number of Annotations</th>
<td>
<a data-ng-if="pc.participant.annotations.length"
<a data-ng-if="pc.annotationIds.length"
data-ui-sref="annotations({ 'filters':
{{ [{ name: 'annotation_id', value: pc.annotationIds }] | makeFilter }} })">
{{ ::pc.participant.annotations.length | number:0 }}
{{ ::pc.annotationIds.length | number:0 }}
</a>
<span data-ng-if="!pc.participant.annotations.length">0</span>
<span data-ng-if="!pc.annotationIds.length">0</span>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit 9ac045e

Please sign in to comment.