Compare commits
2 Commits
3e3a98e522
...
dee055b392
Author | SHA1 | Date |
---|---|---|
argirok | dee055b392 | |
argirok | 0c92b719b3 |
|
@ -6,7 +6,7 @@
|
||||||
<ng-container *ngIf="!showLoading">
|
<ng-container *ngIf="!showLoading">
|
||||||
<ng-container *ngFor="let pluginGroup of pluginsByPlacement.get('top') ; let i=index">
|
<ng-container *ngFor="let pluginGroup of pluginsByPlacement.get('top') ; let i=index">
|
||||||
<ng-container *ngIf="(pluginGroup.template.portalSpecific.length == 0 || pluginGroup.template.portalSpecific.indexOf(community.communityId) != -1 ) &&
|
<ng-container *ngIf="(pluginGroup.template.portalSpecific.length == 0 || pluginGroup.template.portalSpecific.indexOf(community.communityId) != -1 ) &&
|
||||||
(pluginGroup.template.plan == 'starter'|| pluginGroup.template.plan == community.plan ) && pluginGroup.plugin.active">
|
(pluginGroup.template.plan == 'Default'|| pluginGroup.template.plan == 'Standard'|| pluginGroup.template.plan == community.plan ) && pluginGroup.plugin.active">
|
||||||
<plugin-wrapper [pluginTemplate]="pluginGroup.template" [plugin]="pluginGroup.plugin"
|
<plugin-wrapper [pluginTemplate]="pluginGroup.template" [plugin]="pluginGroup.plugin"
|
||||||
[pluginObject]="pluginGroup.plugin.object"></plugin-wrapper>
|
[pluginObject]="pluginGroup.plugin.object"></plugin-wrapper>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
|
@ -2,22 +2,41 @@ import {Component} from "@angular/core";
|
||||||
import {properties} from "../../environments/environment";
|
import {properties} from "../../environments/environment";
|
||||||
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
||||||
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
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({
|
@Component({
|
||||||
selector: 'community-sdg',
|
selector: 'community-sdg',
|
||||||
template: `
|
template: `
|
||||||
<sdg [customFilter]="customFilter"></sdg>
|
<sdg *ngIf="pageContents" [customFilter]="customFilter" [pageContents]="pageContents"></sdg>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class CommunitySdgComponent {
|
export class CommunitySdgComponent {
|
||||||
communityId;
|
communityId;
|
||||||
customFilter: SearchCustomFilter = null;
|
customFilter: SearchCustomFilter = null;
|
||||||
|
public pageContents = null;
|
||||||
constructor() {
|
subs: Subscription[] = [];
|
||||||
|
constructor(
|
||||||
|
private _router: Router,
|
||||||
|
private helper: HelperService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
||||||
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
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