58 lines
2.2 KiB
TypeScript
58 lines
2.2 KiB
TypeScript
import {Component, Input} from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'showSubjects',
|
|
template: `
|
|
<div *ngIf="subjects != undefined || otherSubjects != undefined || classifiedSubjects != undefined ">
|
|
|
|
<div *ngIf="(subjects != undefined && subjects.length > 0) ||
|
|
(otherSubjects != undefined && otherSubjects.size > 0) ||
|
|
(classifiedSubjects != undefined && classifiedSubjects.size > 0)">
|
|
<span class="uk-text-bold">Subject:</span>
|
|
|
|
<span *ngIf="subjects != undefined && subjects.length > 0"> {{subjects.join(" | ")}} </span>
|
|
<ul class="uk-list">
|
|
<li *ngIf="otherSubjects != undefined && otherSubjects.size > 0">
|
|
<div *ngFor="let key of getKeys(otherSubjects)">
|
|
<span class="uk-text-bold">{{key}}:</span> {{otherSubjects.get(key).join(" | ")}}
|
|
</div>
|
|
</li>
|
|
<!--li *ngIf="(subjects == undefined || subjects.length == 0) &&
|
|
(otherSubjects == undefined || otherSubjects.size == 0) &&
|
|
classifiedSubjects != undefined && classifiedSubjects.size > 0">
|
|
-
|
|
</li-->
|
|
</ul>
|
|
</div>
|
|
|
|
<div *ngIf="classifiedSubjects != undefined && classifiedSubjects.size > 0">
|
|
<div class="uk-panel uk-padding-small uk-background-muted" >
|
|
<div *ngFor="let key of getKeys(classifiedSubjects)">
|
|
<span class="uk-text-bold">Classified by OpenAIRE into</span>
|
|
<div>
|
|
<span class="uk-text-bold">{{key}}:</span> {{classifiedSubjects.get(key).join(" | ")}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`
|
|
|
|
})
|
|
|
|
export class ShowSubjectsComponent {
|
|
@Input() subjects: string[];
|
|
@Input() otherSubjects: Map<string, string[]>;
|
|
@Input() classifiedSubjects: Map<string, string[]>;
|
|
// private showClassifiedSbj: boolean = false;
|
|
|
|
constructor () {
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
public getKeys( map) {
|
|
return Array.from(map.keys());
|
|
}
|
|
}
|