[Library | Trunk]

Search:
1. advanced link in home and /search/find
2. DOI issue in /search/find/
3. update of numbers in tabs when there is an error in /search/find/
4. order of filters in search outcomes
5. In Landingpages:  rename "Publication Summary" --> "Summary" kai "Related outcomes" --> "Related research"

Linking:
get communities but not hidden ones



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59003 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-06-29 11:10:32 +00:00
parent 8cbb28284c
commit 1b576e5a40
14 changed files with 76 additions and 34 deletions

View File

@ -18,7 +18,7 @@ export class ContextsService {
public getPublicCommunities( apiUrl:string):any {
let url = apiUrl + 's/';
return this.http.get(url)
.pipe(map(res => this.parseCommunities(res, true) ));
.pipe(map(res => this.parseCommunities(res, false) ));
}
parseCommunities(data, getall){
var communities = [];

View File

@ -591,7 +591,7 @@
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
<!-- [class]="(firstTab === 'summary')?'uk-active':''">-->
<my-tab
[tabTitle]="'Project Summary'" [tabId]="'summary'"
tabTitle="Summary" [tabId]="'summary'"
class="uk-active">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
@ -637,7 +637,7 @@
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
<!-- [class]="(firstTab === 'summary')?'uk-active':''"-->
<my-tab
[tabTitle]="'Project Summary'" [tabId]="'summary'"
tabTitle="Summary" [tabId]="'summary'"
class="uk-active">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
@ -750,4 +750,4 @@
</div>
<modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert>
<modal-alert #AlertModalCsvError></modal-alert>

View File

@ -314,7 +314,7 @@
<div
*ngIf="resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0"
class="uk-margin-bottom">
<h5>Related Outcomes</h5>
<h5>Related research</h5>
<no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateRelatedPage($event)"
@ -399,7 +399,7 @@
<my-tabs>
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
<!-- [class]="(activeTab === 'summary')?'uk-active':''"-->
<my-tab [tabTitle]="getTypeName() + ' Summary'"
<my-tab tabTitle="Summary"
[tabId]="'summary'" class="uk-active">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
@ -419,7 +419,7 @@
<!-- [class]="(activeTab === 'related')?'uk-active':''"-->
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
[tabTitle]="'Related outcomes'" [tabId]="'related'"
[tabTitle]="'Related research'" [tabId]="'related'"
[tabNumber]="relatedResultsNum">
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
</my-tab>
@ -432,7 +432,7 @@
<my-small-tabs>
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
<!-- [class]="(activeTab === 'summary')?'uk-active':''"-->
<my-tab [tabTitle]="getTypeName() + ' Summary'"
<my-tab tabTitle="Summary"
[tabId]="'summary'" class="uk-active">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
@ -452,7 +452,7 @@
<!-- [class]="(activeTab === 'related')?'uk-active':''"-->
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
[tabTitle]="'Related outcomes'" [tabId]="'related'"
[tabTitle]="'Related research'" [tabId]="'related'"
[tabNumber]="relatedResultsNum">
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
</my-tab>

View File

@ -18,7 +18,7 @@
[isDisabled]="disableForms"
[simpleView]="true" [formPlaceholderText]="formPlaceholderText"
[selectedFields]="selectedFields"
[selectedFields]="selectedFields" [showAdvancedSearchLink]="true"
[fieldIdsMap]="fieldIdsMap" [fieldIds]="fieldIds" [entitiesSelection]="true" [customFilter]="customFilter"
>
</advanced-search-form>
@ -79,17 +79,17 @@
(searchPageUpdates)="activeEntityUpdate($event)" [showAdvancedSearchLink]="false"
simpleSearchLink="/search/find"></search-research-results>
<search-projects *ngIf="activeEntity == 'projects'" [includeOnlyResultsAndFilter]="true"
<search-projects *ngIf="activeEntity == 'projects'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
(searchPageUpdates)="activeEntityUpdate($event)"
simpleSearchLink="/search/find">
</search-projects>
<search-organizations *ngIf="activeEntity == 'organizations'" [includeOnlyResultsAndFilter]="true"
<search-organizations *ngIf="activeEntity == 'organizations'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
(searchPageUpdates)="activeEntityUpdate($event)"
simpleSearchLink="/search/find">
</search-organizations>
<search-dataproviders *ngIf="activeEntity == 'datasources'" [includeOnlyResultsAndFilter]="true"
<search-dataproviders *ngIf="activeEntity == 'datasources'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
(searchPageUpdates)="activeEntityUpdate($event)"
simpleSearchLink="/search/find">
</search-dataproviders>

View File

@ -409,6 +409,7 @@ export class SearchAllComponent {
//console.log(err);
this.handleError("Error getting number of Projects", err);
this.fetchProjects.searchUtils.status = this.errorCodes.ERROR;
this.fetchProjects.searchUtils.totalResults = null;
}
);
}
@ -428,6 +429,7 @@ export class SearchAllComponent {
//console.log(err);
this.handleError("Error getting number of Projects", err);
this.fetchDataproviders.searchUtils.status = this.errorCodes.ERROR;
this.fetchDataproviders.searchUtils.totalResults = null;
}
);
}
@ -447,6 +449,7 @@ export class SearchAllComponent {
//console.log(err);
this.handleError("Error getting number of Organizations", err);
this.fetchOrganizations.searchUtils.status = this.errorCodes.ERROR;
this.fetchOrganizations.searchUtils.totalResults = null;
}
);
@ -467,6 +470,7 @@ export class SearchAllComponent {
err => {
this.handleError("Error getting number of research results", err);
fetchClass.searchUtils.status = this.errorCodes.ERROR;
fetchClass.searchUtils.totalResults = null;
}
);
}
@ -488,7 +492,8 @@ export class SearchAllComponent {
activeEntityUpdate($event) {
this.disableForms = $event.disableForms;
let updated = true;
let updated = true
console.debug($event)
if (this.activeEntity == "result") {
if($event.searchUtils.status!=this.errorCodes.LOADING) {
this.fetchPublications.searchUtils.totalResults = $event.searchUtils.totalResults;

View File

@ -32,7 +32,7 @@ import {DatasourcesHelperClass} from "./searchUtils/datasourcesHelper.class";
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
[searchFormClass]="type!='deposit'?'datasourcesSearchForm':''"
[entitiesSelection]="type=='all'" [showAdvancedSearchLink]="type=='all'"
[entitiesSelection]="type=='all'" [showAdvancedSearchLink]="showAdvancedSearchLink"
[filters]="filters"
[simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..."
[showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'"
@ -79,6 +79,7 @@ export class SearchDataProvidersComponent {
@Input() openaireLink: string;
@Input() includeOnlyResultsAndFilter: boolean = false;
@Output() searchPageUpdates = new EventEmitter();
@Input() showAdvancedSearchLink:boolean;
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
this.results =[];
this.errorCodes = new ErrorCodes();
@ -88,6 +89,9 @@ export class SearchDataProvidersComponent {
ngOnInit() {
this.refineFields = DatasourcesHelperClass.getrefineFields(this.type);
this.pageTitle = DatasourcesHelperClass.getTitle(this.type);
if(this.showAdvancedSearchLink == null){
this.showAdvancedSearchLink = (this.type == "all");
}
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties= data.envSpecific;

View File

@ -31,7 +31,7 @@ import {NewSearchPageComponent} from "./searchUtils/newSearchPage.component";
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
[sort]="false"
[filters]="filters"
[simpleView]="simpleView" formPlaceholderText="Search by organization name..."
[simpleView]="simpleView" formPlaceholderText="Search by organization name..." [showAdvancedSearchLink]="showAdvancedSearchLink"
>
</new-search-page>
`
@ -67,7 +67,9 @@ export class SearchOrganizationsComponent {
@Input() openaireLink: string;
@Input() includeOnlyResultsAndFilter: boolean = false;
@Output() searchPageUpdates = new EventEmitter();
public resourcesQuery = "(oaftype exact organization)";
@Input() showAdvancedSearchLink:boolean = true;
public resourcesQuery = "(oaftype exact organization)";
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
this.results =[];
this.errorCodes = new ErrorCodes();
@ -187,7 +189,7 @@ public resourcesQuery = "(oaftype exact organization)";
//console.log(err);
this.handleError("Error getting organizations", err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.searchUtils.totalResults = 0;
//TODO check erros (service not available, bad request)
// if( ){
// this.searchUtils.status = errorCodes.ERROR;

View File

@ -31,7 +31,7 @@ import {RangeFilter} from "../utils/rangeFilter/rangeFilterHelperClasses.class";
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
[filters]="filters"
[rangeFilters]="rangeFilters" [rangeFields]="rangeFields"
[simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..."
[simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..." [showAdvancedSearchLink]="showAdvancedSearchLink"
[sort]="false"
>
</new-search-page>
@ -73,6 +73,8 @@ export class SearchProjectsComponent {
@Input() openaireLink: string;
@Input() includeOnlyResultsAndFilter: boolean = false;
@Output() searchPageUpdates = new EventEmitter();
@Input() showAdvancedSearchLink:boolean = true;
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
this.results =[];
@ -193,7 +195,7 @@ export class SearchProjectsComponent {
//console.log(err);
this.handleError("Error getting projects", err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.searchUtils.totalResults = null;
//TODO check erros (service not available, bad request)
// if( ){
// this.searchUtils.status = errorCodes.ERROR;

View File

@ -195,7 +195,7 @@ export class SearchResearchResultsComponent {
err => {
this.handleError("Error getting " + this.getEntityName(this.resultType, true, true), err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.searchUtils.totalResults = null;
//TODO check erros (service not available, bad request)
// if( ){
// this.searchUtils.status = ErrorCodes.ERROR;
@ -212,6 +212,7 @@ export class SearchResearchResultsComponent {
//this.searchPage.closeLoading();
this.disableForms = false;
this.searchPageUpdates.emit({disableForms: this.disableForms, searchUtils: this.searchUtils})
}

View File

@ -160,15 +160,34 @@
Search
</button>
<div class="uk-margin-small-top" *ngIf="showAdvancedSearchLink">
<a *ngIf ="this.entityType == this.selectedEntity && advancedSearchLink" routerLinkActive="router-link-active"
<a *ngIf ="this.entityType !='all' && this.entityType == this.selectedEntity && advancedSearchLink" routerLinkActive="router-link-active"
[routerLink]="advancedSearchLink" style="z-index:1;" [queryParams]="advancedSearchLinkParameters"
[class]="(isDisabled)?' uk-disabled uk-link-muted portal-link uk-margin-left ':' portal-link uk-margin-left '">Advanced search
</a>
<a *ngIf ="this.entityType != this.selectedEntity && selectedEntityAdvancedUrl " routerLinkActive="router-link-active"
<a *ngIf =" this.entityType !='all' && this.entityType != this.selectedEntity && selectedEntityAdvancedUrl "
routerLinkActive="router-link-active"
[routerLink]="selectedEntityAdvancedUrl" style="z-index:1;"
[queryParams]="{q:this.selectedFields[0].value,op:'and'}"
[class]="(isDisabled)?' uk-disabled uk-link-muted portal-link uk-margin-left ':' portal-link uk-margin-left '">Advanced search
</a>
<a *ngIf="this.entityType=='all'" class="portal-link uk-margin-left">Advanced Search</a>
<div *ngIf="this.entityType =='all'" uk-dropdown class="uk-dropdown default-dropdown">
<ul class="uk-list uk-margin-remove-bottom">
<li><a
[routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="advancedSearchLinkParameters"
>Research
outcomes</a></li>
<li><a
[routerLink]="properties.searchLinkToAdvancedProjects" [queryParams]="advancedSearchLinkParameters" >
Projects</a></li>
<li><a
[routerLink]="properties.searchLinkToAdvancedDataProviders" [queryParams]="advancedSearchLinkParameters">
Content providers</a></li>
<li><a
[routerLink]="properties.searchLinkToAdvancedOrganizations" [queryParams]="advancedSearchLinkParameters">
Organizations</a></li>
</ul>
</div>
</div>
</div>
</div>

View File

@ -84,11 +84,21 @@
</div>
<ul *ngIf="!showUnknownFilters"
[class]="'uk-list uk-list-divider' + (selectedRangeFilters == 0 && selectedFilters == 0 ? ' uk-margin-small-top' : '')">
<quick-selections *ngIf="resultTypes" [resultTypes]="resultTypes" (typeChange)="queryChanged()"
<ng-container *ngIf="filters.length > 0 && filters[0].values.length >0 && filters[0].filterId ==
'resultbestaccessright'">
<li>
<search-filter [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline"
[isDisabled]="disableForms" [filter]="filters[0]" [showResultCount]=showResultCount
(onFilterChange)="filterChanged($event)"></search-filter>
</li>
</ng-container>
<li *ngIf="resultTypes && (filters.length > 0)">
<quick-selections [resultTypes]="resultTypes" (typeChange)="queryChanged()"
[isDisabled]="disableForms"
[quickFilter]="quickFilter" [QFselected]="(quickFilter)?quickFilter.selected:null"
[properties]="properties" [vertical]="true" [delayTime]="0">
</quick-selections>
</li>
<ng-container *ngFor="let filter of rangeFilters">
<li>
<range-filter [isDisabled]="disableForms" [filter]="filter"
@ -96,7 +106,7 @@
</li>
</ng-container>
<ng-container *ngFor="let filter of filters ">
<li *ngIf="filter.values.length >0">
<li *ngIf="filter.values.length >0 && filter.filterId != 'resultbestaccessright'">
<search-filter [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline"
[isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount
(onFilterChange)="filterChanged($event)"></search-filter>

View File

@ -737,9 +737,6 @@ export class NewSearchPageComponent {
}
}
if (this.customFilter) {
params += (countParams == 0 ? "" : " and ") + this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId));
}
// console.log("ParameterS:")
// console.log(params)
return params;
@ -747,8 +744,8 @@ export class NewSearchPageComponent {
public static createKeywordQuery(entityType:string, value:string, id, operatorId, countParams=0){
let params = "";
let doisParams = "";
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result")) {
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
for (let identifier of DOIs) {
// console.log(identifier)
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"
@ -763,7 +760,9 @@ export class NewSearchPageComponent {
if (doisParams.length > 0) {
params += "(" + this.createQuotedKeywordQuery(value, id, operatorId ,countParams,true, true) + " or " + doisParams+")";
} else {
params += this.createQuotedKeywordQuery(value, id, operatorId,countParams,true);
//if it is PIDs but no doisquery produced, forced to use quotes as the query will fail due to special characters
params += this.createQuotedKeywordQuery(value, id, operatorId,countParams,true,
(DOIs.length > 0 && doisParams.length == 0) );
}
return params;

View File

@ -27,14 +27,14 @@ import {debounceTime} from "rxjs/operators";
</div>
</form>
<form *ngIf="vertical && (resultTypes || quickFilter)" [formGroup]="control" class="uk-margin-small-bottom uk-list uk-list-divider">
<li *ngIf="quickFilter" class="uk-margin-small-bottom ">
<!-- <li *ngIf="quickFilter" class="uk-margin-small-bottom ">
<div class="uk-margin-small-top uk-padding-remove-left uk-margin-right ">
<h5 class="">{{quickFilter.value}}</h5>
<mat-slide-toggle
class="uk-margin-small-left" formControlName="QFselected" (change)="quickFilterChanged()">
</mat-slide-toggle>
</div>
</li>
</li>-->
<li *ngIf="resultTypes && showEntities" class="uk-margin-small-bottom ng-star-inserted">
<div class="uk-margin-small-top uk-margin-bottom uk-grid uk-flex uk-flex-bottom">
<h5 class="uk-margin-bottom-remove" title="Community">Research Type ({{(this.showPublications + this.showDatasets + this.showSoftware + this.showOrp)}})</h5>

View File

@ -11,10 +11,10 @@ export class SearchFields {
// Remove Collected From Filter "collectedfrom","collectedfrom"
public RESULT_REFINE_FIELDS = [
"relfunder",
"resultbestaccessright", "relfunder",
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
"relproject",
"resultbestaccessright", "instancetypename", "resultlanguagename", "community", "resulthostingdatasource"];
"instancetypename", "resultlanguagename", "community", "resulthostingdatasource"];
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "resultpublisher",
"resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance",