Skip to content

Commit

Permalink
Show attribution for HTP datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Oct 17, 2023
1 parent 540e83b commit af30f97
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export interface AppConfig {
};
helpdesk_address: string;
show_names_of_staff_curators: boolean;
show_names_of_staff_file_curators: boolean;
gene_systematic_identifier_re: string;
transcript_systematic_identifier_re: string;
details_popup_delay: number;
Expand Down Expand Up @@ -742,6 +743,7 @@ let _appConfig: AppConfig = {
footer: pombaseConfig.footer,
helpdesk_address: pombaseConfig.helpdesk_address,
show_names_of_staff_curators: pombaseConfig.show_names_of_staff_curators,
show_names_of_staff_file_curators: pombaseConfig.show_names_of_staff_file_curators,
gene_systematic_identifier_re: pombaseConfig.gene_systematic_identifier_re,
transcript_systematic_identifier_re: pombaseConfig.transcript_systematic_identifier_re,
details_popup_delay: pombaseConfig.details_popup_delay,
Expand Down
3 changes: 3 additions & 0 deletions src/app/pombase-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@ export class ReferenceDetails {
canto_curator_name: string;
canto_approved_date: string;
annotation_curators: Array<AnnotationCurator>;
file_curator_role: string;
file_curator_name: string;
annotation_file_curators: Array<AnnotationCurator>;
approved_date: string;
canto_session_submitted_date: string;
publication_year: string;
Expand Down
5 changes: 4 additions & 1 deletion src/app/reference-details/reference-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
Curation by {{curator.name}}
</div>
</div>
<div class="ref-curated-by" *ngIf="hasStaffCurator && !this.appConfig.show_names_of_staff_curators">
<div class="ref-curated-by" *ngIf="onlyStaffCurator && !this.appConfig.show_names_of_staff_curators">
Curated by {{siteName}} staff
</div>
<div class="ref-curated-by" *ngIf="communityFileCuratorNames">
High-throughput dataset provided by {{communityFileCuratorNames}}
</div>
<div *ngIf="hasApprovedSession()">
Added to {{siteName}} on <span class="approved-date">{{refDetails.approved_date}}</span>
</div>
Expand Down
37 changes: 34 additions & 3 deletions src/app/reference-details/reference-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export class ReferenceDetailsComponent implements OnInit {
pubMedId?: string;
apiError?: APIError;
cantoCuratorName?: string;
hasStaffCurator = false;
onlyStaffCurator = false;
onlyStaffFileCurator = false;
cantoTriageStatus = 'UNKNOWN';

multiOrgMode = getAppConfig().isMultiOrganismMode();
Expand All @@ -38,7 +39,10 @@ export class ReferenceDetailsComponent implements OnInit {
doiUrl?: string;

communityCuratorNames?: string;
communityFileCuratorNames?: string;

adminCuratorList: Array<AnnotationCurator> = [];
adminFileCuratorList: Array<AnnotationCurator> = [];

externalLinks?: Array<DetailsPageLinkConfig>;

Expand Down Expand Up @@ -69,7 +73,7 @@ export class ReferenceDetailsComponent implements OnInit {

this.cantoTriageStatus = this.refDetails.canto_triage_status;

this.hasStaffCurator = true;
this.onlyStaffCurator = true;

this.communityCuratorNames = undefined;
this.adminCuratorList = [];
Expand All @@ -79,7 +83,7 @@ export class ReferenceDetailsComponent implements OnInit {
for (const curator of this.refDetails.annotation_curators) {
if (curator.community_curator) {
communityCuratorList.push(curator.name);
this.hasStaffCurator = false
this.onlyStaffCurator = false
} else {
if (this.appConfig.show_names_of_staff_curators) {
this.adminCuratorList.push(curator);
Expand All @@ -95,6 +99,33 @@ export class ReferenceDetailsComponent implements OnInit {
this.communityCuratorNames = communityCuratorList.join(', ') + ' and ' + lastName;
}
}

this.onlyStaffFileCurator = true;

this.communityFileCuratorNames = undefined;
this.adminFileCuratorList = [];

let communityFileCuratorList = [];

for (const curator of this.refDetails.annotation_file_curators) {
if (curator.community_curator) {
communityFileCuratorList.push(curator.name);
this.onlyStaffFileCurator = false
} else {
if (this.appConfig.show_names_of_staff_file_curators) {
this.adminFileCuratorList.push(curator);
}
}
}

if (communityFileCuratorList.length == 1) {
this.communityFileCuratorNames = communityFileCuratorList[0];
} else {
if (communityFileCuratorList.length > 1) {
const lastName = communityFileCuratorList.pop();
this.communityFileCuratorNames = communityFileCuratorList.join(', ') + ' and ' + lastName;
}
}
}

hasGenes(): boolean {
Expand Down

0 comments on commit af30f97

Please sign in to comment.