Lazy Routing in search results added (search publications -> link to publication landing with lazy routing) | Deposit Result page: uncomment search-result component | utils/showDataProviders.component.ts file not used (possibly it should be deleted)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45898 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
e60899bdcc
commit
78e67c04d3
|
@ -9,13 +9,16 @@ import { DepositResultComponent } from './depositResult.component';
|
|||
import {EntitiesAutocompleteModule} from '../utils/entitiesAutoComplete/entitiesAutoComplete.module';
|
||||
import {DataProvidersServiceModule} from '../services/dataProvidersService.module';
|
||||
import {OrganizationServiceModule} from '../services/organizationService.module';
|
||||
import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
EntitiesAutocompleteModule,
|
||||
DataProvidersServiceModule,
|
||||
OrganizationServiceModule
|
||||
OrganizationServiceModule,
|
||||
SearchResultsModule
|
||||
],
|
||||
declarations: [
|
||||
DepositComponent,
|
||||
|
|
|
@ -39,7 +39,10 @@ import {OrganizationService} from '../services/organization.service';
|
|||
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p>
|
||||
<!--showDataProviders [dataProviders]=dataProviders></showDataProviders-->
|
||||
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
||||
<!--search-result [(results)]="fetchDataproviders.results" [(status)]= "fetchDataproviders.searchUtils.status"></search-result-->
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.searchUtils.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -50,7 +53,7 @@ import {OrganizationService} from '../services/organization.service';
|
|||
An error occured.
|
||||
</span>
|
||||
No data providers found for institution:
|
||||
<a *ngIf="organization['url']!=''" href="{{organization.url}}">
|
||||
<a *ngIf="organization['url']!=''" target="_blank" href="{{organization.url}}">
|
||||
<span>{{organization['name']}}</span>
|
||||
</a>
|
||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||
|
|
|
@ -17,7 +17,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDatasets.results" [(status)]= "fetchDatasets.searchUtils.status"></search-result>
|
||||
<search-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.searchUtils.status"
|
||||
type="dataset" urlParam="datasetId">
|
||||
</search-result>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -17,7 +17,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDataproviders.results" [(status)]= "fetchDataproviders.status"></search-result>
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
</search-result>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -18,7 +18,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchProjects.results" [(status)]= "fetchProjects.status"></search-result>
|
||||
<search-result [(results)]="fetchProjects.results"
|
||||
[(status)]= "fetchProjects.status"
|
||||
type="project" urlParam="projectId">
|
||||
</search-result>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -17,7 +17,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchPublications.results" [(status)]= "fetchPublications.status"></search-result>
|
||||
<search-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.status"
|
||||
type="publication" urlParam="articleId">
|
||||
</search-result>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -126,7 +126,10 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDataproviders.results" [(status)]= "fetchDataproviders.status"></search-result>
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
</search-result>
|
||||
</div>
|
||||
</li>
|
||||
<!--li id="metricsTab">
|
||||
|
|
|
@ -48,7 +48,10 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchPublications.results" [(status)]= "fetchPublications.searchUtils.status"></search-result>
|
||||
<search-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.searchUtils.status"
|
||||
type="publication" urlParam="articleId">
|
||||
</search-result>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -64,7 +67,10 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDatasets.results" [(status)]= "fetchDatasets.status"></search-result>
|
||||
<search-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.status"
|
||||
type="dataset" urlParam="datasetId">
|
||||
</search-result>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -96,7 +96,10 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchPublications.results" [(status)]= "fetchPublications.searchUtils.status"></search-result>
|
||||
<search-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.searchUtils.status"
|
||||
type="publication" urlParam="articleId">
|
||||
</search-result>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -112,7 +115,10 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDatasets.results" [(status)]= "fetchDatasets.searchUtils.status"></search-result>
|
||||
<search-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.searchUtils.status"
|
||||
type="dataset" urlParam="datasetId">
|
||||
</search-result>
|
||||
</div>
|
||||
</li>
|
||||
<li id="statisticsTab">
|
||||
|
|
|
@ -21,7 +21,6 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
})
|
||||
|
||||
|
|
|
@ -15,11 +15,13 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
|
|||
selector: 'search-dataproviders',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Compatible Dataproviders" type="datasources" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
|
||||
(downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="resources">
|
||||
<search-page pageTitle="Compatible Dataproviders"
|
||||
type="datasources" entityType="dataprovider" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" [showResultCount]=false
|
||||
(queryChange)="queryChanged($event)"
|
||||
(downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="resources">
|
||||
</search-page>
|
||||
<!--table-view [(datasources)] = results></table-view-->
|
||||
|
||||
|
|
|
@ -15,9 +15,11 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
|
|||
selector: 'search-entity-registries',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Entity Registries" type="datasources" [(filters)] = "filters"
|
||||
<search-page pageTitle="Entity Registries"
|
||||
type="datasources" entityType="dataprovider" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
|
||||
[baseUrl] = "baseUrl" [showResultCount]=false
|
||||
(queryChange)="queryChanged($event)"
|
||||
(downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="resources">
|
||||
</search-page>
|
||||
|
|
|
@ -77,7 +77,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="pubsTab" class="uk-active">
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchPublications.results" [(status)]= "fetchPublications.status"></search-result>
|
||||
<search-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.status"
|
||||
type="publication" urlParam="articleId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" >
|
||||
<browse-entities entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
|
@ -86,7 +89,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="dataTab">
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDatasets.results" [(status)]= "fetchDatasets.status"></search-result>
|
||||
<search-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.status"
|
||||
type="dataset" urlParam="datasetId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='datasets'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
|
@ -95,7 +101,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="projectsTab" >
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchProjects.results" [(status)]= "fetchProjects.status"></search-result>
|
||||
<search-result [(results)]="fetchProjects.results"
|
||||
[(status)]= "fetchProjects.status"
|
||||
type="project" urlParam="projectId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='projects'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="project" baseUrl="/search/find/projects" [refineFields]=searchFields.PROJECT_REFINE_FIELDS></browse-entities>
|
||||
|
@ -104,7 +113,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="dataProviderTab">
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDataproviders.results" [(status)]= "fetchDataproviders.status"></search-result>
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='dataproviders'" class ="uk-animation-fade" >
|
||||
<browse-entities entityName="dataprovider" baseUrl="/search/find/dataproviders" [refineFields]=searchFields.DATASOURCE_REFINE_FIELDS></browse-entities>
|
||||
|
@ -113,7 +125,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="organizationsTab" >
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchOrganizations.results" [(status)]= "fetchOrganizations.status"></search-result>
|
||||
<search-result [(results)]="fetchOrganizations.results"
|
||||
[(status)]= "fetchOrganizations.status"
|
||||
type="organization" urlParam="organizationId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='organizations'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="organization" baseUrl="/search/find/organizations" [refineFields]=searchFields.ORGANIZATION_REFINE_FIELDS></browse-entities>
|
||||
|
@ -122,7 +137,10 @@ import {SearchFields} from '../../utils/properties/searchFields';
|
|||
<li id="peopleTab">
|
||||
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
|
||||
<div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchPeople.results" [(status)]= "fetchPeople.status"></search-result>
|
||||
<search-result [(results)]="fetchPeople.results"
|
||||
[(status)]= "fetchPeople.status"
|
||||
type="person" urlParam="personId">
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='people'" class ="uk-animation-fade">
|
||||
<div class="uk-alert uk-alert-info " role="alert">No person statistics found</div>
|
||||
|
|
|
@ -43,7 +43,11 @@ import {StringUtils} from '../../utils/string-utils.class';
|
|||
|
||||
<!--/div-->
|
||||
<div>
|
||||
<search-result [results]="results" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
|
||||
<search-result [results]="results"
|
||||
[status]=searchUtils.status
|
||||
[page]="searchUtils.page"
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
</search-result>
|
||||
</div>
|
||||
<!--/div>
|
||||
</div-->
|
||||
|
@ -67,6 +71,7 @@ export class AdvancedSearchPageComponent {
|
|||
@Input() csvParams: string;
|
||||
@Input() csvPath: string;
|
||||
|
||||
public urlParam: string;
|
||||
public baseURLWithParameters:string = '';
|
||||
|
||||
@Output() queryChange = new EventEmitter();
|
||||
|
@ -75,8 +80,26 @@ export class AdvancedSearchPageComponent {
|
|||
|
||||
ngOnInit() {
|
||||
this.updateBaseUrlWithParameters();
|
||||
this.defineUrlParam();
|
||||
// this.searchUtils.totalResults = this.results.length;
|
||||
}
|
||||
|
||||
private defineUrlParam() {
|
||||
if(this.entityType == "publication") {
|
||||
this.urlParam = "articleId";
|
||||
} else if(this.entityType == "dataset") {
|
||||
this.urlParam = "datasetId";
|
||||
} else if(this.entityType == "project") {
|
||||
this.urlParam = "projectId";
|
||||
} else if(this.entityType == "organization") {
|
||||
this.urlParam = "organizationId";
|
||||
} else if(this.entityType == "person") {
|
||||
this.urlParam = "personId";
|
||||
} else {
|
||||
this.urlParam = "datasourceId";
|
||||
}
|
||||
}
|
||||
|
||||
public getSelectedFiltersFromUrl(params){
|
||||
for(var i=0; i< this.fieldIds.length ; i++){
|
||||
|
||||
|
|
|
@ -41,7 +41,12 @@ import {ModalLoading} from '../../utils/modal/loading.component';
|
|||
<div class="uk-width-large-3-4 uk-width-medium-3-4 uk-width-small-1-1" >
|
||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
|
||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
||||
<search-result [results]="results" [totalResults]="searchUtils.totalResults" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
|
||||
<search-result [results]="results"
|
||||
[totalResults]="searchUtils.totalResults"
|
||||
[status]=searchUtils.status
|
||||
[page]="searchUtils.page"
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
</search-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,7 +56,12 @@ import {ModalLoading} from '../../utils/modal/loading.component';
|
|||
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
|
||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
|
||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
||||
<search-result [results]="results" [totalResults]="searchUtils.totalResults" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
|
||||
<search-result [results]="results"
|
||||
[totalResults]="searchUtils.totalResults"
|
||||
[status]=searchUtils.status
|
||||
[page]="searchUtils.page"
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
</search-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -65,6 +75,7 @@ export class SearchPageComponent {
|
|||
@Input() results = [];
|
||||
@Input() filters = [];
|
||||
@Input() type:string = "";
|
||||
@Input() entityType: string = "aaa";
|
||||
@Input() searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||
@Output() queryChange = new EventEmitter();
|
||||
@Output() downloadClick = new EventEmitter();
|
||||
|
@ -81,17 +92,36 @@ export class SearchPageComponent {
|
|||
private baseURLWithParameters:string = '';
|
||||
private sub: any;
|
||||
public countFilters= 0;
|
||||
public urlParam: string;
|
||||
constructor (private location: Location ) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.updateBaseUrlWithParameters(this.filters);
|
||||
this.defineUrlParam();
|
||||
//console.info(this.entityType + " " + this.urlParam);
|
||||
}
|
||||
ngAfterViewChecked(){
|
||||
|
||||
}
|
||||
|
||||
private defineUrlParam() {
|
||||
if(this.entityType == "publication") {
|
||||
this.urlParam = "articleId";
|
||||
} else if(this.entityType == "dataset") {
|
||||
this.urlParam = "datasetId";
|
||||
} else if(this.entityType == "project") {
|
||||
this.urlParam = "projectId";
|
||||
} else if(this.entityType == "organization") {
|
||||
this.urlParam = "organizationId";
|
||||
} else if(this.entityType == "person") {
|
||||
this.urlParam = "personId";
|
||||
} else {
|
||||
this.urlParam = "datasourceId";
|
||||
}
|
||||
}
|
||||
|
||||
public getQueryParametersFromUrl(params){
|
||||
//TODO when final search is done-allFqs/fq
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
|
||||
@Component({
|
||||
selector: 'search-result',
|
||||
|
@ -13,7 +14,9 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
|||
|
||||
<li *ngFor="let result of results" class="uk-animation-fade">
|
||||
<h4 [class] = result.title.accessMode [title] = result.title.accessMode >
|
||||
<a href="{{result['title'].url}}">
|
||||
<!--a href="{{result['title'].url}}"-->
|
||||
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
|
||||
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||
[innerHTML]="result['title'].name">
|
||||
</p>
|
||||
|
@ -27,6 +30,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
|||
<span *ngIf="result['authors'] != undefined">
|
||||
<span *ngFor="let author of result['authors'].slice(0,15)">
|
||||
<a href="{{author['url']}}">
|
||||
<!--a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}"-->
|
||||
{{author['name']}};
|
||||
</a>
|
||||
</span>
|
||||
|
@ -126,16 +130,16 @@ export class SearchResultComponent {
|
|||
@Input() totalResults: number;
|
||||
@Input() results: SearchResult[];
|
||||
@Input() status: number;
|
||||
errorCodes:ErrorCodes = new ErrorCodes();
|
||||
@Input() type: string;
|
||||
@Input() urlParam: string;
|
||||
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public errorMessage: string = "No results found";
|
||||
|
||||
constructor () {
|
||||
constructor () {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.info("Heeey!!");
|
||||
}
|
||||
ngOnInit() {}
|
||||
}
|
||||
|
|
|
@ -7,10 +7,12 @@ import {SearchResult} from '../../utils/entities/searchResult';
|
|||
// import {SearchDownloadComponent} from './searchDownload.component';
|
||||
import {SearchResultComponent} from './searchResult.component';
|
||||
// import{PagingModule} from '../../utils/paging.module';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule
|
||||
CommonModule, FormsModule,
|
||||
RouterModule
|
||||
// ,PagingModule
|
||||
],
|
||||
declarations: [
|
||||
|
|
|
@ -14,7 +14,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
selector: 'search-dataproviders',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search Dataproviders" type="data providers" [(filters)] = "filters"
|
||||
<search-page pageTitle="Search Dataproviders"
|
||||
type="data providers" entityType="dataprovider" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
|
||||
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="datasources">
|
||||
|
|
|
@ -15,7 +15,8 @@ import {DOI} from '../../utils/string-utils.class';
|
|||
selector: 'search-datasets',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search Datasets" type="datasets" [(filters)] = "filters"
|
||||
<search-page pageTitle="Search Datasets"
|
||||
type="datasets" entityType="dataset" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="datasets">
|
||||
|
|
|
@ -13,7 +13,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
selector: 'search-organizations',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search Organizations" type="organizations" [(filters)] = "filters"
|
||||
<search-page pageTitle="Search Organizations"
|
||||
type="organizations" entityType="organization" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="organizations">
|
||||
|
|
|
@ -15,7 +15,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
selector: 'search-people',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search People" type="people" [(filters)] = "filters"
|
||||
<search-page pageTitle="Search People"
|
||||
type="people" entityType="person" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false
|
||||
[csvParams]="csvParams" csvPath="people">
|
||||
|
|
|
@ -13,7 +13,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
selector: 'search-projects',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search Projects" type="projects" [(filters)] = "filters"
|
||||
<search-page pageTitle="Search Projects"
|
||||
type="projects" entityType="project" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="projects">
|
||||
|
|
|
@ -17,7 +17,8 @@ import {DOI} from '../../utils/string-utils.class';
|
|||
selector: 'search-publications',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search Publications" type="publications"
|
||||
<search-page pageTitle="Search Publications"
|
||||
type="publications" entityType="publication"
|
||||
[(filters)] = "filters" [(results)] = "results"
|
||||
[(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl
|
||||
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
|
||||
|
@ -194,7 +195,7 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
|
|||
|
||||
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
||||
this.csvParams = parameters;
|
||||
|
||||
|
||||
if(!refine && !this.searchPage){
|
||||
this.searchPage = new SearchPageComponent(this._location);
|
||||
}
|
||||
|
|
|
@ -247,12 +247,13 @@ export class SearchDataprovidersService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
|
||||
result['title'].name = resData.officialname;
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToDataProvider();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToDataProvider();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
result['type'] = this.getDataproviderType(resData);
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ export class SearchDatasetsService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
|
||||
if(Array.isArray(resData['title'])) {
|
||||
result['title'].name = resData['title'][0].content;
|
||||
|
@ -139,8 +139,8 @@ export class SearchDatasetsService {
|
|||
result['title'].name = resData['title'].content;
|
||||
}
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToDataset();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToDataset();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
if(resData['bestlicense'].hasOwnProperty("classid")) {
|
||||
result['title'].accessMode = resData['bestlicense'].classid;
|
||||
|
|
|
@ -97,15 +97,16 @@ export class SearchOrganizationsService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
|
||||
result['title'].name = resData.legalshortname;
|
||||
if(result['title'].name == '') {
|
||||
result['title'].name = resData.legalname;
|
||||
}
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToOrganization();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToOrganization();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
if(resData['rels'].hasOwnProperty("rel")) {
|
||||
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
|
||||
|
|
|
@ -75,12 +75,13 @@ export class SearchPeopleService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
|
||||
result['title'].name = resData.fullname;
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToPerson();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToPerson();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
results.push(result);
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ export class SearchProjectsService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
if(Array.isArray(resData['title'])) {
|
||||
// resData['title'][0].hasOwnProperty("content") {
|
||||
result['title'].name = resData['title'][0];
|
||||
|
@ -142,8 +142,9 @@ export class SearchProjectsService {
|
|||
// if(resData['title'].hasOwnProperty("content")) {
|
||||
// result['title'].name = resData['title'].content;
|
||||
// }
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToProject();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToProject();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
if(resData['rels'].hasOwnProperty("rel")) {
|
||||
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
|
||||
|
|
|
@ -195,7 +195,7 @@ export class SearchPublicationsService {
|
|||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
result['title'] = {"name": '', "accessMode": ''};
|
||||
|
||||
if(Array.isArray(resData['title'])) {
|
||||
// resData['title'][0].hasOwnProperty("content") {
|
||||
|
@ -207,8 +207,8 @@ export class SearchPublicationsService {
|
|||
// }
|
||||
}
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToPublication();
|
||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
//result['title'].url = OpenaireProperties.getsearchLinkToPublication();
|
||||
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
if(resData['bestlicense'].hasOwnProperty("classid")) {
|
||||
result['title'].accessMode = resData['bestlicense'].classid;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export class SearchResult {
|
||||
title: { "name": string, "url": string, "accessMode": string};
|
||||
title: { "name": string, "accessMode": string};
|
||||
id:string;
|
||||
DOI:string;
|
||||
//publications & organizations:
|
||||
|
|
|
@ -51,6 +51,7 @@ import {Component, Input} from '@angular/core';
|
|||
`
|
||||
})
|
||||
|
||||
// Possibly should be deleted. Not used anywhere.
|
||||
export class ShowDataProvidersComponent {
|
||||
@Input() dataProviders: { "name": string, "url": string, "type": string, "websiteUrl": string,
|
||||
"organizations": {"name": string, "url": string}[]}[];
|
||||
|
|
Loading…
Reference in New Issue