From dc07897cd826d277885e01754dab4810d761a596 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Fri, 7 Dec 2018 14:21:38 +0000 Subject: [PATCH] Navbar: pass properly boolean variables add all related subitems route in rootmenuitem (for enabling/disabling routes) Footer: pass properly boolean variables Content: update text Organization/about/stats pages: add route enabled guard Search/find: use input for placeholder text Stats: add loading Manage button: add svg instead of uikit git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@54209 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/app.component.ts | 19 +++-- src/app/content/contentPage.component.html | 83 +++++++++++++------ src/app/content/contentPage.module.ts | 6 +- .../about/aboutPage-routing.module.ts | 3 +- .../htmlPages/about/aboutPage.component.ts | 2 +- .../organizationsPage-routing.module.ts | 3 +- .../organizationsPage.component.ts | 2 +- src/app/searchPages/find/search.component.ts | 2 +- .../statistics/statistics-routing.module.ts | 3 +- src/app/statistics/statistics.component.html | 6 +- src/app/statistics/statistics.component.ts | 23 ++--- src/app/statistics/statistics.module.ts | 3 +- src/app/utils/manage/manage.component.ts | 4 +- src/assets/env-properties.json | 2 +- 14 files changed, 102 insertions(+), 59 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3b78973..6b7255c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -17,9 +17,9 @@ import {ConnectHelper} from './openaireLibrary/connect/connectHelper'; `], template: ` - -
@@ -36,7 +36,7 @@ import {ConnectHelper} from './openaireLibrary/connect/connectHelper'; - + ` @@ -68,6 +68,8 @@ export class AppComponent { var community = null; this.community = null; this.showMenu = false; + // var test:MenuItem = new MenuItem("monitor","Monitor","","/monitor",false,[],["/monitor"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}); + // test. this._communitiesService.getCommunities(this.properties, this.properties.communitiesAPI).subscribe ( communities => { @@ -81,7 +83,7 @@ export class AppComponent { // {rootItem: new MenuItem("dashboard","Dashboard","","/",false,[],[],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), // items: [] // }, - {rootItem: new MenuItem("search","Search","","/search/find",false,[],["/search/find"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + {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"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), @@ -90,7 +92,7 @@ export class AppComponent { new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), ]}, { - rootItem: new MenuItem("monitor","Monitor","","/monitor",false,[],["/statistics"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + rootItem: new MenuItem("monitor","Monitor","","/monitor",false,[],["/monitor"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), items: [] }, { @@ -117,9 +119,9 @@ export class AppComponent { new MenuItem("","Blog","https://blogs.openaire.eu/","",false,[],[],{}), new MenuItem("","Contact us","https://beta.openaire.eu/contact-us","",false,[],[],{}) ]; - if(this.properties.showContent){ - this.bottomMenuItems.push(new MenuItem("","Content Policy","","/content",false,[],[],{})); - } + // if(this.properties.showContent){ + // this.bottomMenuItems.push(new MenuItem("","Content Policy","","/content",false,[],[],{})); + // } this.userMenuItems =[ // new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],(data['communityId'] && typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:data['communityId']}), ]; @@ -138,7 +140,6 @@ export class AppComponent { ]; } this.showMenu = true; - }); diff --git a/src/app/content/contentPage.component.html b/src/app/content/contentPage.component.html index 37ca4ed..4d98176 100644 --- a/src/app/content/contentPage.component.html +++ b/src/app/content/contentPage.component.html @@ -1,50 +1,79 @@ -
+
Content policy
-

The Research Community Dashboard (RCD) shows a "slice" of the OpenAIRE Graph that is relevant to the research community.

- -

Relevant research results are specified by users and OpenAIRE algorithms.

-
- Users + + + +

+ OpenAIRE builds an open scholarly graph of research products (publications, datasets, software and other types of research products), linked to each other and to fundings, projects and organizations. + The information used to build the graph is collected from the OpenAIRE network of content providers + and is inferred by OpenAIRE algorithms. OpenAIRE algorithms are capable of detecting duplicates and mining information from the full-texts of Open Access publications. + For more details about the construction of the graph, please check here. +

+

+ Thanks to the Research Community Dashboard (RCD), researchers have a dedicated view of the OpenAIRE graph where only the research products relevant to the community are searchable and browsable.
+ There are several ways to decide if a research product is relevant to a given community: +

+ + +

+ + + Links: Users can "claim" that a research result is relevant to a community via the + Link functionality of the Research community dashboard. +
+ For more details about linking functionality, please check here. + + +

+
+ + OpenAIRE algorithms: Community managers can configure the OpenAIRE algorithms, in order to automatically assign research products to a community based on: +
- Users can "claim" that a research result is relevant for a community via the "Linking" functionality of the RCD; -
Coming soon: the community managers will be able to curate the user claims to identify and reject "wrong" claims
-
-
-
- OpenAIRE algorithms
-
- OpenAIRE algorithms automatically assign research results to the dashboard based on the configuration specified by the community managers. Specifically: -
    +
    • - Content providers: research results collected from the selected content providers are assigned to the community -
      Coming soon: configuration of additional criteria to select subsets of research results collected from a provider
      + The content providers they have been collected from.
      Examples: all research products collected from "NeuroVault" are relevant to the Neuroinformatics community; all research products collected from the LINDAT/CLARIN repository are relevant to the CLARIN research initiative.
    • - Projects: research results linked to the selected projects are assigned to the community -
      Coming soon: configuration of additional criteria to select subsets of research results linked to projects
      - + The projects they have been produced in.
      Examples: all research products of the project "Tara Mediterranee" are relevant to the European Marine Science community; all research products of the project "ARIADNE" are relevant to the Digital Humanities and Cultural Heritage community.
    • - Subjects: research results whose keywords include at least one of the specified subjects are assigned to the community (only for RCD serving research communities) -
      Coming soon: GUI support for the selection of keywords from standard subject classification vocabularies and taxonomies
      - - + The subjects and keywords (only for RCD serving research communities).
      Examples: all research products having "SDG11 - Sustainable cities and communities" among the subjects are relevant to the Greek Sustainable Development Solutions Network community; all research products with subject "agriculture" are relevant to the AgInfra community
    • -
    • - Acknowledgment statements: found in full-texts (only for RCDs serving research infrastructures/initiatives) +
-
+
+
+ Acknowledgement statements: Acknowledgement statements found in full-texts (only for RCDs serving research infrastructures/initiatives) +
+ +
diff --git a/src/app/content/contentPage.module.ts b/src/app/content/contentPage.module.ts index 9d24940..751beee 100644 --- a/src/app/content/contentPage.module.ts +++ b/src/app/content/contentPage.module.ts @@ -1,8 +1,8 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; +import { RouterModule } from '@angular/router'; import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard' import {ContentPageComponent} from './contentPage.component'; import {ContentPageRoutingModule} from './content-routing.module'; @@ -10,12 +10,12 @@ import {ContentPageRoutingModule} from './content-routing.module'; @NgModule({ imports: [ - ContentPageRoutingModule + ContentPageRoutingModule, RouterModule ], declarations: [ ContentPageComponent ], - providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], + providers:[FreeGuard,PreviousRouteRecorder], exports: [ ContentPageComponent ] diff --git a/src/app/htmlPages/about/aboutPage-routing.module.ts b/src/app/htmlPages/about/aboutPage-routing.module.ts index 10abfaf..03e2c00 100644 --- a/src/app/htmlPages/about/aboutPage-routing.module.ts +++ b/src/app/htmlPages/about/aboutPage-routing.module.ts @@ -4,11 +4,12 @@ import { RouterModule } from '@angular/router'; import {AboutPageComponent} from './aboutPage.component'; import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' @NgModule({ imports: [ RouterModule.forChild([ - { path: '', component: AboutPageComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } + { path: '', component: AboutPageComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } ]) ] diff --git a/src/app/htmlPages/about/aboutPage.component.ts b/src/app/htmlPages/about/aboutPage.component.ts index 1925a81..969c38b 100644 --- a/src/app/htmlPages/about/aboutPage.component.ts +++ b/src/app/htmlPages/about/aboutPage.component.ts @@ -7,7 +7,7 @@ import{EnvProperties} from '../../openaireLibrary/utils/properties/env-propertie @Component({ selector: 'about', template: ` -
+
diff --git a/src/app/htmlPages/organizations/organizationsPage-routing.module.ts b/src/app/htmlPages/organizations/organizationsPage-routing.module.ts index ef941e3..8500909 100644 --- a/src/app/htmlPages/organizations/organizationsPage-routing.module.ts +++ b/src/app/htmlPages/organizations/organizationsPage-routing.module.ts @@ -4,11 +4,12 @@ import { RouterModule } from '@angular/router'; import {OrganizationsPageComponent} from './organizationsPage.component'; import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' @NgModule({ imports: [ RouterModule.forChild([ - { path: '', component: OrganizationsPageComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } + { path: '', component: OrganizationsPageComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } ]) ] diff --git a/src/app/htmlPages/organizations/organizationsPage.component.ts b/src/app/htmlPages/organizations/organizationsPage.component.ts index 5d3c16c..5fbe4df 100644 --- a/src/app/htmlPages/organizations/organizationsPage.component.ts +++ b/src/app/htmlPages/organizations/organizationsPage.component.ts @@ -7,7 +7,7 @@ import{EnvProperties} from '../../openaireLibrary/utils/properties/env-propertie @Component({ selector: 'organizations', template: ` -
+
diff --git a/src/app/searchPages/find/search.component.ts b/src/app/searchPages/find/search.component.ts index ef6c925..fd40a1e 100644 --- a/src/app/searchPages/find/search.component.ts +++ b/src/app/searchPages/find/search.component.ts @@ -6,7 +6,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; @Component({ selector: 'openaire-search-find', template: ` - + `, }) export class OpenaireSearchComponent{ diff --git a/src/app/statistics/statistics-routing.module.ts b/src/app/statistics/statistics-routing.module.ts index 36eb84a..d05d221 100644 --- a/src/app/statistics/statistics-routing.module.ts +++ b/src/app/statistics/statistics-routing.module.ts @@ -4,11 +4,12 @@ import { RouterModule } from '@angular/router'; import{StatisticsComponent} from './statistics.component'; import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard' @NgModule({ imports: [ RouterModule.forChild([ - { path: '', component: StatisticsComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } + { path: '', component: StatisticsComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } ]) ] diff --git a/src/app/statistics/statistics.component.html b/src/app/statistics/statistics.component.html index ff06710..082ae0d 100644 --- a/src/app/statistics/statistics.component.html +++ b/src/app/statistics/statistics.component.html @@ -3,7 +3,11 @@
-
+ +
+ An error occured +
+
No statistics are available for {{ communityId.toUpperCase() }}
diff --git a/src/app/statistics/statistics.component.ts b/src/app/statistics/statistics.component.ts index 8d367a7..2702879 100644 --- a/src/app/statistics/statistics.component.ts +++ b/src/app/statistics/statistics.component.ts @@ -25,6 +25,7 @@ import {availableCharts, availableEntitiesMap, StatisticsDisplay, } from "../openaireLibrary/connect/statistics/statisticsEntities"; import {PiwikHelper} from '../utils/piwikHelper'; + @Component({ selector: 'statistics', templateUrl: 'statistics.component.html', @@ -47,8 +48,8 @@ export class StatisticsComponent { allowedCharts: Map = new Map(); allowedEntities: string[] = []; - statisticsSum: StatisticsSummary; - statisticsDisplay: StatisticsDisplay; + statisticsSum: StatisticsSummary =null; + statisticsDisplay: StatisticsDisplay = null; chartsUrlMap: {}; displayedTimeline: string; @@ -58,7 +59,8 @@ export class StatisticsComponent { displayedProjectChart: string; displayedProjectChartUrl: string; displayedEntity: string; - + public errorCodes:ErrorCodes = new ErrorCodes(); + status = null; constructor ( private route: ActivatedRoute, private _router: Router, @@ -122,6 +124,7 @@ export class StatisticsComponent { createStatisticsObjects() { // console.log(" Stats! "+ this.properties.statisticsAPIURL); + this.status = this.errorCodes.LOADING; this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe ( res => { console.log('statisticsSum is:'); @@ -130,12 +133,11 @@ export class StatisticsComponent { this.statisticsSum["orp"]=res["other"]; } console.log(this.statisticsSum); + this.getDisplayOptions(); }, error => { console.log(error); - }, - () => { - this.getDisplayOptions(); + this.status = this.errorCodes.ERROR; }); } @@ -144,13 +146,14 @@ export class StatisticsComponent { .subscribe( res => { this.statisticsDisplay = res; + this.createChartUrlMap(); + this.getCommunityInfo(); + this.status = this.errorCodes.DONE; + }, error => { console.log(error); - }, - () => { - this.createChartUrlMap(); - this.getCommunityInfo(); + this.status = this.errorCodes.ERROR; } ); } diff --git a/src/app/statistics/statistics.module.ts b/src/app/statistics/statistics.module.ts index b12f902..b370fe2 100644 --- a/src/app/statistics/statistics.module.ts +++ b/src/app/statistics/statistics.module.ts @@ -16,6 +16,7 @@ import {ConfigurationService} from '../openaireLibrary/utils/configuratio import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard' @NgModule({ imports: [ @@ -27,7 +28,7 @@ import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previo StatisticsForDashboardComponent ], providers: [ - FreeGuard, PreviousRouteRecorder, ConfigurationService, + IsRouteEnabled, FreeGuard, PreviousRouteRecorder, ConfigurationService, PiwikService, CommunityService, CommunitiesService, StatisticsService, TitleCasePipe ], exports: [ diff --git a/src/app/utils/manage/manage.component.ts b/src/app/utils/manage/manage.component.ts index c53a600..13ad69b 100644 --- a/src/app/utils/manage/manage.component.ts +++ b/src/app/utils/manage/manage.component.ts @@ -10,7 +10,9 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class'; - Manage + + + Manage ` diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index b9ca27d..46acf07 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -36,7 +36,7 @@ "piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=", "piwikSiteId" : "80", - "loginUrl" :"http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login", + "loginUrl" :"http://scoobydoo.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login", "logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",