add search pages, link resolver, customFilter service, update researcher component and module, add search routes for researcher

This commit is contained in:
argirok 2023-11-03 10:51:59 +02:00
parent 30da13b642
commit 500bf0a077
61 changed files with 1728 additions and 24 deletions

View File

@ -19,7 +19,7 @@ const routes: Routes = [
},
{
path: 'researcher',
loadChildren: () => import('./researcher/researcher-routing.module').then(m => m.ResearcherRoutingModule)
loadChildren: () => import('./researcher/researcher.module').then(m => m.ResearcherModule)
},
{
path: 'upload-dois',

View File

@ -9,6 +9,7 @@ import {Option} from "./openaireLibrary/sharedComponents/input/input.component";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
import {Portal} from "./openaireLibrary/utils/entities/adminTool/portal";
import {Irish} from "./shared/irish";
import {CustomFilterService} from "./shared/customFilter.service";
@Component({
selector: 'app-root',
@ -52,7 +53,7 @@ export class AppComponent extends BaseComponent implements OnInit {
irish: Irish = new Irish();
constructor(private route: ActivatedRoute,
private router: Router, private configurationService: ConfigurationService) {
private router: Router, private configurationService: ConfigurationService, private customFilterService:CustomFilterService) {
super();
configurationService.initStaticPortal(this.irish.portal);
//Test track event
@ -60,6 +61,11 @@ export class AppComponent extends BaseComponent implements OnInit {
// this._piwikService.doTrackEvent(properties,"test", properties.piwikSiteId,location.href,"Linking", "Link", JSON.stringify(json) )
}
ngOnDestroy() {
super.ngOnDestroy();
this.customFilterService.clearSubscriptions();
this.configurationService.clearSubscriptions()
}
ngOnInit() {
this.initialize();

View File

@ -0,0 +1,39 @@
import {Component, OnDestroy, OnInit} from "@angular/core";
import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service";
import {BaseComponent} from "../../openaireLibrary/sharedComponents/base/base.component";
import {ActivatedRoute, Router} from "@angular/router";
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
import {Meta, Title} from "@angular/platform-browser";
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {SearchOrcidService} from "../../openaireLibrary/claims/claim-utils/service/searchOrcid.service";
import {properties} from "../../../environments/environment";
@Component({
selector: 'author',
template: `
<monitor-search-results ></monitor-search-results>
`
})
export class AuthorComponent extends BaseComponent implements OnInit {
constructor(private stakeholderService: StakeholderService,
private _searchOrcidService: SearchOrcidService,
protected _route: ActivatedRoute,
protected _router: Router,
protected seoService: SEOService,
protected _piwikService: PiwikService,
protected _title: Title,
protected _meta: Meta) {
super();
}
ngOnInit() {
}
}

View File

@ -0,0 +1,18 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {Route, RouterModule} from "@angular/router";
import {AuthorComponent} from "./author.component";
import {MonitorSearchResearchResultsModule} from "../../search/searchPages/simple/searchResearchResults.module";
const routes: Route[] = [
{
path: '', component: AuthorComponent
}
];
@NgModule({
imports: [CommonModule, RouterModule.forChild(routes), MonitorSearchResearchResultsModule],
declarations: [AuthorComponent],
exports: [AuthorComponent],
})
export class AuthorModule {
}

View File

@ -1,14 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: '',
loadChildren: () => import('./search-researcher/search-researcher.module').then(m => m.SearchResearcherModule)
}
];
@NgModule({
imports: [RouterModule.forChild(routes)]
})
export class ResearcherRoutingModule { }

View File

@ -0,0 +1,78 @@
import {Component, OnInit} from "@angular/core";
import {BaseComponent} from "../openaireLibrary/sharedComponents/base/base.component";
import {ActivatedRoute, Router} from "@angular/router";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {Meta, Title} from "@angular/platform-browser";
import {properties} from "../../environments/environment";
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {SearchOrcidService} from "../openaireLibrary/claims/claim-utils/service/searchOrcid.service";
import {CustomFilterService} from "../shared/customFilter.service";
import {LinksResolver} from "../search/links-resolver";
@Component({
selector: 'researcher',
template: `
<div style="background: transparent radial-gradient(closest-side at 50% 38%, #3086ED 0%,#184377 100%) 0% 0% no-repeat padding-box; height: 200px" class="uk-light uk-padding">
<div *ngIf="authorId && author" class="">
<div class="uk-margin-top uk-margin-bottom">
<span class="uk-border uk-border-circle uk-padding-small uk-text-meta uk-margin-small-right"
width="16px" height="16px">
<span uk-icon="user"></span></span>
{{author.authorGivenName}} {{author.authorFamilyName}}
</div>
<div class="uk-text-xsmall uk-text-secondary uk-margin-medium-top">
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="orcid"
loading="lazy" style="width:16px; height:16px; margin-right: 3px;">
<a [href]="properties.orcidURL + author.id" target="_blank" class="uk-link uk-text-primary">
{{properties.orcidURL + author.id}}</a></div>
</div>
<div *ngIf="!authorId">
<div class="uktext-large">Researcher Monitors</div>
<div>Lorem ipsum...</div>
</div>
</div>
<div class="uk-section uk-container">
<router-outlet></router-outlet>
</div>
`
})
export class ResearcherComponent extends BaseComponent implements OnInit {
author;
authorId;
properties = properties;
constructor(protected _router: Router,
protected _route: ActivatedRoute,
protected seoService: SEOService,
protected _piwikService: PiwikService,
protected _title: Title,
protected _meta: Meta,
private _searchOrcidService: SearchOrcidService,
private _customFilterService:CustomFilterService) {
super();
super.initRouterParams(this._route);
}
ngOnInit() {
this.params.subscribe(params => {
console.log(params)
this.authorId = params['stakeholder'];
if(this.authorId) {
this.subscriptions.push(this._searchOrcidService.searchOrcidSingleAuthor(this.authorId, properties, true).subscribe(data => {
this.author = data;
this._customFilterService.setCustomFilter(new SearchCustomFilter("Orcid", "authorId", this.authorId, this.author.authorGivenName + " " + this.author.authorFamilyName));
LinksResolver.setProperties("researcher/"+this.authorId);
// TODO not correct id/ no author // no irish author?
}));
}
});
}
}

View File

@ -0,0 +1,24 @@
import {NgModule} from '@angular/core';
import {Route, RouterModule} from '@angular/router';
import {CommonModule} from "@angular/common";
import {ResearcherComponent} from "./researcher.component";
import {SearchOrcidServiceModule} from "../openaireLibrary/claims/claim-utils/service/searchOrcidService.module";
const routes: Route[] = [
{
path: '', component: ResearcherComponent, children: [
{path: '', loadChildren: () => import('./search-researcher/search-researcher.module').then(m => m.SearchResearcherModule)},
{path: ':stakeholder', loadChildren: () => import('./author/author.module').then(m => m.AuthorModule)},
{path: ':stakeholder/search', loadChildren: () => import('../search/search.module').then(m => m.SearchModule)}
]
}
];
@NgModule({
imports: [CommonModule, RouterModule.forChild(routes), SearchOrcidServiceModule],
declarations: [ResearcherComponent],
exports: [ResearcherComponent],
})
export class ResearcherModule { }

View File

@ -1,7 +1,3 @@
<div style="background: royalblue; height: 200px">
</div>
<div class="uk-section uk-container">
<div class=" uk-flex uk-flex-center ">
<div search-input [(value)]="keyword" [placeholder]="'Search for author or ORCID...'"
[searchInputClass]="'inner background'" (searchEmitter)="search()" class="uk-width-xlarge@l uk-width-large@m"></div>
@ -31,7 +27,7 @@
<div class="uk-grid uk-child-width-1-3">
<div *ngFor=" let author of authorsToShow.slice(0,page*size>authorsToShow.length?authorsToShow.length:page*size)" class="uk-padding-small">
<div *ngIf="author.resultsCount > 0" class="uk-card uk-card-default uk-card-hover uk-padding-small">
<a [routerLink]="['./',author.id]" class="uk-link-reset">
<a [routerLink]="'./'+author.id+''" class="uk-link-reset">
<div class="uk-margin-top uk-margin-bottom">
<span class="uk-border uk-border-circle uk-padding-small uk-text-meta uk-margin-small-right" width="16px" height="16px">
@ -57,4 +53,3 @@
</div>
</div>
</div>
</div>

View File

@ -7,13 +7,15 @@ import {MatSelectModule} from "@angular/material/select";
import {SearchOrcidServiceModule} from "../../openaireLibrary/claims/claim-utils/service/searchOrcidService.module";
import {SearchResearchResultsServiceModule} from "../../openaireLibrary/services/searchResearchResultsService.module";
import {LoadingModule} from "../../openaireLibrary/utils/loading/loading.module";
import {RouterModule} from "@angular/router";
@NgModule({
declarations: [SearchResearcherComponent],
imports: [
CommonModule, SearchResearcherRoutingModule, SearchInputModule, MatSelectModule, SearchOrcidServiceModule, SearchResearchResultsServiceModule, LoadingModule
CommonModule, SearchResearcherRoutingModule, SearchInputModule, MatSelectModule, SearchOrcidServiceModule, SearchResearchResultsServiceModule, LoadingModule,
RouterModule
]
})

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorDataProviderComponent} from './dataProvider.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{path: '', component: MonitorDataProviderComponent, canDeactivate: [PreviousRouteRecorder]}
])
]
})
export class DataProviderRoutingModule {
}

View File

@ -0,0 +1,41 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
@Component({
selector: 'monitor-dataprovider',
template: `
<div id="page_content">
<dataprovider *ngIf="initialized" [communityId]="communityId"></dataprovider>
</div>`,
})
export class MonitorDataProviderComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,14 @@
import { NgModule} from '@angular/core';
import { DataProviderModule } from '../../../openaireLibrary/landingPages/dataProvider/dataProvider.module';
import { MonitorDataProviderComponent } from './dataProvider.component';
import {DataProviderRoutingModule} from './dataProvider-routing.module';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {CommonModule} from "@angular/common";
@NgModule({
imports: [DataProviderModule, DataProviderRoutingModule, CommonModule],
declarations:[MonitorDataProviderComponent],
providers:[ PreviousRouteRecorder],
exports:[MonitorDataProviderComponent]
})
export class LibDataProviderModule { }

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorDatasetComponent} from './dataset.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{path: '', component: MonitorDatasetComponent, canDeactivate: [PreviousRouteRecorder]}
])
]
})
export class DatasetRoutingModule {
}

View File

@ -0,0 +1,42 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-dataset',
template: `
<result-landing *ngIf="initialized" type="dataset" [communityId]="communityId"></result-landing>
`,
})
export class MonitorDatasetComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/*this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {MonitorDatasetComponent} from './dataset.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {DatasetRoutingModule} from './dataset-routing.module';
import {ResultLandingModule} from "../../../openaireLibrary/landingPages/result/resultLanding.module";
import {CommonModule} from "@angular/common";
@NgModule({
imports: [DatasetRoutingModule, ResultLandingModule, CommonModule],
declarations:[MonitorDatasetComponent],
providers:[PreviousRouteRecorder],
exports:[MonitorDatasetComponent]
})
export class LibDatasetModule { }

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {OrganizationModule} from '../../../openaireLibrary/landingPages/organization/organization.module';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorOrganizationComponent} from './organization.component';
import {OrganizationRoutingModule} from './organization-routing.module';
import {CommonModule} from "@angular/common";
@NgModule({
imports: [OrganizationModule, OrganizationRoutingModule, CommonModule],
declarations:[MonitorOrganizationComponent],
providers:[ PreviousRouteRecorder],
exports:[MonitorOrganizationComponent]
})
export class LibOrganizationModule { }

View File

@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorOrganizationComponent} from './organization.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{path: '', component: MonitorOrganizationComponent, canDeactivate: [PreviousRouteRecorder]}
])
]
})
export class OrganizationRoutingModule {
}

View File

@ -0,0 +1,45 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-organization',
template: `
<organization *ngIf="initialized" [communityId]="communityId"></organization>
`,
})
export class MonitorOrganizationComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,22 @@
import {NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorOrpComponent} from './orp.component';
import {OrpRoutingModule} from './orp-routing.module';
import {ResultLandingModule} from "../../../openaireLibrary/landingPages/result/resultLanding.module";
import {CommonModule} from "@angular/common";
@NgModule({
imports: [
OrpRoutingModule, ResultLandingModule, CommonModule
],
declarations: [
MonitorOrpComponent
],
providers: [
PreviousRouteRecorder
],
exports: [
MonitorOrpComponent
]
})
export class LibOrpModule { }

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorOrpComponent} from './orp.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([{
path: '', component: MonitorOrpComponent, canDeactivate: [PreviousRouteRecorder]
}])
]
})
export class OrpRoutingModule { }

View File

@ -0,0 +1,43 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-orp',
template: `
<result-landing *ngIf="initialized" type="orp" [communityId]="communityId"></result-landing>
`,
})
export class MonitorOrpComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {ProjectModule} from '../../../openaireLibrary/landingPages/project/project.module';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorProjectComponent} from './project.component';
import {ProjectRoutingModule} from './project-routing.module';
import {CommonModule} from "@angular/common";
@NgModule({
imports: [ProjectModule, ProjectRoutingModule, CommonModule],
declarations:[MonitorProjectComponent],
providers:[PreviousRouteRecorder],
exports:[MonitorProjectComponent]
})
export class LibProjectModule { }

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorProjectComponent} from './project.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorProjectComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class ProjectRoutingModule { }

View File

@ -0,0 +1,43 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-project',
template: `
<project *ngIf="initialized" [communityId]="communityId"></project>
`,
})
export class MonitorProjectComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,14 @@
import { NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import { MonitorPublicationComponent } from './publication.component';
import {PublicationRoutingModule} from './publication-routing.module';
import {ResultLandingModule} from "../../../openaireLibrary/landingPages/result/resultLanding.module";
import {CommonModule} from "@angular/common";
@NgModule({
imports: [PublicationRoutingModule, ResultLandingModule, CommonModule],
declarations:[MonitorPublicationComponent],
providers:[PreviousRouteRecorder],
exports:[MonitorPublicationComponent]
})
export class LibPublicationModule { }

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorPublicationComponent} from './publication.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorPublicationComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class PublicationRoutingModule { }

View File

@ -0,0 +1,41 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-publication',
template: `
<result-landing type="publication" [communityId]="communityId"></result-landing>
`,
})
export class MonitorPublicationComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
}
}

View File

@ -0,0 +1,14 @@
import {NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorResultComponent} from './result.component';
import {ResultRoutingModule} from './result-routing.module';
import {ResultLandingModule} from "../../../openaireLibrary/landingPages/result/resultLanding.module";
import {CommonModule} from "@angular/common";
@NgModule({
imports: [ResultRoutingModule, ResultLandingModule, CommonModule],
declarations:[MonitorResultComponent],
providers:[PreviousRouteRecorder],
exports:[MonitorResultComponent]
})
export class LibResultModule { }

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorResultComponent} from './result.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorResultComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class ResultRoutingModule { }

View File

@ -0,0 +1,42 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-result',
template: `
<result-landing *ngIf="initialized" type="result" [communityId]="communityId"></result-landing>
`,
})
export class MonitorResultComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/* this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,13 @@
import { NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import { MonitorSoftwareComponent } from './software.component';
import {SoftwareRoutingModule} from './software-routing.module';
import {ResultLandingModule} from "../../../openaireLibrary/landingPages/result/resultLanding.module";
import {CommonModule} from "@angular/common";
@NgModule({
imports: [SoftwareRoutingModule, ResultLandingModule, CommonModule],
declarations:[MonitorSoftwareComponent],
providers:[ PreviousRouteRecorder],
exports:[MonitorSoftwareComponent]
})
export class LibSoftwareModule { }

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorSoftwareComponent} from './software.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorSoftwareComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SoftwareRoutingModule { }

View File

@ -0,0 +1,42 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'monitor-software',
template: `
<result-landing *ngIf="initialized" type="software"></result-landing>
`,
})
export class MonitorSoftwareComponent {
initialized: boolean = false;
communityId;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
/*this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
this.communityId = stakeholder.alias;
}
}));
}
}));*/
this.initialized =true;
}
}

View File

@ -0,0 +1,72 @@
import {properties} from "../../environments/environment";
interface Links {
searchLinkToResult;
searchLinkToPublication;
searchLinkToProject;
searchLinkToDataProvider;
searchLinkToDataset;
searchLinkToSoftwareLanding;
searchLinkToOrp;
searchLinkToOrganization;
searchLinkToResults,
searchLinkToPublications,
searchLinkToDatasets,
searchLinkToSoftware,
searchLinkToOrps,
searchLinkToProjects,
searchLinkToDataProviders,
searchLinkToOrganizations,
searchLinkToAdvancedResults,
searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets
searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations,
errorLink
}
export class LinksResolver {
private static default: Links = {
searchLinkToResult: properties.searchLinkToResult,
searchLinkToPublication: properties.searchLinkToPublication,
searchLinkToProject: properties.searchLinkToProject,
searchLinkToDataProvider: properties.searchLinkToDataProvider,
searchLinkToDataset: properties.searchLinkToDataset,
searchLinkToSoftwareLanding: properties.searchLinkToSoftwareLanding,
searchLinkToOrp: properties.searchLinkToOrp,
searchLinkToOrganization: properties.searchLinkToOrganization,
searchLinkToResults: properties.searchLinkToResults,
searchLinkToPublications: properties.searchLinkToPublications,
searchLinkToDatasets: properties.searchLinkToDatasets,
searchLinkToSoftware: properties.searchLinkToSoftware,
searchLinkToOrps: properties.searchLinkToOrps,
searchLinkToDataProviders: properties.searchLinkToDataProviders,
searchLinkToProjects: properties.searchLinkToProjects,
searchLinkToOrganizations: properties.searchLinkToOrganizations,
searchLinkToAdvancedResults: properties.searchLinkToAdvancedResults,
searchLinkToAdvancedPublications: properties.searchLinkToAdvancedPublications,
searchLinkToAdvancedDatasets: properties.searchLinkToAdvancedDatasets,
searchLinkToAdvancedSoftware: properties.searchLinkToAdvancedSoftware,
searchLinkToAdvancedOrps: properties.searchLinkToAdvancedOrps,
searchLinkToAdvancedProjects: properties.searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders: properties.searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations: properties.searchLinkToAdvancedOrganizations,
errorLink: properties.errorLink
};
public static setProperties(alias: string) {
Object.keys(this.default).forEach(field => {
properties[field] = "/" + alias + (<string>this.default[field]);
});
}
public static resetProperties() {
Object.keys(this.default).forEach(field => {
properties[field] = this.default[field];
});
}
}

View File

@ -0,0 +1,28 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router";
@NgModule({
imports: [CommonModule, RouterModule.forChild([
// Search Pages
{ path: '', redirectTo: 'find/research-outcomes', pathMatch: 'full'},
{ path: 'find/research-outcomes', loadChildren: () => import('./searchPages/simple/searchResearchResults.module').then(m => m.MonitorSearchResearchResultsModule)},
{ path: 'find/projects', loadChildren: () => import('./searchPages/simple/searchProjects.module').then(m => m.MonitorSearchProjectsModule)},
{ path: 'find/dataproviders', loadChildren: () => import('./searchPages/simple/searchDataProviders.module').then(m => m.MonitorSearchDataProvidersModule)},
{ path: 'find/organizations', loadChildren: () => import('./searchPages/simple/searchOrganizations.module').then(m => m.MonitorSearchOrganizationsModule)},
// Advanced Search Pages
{ path: 'advanced/research-outcomes', loadChildren: () => import('./searchPages/advanced/searchResearchResults.module').then(m => m.MonitorAdvancedSearchResearchResultsModule)},
{ path: 'advanced/projects', loadChildren: () => import('./searchPages/advanced/searchProjects.module').then(m => m.MonitorAdvancedSearchProjectsModule)},
{ path: 'advanced/dataproviders', loadChildren: () => import('./searchPages/advanced/searchDataProviders.module').then(m => m.MonitorAdvancedSearchDataProvidersModule)},
{ path: 'advanced/organizations', loadChildren: () => import('./searchPages/advanced/searchOrganizations.module').then(m => m.MonitorAdvancedSearchOrganizationsModule)},
// Landing Pages
{ path: 'result', loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule), data: {hasMenuSearchBar: true}},
{ path: 'publication', loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule), data: {hasMenuSearchBar: true}},
{ path: 'dataset', loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule), data: {hasMenuSearchBar: true}},
{ path: 'software', loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule), data: {hasMenuSearchBar: true}},
{ path: 'other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule), data: {hasMenuSearchBar: true}},
{ path: 'project', loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule), data: {hasMenuSearchBar: true}},
{ path: 'dataprovider', loadChildren: () => import('./landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule), data: {hasMenuSearchBar: true}},
{ path: 'organization', loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule), data: {hasMenuSearchBar: true}},
])]
})
export class SearchModule {}

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import{MonitorAdvancedSearchDataprovidersComponent} from './searchDataproviders.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorAdvancedSearchDataprovidersComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchDataProvidersRoutingModule { }

View File

@ -0,0 +1,24 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {MonitorAdvancedSearchDataprovidersComponent} from './searchDataproviders.component';
import {SearchDataProvidersRoutingModule} from './searchDataProviders-routing.module';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchDataProvidersModule} from '../../../openaireLibrary/searchPages/searchDataProviders.module';
@NgModule({
imports: [
CommonModule, FormsModule,
SearchDataProvidersModule, SearchDataProvidersRoutingModule
],
declarations: [
MonitorAdvancedSearchDataprovidersComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorAdvancedSearchDataprovidersComponent
]
})
export class MonitorAdvancedSearchDataProvidersModule {
}

View File

@ -0,0 +1,61 @@
import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-advanced-search-dataproviders',
template: `
<search-dataproviders *ngIf="initialized" [simpleView]="false"
[customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink">
</search-dataproviders>
`
})
export class MonitorAdvancedSearchDataprovidersComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
showSwitchSearchLink: boolean = false;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
this.showSwitchSearchLink = true;
} else if (stakeholder.type === "funder") {
let value = stakeholder.index_id + "||" + stakeholder.index_name + "||" + stakeholder.index_shortName;
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
} else if (stakeholder.type === "ri") {
let value = stakeholder.index_id + "||" + stakeholder.index_name;
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
}
this.initialized = true;
}
}));
}
}));
}
}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import{MonitorAdvancedSearchOrganizationsComponent} from './searchOrganizations.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorAdvancedSearchOrganizationsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchOrganizationsRoutingModule { }

View File

@ -0,0 +1,57 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {Subscriber} from "rxjs";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-advanced-search-organizations',
template: `
<search-organizations *ngIf="initialized" [simpleView]="false" [showSwitchSearchLink]="false" [customFilter]="customFilter" [searchForm]="searchForm">
</search-organizations>
`
})
export class MonitorAdvancedSearchOrganizationsComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
initialized: boolean = false;
customFilter: SearchCustomFilter = null;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "funder") {
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
this.customFilter.isHiddenFilter = false;
} else if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
this.customFilter.isHiddenFilter = false;
} else if (stakeholder.type === "ri") {
let value = stakeholder.index_id+"||"+stakeholder.index_name;
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
this.customFilter.isHiddenFilter = false;
}
this.initialized = true;
}
}));
}
}));
}
}

View File

@ -0,0 +1,26 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchOrganizationsRoutingModule} from './searchOrganizations-routing.module';
import {MonitorAdvancedSearchOrganizationsComponent} from './searchOrganizations.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchOrganizationsModule} from "../../../openaireLibrary/searchPages/searchOrganizations.module";
@NgModule({
imports: [
CommonModule, FormsModule,
SearchOrganizationsRoutingModule, SearchOrganizationsModule
],
declarations: [
MonitorAdvancedSearchOrganizationsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorAdvancedSearchOrganizationsComponent
]
})
export class MonitorAdvancedSearchOrganizationsModule {
}

View File

@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorAdvancedSearchProjectsComponent} from './searchProjects.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorAdvancedSearchProjectsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchProjectsRoutingModule { }

View File

@ -0,0 +1,67 @@
import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-advanced-search-projects',
template: `
<search-projects *ngIf="initialized" [simpleView]="false"
[customFilter]=customFilter [hasPrefix]="false"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'"
[searchForm]="searchForm"
>
</search-projects>
`
})
export class MonitorAdvancedSearchProjectsComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
showSwitchSearchLink:boolean = false;
properties;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "funder") {
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
this.showSwitchSearchLink = true;
} else if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
this.showSwitchSearchLink = true;
} else if (stakeholder.type === "ri") {
let value = stakeholder.index_id+"||"+stakeholder.index_name;
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
}
this.initialized = true;
}
}));
}
}));
}
}

View File

@ -0,0 +1,24 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchProjectsRoutingModule} from './searchProjects-routing.module';
import {MonitorAdvancedSearchProjectsComponent} from './searchProjects.component';
import {SearchProjectsModule} from "../../../openaireLibrary/searchPages/searchProjects.module";
import {PreviousRouteRecorder} from "../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
@NgModule({
imports: [
CommonModule, FormsModule, SearchProjectsRoutingModule, SearchProjectsModule
],
declarations: [
MonitorAdvancedSearchProjectsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorAdvancedSearchProjectsComponent
]
})
export class MonitorAdvancedSearchProjectsModule {
}

View File

@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorAdvancedSearchResearchResultsComponent,} from './searchResearchResults.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorAdvancedSearchResearchResultsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchResearchResultsRoutingModule { }

View File

@ -0,0 +1,62 @@
import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-advanced-search-results',
template: `
<search-research-results *ngIf="initialized" resultType="result" [simpleView]="false"
[customFilter]=customFilter [hasPrefix]="false"
[includeOnlyResultsAndFilter]="false"
[showSwitchSearchLink]="true"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"
[searchForm]="searchForm"
></search-research-results>
`
})
export class MonitorAdvancedSearchResearchResultsComponent {
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
properties;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "funder") {
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
this.customFilter = new SearchCustomFilter("Funder", "relfunder", value, stakeholder.name);
} else if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, stakeholder.name);
} else if (stakeholder.type === "ri") {
let value = stakeholder.index_id+"||"+stakeholder.index_name;
this.customFilter = new SearchCustomFilter("Community", "community", value, stakeholder.name);
}
this.initialized = true;
}
}));
}
}));
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchResearchResultsRoutingModule} from './searchResearchResults-routing.module';
import {MonitorAdvancedSearchResearchResultsComponent} from './searchResearchResults.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchResearchResultsModule} from "../../../openaireLibrary/searchPages/searchResearchResults.module";
@NgModule({
imports: [
CommonModule, FormsModule,
SearchResearchResultsRoutingModule, SearchResearchResultsModule
],
declarations: [
MonitorAdvancedSearchResearchResultsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorAdvancedSearchResearchResultsComponent
]
})
export class MonitorAdvancedSearchResearchResultsModule {
}

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import{MonitorSearchDataprovidersComponent} from './searchDataproviders.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorSearchDataprovidersComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchDataProvidersRoutingModule { }

View File

@ -0,0 +1,24 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {MonitorSearchDataprovidersComponent} from './searchDataproviders.component';
import {SearchDataProvidersRoutingModule} from './searchDataProviders-routing.module';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchDataProvidersModule} from '../../../openaireLibrary/searchPages/searchDataProviders.module';
@NgModule({
imports: [
CommonModule, FormsModule,
SearchDataProvidersModule, SearchDataProvidersRoutingModule
],
declarations: [
MonitorSearchDataprovidersComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorSearchDataprovidersComponent
]
})
export class MonitorSearchDataProvidersModule {
}

View File

@ -0,0 +1,65 @@
import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
import {EnvProperties} from "../../../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'monitor-search-dataproviders',
template: `
<search-dataproviders *ngIf="initialized"
[customFilter]=customFilter [hasPrefix]="false" [searchForm]="searchForm"
[includeOnlyResultsAndFilter]="false" [showSwitchSearchLink]="showSwitchSearchLink">
</search-dataproviders>
`
})
export class MonitorSearchDataprovidersComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
showSwitchSearchLink: boolean = false;
public properties: EnvProperties = properties;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "funder") {
this.navigateToError();
} else if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
} else if (stakeholder.type === "ri") {
this.navigateToError();
}
this.initialized = true;
}
}));
}
}));
}
navigateToError() {
this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
}
}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import{MonitorSearchOrganizationsComponent} from './searchOrganizations.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorSearchOrganizationsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchOrganizationsRoutingModule { }

View File

@ -0,0 +1,42 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {ConfigurationService} from "../../../openaireLibrary/utils/configuration/configuration.service";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-search-organizations',
template: `
<search-organizations *ngIf="initialized" [searchForm]="searchForm">
</search-organizations>
`
})
export class MonitorSearchOrganizationsComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
initialized: boolean = false;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService, private configurationService: ConfigurationService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.initialized = true;
}
}));
}
}));
}
}

View File

@ -0,0 +1,26 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchOrganizationsRoutingModule} from './searchOrganizations-routing.module';
import {MonitorSearchOrganizationsComponent} from './searchOrganizations.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchOrganizationsModule} from "../../../openaireLibrary/searchPages/searchOrganizations.module";
@NgModule({
imports: [
CommonModule, FormsModule,
SearchOrganizationsRoutingModule, SearchOrganizationsModule
],
declarations: [
MonitorSearchOrganizationsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorSearchOrganizationsComponent
]
})
export class MonitorSearchOrganizationsModule {
}

View File

@ -0,0 +1,16 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorSearchProjectsComponent} from './searchProjects.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorSearchProjectsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchProjectsRoutingModule { }

View File

@ -0,0 +1,65 @@
import {Component, Input} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {SearchForm} from "../../../openaireLibrary/searchPages/searchUtils/newSearchPage.component";
@Component({
selector: 'monitor-search-projects',
template: `
<search-projects *ngIf="initialized"
[customFilter]=customFilter [hasPrefix]="false"
[includeOnlyResultsAndFilter]="false"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'"
[searchForm]="searchForm">
</search-projects>
`
})
export class MonitorSearchProjectsComponent {
@Input() searchForm: SearchForm = {class: 'search-form', dark: false};
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
properties;
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
if (stakeholder.type === "funder") {
let value = stakeholder.index_id+"||"+stakeholder.index_name+"||"+stakeholder.index_shortName;
this.customFilter = new SearchCustomFilter("Funder", "funder", value, "");
} else if (stakeholder.type === "organization") {
let value = stakeholder.index_id;
this.customFilter = new SearchCustomFilter("Organization", "relorganizationid", value, "");
} else if (stakeholder.type === "ri") {
this.navigateToError();
}
this.initialized = true;
}
}));
}
}));
}
navigateToError() {
this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.router.url}});
}
}

View File

@ -0,0 +1,24 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchProjectsRoutingModule} from './searchProjects-routing.module';
import {MonitorSearchProjectsComponent} from './searchProjects.component';
import {SearchProjectsModule} from "../../../openaireLibrary/searchPages/searchProjects.module";
import {PreviousRouteRecorder} from "../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
@NgModule({
imports: [
CommonModule, FormsModule, SearchProjectsRoutingModule, SearchProjectsModule
],
declarations: [
MonitorSearchProjectsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorSearchProjectsComponent
]
})
export class MonitorSearchProjectsModule {
}

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {MonitorSearchResearchResultsComponent} from './searchResearchResults.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MonitorSearchResearchResultsComponent, canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SearchResearchResultsRoutingModule { }

View File

@ -0,0 +1,85 @@
import {Component} from '@angular/core';
import {SearchCustomFilter} from "../../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute, Router} from "@angular/router";
import {StakeholderService} from "../../../openaireLibrary/monitor/services/stakeholder.service";
import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {CustomFilterService} from "../../../shared/customFilter.service";
@Component({
selector: 'monitor-search-results',
template: `
<div class=" uk-flex uk-flex-center ">
<div search-input [(value)]="keyword" [placeholder]="'Search research outputs'"
[searchInputClass]="'inner background'" (searchEmitter)="search()" class="uk-width-xlarge@l uk-width-large@m"></div>
</div>
<search-research-results *ngIf="customFilter" [customFilter]="customFilter" resultType="result"
[openaireLink]="'https://' + (properties.environment == 'production'?'':'beta.') + 'explore.openaire.eu/search/find/research-outcomes'"
[hasPrefix]="false"
[includeOnlyResultsAndFilter]="true" [showBreadcrumb]="false"
[showSwitchSearchLink]="false"
[searchForm]="{dark: false, class: 'search-form'}"></search-research-results>
`,
})
export class MonitorSearchResearchResultsComponent {
customFilter: SearchCustomFilter = null;
initialized: boolean = false;
properties;
keyword = "";
parameters = {};
constructor(private route: ActivatedRoute,
private router: Router,
private stakeholderService: StakeholderService,
private customFilterService: CustomFilterService) {
}
subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => {
if (params['stakeholder']) {
this.subscriptions.push((this.customFilterService.getCustomFilterAsObservable().subscribe(customFilter => {
this.customFilter = customFilter;
this.initialized = true;
})));
}else{
// TODO
}
}));
this.subscriptions.push(this.route.queryParams.subscribe(queryParams => {
this.parameters = Object.assign({}, queryParams);
this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"] ? queryParams["fv0"] : ""));
}));
}
search(){
this.prepareKeywordParam(this.keyword);
this.parameters["page"] = 1;
this.router.navigate([location.pathname], {queryParams: this.parameters});
}
private prepareKeywordParam(keyword){
if (this.parameters["q"]) {
delete this.parameters['q'];
delete this.parameters['op'];
}
if(keyword.length > 0){
this.parameters["fv0"] = keyword;
this.parameters["f0"] = "q";
}else if(keyword.length ==0 && this.parameters["f0"]=="q"){
delete this.parameters['f0'];
delete this.parameters['fv0'];
}
}
}

View File

@ -0,0 +1,26 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {SearchResearchResultsRoutingModule} from './searchResearchResults-routing.module';
import {MonitorSearchResearchResultsComponent} from './searchResearchResults.component';
import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {SearchResearchResultsModule} from "../../../openaireLibrary/searchPages/searchResearchResults.module";
import {SearchInputModule} from "../../../openaireLibrary/sharedComponents/search-input/search-input.module";
@NgModule({
imports: [
CommonModule, FormsModule,
SearchResearchResultsRoutingModule, SearchResearchResultsModule, SearchInputModule
],
declarations: [
MonitorSearchResearchResultsComponent
],
providers: [PreviousRouteRecorder],
exports: [
MonitorSearchResearchResultsComponent
]
})
export class MonitorSearchResearchResultsModule {
}

View File

@ -0,0 +1,48 @@
import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {BehaviorSubject, from, Observable, Subscriber} from "rxjs";
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
@Injectable({
providedIn: "root"
})
export class CustomFilterService {
private customFilterSubject: BehaviorSubject<SearchCustomFilter> = null;
private promise: Promise<void>;
private sub;
constructor(private http: HttpClient) {
this.customFilterSubject = new BehaviorSubject<SearchCustomFilter>(null);
}
ngOnDestroy() {
this.clearSubscriptions();
}
clearSubscriptions() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
async getCustomFilterAsync() {
if (this.promise) {
await this.promise;
this.promise = null;
}
this.clearSubscriptions();
return this.customFilterSubject.getValue();
}
getCustomFilterAsObservable(): Observable<SearchCustomFilter> {
return this.customFilterSubject.asObservable();
}
setCustomFilter(customFilter: SearchCustomFilter) {
this.customFilterSubject.next(customFilter);
}
}

View File

@ -14,7 +14,6 @@ let props: EnvProperties = {
piwikSiteId: "407",
enablePiwikTrack:false,
piwikBaseUrl: 'https://beta.analytics.openaire.eu/piwik.php?idsite=',
}
export let properties: EnvProperties = {
...common, ...commonDev, ...props