Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
81b175a5ea
|
@ -18,12 +18,12 @@ const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'rpo',
|
path: 'rpo',
|
||||||
loadChildren: () => import('./rpo/rpo.module').then(m => m.RpoModule),
|
loadChildren: () => import('./rpo/rpo.module').then(m => m.RpoModule),
|
||||||
data: {type: 'organization'}
|
data: {type: 'organization', title: Irish.METADATA_PREFIX}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'rfo',
|
path: 'rfo',
|
||||||
loadChildren: () => import('./rfo/rfo.module').then(m => m.RfoModule),
|
loadChildren: () => import('./rfo/rfo.module').then(m => m.RfoModule),
|
||||||
data: {type: 'funder'}
|
data: {type: 'funder', title: Irish.METADATA_PREFIX}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'researcher',
|
path: 'researcher',
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div *ngIf="!showLoading" class="uk-container uk-container-large">
|
<div *ngIf="!showLoading" class="uk-container uk-container-large">
|
||||||
<div class="uk-flex uk-flex-middle uk-flex-center">
|
<div class="uk-flex uk-flex-middle uk-flex-center">
|
||||||
<div search-input *ngIf="keywordControl" [searchControl]="keywordControl" searchInputClass="border-bottom" iconPosition="left"
|
<div search-input *ngIf="keywordControl" [searchControl]="keywordControl" searchInputClass="border-bottom" iconPosition="left"
|
||||||
placeholder="Search for {{typeAsLabel}} {{entities.stakeholders}}" [disabled]="stakeholders.length === 0" class="uk-width-1-2@m uk-width-1-1">
|
placeholder="Search for {{typeAsLabel}}s" [disabled]="stakeholders.length === 0" class="uk-width-1-2@m uk-width-1-1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-large-top">
|
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-large-top">
|
||||||
|
|
|
@ -9,6 +9,8 @@ import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
|
||||||
import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service";
|
import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service";
|
||||||
import {SearchResult} from "../../openaireLibrary/utils/entities/searchResult";
|
import {SearchResult} from "../../openaireLibrary/utils/entities/searchResult";
|
||||||
import {ResultPreview} from "../../openaireLibrary/utils/result-preview/result-preview";
|
import {ResultPreview} from "../../openaireLibrary/utils/result-preview/result-preview";
|
||||||
|
import {Observable, forkJoin, of} from "rxjs";
|
||||||
|
import {catchError} from "rxjs/operators";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'browse-repository',
|
selector: 'browse-repository',
|
||||||
|
@ -58,16 +60,30 @@ export class BrowseRepositoriesComponent extends BrowseStakeholderBaseComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
afterStakeholdersInitialized() {
|
afterStakeholdersInitialized() {
|
||||||
this.filteredStakeholders.slice((this.currentPage-1)*this.pageSize, this.currentPage*this.pageSize).forEach(item => {
|
let currentFilteredStakeholders = this.filteredStakeholders.slice((this.currentPage-1)*this.pageSize, this.currentPage*this.pageSize);
|
||||||
|
let obs: Array<Observable<any>> = new Array();
|
||||||
|
currentFilteredStakeholders.forEach(item => {
|
||||||
if(!item.details) {
|
if(!item.details) {
|
||||||
item.details = new ResultPreview();
|
this.showLoading = true;
|
||||||
item.details['title'] = {'name': item.name};
|
let ob = this.searchDataprovidersService.searchDataproviderById(item.index_id).pipe(
|
||||||
this.subscriptions.push(this.searchDataprovidersService.searchDataproviderById(item.index_id).subscribe(data => {
|
catchError(error => {
|
||||||
item.details = data[0];
|
let details: SearchResult = new SearchResult();
|
||||||
item.details['title']['name'] = item.name;
|
details['title'] = {'name': item.name, 'accessMode': ''};
|
||||||
|
details['entityType'] = "dataprovider";
|
||||||
|
return of([details]);
|
||||||
}));
|
}));
|
||||||
|
obs.push(ob);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.subscriptions.push(forkJoin(obs).subscribe(
|
||||||
|
data => {
|
||||||
|
data.forEach((item, index) => {
|
||||||
|
currentFilteredStakeholders[index].details = item[0];
|
||||||
|
currentFilteredStakeholders[index].details['title']['name'] = currentFilteredStakeholders[index].name;
|
||||||
|
});
|
||||||
|
this.showLoading = false;
|
||||||
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultPreview(result: SearchResult): ResultPreview {
|
public getResultPreview(result: SearchResult): ResultPreview {
|
||||||
|
|
|
@ -9,11 +9,11 @@ import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholde
|
||||||
import {CustomFilterService} from "../shared/customFilter.service";
|
import {CustomFilterService} from "../shared/customFilter.service";
|
||||||
import {LinksResolver} from "../search/links-resolver";
|
import {LinksResolver} from "../search/links-resolver";
|
||||||
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
||||||
|
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'repository',
|
selector: 'repository',
|
||||||
template: `
|
template: `
|
||||||
<div class="datasource">
|
|
||||||
<loading *ngIf="loading" class="uk-position-center"></loading>
|
<loading *ngIf="loading" class="uk-position-center"></loading>
|
||||||
<div *ngIf="!loading">
|
<div *ngIf="!loading">
|
||||||
<div class="uk-banner">
|
<div class="uk-banner">
|
||||||
|
@ -44,7 +44,6 @@ import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/sea
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class RepositoryComponent extends StakeholderBaseComponent implements OnInit {
|
export class RepositoryComponent extends StakeholderBaseComponent implements OnInit {
|
||||||
|
@ -54,6 +53,7 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
|
|
||||||
constructor(private stakeholderService: StakeholderService,
|
constructor(private stakeholderService: StakeholderService,
|
||||||
|
private layoutService: LayoutService,
|
||||||
private _customFilterService: CustomFilterService,
|
private _customFilterService: CustomFilterService,
|
||||||
protected _router: Router,
|
protected _router: Router,
|
||||||
protected _route: ActivatedRoute,
|
protected _route: ActivatedRoute,
|
||||||
|
@ -68,6 +68,7 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.layoutService.setRootClass('datasource');
|
||||||
this.title = 'Repository Monitors';
|
this.title = 'Repository Monitors';
|
||||||
this.description = 'Repository Monitors';
|
this.description = 'Repository Monitors';
|
||||||
this.setMetadata();
|
this.setMetadata();
|
||||||
|
|
|
@ -68,6 +68,9 @@ export class RfoComponent extends StakeholderBaseComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.layoutService.setRootClass('funder');
|
this.layoutService.setRootClass('funder');
|
||||||
|
this.title = 'RFOs';
|
||||||
|
this.description = 'RFOs';
|
||||||
|
this.setMetadata();
|
||||||
this.params.subscribe(params => {
|
this.params.subscribe(params => {
|
||||||
this._customFilterService.setCustomFilter(null);
|
this._customFilterService.setCustomFilter(null);
|
||||||
this.alias = params['stakeholder'];
|
this.alias = params['stakeholder'];
|
||||||
|
|
|
@ -68,6 +68,9 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.layoutService.setRootClass('organization');
|
this.layoutService.setRootClass('organization');
|
||||||
|
this.title = 'RPOs';
|
||||||
|
this.description = 'RPOs';
|
||||||
|
this.setMetadata();
|
||||||
this.params.subscribe(params => {
|
this.params.subscribe(params => {
|
||||||
this._customFilterService.setCustomFilter(null);
|
this._customFilterService.setCustomFilter(null);
|
||||||
this.alias = params['stakeholder'];
|
this.alias = params['stakeholder'];
|
||||||
|
|
|
@ -54,7 +54,6 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent imp
|
||||||
this.filteredStakeholders = stakeholders;
|
this.filteredStakeholders = stakeholders;
|
||||||
this.filteredStakeholders.sort((a, b) => a['name'].localeCompare(b['name']));
|
this.filteredStakeholders.sort((a, b) => a['name'].localeCompare(b['name']));
|
||||||
this.filtering(this.keywordControl.value);
|
this.filtering(this.keywordControl.value);
|
||||||
this.showLoading = false;
|
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
|
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
|
||||||
this.filtering(value);
|
this.filtering(value);
|
||||||
|
@ -112,5 +111,6 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent imp
|
||||||
|
|
||||||
afterStakeholdersInitialized() {
|
afterStakeholdersInitialized() {
|
||||||
// this is a method that will be overriden from the components extending this base component, if needed
|
// this is a method that will be overriden from the components extending this base component, if needed
|
||||||
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue