[Library|Trunk]

Search:

-Entities Selection: add check if route is enabled
-Delay in result types checkboxes to 2 s
-Use breadcrumb component
-add connect background
-remove space between names in showAuthors component
-Filters:
	-message about top 100 always visible
	-rename to view all
	-change css for search input
	-show 100 if results > 95
	-view less under the 2nd list
-Search bar:
	-select contains all avaliable entities not only search results
	-

Landing pages:

-correct issue with pmid in landing
-correct issue with date in cite this
-Hide Addthis:
	value in properties
 





git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58552 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-04-27 08:14:05 +00:00
parent 221f37f360
commit 7f1862dbab
22 changed files with 159 additions and 120 deletions

View File

@ -3,7 +3,7 @@ import {HttpParams} from '@angular/common/http';
export class ConnectHelper {
public static getCommunityFromDomain(domain: string): string{
// domain = "beta.egi.openaire.eu"; //for testing
domain = "beta.ee.openaire.eu"; //for testing
if (domain.indexOf('openaire.eu') === -1) {
return null;
}

View File

@ -69,18 +69,28 @@ import {Meta, Title} from "@angular/platform-browser";
<div></div>
</div>
<div class="uk-width-1-2@m uk-width-1-1@s">
<p class="uk-margin-auto-top uk-margin-remove-bottom uk-h5">
<!--<p class="uk-margin-auto-top uk-margin-remove-bottom uk-h5">
Start by <span class="uk-text-bold">searching</span> repositories and journals
</p>
<div class="uk-margin">
<form class="uk-search uk-search-default uk-width-xlarge@l uk-width-medium@m uk-width-auto">
</p>-->
<div class="uk-padding uk-padding-remove-vertical">
<form class=" uk-grid uk-margin">
<!-- <span uk-search-icon class="uk-icon"></span>-->
<button routerLinkActive="uk-link"
routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}" class="uk-search-icon uk-icon" uk-search-icon>
</button>
<input class="uk-search-input uk-input"
<!-- <button routerLinkActive="uk-link"-->
<!-- routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}" class="uk-search-icon uk-icon" uk-search-icon>-->
<!-- </button>-->
<input class="uk-search-input uk-input uk-width-expand uk-margin-small-right"
type="search" [(ngModel)]="keyword" name="keyword"
placeholder="{{searchPlaceHolder}}">
<div class="uk-padding-remove-left">
<button routerLinkActive="uk-link" routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}" class="uk-button"> Search
</button>
<div class="uk-padding-small">
<a [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute"
type="submit" class=" ">
<span><span>Browse all </span><!--<span uk-icon="arrow-right"></span>--></span>
</a>
</div>
</div>
</form>
</div>
<div class="uk-width-1-6 uk-text-right">
@ -100,9 +110,20 @@ import {Meta, Title} from "@angular/platform-browser";
</div>
<div>
<a [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute"
<!--<a [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute"
type="submit" class="uk-button uk-button-large portal-button uk-padding uk-padding-remove-vertical">
<span><span>Browse all </span><span uk-icon="arrow-right"></span></span>
</a>-->
<a *ngIf="zenodoInformation.shareInZenodoUrl" type="submit"
[queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)"
routerLinkActive="router-link-active" [routerLink]="zenodoInformation.shareInZenodoUrl"
class="uk-button portal-button uk-padding uk-padding-remove-vertical uk-margin-medium-top uk-margin-bottom">
<span><span> Use related zenodo communities</span><span uk-icon="arrow-right"></span></span>
</a>
<a *ngIf="!zenodoInformation.shareInZenodoUrl" target="_blank" href="{{zenodoInformation.url}}" type="submit"
[class]="'uk-button uk-padding uk-padding-remove-vertical uk-margin-medium-top uk-margin-bottom' +
((communityId && communityId != 'openaire') ? ' portal-button' : ' uk-button-primary')">
<span><span>Deposit in Zenodo</span><span uk-icon="arrow-right"></span></span>
</a>
</div>
</div>

View File

@ -84,7 +84,7 @@ export class CiteThisComponent {
}
if(this.result.dateofacceptance != undefined){
citationData.issued = {};
var date:string = (this.result.dateofacceptance)+""; // transform to string in case it is an integer
var date:string = (this.result.dateofacceptance.getFullYear())+""; // transform to string in case it is an integer
var dateArray:string[] = (date && (date).indexOf('-') !== -1)?[date.split('-')[0]]:[date];
if(dateArray.length < 3){
// dateArray.push[1];

View File

@ -454,7 +454,7 @@ export class ParsingFunctions {
let identifiers = new Map<string, string[]>();
if (pid.hasOwnProperty("classname") && pid['classname'] != "") {
if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid == "pmid") {
if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid.classname == "pmid") {
if (!identifiers.has(pid.classname)) {
identifiers.set(pid.classname, new Array<string>());
}
@ -463,7 +463,7 @@ export class ParsingFunctions {
}
} else {
for (let i = 0; i < pid.length; i++) {
if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid == "pmid") {
if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid[i].classname == "pmid") {
if (!identifiers.has(pid[i].classname)) {
identifiers.set(pid[i].classname, new Array<string>());
}

View File

@ -498,7 +498,7 @@
</div>
</div>
<!-- Share -->
<div [class.uk-hidden]="!addThis" class="uk-margin-top">
<div *ngIf="properties.showAddThis" [class.uk-hidden]="!addThis" class="uk-margin-top">
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis (event)="hideAddThis($event)"></addThis>
</div>

View File

@ -101,19 +101,23 @@ export class EntitiesSelectionComponent {
if (this.properties) {
// console.log(this.customFilter)
this.config.getCommunityInformation(this.properties, (this.customFilter && this.customFilter.queryFieldName == "communityId") ? this.customFilter.valueId : this.properties.adminToolsCommunity).subscribe(data => {
var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) {
let showEntity = {};
let showPage = {};
for (let i = 0; i < data['entities'].length; i++) {
showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
}
this.showResearchOutcomes = showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"];
this.showPublications = showEntity["publication"];
this.showDatasets = showEntity["dataset"];
this.showSoftware = showEntity["software"];
this.showOther = showEntity["orp"];
this.showProjects = showEntity["project"];
this.showOrganizations = showEntity["organization"];
this.showDataProviders = showEntity["datasource"];
for (let i = 0; i < data['pages'].length; i++) {
showPage["" + data['pages'][i]["route"] + ""] = data['pages'][i]["isEnabled"];
}
this.showResearchOutcomes = showPage[this.properties.searchLinkToResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]);
this.showPublications = showPage[this.properties.searchLinkToResults] && showEntity["publication"];
this.showDatasets = showPage[this.properties.searchLinkToResults] && showEntity["dataset"];
this.showSoftware = showPage[this.properties.searchLinkToResults] && showEntity["software"];
this.showOther = showPage[this.properties.searchLinkToResults] && showEntity["orp"];
this.showProjects = showPage[this.properties.searchLinkToProjects] && showEntity["project"];
this.showOrganizations = showPage[this.properties.searchLinkToOrganizations] && showEntity["organization"];
this.showDataProviders = showPage[this.properties.searchLinkToDataProviders] && showEntity["datasource"];
if (this.customFilter && this.customFilter.queryFieldName == "communityId") {
this.showOrganizations = false;

View File

@ -107,11 +107,10 @@
<div id="tm-main" class=" tm-middle">
<div id="tm-main" class=" tm-middle communityBackground">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<!-- TODO add breadcrumb here-->
<div *ngIf="showBreadcrumb" class=" uk-margin-large-left">Home > Search</div>
<breadcrumbs *ngIf="showBreadcrumb" addClass="uk-margin-large-left uk-margin-remove-bottom uk-margin-small-top" [breadcrumbs]="breadcrumbs"></breadcrumbs>
<div class="uk-container uk-container-large">
<div>
@ -359,7 +358,8 @@
</div>
<div class="uk-width-expand@m uk-with-1-1@s">
<div *ngIf="openaireLink"> <a class="uk-margin-top uk-button uk-button-text"
<div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !loadPaging )"> <a
class="uk-margin-top uk-button uk-button-text"
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
target="_blank" >Results in OpenAIRE</a></div>
<div class="uk-align-center uk-margin-remove-bottom">

View File

@ -18,6 +18,7 @@ import {SearchFields} from "../../utils/properties/searchFields";
import {RefineResultsUtils} from "../../services/servicesUtils/refineResults.class";
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
import {ZenodoInformationClass} from "../../deposit/utils/zenodoInformation.class";
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
declare var UIkit: any;
@ -92,7 +93,7 @@ export class NewSearchPageComponent {
public divContents = null;
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();
breadcrumbs:Breadcrumb[] = [];
url = null;
@Input() entitiesSelection:boolean = true;
@ -133,6 +134,12 @@ export class NewSearchPageComponent {
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false);
this.breadcrumbs.push({name: 'home', route: '/'});
if(this.simpleView) {
this.breadcrumbs.push( {name: "Search", route: this.simpleSearchLink});
}else if(!this.simpleView && this.advancedSearchLink) {
this.breadcrumbs.push({name: "Advanced Search", route: this.advancedSearchLink});
}
}

View File

@ -25,6 +25,7 @@ import {SearchResultsModule} from "./searchResults.module";
import {SearchResultsInDepositModule} from "../../deposit/searchResultsInDeposit.module";
import {AdvancedSearchFormModule} from "./advancedSearchForm.module";
import {QuickSelectionsModule} from "./quick-selections.module";
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
@NgModule({
imports: [
@ -33,7 +34,7 @@ import {QuickSelectionsModule} from "./quick-selections.module";
SearchPagingModule, SearchResultsPerPageModule, SearchSortingModule, SearchDownloadModule, ModalModule,
SearchFilterModule, RangeFilterModule,
PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule,
SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule
SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule
],
declarations: [
NewSearchPageComponent

View File

@ -123,7 +123,7 @@ export class QuickSelectionsComponent implements OnChanges {
});
}
this.resultTypesObs = this.clicks.pipe(
debounceTime(1000)
debounceTime(2000)
).subscribe(e =>{this.actuallyChanged()} );
}

View File

@ -56,19 +56,24 @@
<a
[class]="((isDisabled)?'uk-disabled uk-link-muted ':' portal-link ') + ' uk-margin-small-top'"
[attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
<span *ngIf="!isOpen">+ View more</span>
<span *ngIf="isOpen">- View less</span>
<span *ngIf="!isOpen">+ View all</span>
<!-- <span *ngIf="isOpen">- View less</span>-->
</a>
<div hidden [id]="'toggle-'+filter.filterId" class="uk-text-small uk-margin-small-bottom">
<div class="">
<span *ngIf="filter.values.length >= 99">* only the Top 100 values are shown</span>
<input class="uk-input uk-margin-small-bottom uk-width-1-1 " name="filter-keyword" placeholder="Search for {{filter.title}}" type="text" [(ngModel)]="keyword">
<span class="uk-text-meta uk-margin-small-left">Top 100 values are
shown in the filters</span>
<div class="uk-grid uk-margin-small-left uk-flex uk-flex-bottom">
<input class="uk-input uk-margin-small-top uk-form-small uk-width-2-3@m uk-width-3-5@s text-input-box "
name="filter-keyword"
placeholder="Search..." type="text" [(ngModel)]="keyword">
<span *ngIf = "showResultCount === true" class="uk-flex-inline uk-flex-middle uk-width-5-6@m uk-width-1-1@s uk-align-right uk-margin-small-bottom">
<span *ngIf = "showResultCount === true"
class="uk-width-1-3@m uk-width-2-5@s uk-padding-small uk-padding-remove-vertical uk-padding-remove-right">
<span class="uk-width-1-4 uk-text-muted"> Sort by:</span>
<select [(ngModel)]="sortBy"
class=" uk-width-expand uk-select uk-hidden@m"
class=" uk-width-expand uk-select uk-hidden@m uk-form-small"
id="form-horizontal-select" name="select_order">
<option value="num">Results number</option>
<option value="name">Name</option>
@ -82,6 +87,7 @@
</mat-select>
</span>
</div>
</div>
<div class="uk-modal-body uk-overflow-auto uk-height-max-small uk-padding-remove
uk-margin-small-left uk-margin-small-right uk-margin-small-top uk-width-1-1">
@ -129,10 +135,10 @@
</ng-container>
</div>
</div>
<!-- <a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"-->
<!-- [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">-->
<!-- <span *ngIf="isOpen">- View less</span>-->
<!-- </a>-->
<a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"
[attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
<span *ngIf="isOpen">- View less</span>
</a>
</div>
</div>
</div>

View File

@ -32,7 +32,7 @@ export class SearchFilterComponent {
ngOnInit() {}
public _formatTitle(title,length){
return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+length+")")
return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+(length>95?"100":length)+")")
}
public _formatName(value){
//let maxLineLength = 24;

View File

@ -55,7 +55,8 @@
</div>
</ng-template>
<div class="image-front-topbar uk-section-default uk-position-relative" uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
<div *ngIf="!includeOnlyResultsAndFilter" class="image-front-topbar uk-section-default uk-position-relative"
uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
<div style=" min-height: 350px;" [class]="' uk-background-norepeat uk-background-cover uk-background-bottom-center uk-section uk-padding-remove-bottom uk-flex uk-flex-middle uk-background-fixed '+searchFormClass">
<div class="uk-position-cover" style="/*background-color: rgba(255, 255, 255, 0.37);*/"></div>
<div class="uk-container">
@ -106,10 +107,10 @@
</div>
<schema2jsonld *ngIf="url" [URL]="url" type="search" [name]=pageTitle [searchAction]=false></schema2jsonld>
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" >
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle communityBackground" >
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<breadcrumbs *ngIf="showBreadcrumb" addClass="uk-margin-large-left uk-margin-remove-bottom uk-margin-small-top" [breadcrumbs]="breadcrumbs"></breadcrumbs>
<div class="uk-container uk-container-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<div class="uk-width-2-3@m uk-width-2-3@l uk-width-1-1@s">
@ -141,13 +142,14 @@
</div>
<div class="uk-grid uk-width-1-1 uk-margin-top">
<div *ngIf="filters.length > 0" class="uk-width-1-4@m search-filters uk-visible@m ">
<div *ngIf="filters.length > 0" class="uk-width-1-5@m search-filters uk-visible@m ">
<ng-container *ngTemplateOutlet="filters_column; context: {}" class=""></ng-container>
</div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column custom-dataTable-content" >
<div *ngIf="openaireLink"> <a class=" uk-button uk-button-text" [href]=openaireLink target="_blank"
>Results in OpenAIRE</a></div>
<div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !disableForms )">
<a class="uk-button uk-button-text" [href]=openaireLink target="_blank">Results in OpenAIRE</a>
</div>
<div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom ">
<div class="uk-grid">
<div class="uk-width-expand@m uk-grid uk-grid-medium uk-margin-small-bottom">

View File

@ -18,6 +18,7 @@ import {ErrorCodes} from '../../utils/properties/errorCode
import {PiwikService} from '../../utils/piwik/piwik.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {HelperService} from "../../utils/helper/helper.service";
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
@Component({
selector: 'search-page-table',
@ -77,6 +78,10 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
public pageContents = null;
@Input() customFilter: SearchCustomFilter = null;
@Input() enableEntitySelection: boolean = false;
@Input() includeOnlyResultsAndFilter:boolean = false;
@Input() showBreadcrumb:boolean = false;
breadcrumbs:Breadcrumb[] = [];
constructor (private route: ActivatedRoute,
private router: Router,
private location: Location,
@ -110,6 +115,7 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle;
this.updateDescription(description);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this.router.url,false);
this.breadcrumbs.push({name: 'home', route: '/'}, {name: this.pageTitle, route: this.router.url});
}

View File

@ -26,6 +26,7 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import { SearchDataproviderMapModule } from './searchDataproviderMap.module';
import {AdvancedSearchFormModule} from "./advancedSearchForm.module";
import {EntitiesSelectionModule} from "./entitiesSelection.module";
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
@NgModule({
@ -33,7 +34,7 @@ import {EntitiesSelectionModule} from "./entitiesSelection.module";
CommonModule, FormsModule, RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule,
DataTablesModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule,
Schema2jsonldModule, SEOServiceModule, SearchResultsPerPageModule, SearchDataproviderMapModule, AdvancedSearchFormModule, EntitiesSelectionModule
Schema2jsonldModule, SEOServiceModule, SearchResultsPerPageModule, SearchDataproviderMapModule, AdvancedSearchFormModule, EntitiesSelectionModule, BreadcrumbsModule
],
declarations: [
SearchPageTableViewComponent

View File

@ -29,7 +29,7 @@
<div *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
class=" uk-width-large ">
<search-bar [searchPlaceHolder]="searchPlaceHolder"
[searchRoute]="searchRoute" [properties]="properties"></search-bar>
[searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId"></search-bar>
</div>
</div>
<div class="uk-navbar-center">
@ -152,7 +152,7 @@
<div *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
class=" uk-margin-left uk-width-xlarge ">
<search-bar [searchPlaceHolder]="searchPlaceHolder"
[searchRoute]="searchRoute" [properties]="properties"></search-bar>
[searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId"></search-bar>
</div>
</div>
<div class="uk-navbar-left uk-visible@m uk-hidden@l ">
@ -172,7 +172,7 @@
<div *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
class="uk-width-large ">
<search-bar [searchPlaceHolder]="searchPlaceHolder"
[searchRoute]="searchRoute" [properties]="properties"></search-bar>
[searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId" ></search-bar>
</div>
</div>

View File

@ -8,7 +8,7 @@
[properties]="properties"
(selectionChange)=" entityChanged($event)"
[customFilter]="customFilter"
[onlyresults]="true" matPanelClass="navbarMatSelectPanelClass"
[onlyresults]="false" matPanelClass="navbarMatSelectPanelClass"
[onChangeNavigate]="false" ></entities-selection>
</div>
@ -29,4 +29,6 @@
<button (click)="keywordChanged()" type="submit"
class="uk-icon-button uk-icon portal-button uk-padding-remove-left uk-margin-small-left uk-margin-small-top"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="search"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
</button>
<a *ngIf="advancedSearchLink" class="portal-link uk-margin-top uk-padding-remove-left uk-margin-small-left"
routerLinkActive="router-link-active" [routerLink]="advancedSearchLink"> Advanced search</a>
</form>

View File

@ -6,11 +6,6 @@ import {SearchCustomFilter} from "../../searchPages/searchUtils/searchUtils.clas
@Component({
selector: 'search-bar',
templateUrl: 'searchBar.component.html',
styles:[`
.mat-select-panel-wrap {
z-index: 2001
}
`]
})
export class SearchBarComponent {
@ -22,8 +17,11 @@ export class SearchBarComponent {
keyword: string = "";
entityType = "all";
enableSearchbar:boolean = true;
@Input() customFilter: SearchCustomFilter = null;
customFilter: SearchCustomFilter = null;
@Input() communityId;
@Input() onlyresults:boolean=false;
parameters = {};
advancedSearchLink = null;
constructor(private router: Router,
private route: ActivatedRoute ) {
}
@ -31,60 +29,53 @@ export class SearchBarComponent {
ngOnInit() {
// this.activeRouteEnabled = false;
if(this.communityId){
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
}
this.route.queryParams.subscribe(params => {
this.parameters = Object.assign({}, params);
this.entityType = "all";
if (params["type"] && params["type"].length > 0) {
let types= params["type"].split(",");
if(types.length == 1){
if(types.indexOf("publications")!=-1 ){
if(this.onlyresults) {
if (params["type"] && params["type"].length > 0) {
let types = params["type"].split(",");
if (types.length == 1) {
if (types.indexOf("publications") != -1) {
this.entityType = "publications";
}else if(types.indexOf("datasets")!=-1 ){
this.entityType = "datasets";
}else if(types.indexOf("software")!=-1 ){
this.entityType = "software";
}else if(types.indexOf("other")!=-1 ){
this.entityType = "other";
} else if (types.indexOf("datasets") != -1) {
this.entityType = "datasets";
} else if (types.indexOf("software") != -1) {
this.entityType = "software";
} else if (types.indexOf("other") != -1) {
this.entityType = "other";
}
}
}
}else{
let currentRoute= this.getCurrentRoute();
if(currentRoute== this.properties.searchLinkToProjects){
this.entityType = "project";
}else if(currentRoute== this.properties.searchLinkToDataProviders){
this.entityType = "dataprovider";
}else if(currentRoute== this.properties.searchLinkToOrganizations){
this.entityType = "organization";
}else{
this.entityType = "result";
}
}
if(this.getCurrentRoute() == "/search/advanced/research-outcomes" ){
if(this.getCurrentRoute() == this.properties.searchLinkToAdvancedResults){
this.enableSearchbar = false;
}else{
this.enableSearchbar = true;
}
// this.initialize();
if(this.entityType == "result"){
this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;
}else{
this.advancedSearchLink = null;
}
});
}
/*
ngOnDestroy() {
this.sub.unsubscribe();
}
initialize() {
this.activeRouteEnabled = false;
this.isAuthorized = Session.isClaimsCurator(this.user) || Session.isPortalAdministrator(this.user);
/!*if (this.properties.adminToolsAPIURL && this.communityId) {
this.config.getCommunityInformation(this.properties, this.communityId).subscribe(data => {
for (var i = 0; i < data['entities'].length; i++) {
this.showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
}
for (var i = 0; i < data['pages'].length; i++) {
this.showPage[data['pages'][i]["route"]] = data['pages'][i]["isEnabled"];
}
},
error => {
this.handleError("Error getting community information (e.g. pages,entities) for community with id: " + this.communityId, error);
});
}*!/
}*/
isEnabled(required, enabled) {
if (!required) {
return true;
@ -96,27 +87,25 @@ export class SearchBarComponent {
}
return true;
}
private handleError(message: string, error) {
console.error("NavigationBar (component): " + message, error);
}
getCurrentRoute() {
return this.router.url.split('?')[0];
}
entityChanged($event){
this.entityType = $event.entity;
this.searchRoute = $event.simpleUrl;
// this.selectedEntityAdvancedUrl = $event.advancedUrl;
// check if it is search or not
//no search page
if(!this.onlyresults && this.entityType == "result") {
this.parameters["qf"] = true;
}
if(this.entityType == "result"){
this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;
}else{
this.advancedSearchLink = null;
}
}
keywordChanged(){
// this.parameters = {};
if(!this.onlyresults) {
this.parameters = {};
}
if ( this.keyword.length > 0) {
this.parameters["fv0"] = this.keyword;
this.parameters["f0"] = "q";
@ -124,7 +113,7 @@ export class SearchBarComponent {
delete this.parameters['fv0'];
delete this.parameters['f0'];
}
if(this.entityType != "all"){
if(this.onlyresults && this.entityType != "all"){
this.parameters["type"] = this.entityType;
}else{
delete this.parameters['type'];
@ -133,7 +122,6 @@ export class SearchBarComponent {
if(!this.parameters["qf"]) {
this.parameters["qf"] = true;
}
console.log(this.parameters);
this.router.navigate([this.searchRoute], {queryParams: this.parameters} );
}
}

View File

@ -14,12 +14,12 @@ import {AlertModal} from "../modal/alert";
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
<span *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser"
[class.uk-text-small]="small">
{{author.fullName}}
{{author.fullName + "; "}}
</span>
<a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser">
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
<span [class.uk-text-small]="small">
{{author.fullName}}
{{author.fullName + "; "}}
</span>
</a>
<div *ngIf="author.orcid && (properties.environment != 'production')"
@ -57,7 +57,6 @@ import {AlertModal} from "../modal/alert";
</a>
</div>
</div>
<span>;{{" "}}</span>
</span>
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span>
</div>

View File

@ -8,7 +8,7 @@ export interface Breadcrumb {
@Component({
selector: 'breadcrumbs',
template: `
<ul class="uk-breadcrumb" [class.uk-light]="light">
<ul [class]="'uk-breadcrumb '+addClass" [class.uk-light]="light">
<li *ngFor="let breadcrumb of breadcrumbs">
<a class="uk-text-capitalize" *ngIf="breadcrumb.route" [routerLink]="breadcrumb.route">{{breadcrumb.name}}</a>
<span class="uk-text-capitalize" *ngIf="!breadcrumb.route">{{breadcrumb.name}}</span>
@ -19,4 +19,5 @@ export class BreadcrumbsComponent {
@Input() public light: boolean = false;
@Input() public breadcrumbs: Breadcrumb[] = [];
}
@Input() public addClass;
}

View File

@ -4,6 +4,7 @@ export class EnvProperties {
domain: string;
enablePiwikTrack: boolean;
useCache: boolean;
showAddThis: boolean;
showContent: boolean;
metricsAPIURL;

View File

@ -6,7 +6,7 @@
<span class="uk-width-expand uk-flex-right">
<a *ngIf="result.websiteURL && promoteWebsiteURL" href="{{result.websiteURL}}" target="_blank" type="submit"
class="uk-float-right uk-button portal-button uk-padding uk-padding-remove-vertical uk-margin-small-left">
<span><span>Go to website</span><span uk-icon="arrow-right"></span></span>
<span><span>Visit repository to deposit</span><span uk-icon="arrow-right"></span></span>
</a>
</span>
<div class="uk-text-small">
@ -267,7 +267,7 @@
</div>
<!-- Description -->
<div *ngIf="result.description" class="uk-margin-small-bottom multi-line-ellipsis lines-3">
<p class="uk-text-small">
<p class="uk-text-small uk-text-muted">
{{result.description}}
</p>
</div>