[pluginsFunctionality | DONE | ADDED] pass helptexts in sdg page
This commit is contained in:
parent
0c92b719b3
commit
dee055b392
|
@ -2,22 +2,41 @@ import {Component} from "@angular/core";
|
|||
import {properties} from "../../environments/environment";
|
||||
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
||||
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
||||
import {Router} from "@angular/router";
|
||||
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
|
||||
import {Subscription} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'community-sdg',
|
||||
template: `
|
||||
<sdg [customFilter]="customFilter"></sdg>
|
||||
<sdg *ngIf="pageContents" [customFilter]="customFilter" [pageContents]="pageContents"></sdg>
|
||||
`
|
||||
})
|
||||
export class CommunitySdgComponent {
|
||||
communityId;
|
||||
customFilter: SearchCustomFilter = null;
|
||||
|
||||
constructor() {
|
||||
public pageContents = null;
|
||||
subs: Subscription[] = [];
|
||||
constructor(
|
||||
private _router: Router,
|
||||
private helper: HelperService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
||||
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
||||
this.getPageContents();
|
||||
}
|
||||
ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
private getPageContents() {
|
||||
this.subs.push(this.helper.getPageHelpContents(properties, this.communityId, this._router.url).subscribe(contents => {
|
||||
this.pageContents = contents;
|
||||
console.log(this.pageContents)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue