[Explore|Trunk]

New Search:
	1. update home page with new search form


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@58094 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-02-13 14:45:55 +00:00
parent 84d7984100
commit 9c0c821b50
4 changed files with 93 additions and 4 deletions

View File

@ -20,7 +20,41 @@
<div class="search_box_bg uk-grid-large uk-flex-middle uk-grid uk-grid-stack" uk-grid=""> <div class="search_box_bg uk-grid-large uk-flex-middle uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column"> <div class="uk-width-1-1@m uk-first-column">
<div data-id="page#4"> <div data-id="page#4">
<search-form placeholderText="Search in OpenAIRE for scholarly works" link="/search/find"></search-form> <!-- <search-form placeholderText="Search in OpenAIRE for scholarly works" link="/search/find"></search-form>-->
<form class=" uk-margin uk-margin-top ">
<div class="uk-grid">
<div>
<entities-selection [simpleView]="true" currentEntity="all" [selectedEntity]="selectedEntity"
[properties]="properties" [onChangeNavigate]="false"
(selectionChange)="entityChanged($event)"
></entities-selection>
</div>
<div [class]="((selectedEntity == 'result')?'quickSelectionsBox':'')+' uk-padding-remove-left'" >
<div class="uk-inline">
<a *ngIf="keyword.length > 0" class="uk-form-icon uk-form-icon-flip" (click)="keyword = ''"
uk-icon="icon: close"></a>
<input type="text" class="uk-input uk-width-xlarge@l uk-width-medium@m uk-width-auto"
placeholder="Search in OpenAIRE for scholarly works"
[(ngModel)]="keyword"
name="keyword">
</div>
<div>
<quick-selections *ngIf="selectedEntity == 'result'" [resultTypes]="resultTypes"
[quickFilter]="resultsQuickFilter" [QFselected]="(resultsQuickFilter)?resultsQuickFilter.selected:null" [properties]="properties">
</quick-selections>
</div>
</div>
<div class="uk-padding-remove-left">
<button (click)="goTo(true)" type="submit"
class="uk-button portal-button uk-text-bold uk-padding uk-padding-remove-vertical uk-margin-small-left">
Search
</button>
<div class="uk-margin-small-top uk-margin-left"> <a *ngIf="selectedEntity!= 'all'" (click)="goTo(false)"
class="portal-link">Advanced Search</a></div>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>

View File

@ -20,6 +20,7 @@ import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service'; import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service';
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service"; import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
@Component({ @Component({
selector: 'home', selector: 'home',
@ -144,6 +145,16 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
trelloImg: string = 'trello.svg'; trelloImg: string = 'trello.svg';
trelloImg2: string = 'trello.svg'; trelloImg2: string = 'trello.svg';
resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
filter: null,
selected: true,
filterId: "resultbestaccessright",
value: "Open Access"
};
selectedEntity = "all";
selectedEntitySimpleUrl;
selectedEntityAdvancedUrl;
resultTypes = {publication:true, dataset:true, software:true, other:true};
public pageContents = null; public pageContents = null;
constructor ( constructor (
@ -156,7 +167,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
private _refineFieldResultsService:RefineFieldResultsService, private _refineFieldResultsService:RefineFieldResultsService,
private location: Location, private _piwikService:PiwikService, private location: Location, private _piwikService:PiwikService,
private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService, private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService,
private helper: HelperService private helper: HelperService, private router: Router
) { ) {
var description = "openAIRE explore, open access, publications, research results, European commission, search"; var description = "openAIRE explore, open access, publications, research results, European commission, search";
@ -380,4 +391,46 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Home Page: "+message, error); console.error("Home Page: "+message, error);
} }
entityChanged($event){
this.selectedEntity = $event.entity;
this.selectedEntitySimpleUrl = $event.simpleUrl;
this.selectedEntityAdvancedUrl = $event.advancedUrl;
}
goTo(simple:boolean){
let url = (simple)?this.selectedEntitySimpleUrl:this.selectedEntityAdvancedUrl;
let parameterNames = [];
let parameterValues = [];
if (this.selectedEntity == "result") {
if (this.resultTypes) {
let values = [];
if (this.resultTypes.publication) {
values.push("publications");
}
if (this.resultTypes.dataset) {
values.push("datasets");
}
if (this.resultTypes.software) {
values.push("software");
}
if (this.resultTypes.other) {
values.push("other");
}
if (values.length > 0) {
parameterNames.push("type");
parameterValues.push(values.join(","));
}
if (this.resultsQuickFilter) {
parameterNames.push("qf");
parameterValues.push("" + this.resultsQuickFilter.selected);
}
}
}
if(this.keyword.length > 0) {
parameterNames.push("q");
parameterValues.push(this.keyword);
parameterNames.push("op");
parameterValues.push("and");
}
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
}
} }

View File

@ -24,6 +24,8 @@ import { SEOServiceModule } from '../openaireLibrary/sharedComponents/SEO/SEOSer
import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module';
import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module";
import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module";
import {QuickSelectionsModule} from "../openaireLibrary/searchPages/searchUtils/quick-selections.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -36,7 +38,7 @@ import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-port
HomeRoutingModule, HomeRoutingModule,
HelperModule, HelperModule,
ErrorMessagesModule, ErrorMessagesModule,
Schema2jsonldModule, SEOServiceModule, OtherPortalsModule Schema2jsonldModule, SEOServiceModule, OtherPortalsModule, EntitiesSelectionModule, QuickSelectionsModule
], ],
declarations: [ declarations: [
HomeComponent HomeComponent

View File

@ -8,7 +8,7 @@
"statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/stats/", "statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/stats/",
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
"claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", "claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/", "searchAPIURLLAst" : "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/",
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", "searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=", "openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",
"csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports", "csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports",