From dee055b392c1d1667fce97ef219e618409cee33c Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 9 May 2024 10:19:12 +0300 Subject: [PATCH] [pluginsFunctionality | DONE | ADDED] pass helptexts in sdg page --- src/app/sdg/sdg.component.ts | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/app/sdg/sdg.component.ts b/src/app/sdg/sdg.component.ts index 18cbd0c..82a7c37 100644 --- a/src/app/sdg/sdg.component.ts +++ b/src/app/sdg/sdg.component.ts @@ -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: ` - + ` }) 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) + })); } }