[plugins-functionality | WIP]
This commit is contained in:
parent
e781dc8a51
commit
7d5b82e0dc
|
@ -38,9 +38,9 @@
|
|||
</div>
|
||||
|
||||
<div *ngIf="affiliations.length > 0 && communityFirstPage && !longView" class="uk-grid uk-grid-large" uk-grid>
|
||||
<div class="uk-width-1-3@m">
|
||||
<div class="uk-width-auto@m uk-width-1-1@s">
|
||||
<h2 class="uk-h1">
|
||||
Supporting Organizations
|
||||
Supporting <br> Organizations
|
||||
</h2>
|
||||
<a class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default uk-margin-top"
|
||||
routerLinkActive="router-link-active" routerLink="/organizations">
|
||||
|
@ -49,7 +49,7 @@
|
|||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-2-3@m">
|
||||
<div class="uk-width-expand@m uk-width-1-1@s">
|
||||
<div class="uk-grid uk-grid-large uk-child-width-1-3@m uk-child-width-1-2@s supportingOrganizations" uk-grid>
|
||||
<div *ngFor="let affiliation of affiliations.slice(0,9);">
|
||||
<a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix" class="uk-link-reset">
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
</h3>
|
||||
<ul *ngIf="subcommunities" class="uk-subnav uk-subnav-pill uk-flex uk-flex-center">
|
||||
<li *ngFor="let item of subcommunities.slice(0,15)" class="uk-margin-small-bottom">
|
||||
<a [href]="properties.searchLinkToAdvancedResults">
|
||||
<!--{{item.category}}:--> {{item.label}}
|
||||
<a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="{f0:'conceptname', fv0:item.label}">
|
||||
<!--{{item.category}} : {{item.subCommunityId}} - --> {{item.label}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
{{pluginObject.title}}
|
||||
</h3>
|
||||
|
||||
<!-- <a [routerLink]="properties.searchLinkToAdvancedResults"
|
||||
[queryParams]="{f0:'categoryid', fv0: 'enermaps::selection'}"
|
||||
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
|
||||
Browse all
|
||||
</a>-->
|
||||
</div>
|
||||
<div>
|
||||
<div class="uk-margin-top uk-margin-medium-bottom uk-text-meta">
|
||||
|
@ -12,19 +17,19 @@
|
|||
{{pluginObject.textLine2}}
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="fetchFeaturedDatasets" uk-slider class="uk-slider">
|
||||
<ul *ngIf="slides" class="uk-slider-items" uk-height-match="target: .uk-card; row: false">
|
||||
<li *ngFor="let slide of [].constructor(slides); let i=index" class="uk-width-1-1 uk-padding">
|
||||
<div class="uk-grid uk-child-width-1-1" uk-grid uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; repeat: true">
|
||||
<search-result [properties]="properties"
|
||||
[results]="fetchFeaturedDatasets.results"
|
||||
[status]="fetchFeaturedDatasets.searchUtils.status"
|
||||
[type]="'dataset'" [showEnermaps]="true" >
|
||||
</search-result>
|
||||
<div *ngIf="results" class=" uk-card uk-card-default uk-padding-xsmall">
|
||||
<div>
|
||||
<paging-no-load [totalResults]="results.length" [currentPage]="page" (pageChange)="page = $event.value"
|
||||
[size]="size"></paging-no-load>
|
||||
</div>
|
||||
<div class="uk-margin-top">
|
||||
<ng-container *ngFor="let result of results.slice((page-1)*slideItems,(page)*slideItems)">
|
||||
<result-preview [properties]="properties" [showOrganizations]="true"
|
||||
[showSubjects]="true" [result]="result" [showEnermaps]="true"
|
||||
[isCard]="true" [showEntityActions]="false">
|
||||
</result-preview>
|
||||
</ng-container>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin-medium-top"></ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, SimpleChanges} from '@angular/core';
|
||||
import {PluginBaseComponent, PluginBaseInfo} from "../../utils/base-plugin.component";
|
||||
import {FetchResearchResults} from "../../../../utils/fetchEntitiesClasses/fetchResearchResults.class";
|
||||
import {SearchResearchResultsService} from "../../../../services/searchResearchResults.service";
|
||||
import {properties} from "../../../../../../environments/environment";
|
||||
import {ResultPreview} from "../../../../utils/result-preview/result-preview";
|
||||
|
||||
export class PluginFeaturedDatasets extends PluginBaseInfo{
|
||||
title: string = "Featured datasets";
|
||||
|
@ -17,17 +19,53 @@ export class PluginFeaturedDatasets extends PluginBaseInfo{
|
|||
|
||||
export class PluginFeaturedDatasetsComponent extends PluginBaseComponent<PluginFeaturedDatasets> {
|
||||
default = new PluginFeaturedDatasets();
|
||||
public fetchFeaturedDatasets: FetchResearchResults;
|
||||
// public fetchFeaturedDatasets: FetchResearchResults;
|
||||
page = 1;
|
||||
size = 3;
|
||||
slides = 1;
|
||||
slideItems = 3;
|
||||
totalNum = null;
|
||||
results: ResultPreview[] = null;
|
||||
constructor(private _searchResearchResultsService: SearchResearchResultsService) {
|
||||
super()
|
||||
this.fetchFeaturedDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
||||
this.fetchFeaturedDatasets.searchUtils.size = this.size;
|
||||
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", "enermaps", 1, 50, this.properties, "enermaps::selection");
|
||||
}
|
||||
// this.fetchFeaturedDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
||||
// this.fetchFeaturedDatasets.searchUtils.size = this.size;
|
||||
// this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", "enermaps", 1, 50, this.properties, "enermaps::selection");
|
||||
this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults("dataset", null, 1, 50, null, properties, "&type=results&fq=communityid=enermaps&fq=categoryid=" + encodeURIComponent("enermaps::selection")).subscribe(
|
||||
data => {
|
||||
console.log(data);
|
||||
|
||||
this.totalNum = data[0];
|
||||
this.results = data[1].map( res => {
|
||||
let resultPreview = ResultPreview.searchResultConvert(res, 'dataset')
|
||||
resultPreview.hostedBy_collectedFrom = null;
|
||||
resultPreview.measure = null;
|
||||
return resultPreview
|
||||
}) ;
|
||||
console.log(this.totalNum = data[0], this.results);
|
||||
|
||||
if(this.results && this.results.length>0) {
|
||||
this.calculatePages();
|
||||
}
|
||||
},
|
||||
err => {
|
||||
|
||||
}
|
||||
));
|
||||
}
|
||||
/* ngOnChanges(changes: SimpleChanges) {
|
||||
if(this.results) {
|
||||
this.calculatePages();
|
||||
}
|
||||
}*/
|
||||
calculatePages(){
|
||||
this.slides = 1;
|
||||
if (this.results.length > this.slideItems) {
|
||||
this.slides = parseInt('' + (this.results.length / this.slideItems));
|
||||
if(this.slides< (this.results.length / this.slideItems)){
|
||||
this.slides++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,10 +12,11 @@ import {PluginFeaturedDatasetsComponent} from './plugin-featured-datasets.compon
|
|||
import {NoLoadPaging} from "../../../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {SearchResultsModule} from "../../../../searchPages/searchUtils/searchResults.module";
|
||||
import {ResultPreviewModule} from "../../../../utils/result-preview/result-preview.module";
|
||||
import {PagingModule} from "../../../../utils/paging.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule, NoLoadPaging, SearchResultsModule, ResultPreviewModule
|
||||
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, ResultPreviewModule, PagingModule
|
||||
],
|
||||
providers:[PluginsService],
|
||||
declarations: [PluginFeaturedDatasetsComponent],
|
||||
|
|
|
@ -43,26 +43,22 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
super.ngOnInit();
|
||||
this.requireLogin = false;
|
||||
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(communityInfo => {
|
||||
// this.subscriptions.push(this.http.get("https://services.openaire.eu/uoa-monitor-service/stakeholder/connect-template").
|
||||
// subscribe(stakeholder => {
|
||||
// if (stakeholder) {
|
||||
|
||||
if (communityInfo) {
|
||||
|
||||
this.loading = true;
|
||||
this.stakeholder = PluginStats.getMockStakeholder();
|
||||
this.stakeholder.index_id = communityInfo.communityId
|
||||
this.stakeholder.index_name = communityInfo.title;
|
||||
this.stakeholder.index_shortName = communityInfo.shortTitle;
|
||||
|
||||
this.title = this.stakeholder.name;
|
||||
this.description = this.stakeholder.name;
|
||||
|
||||
this.loading = true;
|
||||
this.activeTopic = null;
|
||||
this.activeCategory = null;
|
||||
this.activeSubCategory = null;
|
||||
this.numberResults = new Map<string, number>();
|
||||
this.chartsActiveType = new Map<string, IndicatorPath>();
|
||||
// this.subscriptions.push(this._route.queryParams.subscribe(queryParams => {
|
||||
this.setView({});
|
||||
let ids = [];
|
||||
for (let section of this.activeSubCategory.charts) {
|
||||
|
@ -70,10 +66,8 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
ids.push(indicator._id)
|
||||
}
|
||||
}
|
||||
// this.setMetadata();
|
||||
// }
|
||||
|
||||
// }));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -86,6 +80,7 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
return false;
|
||||
|
||||
}
|
||||
|
||||
public showIndicator(indicator): boolean {
|
||||
return this.pluginObject.disabledIndicators.indexOf(indicator._id) == -1;
|
||||
}
|
||||
|
|
|
@ -16,12 +16,7 @@ import {LoadingModule} from "../../../../utils/loading/loading.module";
|
|||
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, RouterModule.forChild([
|
||||
{path: '', component: MonitorComponent},
|
||||
{path: ':topic/', component: MonitorComponent},
|
||||
{path: ':topic/:category', component: MonitorComponent},
|
||||
{path: ':topic/:category/:subCategory', component: MonitorComponent}
|
||||
]), PageContentModule, SliderTabsModule, NumberRoundModule, IconsModule, ClickModule, RangeFilterModule, SearchFilterModule, SliderUtilsModule, LoadingModule],
|
||||
imports: [CommonModule, PageContentModule, SliderTabsModule, NumberRoundModule, IconsModule, ClickModule, RangeFilterModule, SearchFilterModule, SliderUtilsModule, LoadingModule],
|
||||
declarations: [MonitorComponent],
|
||||
exports: [
|
||||
MonitorComponent
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -50,6 +50,12 @@ export class PluginsService {
|
|||
getPluginTemplatesByPage(api: string, pid: string, pageId: string) {
|
||||
return this.http.get<Array<PluginTemplate>>(api + properties.adminToolsPortalType + '/' + pid + '/pluginTemplates/page/' + pageId);
|
||||
}
|
||||
getPluginsByPageRoute(api:string, pid:string, route:string){
|
||||
return this.http.get<Array<Plugin>>(api + 'community/' +pid+'/plugins/page/route?route=' + route);
|
||||
}
|
||||
getPluginTemplatesByPageRoute(api:string, pid:string, route:string){
|
||||
return this.http.get<Array<PluginTemplate>>(api + 'community/' +pid+'/pluginTemplates/page/route?route=' + route);
|
||||
}
|
||||
|
||||
togglePlugin(id: string, status: boolean, api: string) {
|
||||
return this.http.post(api + 'plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody());
|
||||
|
|
|
@ -32,7 +32,7 @@ export class SearchFieldsBase {
|
|||
];
|
||||
|
||||
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "eoscifguidelines", "resultpublisher",
|
||||
"resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance",
|
||||
"resultbestaccessright", "community","conceptname", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance",
|
||||
"relfunder",
|
||||
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
|
||||
"resultlanguagename", "relorganizationid", "pid", "relprojectid", "instancetypename", "fos", "sdg"];
|
||||
|
@ -142,6 +142,14 @@ export class SearchFieldsBase {
|
|||
equalityOperator: " exact ",
|
||||
filterType: "checkbox"
|
||||
},
|
||||
["conceptname"]: {
|
||||
name: "Subcommunity",
|
||||
type: "keyword",
|
||||
param: "conceptname",
|
||||
operator: "sc",
|
||||
equalityOperator: " exact ",
|
||||
filterType: "checkbox"
|
||||
},
|
||||
["relproject"]: {
|
||||
name: "Project",
|
||||
type: "refine",
|
||||
|
|
Loading…
Reference in New Issue