From 8cf1edfee7d9604f9ff0994a7513ef59e2cd1ccd Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Fri, 3 Apr 2020 16:02:40 +0000 Subject: [PATCH] [Connect|Trunk] Initial commit for new UI of Search page: add search research outcomes page update links, routes and menu items accordingly add result landing page git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@58392 d315682c-612b-4755-9ff5-7f18f6832af3 --- angular.json | 2 + deploy/beta-properties.json | 16 +++--- deploy/production-properties.json | 11 +++- src/app/app-routing.module.ts | 23 ++++---- src/app/app.component.ts | 12 +++-- src/app/app.module.ts | 3 +- src/app/community/community.component.html | 33 ++++++------ src/app/community/community.component.ts | 15 ++---- .../searchDataprovidersToDeposit.component.ts | 2 +- .../landingPages/result/libResult.module.ts | 14 +++++ .../result/result-routing.module.ts | 18 +++++++ .../landingPages/result/result.component.ts | 32 ++++++++++++ .../results/results.component.ts | 2 +- .../searchResearchResults-routing.module.ts | 19 +++++++ .../searchResearchResults.component.ts | 43 +++++++++++++++ .../advanced/searchResearchResults.module.ts | 27 ++++++++++ src/app/searchPages/find/libSearch.module.ts | 3 +- src/app/searchPages/find/search.component.ts | 6 ++- .../simple/searchDataproviders.component.ts | 16 +++--- .../simple/searchProjects.component.ts | 14 ++--- .../searchResearchResults-routing.module.ts | 19 +++++++ .../simple/searchResearchResults.component.ts | 52 +++++++++++++++++++ .../simple/searchResearchResults.module.ts | 27 ++++++++++ src/app/utils/piwikHelper.ts | 6 ++- src/assets/env-properties.json | 27 +++++----- src/material.scss | 9 ++++ 26 files changed, 360 insertions(+), 91 deletions(-) create mode 100644 src/app/landingPages/result/libResult.module.ts create mode 100644 src/app/landingPages/result/result-routing.module.ts create mode 100644 src/app/landingPages/result/result.component.ts create mode 100644 src/app/searchPages/advanced/searchResearchResults-routing.module.ts create mode 100644 src/app/searchPages/advanced/searchResearchResults.component.ts create mode 100644 src/app/searchPages/advanced/searchResearchResults.module.ts create mode 100644 src/app/searchPages/simple/searchResearchResults-routing.module.ts create mode 100644 src/app/searchPages/simple/searchResearchResults.component.ts create mode 100644 src/app/searchPages/simple/searchResearchResults.module.ts create mode 100644 src/material.scss diff --git a/angular.json b/angular.json index f45194e..70fd685 100644 --- a/angular.json +++ b/angular.json @@ -22,6 +22,7 @@ ], "styles": [ "src/styles.css", + "src/material.scss", "node_modules/datatables.net-dt/css/jquery.dataTables.css" ], "scripts": [ @@ -79,6 +80,7 @@ ], "styles": [ "src/styles.css", + "src/material.scss", "node_modules/datatables.net-dt/css/jquery.dataTables.css" ], "assets": [ diff --git a/deploy/beta-properties.json b/deploy/beta-properties.json index 1196989..b890946 100644 --- a/deploy/beta-properties.json +++ b/deploy/beta-properties.json @@ -26,7 +26,8 @@ "cordisURL" : "http://cordis.europa.eu/projects/", "openDoarURL": "http://v2.sherpa.ac.uk/id/repository/", "r3DataURL": "http://service.re3data.org/repository/", - "sherpaURL": "http://www.sherpa.ac.uk/romeo/search.php?issn=", + "sherpaURL": "http://sherpa.ac.uk/romeo/issn/", + "sherpaURLSuffix": "/", "zenodo" : "https://zenodo.org/", "zenodoCommunities" : "https://zenodo.org/api/communities/", "openAccess" : "https://www.openaire.eu/support/faq#article-id-234", @@ -54,7 +55,6 @@ "cacheUrl" :"https://demo.openaire.eu/cache/get?url=", - "adminToolsAPIURL" :"https://beta.services.openaire.eu/uoa-admin-tools", "adminToolsCommunity" :"connect", @@ -68,7 +68,9 @@ "resultsPerPage": 10, "baseLink" : "https://beta.connect.openaire.eu", + "afterLoginRedirectLink": "/myCommunities", + "searchLinkToPublication" : "/search/publication?articleId=", "searchLinkToProject" : "/search/project?projectId=", "searchLinkToDataProvider" : "/search/dataprovider?datasourceId=", @@ -90,6 +92,7 @@ "searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table", "searchLinkToJournals" : "/search/journals", "searchLinkToJournalsTable" : "/search/journals-table", + "searchLinkToResults" : "/search/find/research-outcomes", "searchLinkToAdvancedPublications" : "/search/advanced/publications", "searchLinkToAdvancedProjects" : "/search/advanced/projects", @@ -98,15 +101,10 @@ "searchLinkToAdvancedOrps" : "/search/advanced/other", "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations", - - "sendMailUrl": "https://beta.services.openaire.eu/uoa-admin-tools/sendMail/", - "notifyForNewManagers": "https://beta.services.openaire.eu/uoa-admin-tools/notifyForNewManagers/", - "notifyForNewSubscribers": "https://beta.services.openaire.eu/uoa-admin-tools/notifyForNewSubscribers/", - + "searchLinkToAdvancedResults" : "/search/advanced/research-outcomes", "lastIndexInformationLink" : "https://beta.openaire.eu/aggregation-and-content-provision-workflows", "showLastIndexInformationLink" : true, - "widgetLink" : "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", "claimsInformationLink": "https://beta.openaire.eu/linking", @@ -117,7 +115,7 @@ "reCaptchaSiteKey": "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", "admins" : ["rcd-helpdesk@openaire.eu"], - "lastIndexUpdate": "2019-08-07", + "lastIndexUpdate": "2019-11-01", "indexInfoAPI": "http://beta.services.openaire.eu/openaire/info/", "altMetricsAPIURL": "https://api.altmetric.com/v1/doi/" } diff --git a/deploy/production-properties.json b/deploy/production-properties.json index a6f8bc6..234bf75 100644 --- a/deploy/production-properties.json +++ b/deploy/production-properties.json @@ -26,7 +26,8 @@ "cordisURL" : "http://cordis.europa.eu/projects/", "openDoarURL": "http://v2.sherpa.ac.uk/id/repository/", "r3DataURL": "http://service.re3data.org/repository/", - "sherpaURL": "http://www.sherpa.ac.uk/romeo/search.php?issn=", + "sherpaURL": "http://sherpa.ac.uk/romeo/issn/", + "sherpaURLSuffix": "/", "zenodo" : "https://zenodo.org/", "zenodoCommunities" : "https://zenodo.org/api/communities/", "openAccess" : "https://www.openaire.eu/support/faq#article-id-234", @@ -80,6 +81,7 @@ "searchLinkToOrp" : "/search/other?orpId=", "searchLinkToOrganization" : "/search/organization?organizationId=", + "searchLinkToCommunities" : "/search/find/communities", "searchLinkToPublications" : "/search/find/publications", "searchLinkToDataProviders" : "/search/find/dataproviders", "searchLinkToProjects" : "/search/find/projects", @@ -92,6 +94,7 @@ "searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table", "searchLinkToJournals" : "/search/journals", "searchLinkToJournalsTable" : "/search/journals-table", + "searchLinkToResults" : "/search/find/research-outcomes", "searchLinkToAdvancedPublications" : "/search/advanced/publications", "searchLinkToAdvancedProjects" : "/search/advanced/projects", @@ -100,10 +103,13 @@ "searchLinkToAdvancedOrps" : "/search/advanced/other", "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations", + "searchLinkToAdvancedResults" : "/search/advanced/research-outcomes", + "lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows", "showLastIndexInformationLink" : true, "widgetLink" : "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", "claimsInformationLink": "https://www.openaire.eu/linking", + "depositLearnHowPage": "/participate/deposit/learn-how", "depositSearchPage": "/participate/deposit/search", "shareInZenodoPage": "/participate/deposit/zenodo", @@ -111,5 +117,6 @@ "admins" : ["rcd-helpdesk@openaire.eu"], "lastIndexUpdate": "2019-07-24", - "indexInfoAPI": "http://services.openaire.eu/openaire/info/" + "indexInfoAPI": "http://services.openaire.eu/openaire/info/", + "altMetricsAPIURL": "https://api.altmetric.com/v1/doi/" } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0eb1851..a832c91 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -6,6 +6,7 @@ import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/en import { OpenaireErrorPageComponent } from './error/errorPage.component'; import {ThemeComponent} from "./test/theme.component"; +import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component"; const routes: Routes = [ // Other Pages @@ -26,6 +27,7 @@ const routes: Routes = [ { path: 'helper-test', loadChildren: './helper-test/helper-test.module#HelperTestModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, // Landing Pages + { path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, { path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, { path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, { path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, @@ -37,22 +39,23 @@ const routes: Routes = [ { path: 'project-report', loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, // Search Pages - { path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'}, { path: 'search/find/communities', loadChildren: './searchPages/communities/searchCommunities.module#SearchCommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - - { path: 'search/find/publications', loadChildren: './searchPages/simple/searchPublications.module#LibSearchPublicationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/find/datasets', loadChildren: './searchPages/simple/searchDatasets.module#LibSearchDatasetsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/find/software', loadChildren: './searchPages/simple/searchSoftware.module#LibSearchSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/find/research-outcomes', loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/find/publications', component: PageURLResolverComponent}, + { path: 'search/find/datasets', component: PageURLResolverComponent}, + { path: 'search/find/software', component: PageURLResolverComponent}, + { path: 'search/find/other', component: PageURLResolverComponent}, { path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, { path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/find/other', loadChildren: './searchPages/simple/searchOrps.module#LibSearchOrpsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, // Advanced Search Pages - { path: 'search/advanced/publications', loadChildren: './searchPages/advanced/advancedSearchPublications.module#LibAdvancedSearchPublicationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/advanced/datasets', loadChildren: './searchPages/advanced/advancedSearchDatasets.module#LibAdvancedSearchDatasetsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/advanced/software', loadChildren: './searchPages/advanced/advancedSearchSoftware.module#LibAdvancedSearchSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'search/advanced/other', loadChildren: './searchPages/advanced/advancedSearchOrps.module#LibAdvancedSearchOrpsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/advanced/research-outcomes', loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/advanced/publications', component: PageURLResolverComponent}, + { path: 'search/advanced/datasets', component: PageURLResolverComponent}, + { path: 'search/advanced/software', component: PageURLResolverComponent}, + { path: 'search/advanced/other', component: PageURLResolverComponent}, // Deposit Pages { path: 'participate/deposit-datasets', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'}, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 96745b8..a828974 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -109,7 +109,7 @@ export class AppComponent { if (this.properties.environment == "development") { this.showMenu = false; this.route.queryParams.subscribe(params => { - communityId = (params['communityId']) ? params['communityId'] : ''; + communityId = (params['communityId']) ? params['communityId'] : ConnectHelper.getCommunityFromDomain(this.properties.domain); this.buildMenu(communityId); }) } else { @@ -163,10 +163,12 @@ export class AppComponent { this.menuItems.push( { rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find", "/search/find/publications", "/search/find/datasets", "/search/find/software", "/search/find/other", "/search/find/projects", "/search/find/dataproviders"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), - items: [new MenuItem("", "Publications", "", "/search/find/publications", false, ["publication"], ["/search/find/publications"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), - new MenuItem("", "Research Data", "", "/search/find/datasets", false, ["dataset"], ["/search/find/datasets"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), - new MenuItem("", "Software", "", "/search/find/software", false, ["software"], ["/search/find/software"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), - new MenuItem("", "Other Research Products", "", "/search/find/other", false, ["orp"], ["/search/find/other"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), + items: [ + new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), + // new MenuItem("", "Publications", "", "/search/find/publications", false, ["publication"], ["/search/find/publications"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), + // new MenuItem("", "Research Data", "", "/search/find/datasets", false, ["dataset"], ["/search/find/datasets"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), + // new MenuItem("", "Software", "", "/search/find/software", false, ["software"], ["/search/find/software"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), + // new MenuItem("", "Other Research Products", "", "/search/find/other", false, ["orp"], ["/search/find/other"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), new MenuItem("", "Projects", "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], this.properties.environment != "development" ? {} : {communityId: community.communityId}), ] diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9758bea..6373f85 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,6 +23,7 @@ import {SubscribeModule} from './utils/subscribe/subscribe.module'; import {ThemeComponent} from "./test/theme.component"; import {CustomizationModule} from "./utils/customization/customization.module"; import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service"; +import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component"; @NgModule({ @@ -42,7 +43,7 @@ import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service AppRoutingModule, BrowserTransferStateModule ], - declarations: [ AppComponent, OpenaireErrorPageComponent, ThemeComponent], + declarations: [ AppComponent, OpenaireErrorPageComponent, ThemeComponent, PageURLResolverComponent], exports: [ AppComponent ], providers:[ EnvironmentSpecificResolver, CommunitiesService, LayoutService, diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index c3ca521..c8582e5 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -50,13 +50,13 @@ uk-scrollspy="cls: uk-animation-fade; target: > div > .uk-card; delay: 450; repeat: false">
@@ -91,13 +91,14 @@
@@ -140,8 +141,8 @@
- + {{subject}} {{" "}} @@ -149,8 +150,8 @@ - + {{subject}} {{" "}} diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 7bfd762..6b07a2a 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -69,13 +69,11 @@ export class CommunityComponent { public activeTab = "publication"; public show: string = 'overview'; - searchLinkToPublications: string = null; - searchLinkToDatasets: string = null; - searchLinkToSoftware: string = null; - searchLinkToOrps: string = null; + searchLinkToResults: string = null; + searchLinkToProjects: string = null; searchLinkToDataProviders: string = null; - searchLinkToAdvancedPublications: string = null; + searchLinkToAdvancedResults: string = null; shareInZenodoPage: string = null; public routerHelper: RouterHelper = new RouterHelper(); private user: User; @@ -111,13 +109,10 @@ export class CommunityComponent { this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; - this.searchLinkToPublications = this.properties.searchLinkToPublications; - this.searchLinkToDatasets = this.properties.searchLinkToDatasets; - this.searchLinkToSoftware = this.properties.searchLinkToSoftware; - this.searchLinkToOrps = this.properties.searchLinkToOrps; + this.searchLinkToResults = this.properties.searchLinkToResults; this.searchLinkToProjects = this.properties.searchLinkToProjects; this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders; - this.searchLinkToAdvancedPublications = this.properties.searchLinkToAdvancedPublications; + this.searchLinkToAdvancedResults = this.properties.searchLinkToAdvancedResults; this.shareInZenodoPage = this.properties.shareInZenodoPage; this.url = data.envSpecific.baseLink + this._router.url; this.seoService.createLinkForCanonicalURL(this.url, false); diff --git a/src/app/deposit/searchDataprovidersToDeposit.component.ts b/src/app/deposit/searchDataprovidersToDeposit.component.ts index f2ba09f..6ebb63c 100644 --- a/src/app/deposit/searchDataprovidersToDeposit.component.ts +++ b/src/app/deposit/searchDataprovidersToDeposit.component.ts @@ -15,7 +15,7 @@ import {FetchZenodoInformation} from './utils/fetchZenodoInformation.class'; @Component({ selector: 'openaire-search-deposit', template: ` - + ` }) diff --git a/src/app/landingPages/result/libResult.module.ts b/src/app/landingPages/result/libResult.module.ts new file mode 100644 index 0000000..fd55523 --- /dev/null +++ b/src/app/landingPages/result/libResult.module.ts @@ -0,0 +1,14 @@ +import {NgModule} from '@angular/core'; +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {OpenaireResultComponent} from './result.component'; +import {ResultRoutingModule} from './result-routing.module'; +import {ResultLandingModule} from "../../openaireLibrary/landingPages/result/resultLanding.module"; + +@NgModule({ + imports: [ResultRoutingModule, ResultLandingModule], + declarations:[OpenaireResultComponent], + providers:[FreeGuard, PreviousRouteRecorder], + exports:[OpenaireResultComponent] +}) +export class LibResultModule { } diff --git a/src/app/landingPages/result/result-routing.module.ts b/src/app/landingPages/result/result-routing.module.ts new file mode 100644 index 0000000..48737fd --- /dev/null +++ b/src/app/landingPages/result/result-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import {OpenaireResultComponent } from './result.component'; +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; + + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OpenaireResultComponent, canActivate: [FreeGuard], data: { + redirect: '/error', community : 'openaire' + },canDeactivate: [PreviousRouteRecorder] } + ]) +] +}) +export class ResultRoutingModule { } diff --git a/src/app/landingPages/result/result.component.ts b/src/app/landingPages/result/result.component.ts new file mode 100644 index 0000000..6f31818 --- /dev/null +++ b/src/app/landingPages/result/result.component.ts @@ -0,0 +1,32 @@ +import {Component} from '@angular/core'; +import {ActivatedRoute} from "@angular/router"; +import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; +import {PiwikHelper} from "../../utils/piwikHelper"; + +@Component({ + selector: 'openaire-publication', + template: ``, + }) +export class OpenaireResultComponent{ + piwikSiteId = null; + communityId = null; + + constructor(private route: ActivatedRoute) { + this.route.data + .subscribe((data: { envSpecific: any }) => { + this.route.queryParams.subscribe(params => { + this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain); + if (!this.communityId) { + this.communityId = params['communityId']; + } + this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, data.envSpecific.environment); + }); + }); + } + + + ngOnInit() { + } + + +} diff --git a/src/app/searchEntries/results/results.component.ts b/src/app/searchEntries/results/results.component.ts index f317401..646937f 100644 --- a/src/app/searchEntries/results/results.component.ts +++ b/src/app/searchEntries/results/results.component.ts @@ -13,7 +13,7 @@ import {SearchResult} from "../../openaireLibrary/utils/entities/searchResult";
diff --git a/src/app/searchPages/advanced/searchResearchResults-routing.module.ts b/src/app/searchPages/advanced/searchResearchResults-routing.module.ts new file mode 100644 index 0000000..35745ad --- /dev/null +++ b/src/app/searchPages/advanced/searchResearchResults-routing.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{OpenaireSearchResearchResultsComponent} from './searchResearchResults.component'; +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; + + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OpenaireSearchResearchResultsComponent, canActivate: [FreeGuard], data: { + redirect: '/error', community : 'openaire' + }, canDeactivate: [PreviousRouteRecorder] } + + ]) + ] +}) +export class SearchResearchResultsRoutingModule { } diff --git a/src/app/searchPages/advanced/searchResearchResults.component.ts b/src/app/searchPages/advanced/searchResearchResults.component.ts new file mode 100644 index 0000000..a55ef47 --- /dev/null +++ b/src/app/searchPages/advanced/searchResearchResults.component.ts @@ -0,0 +1,43 @@ +import {Component} from '@angular/core'; +import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; +import {ActivatedRoute} from "@angular/router"; +import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; +import {PiwikHelper} from "../../utils/piwikHelper"; + +@Component({ + selector: 'openaire-search-results', + template: ` + + ` + +}) +export class OpenaireSearchResearchResultsComponent { + connectCommunityId:string; + piwikSiteId = null; + customFilter: SearchCustomFilter = null; + constructor ( private route: ActivatedRoute) { + } + ngOnInit() { + this.route.data + .subscribe((data: { envSpecific: any }) => { + + var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain); + + this.piwikSiteId = PiwikHelper.getSiteId(communityId, data.envSpecific.environment); + + if(communityId){ + this.connectCommunityId = communityId; + this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); + } else{ + this.route.queryParams.subscribe(params => { + + if(params['communityId'] && params['communityId']!=""){ + this.connectCommunityId = params['communityId']; + this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, data.envSpecific.environment); + this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); + } + }); + } + }); + } +} diff --git a/src/app/searchPages/advanced/searchResearchResults.module.ts b/src/app/searchPages/advanced/searchResearchResults.module.ts new file mode 100644 index 0000000..f495397 --- /dev/null +++ b/src/app/searchPages/advanced/searchResearchResults.module.ts @@ -0,0 +1,27 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ SearchResearchResultsRoutingModule} from './searchResearchResults-routing.module'; +import{OpenaireSearchResearchResultsComponent} from './searchResearchResults.component'; + +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' +import {SearchResearchResultsModule} from "../../openaireLibrary/searchPages/searchResearchResults.module"; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + SearchResearchResultsRoutingModule, SearchResearchResultsModule + + ], + declarations: [ + OpenaireSearchResearchResultsComponent + ], + providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], + exports: [ + OpenaireSearchResearchResultsComponent + ] +}) +export class OpenaireAdvancedSearchResearchResultsModule { } diff --git a/src/app/searchPages/find/libSearch.module.ts b/src/app/searchPages/find/libSearch.module.ts index 4a5f5e4..c034338 100644 --- a/src/app/searchPages/find/libSearch.module.ts +++ b/src/app/searchPages/find/libSearch.module.ts @@ -11,9 +11,10 @@ import { MainSearchRoutingModule } from './mainSearch-routing.module'; import {FreeGuard} from "../../openaireLibrary/login/freeGuard.guard"; import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard"; +import {SearchAllModule} from "../../openaireLibrary/searchPages/find/searchAll.module"; @NgModule({ - imports: [ MainSearchRoutingModule, MainSearchModule], + imports: [MainSearchRoutingModule, MainSearchModule, SearchAllModule], declarations:[OpenaireSearchComponent], exports:[OpenaireSearchComponent], providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], diff --git a/src/app/searchPages/find/search.component.ts b/src/app/searchPages/find/search.component.ts index 51bf089..5027c7f 100644 --- a/src/app/searchPages/find/search.component.ts +++ b/src/app/searchPages/find/search.component.ts @@ -1,4 +1,4 @@ -import {Component, ViewChild, ElementRef} from '@angular/core'; +import {Component} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {PiwikHelper} from '../../utils/piwikHelper'; import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; @@ -7,7 +7,9 @@ import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/ @Component({ selector: 'openaire-search-find', template: ` - + + + `, }) export class OpenaireSearchComponent{ diff --git a/src/app/searchPages/simple/searchDataproviders.component.ts b/src/app/searchPages/simple/searchDataproviders.component.ts index a32c07e..6bf4e4d 100644 --- a/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/src/app/searchPages/simple/searchDataproviders.component.ts @@ -1,14 +1,11 @@ -import {Component, Input, ViewChild} from '@angular/core'; +import {Component, ViewChild} from '@angular/core'; import { ActivatedRoute} from '@angular/router'; -import { Filter, Value} from '../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class'; - -import {SearchResult} from '../../openaireLibrary/utils/entities/searchResult'; import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; import {ErrorMessagesComponent} from '../../openaireLibrary/utils/errorMessages.component'; -import {SearchFields, FieldDetails} from '../../openaireLibrary/utils/properties/searchFields'; +import {SearchFields} from '../../openaireLibrary/utils/properties/searchFields'; import {SearchPageTableViewComponent } from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.component'; -import {SearchUtilsClass } from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; +import {SearchCustomFilter, SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {SearchCommunityDataprovidersService} from '../../openaireLibrary/connect/contentProviders/searchDataproviders.service'; import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; @@ -20,7 +17,7 @@ import {PiwikHelper} from '../../utils/piwikHelper'; + [piwikSiteId]="piwikSiteId" [hasPrefix]="false" [customFilter]="customFilter" [enableEntitySelection]="true"> ` @@ -53,6 +50,7 @@ export class OpenaireSearchDataprovidersComponent { @ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ; piwikSiteId = null; + customFilter: SearchCustomFilter = null; constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) { this.errorCodes = new ErrorCodes(); @@ -72,7 +70,7 @@ export class OpenaireSearchDataprovidersComponent { if(!this.communityId) { this.communityId = params['communityId']; } - + this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, ""); this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment); this.searchUtils.keyword = (params['keyword']?params['keyword']:''); //this.filters = this.createFilters(); diff --git a/src/app/searchPages/simple/searchProjects.component.ts b/src/app/searchPages/simple/searchProjects.component.ts index 619508f..8b5791c 100644 --- a/src/app/searchPages/simple/searchProjects.component.ts +++ b/src/app/searchPages/simple/searchProjects.component.ts @@ -3,12 +3,11 @@ import { ActivatedRoute} from '@angular/router'; import { Filter, Value} from '../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class'; -import {SearchResult} from '../../openaireLibrary/utils/entities/searchResult'; import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; import {ErrorMessagesComponent} from '../../openaireLibrary/utils/errorMessages.component'; import {SearchFields, FieldDetails} from '../../openaireLibrary/utils/properties/searchFields'; import {SearchPageTableViewComponent } from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.component'; -import {SearchUtilsClass } from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; +import {SearchCustomFilter, SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {SearchCommunityProjectsService} from '../../openaireLibrary/connect/projects/searchProjects.service'; import {PiwikHelper} from '../../utils/piwikHelper'; @@ -19,8 +18,8 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; template: ` + [piwikSiteId]="piwikSiteId" [hasPrefix]="false" [customFilter]="customFilter" [enableEntitySelection]="true"> ` @@ -53,7 +52,7 @@ export class OpenaireSearchProjectsComponent { @ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ; piwikSiteId = null; - + customFilter: SearchCustomFilter = null; constructor (private route: ActivatedRoute, private _searchProjectsService: SearchCommunityProjectsService) { this.errorCodes = new ErrorCodes(); this.errorMessages = new ErrorMessagesComponent(); @@ -72,7 +71,7 @@ export class OpenaireSearchProjectsComponent { if(!this.communityId) { this.communityId = params['communityId']; } - + this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, ""); this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment); this.searchUtils.keyword = (params['keyword']?params['keyword']:''); //this.filters = this.createFilters(); @@ -102,6 +101,7 @@ export class OpenaireSearchProjectsComponent { this.subResults = this._searchProjectsService.searchProjects(this.properties, this.communityId).subscribe( data => { + // data=data.slice(0,150) this.filters = this.createFilters(data, params); this.searchUtils.totalResults = data.length; diff --git a/src/app/searchPages/simple/searchResearchResults-routing.module.ts b/src/app/searchPages/simple/searchResearchResults-routing.module.ts new file mode 100644 index 0000000..35745ad --- /dev/null +++ b/src/app/searchPages/simple/searchResearchResults-routing.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{OpenaireSearchResearchResultsComponent} from './searchResearchResults.component'; +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; + + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OpenaireSearchResearchResultsComponent, canActivate: [FreeGuard], data: { + redirect: '/error', community : 'openaire' + }, canDeactivate: [PreviousRouteRecorder] } + + ]) + ] +}) +export class SearchResearchResultsRoutingModule { } diff --git a/src/app/searchPages/simple/searchResearchResults.component.ts b/src/app/searchPages/simple/searchResearchResults.component.ts new file mode 100644 index 0000000..d5fe526 --- /dev/null +++ b/src/app/searchPages/simple/searchResearchResults.component.ts @@ -0,0 +1,52 @@ +import {Component, Input} from '@angular/core'; +import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; +import {ActivatedRoute} from "@angular/router"; +import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; +import {PiwikHelper} from "../../utils/piwikHelper"; + +@Component({ + selector: 'openaire-search-results', + template: ` + + ` + +}) +export class OpenaireSearchResearchResultsComponent { + + connectCommunityId: string; + piwikSiteId = null; + customFilter: SearchCustomFilter = null; + properties:EnvProperties; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + + this.route.data + .subscribe((data: { envSpecific: any }) => { + + var communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain); + if (communityId) { + this.connectCommunityId = communityId; + this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment); + this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); + + } else { + this.route.queryParams.subscribe(params => { + if (params['communityId'] && params['communityId'] != "") { + this.connectCommunityId = params['communityId']; + this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,data.envSpecific.environment); + this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, ""); + + } + }); + } + + + }); + + } +} diff --git a/src/app/searchPages/simple/searchResearchResults.module.ts b/src/app/searchPages/simple/searchResearchResults.module.ts new file mode 100644 index 0000000..41765a5 --- /dev/null +++ b/src/app/searchPages/simple/searchResearchResults.module.ts @@ -0,0 +1,27 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ SearchResearchResultsRoutingModule} from './searchResearchResults-routing.module'; +import{OpenaireSearchResearchResultsComponent} from './searchResearchResults.component'; + +import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' +import {SearchResearchResultsModule} from "../../openaireLibrary/searchPages/searchResearchResults.module"; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + SearchResearchResultsRoutingModule, SearchResearchResultsModule + + ], + declarations: [ + OpenaireSearchResearchResultsComponent + ], + providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], + exports: [ + OpenaireSearchResearchResultsComponent + ] +}) +export class OpenaireSearchResearchResultsModule { } diff --git a/src/app/utils/piwikHelper.ts b/src/app/utils/piwikHelper.ts index b3424e5..dde3ce8 100644 --- a/src/app/utils/piwikHelper.ts +++ b/src/app/utils/piwikHelper.ts @@ -15,7 +15,8 @@ export class PiwikHelper{ "clarin":100, "dariah":103, "epos": 217, - "beopen": 218 + "beopen": 218, + "risis":219 }; public static siteIDsProduction={ "connect": 112, @@ -33,7 +34,8 @@ export class PiwikHelper{ "clarin":'', "dariah":'', "epos": null, - "beopen" :null + "beopen" :null, + "risis":null }; public static getSiteId(communityId:string, environment:string){ if(environment == 'production'){ diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index ae9a28c..885be52 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -10,11 +10,11 @@ "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", "statisticsFrameNewAPIURL": "http://marilyn.athenarc.gr:8080/stats-api/", "useNewStatistisTool":false, - "claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", + "claimsAPIURL" : "http://dl170.madgik.di.uoa.gr:8180/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", "searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/", "searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", "openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=", - "csvAPIURL" : "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/reports", + "csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports", "searchCrossrefAPIURL" : "https://api.crossref.org/works", "searchDataciteAPIURL" : "https://api.datacite.org/works", "searchOrcidURL" : "https://pub.orcid.org/v2.1/", @@ -26,7 +26,8 @@ "cordisURL" : "http://cordis.europa.eu/projects/", "openDoarURL": "http://v2.sherpa.ac.uk/id/repository/", "r3DataURL": "http://service.re3data.org/repository/", - "sherpaURL": "http://www.sherpa.ac.uk/romeo/search.php?issn=", + "sherpaURL": "http://sherpa.ac.uk/romeo/issn/", + "sherpaURLSuffix": "/", "zenodo" : "https://zenodo.org/", "zenodoCommunities" : "https://zenodo.org/api/communities/", "openAccess" : "https://www.openaire.eu/support/faq#article-id-234", @@ -36,8 +37,7 @@ "ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", "helpdesk" : "https://www.openaire.eu/support/helpdesk", "helpdeskEmail": "helpdesk@openaire.eu", - "uploadService" : "http://scoobydoo.di.uoa.gr:8000/upload", - "utilsService" : "http://mpagasas.di.uoa.gr:8000", + "utilsService" : "http://dl170.madgik.di.uoa.gr:8000", "vocabulariesAPI" :"https://dev-openaire.d4science.org/provision/mvc/vocabularies/", @@ -53,9 +53,9 @@ "feedbackmail" :"openaire.test@gmail.com", - "cacheUrl" :"http://scoobydoo.di.uoa.gr:3000/get?url=", + "cacheUrl" :"http://dl170.madgik.di.uoa.gr:3000/get?url=", - "adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools/", + "adminToolsAPIURL" :"http://dl170.madgik.di.uoa.gr:8080/uoa-admin-tools/", "adminToolsCommunity" :"connect", "datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/", @@ -67,7 +67,7 @@ "pagingLimit": 20, "resultsPerPage": 10, - "baseLink" : "https://beta.explore.openaire.eu", + "baseLink" : "https://beta.connect.openaire.eu", "afterLoginRedirectLink": "/myCommunities", @@ -92,6 +92,7 @@ "searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table", "searchLinkToJournals" : "/search/journals", "searchLinkToJournalsTable" : "/search/journals-table", + "searchLinkToResults" : "/search/find/research-outcomes", "searchLinkToAdvancedPublications" : "/search/advanced/publications", "searchLinkToAdvancedProjects" : "/search/advanced/projects", @@ -100,15 +101,10 @@ "searchLinkToAdvancedOrps" : "/search/advanced/other", "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations", - - - "sendMailUrl": "http://scoobydoo.di.uoa.gr:8080/uoa-admin-tools/sendMail/", - "notifyForNewManagers": "http://scoobydoo.di.uoa.gr:8080/uoa-admin-tools/notifyForNewManagers/", - "notifyForNewSubscribers": "http://scoobydoo.di.uoa.gr:8080/uoa-admin-tools/notifyForNewSubscribers/", + "searchLinkToAdvancedResults" : "/search/advanced/research-outcomes", "lastIndexInformationLink" : "https://beta.openaire.eu/aggregation-and-content-provision-workflows", "showLastIndexInformationLink" : true, - "widgetLink" : "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", "claimsInformationLink": "https://beta.openaire.eu/linking", @@ -116,10 +112,11 @@ "depositSearchPage": "/participate/deposit/search", "shareInZenodoPage": "/participate/deposit/zenodo", + "reCaptchaSiteKey": "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu", "admins" : ["kostis30fylloy@gmail.com"], - "lastIndexUpdate": "2019-05-16", + "lastIndexUpdate": "2019-11-01", "indexInfoAPI": "http://beta.services.openaire.eu/openaire/info/", "altMetricsAPIURL": "https://api.altmetric.com/v1/doi/" } diff --git a/src/material.scss b/src/material.scss new file mode 100644 index 0000000..50525af --- /dev/null +++ b/src/material.scss @@ -0,0 +1,9 @@ +@import '~@angular/material/theming'; +@include mat-core(); +$my-app-primary: mat-palette($mat-gray, 900); +$my-app-accent: mat-palette($mat-light-green, 700); + +$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent); + +@include angular-material-theme($my-app-theme); +