Merge branch 'master' of code-repo.d4science.org:MaDgIK/irish-monitor

This commit is contained in:
Konstantinos Triantafyllou 2023-11-13 15:00:56 +02:00
commit aada970077
4 changed files with 19 additions and 7 deletions

View File

@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {Irish} from "./shared/irish";
import {ErrorPageComponent} from "./openaireLibrary/error/errorPage.component";
const routes: Routes = [
{
@ -30,6 +31,8 @@ const routes: Routes = [
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
data: {title: Irish.METADATA_PREFIX + ' Admin | '},
},
{path: 'error', component: ErrorPageComponent},
{path: '**', pathMatch: 'full', component: ErrorPageComponent}
];
@NgModule({

View File

@ -66,7 +66,6 @@ export class ResearcherComponent extends BaseComponent implements OnInit {
if(this.authorId) {
LinksResolver.resetProperties();
LinksResolver.setSearchAndResultLanding("researcher/"+this.authorId);
console.log(properties.searchLinkToPublication);
this.subscriptions.push(this._searchOrcidService.searchOrcidSingleAuthor(this.authorId, properties, true).subscribe(data => {
this.author = data;
this._customFilterService.setCustomFilter(
@ -76,6 +75,8 @@ export class ResearcherComponent extends BaseComponent implements OnInit {
// TODO not correct id/ no author // no irish author?
}, err => {
this._router.navigate([properties.errorLink]);
}));
}
});

View File

@ -1,6 +1,6 @@
<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>
[searchInputClass]="'inner background'" (searchEmitter)="keywordChanged()" class="uk-width-xlarge@l uk-width-large@m"></div>
</div>
<div class="uk-margin-top">

View File

@ -7,7 +7,7 @@ import {SearchResearchResultsService} from "../../openaireLibrary/services/searc
import {forkJoin, Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
import {BaseComponent} from "../../openaireLibrary/sharedComponents/base/base.component";
import {Router} from "@angular/router";
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";
@ -33,6 +33,8 @@ export class SearchResearcherComponent extends BaseComponent implements OnInit
constructor(private _searchOrcidService: SearchOrcidService,
private _searchResearchResultsService: SearchResearchResultsService,
protected _router: Router,
protected _route: ActivatedRoute,
protected seoService: SEOService,
protected _piwikService: PiwikService,
protected _title: Title,
@ -43,10 +45,12 @@ export class SearchResearcherComponent extends BaseComponent implements OnInit
this.title = 'Researcher Monitors';
this.description = 'Researcher Monitors';
this.setMetadata();
if (this.keyword != null && this.keyword.length > 0) {
this.search();
}
this.subscriptions.push(this._route.queryParams.subscribe(params => {
if (params['keyword']) {
this.keyword = params['keyword'];
this.search();
}
}));
}
ngOnDestroy() {
@ -56,6 +60,10 @@ export class SearchResearcherComponent extends BaseComponent implements OnInit
}
});
}
keywordChanged(){
this._router.navigate(['/researcher'], {queryParams: {keyword:this.keyword}});
}
search() {
//uncomment to disable search with no keyword
if (this.keyword.length == 0) {