2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
2021-11-09 15:02:32 +01:00
|
|
|
import {properties} from "../../../../environments/environment";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
2020-03-16 14:09:46 +01:00
|
|
|
selector: 'showSubjects',
|
|
|
|
template: `
|
2020-05-22 16:51:28 +02:00
|
|
|
<div class="uk-text-muted">
|
|
|
|
Subjects
|
|
|
|
</div>
|
2020-05-26 16:42:47 +02:00
|
|
|
<div class="uk-margin-small-top">
|
|
|
|
<div>
|
|
|
|
<ng-container *ngIf="classifiedSubjects && classifiedSubjects.size > 0">
|
|
|
|
<div *ngFor="let key of getKeys(classifiedSubjects)" style="line-height: 20px">
|
|
|
|
<span uk-icon="tag"></span>
|
2021-11-09 15:02:32 +01:00
|
|
|
<span class="uk-text-bold"> {{key}}: </span>
|
2020-05-26 16:42:47 +02:00
|
|
|
<ng-container *ngFor="let subject of classifiedSubjects.get(key)">
|
2021-11-09 15:02:32 +01:00
|
|
|
<span class="uk-display-inline-block label-classified">
|
|
|
|
<span *ngIf="specialSubjects.indexOf(subject) == -1 ">{{subject}}</span>
|
2021-11-24 14:55:54 +01:00
|
|
|
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1"
|
|
|
|
[routerLink]=" properties.searchLinkToAdvancedResults"
|
|
|
|
[queryParams]="getSubjectParameter(subject)" >
|
|
|
|
{{subject}}
|
|
|
|
</a>
|
2021-11-09 15:02:32 +01:00
|
|
|
</span>
|
2020-05-26 16:42:47 +02:00
|
|
|
</ng-container>
|
|
|
|
</div>
|
|
|
|
</ng-container>
|
2020-05-27 22:43:59 +02:00
|
|
|
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-break">
|
2020-03-16 14:09:46 +01:00
|
|
|
<span uk-icon="tag"></span>
|
2021-11-09 15:02:32 +01:00
|
|
|
<span class="uk-text-bold"> free text keywords: </span>
|
2020-05-26 16:42:47 +02:00
|
|
|
<span *ngIf="subjects && subjects.length > 0">{{subjects.join(', ')}}</span>
|
|
|
|
<span *ngIf="(subjects && subjects.length > 0) && (otherSubjects && otherSubjects.size > 0)">, </span>
|
|
|
|
<span *ngIf="otherSubjects && otherSubjects.size > 0">
|
2021-09-23 16:49:41 +02:00
|
|
|
<span *ngFor="let key of getKeys(otherSubjects); let i=index">
|
|
|
|
<span *ngIf="otherSubjects.get(key).length > 0">
|
|
|
|
<span>{{otherSubjects.get(key).join(', ')}}</span>
|
|
|
|
<span *ngIf="i < (otherSubjects.size - 1)">, </span>
|
|
|
|
</span>
|
|
|
|
</span>
|
2020-03-16 14:09:46 +01:00
|
|
|
</span>
|
2020-05-26 16:42:47 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-16 14:09:46 +01:00
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
export class ShowSubjectsComponent {
|
2020-03-16 14:09:46 +01:00
|
|
|
@Input() subjects: string[];
|
|
|
|
@Input() otherSubjects: Map<string, string[]>;
|
|
|
|
@Input() classifiedSubjects: Map<string, string[]>;
|
2021-11-09 15:02:32 +01:00
|
|
|
properties = properties;
|
2021-11-11 14:17:39 +01:00
|
|
|
specialSubjects = [];
|
2021-11-09 15:02:32 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
constructor() {
|
2021-11-24 14:55:54 +01:00
|
|
|
if(properties.dashboard == "explore") {
|
2021-11-11 14:17:39 +01:00
|
|
|
this.specialSubjects = [
|
2021-11-24 14:55:54 +01:00
|
|
|
// "Physics::Optics",
|
|
|
|
// "Astrophysics::Cosmology and Extragalactic Astrophysics",
|
|
|
|
// "Computer Science::Information Theory",
|
|
|
|
// "Physics::Accelerator Physics",
|
|
|
|
// "Condensed Matter::Superconductivity",
|
2021-11-11 14:17:39 +01:00
|
|
|
"Physics::Atomic Physics",
|
2021-11-24 14:55:54 +01:00
|
|
|
// "Computer Science::Robotics",
|
|
|
|
// "Computer Science::Computer Science and Game Theory",
|
|
|
|
// "Computer Science::Neural and Evolutionary Computation",
|
2021-11-11 14:17:39 +01:00
|
|
|
"Mathematics::Combinatorics",
|
2021-11-24 14:55:54 +01:00
|
|
|
// "Mathematics::Probability",
|
|
|
|
// "Computer Science::Operating Systems",
|
|
|
|
// "lcsh:Medicine",
|
|
|
|
// "lcsh:Science",
|
|
|
|
// "lcsh:Biology (General)",
|
|
|
|
// "lcsh:Chemistry",
|
|
|
|
// "lcsh:Engineering (General). Civil engineering (General)",
|
|
|
|
// "lcsh:Technology"
|
2021-11-11 14:17:39 +01:00
|
|
|
];
|
|
|
|
}
|
2020-03-16 14:09:46 +01:00
|
|
|
}
|
2021-11-09 15:02:32 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
ngOnInit() {
|
|
|
|
}
|
2021-11-09 15:02:32 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
public getKeys(map) {
|
|
|
|
return Array.from(map.keys());
|
|
|
|
}
|
2021-11-09 15:02:32 +01:00
|
|
|
getSubjectParameter(param){
|
2021-12-17 13:35:18 +01:00
|
|
|
return {'f0':'resultsubject','fv0':'"' +(param)+'"', size:50};
|
2021-11-09 15:02:32 +01:00
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|