From 15a93413ace209d2ad8a33c5e28894847bea47e0 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 29 Nov 2018 11:40:38 +0000 Subject: [PATCH] update beta properties correct menu items for beta - don't add communityId parameter if doesn't exist Community add number of total zenodo communities (master + sub communities) show invite only for admins and managers Invite: html edit form only for managers and admin, simple users can't change route requires login Index.html clean up git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@54047 d315682c-612b-4755-9ff5-7f18f6832af3 --- connect-production-properties.json | 17 ++++++--- src/app/app.component.ts | 16 ++++---- src/app/community/community.component.html | 8 ++-- src/app/community/community.component.ts | 11 ++++++ .../deposit/zenodo/shareInZenodo.component.ts | 2 +- .../subscribe/invite/invite-routing.module.ts | 4 +- .../subscribe/invite/invite.component.html | 6 ++- .../subscribe/invite/invite.component.ts | 10 +++++ .../utils/subscribe/invite/invite.module.ts | 4 +- src/assets/env-properties.json | 17 +++------ src/index.html | 37 +------------------ 11 files changed, 63 insertions(+), 69 deletions(-) diff --git a/connect-production-properties.json b/connect-production-properties.json index 88485ce..12cb602 100644 --- a/connect-production-properties.json +++ b/connect-production-properties.json @@ -3,7 +3,7 @@ "enablePiwikTrack" : true, "enableHelper" : true, "useCache" : true, - "showContent" : false, + "showContent" : true, "metricsAPIURL" : "https://beta.services.openaire.eu/usagestats/", "framesAPIURL" : "https://beta.openaire.eu/stats3/", "statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/", @@ -23,6 +23,7 @@ "openDoarURL": "http://v2.sherpa.ac.uk/id/repository/", "r3DataURL": "http://service.re3data.org/repository/", "zenodo" : "https://zenodo.org/", + "zenodoCommunities" : "https://zenodo.org/api/communities/", "openAccess" : "https://www.openaire.eu/support/faq#article-id-234", "openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310", "fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme", @@ -49,11 +50,11 @@ "cacheUrl" :"https://demo.openaire.eu/cache/get?url=", - "datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/", "adminToolsAPIURL" :"https://beta.services.openaire.eu/uoa-admin-tools", "adminToolsCommunity" :"openaire", + "datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/", "contextsAPI":"https://beta.services.openaire.eu/openaire/context", "communityAPI": "https://beta.services.openaire.eu/openaire/community/", "communitiesAPI": "https://beta.services.openaire.eu/openaire/community/communities", @@ -89,13 +90,19 @@ "searchLinkToAdvancedProjects" : "/search/advanced/projects", "searchLinkToAdvancedDatasets" : "/search/advanced/datasets", "searchLinkToAdvancedSoftware" : "/search/advanced/software", - "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", "searchLinkToAdvancedOrps" : "/search/advanced/other", + "searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders", "searchLinkToAdvancedOrganizations" : "/search/advanced/organizations", "searchLinkToAdvancedPeople" : "/search/advanced/people", - "lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows", - "showLastIndexInformationLink" : false, + + "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/", + + + "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", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index cb5fc27..3b78973 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -81,7 +81,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","","",false,[],[],{}), + {rootItem: new MenuItem("search","Search","","/search/find",false,[],["/search/find"],(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}), @@ -94,14 +94,14 @@ export class AppComponent { items: [] }, { - rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets","/participate/share-zenodo"],{communityId:community.communityId}), + rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets","/participate/share-zenodo"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), items: [ - new MenuItem("","Zenodo Communities","","/participate/share-zenodo",false,[],["/participate/share-zenodo"],{communityId:community.communityId}), - new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{communityId:community.communityId}), - new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{communityId:community.communityId})] + new MenuItem("","Zenodo Communities","","/participate/share-zenodo",false,[],["/participate/share-zenodo"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId})] }, { - rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{communityId:community.communityId}), + rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), items: [] } ]; @@ -133,8 +133,8 @@ export class AppComponent { this.bottomMenuItems.push(new MenuItem("","Content Policy","","/content",false,[],[],{})); } this.userMenuItems =[ new MenuItem("","My profile","","",false,[],[],{}), - new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],(data['communityId'] && typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:data['communityId']}), - new MenuItem("","Invite users","","/invite",false,[],[],(data['communityId'] && typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:data['communityId']}), + new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), + new MenuItem("","Invite users","","/invite",false,[],[],(typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:community.communityId}), ]; } this.showMenu = true; diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 3c5cb90..b16775c 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -53,13 +53,13 @@ - Zenodo communities : {{zenodoCommunityIdS.length}} + Zenodo communities: {{zenodoCommunityIdS.length + ((masterZenodoCommunity)?1:0)}}

-
-
+
+
-
+
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 7984893..338ad96 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -19,6 +19,7 @@ import {PiwikService} from '../openaireLibrary/utils/piwik/piwik import {SearchEntriesService} from '../searchEntries/searchEntries.service'; import {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service'; import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; +import {Session} from '../openaireLibrary/login/utils/helper.class'; import {PiwikHelper} from '../utils/piwikHelper'; @@ -243,4 +244,14 @@ export class CommunityComponent { IsRouteEnabled(route: string) { return this.communityInfo.pages.some(x => x['route'] == route && x['isEnabled']===true); } + showInvite(){ + // console.log(Session.isPortalAdministrator() + Session.isCommunityCurator()) + var email = Session.getUserEmail(); + var index =-1; + if(email && this.community != null && this.community.managers != null){ + index = this.community.managers.indexOf(email); + } + + return Session.isPortalAdministrator() || Session.isCommunityCurator() || index != -1; + } } diff --git a/src/app/deposit/zenodo/shareInZenodo.component.ts b/src/app/deposit/zenodo/shareInZenodo.component.ts index 4cc44b7..2ecd728 100644 --- a/src/app/deposit/zenodo/shareInZenodo.component.ts +++ b/src/app/deposit/zenodo/shareInZenodo.component.ts @@ -34,7 +34,7 @@ export class ShareInZenodoComponent { zenodocommunitiesloadedCount = 0; zenodoSearchUtils:SearchUtilsClass = new SearchUtilsClass(); - private errorCodes: ErrorCodes = new ErrorCodes();; + errorCodes: ErrorCodes = new ErrorCodes();; depositLink = "https://zenodo.org/deposit/new?c="; diff --git a/src/app/utils/subscribe/invite/invite-routing.module.ts b/src/app/utils/subscribe/invite/invite-routing.module.ts index 9223c7c..c23d9d3 100644 --- a/src/app/utils/subscribe/invite/invite-routing.module.ts +++ b/src/app/utils/subscribe/invite/invite-routing.module.ts @@ -2,13 +2,13 @@ import {NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import {InviteComponent} from './invite.component'; -import {FreeGuard} from '../../../openaireLibrary/login/freeGuard.guard'; +import {LoginGuard} from '../../../openaireLibrary/login/loginGuard.guard'; import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; @NgModule({ imports: [ RouterModule.forChild([ - { path: '', component: InviteComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } + { path: '', component: InviteComponent, canActivate: [LoginGuard], canDeactivate: [PreviousRouteRecorder] } ]) ] diff --git a/src/app/utils/subscribe/invite/invite.component.html b/src/app/utils/subscribe/invite/invite.component.html index 519dee2..cccccf0 100644 --- a/src/app/utils/subscribe/invite/invite.component.html +++ b/src/app/utils/subscribe/invite/invite.component.html @@ -70,7 +70,7 @@ --> Message: - + --> + + +
+ diff --git a/src/app/utils/subscribe/invite/invite.component.ts b/src/app/utils/subscribe/invite/invite.component.ts index ecb170d..681bf30 100644 --- a/src/app/utils/subscribe/invite/invite.component.ts +++ b/src/app/utils/subscribe/invite/invite.component.ts @@ -12,6 +12,7 @@ import {EnvProperties} from '../../../openaire import {EmailService} from '../../../openaireLibrary/utils/email/email.service'; import {CommunityService} from "../../../openaireLibrary/connect/community/community.service"; import {ErrorCodes} from '../../../openaireLibrary/utils/properties/errorCodes'; +import {Session} from '../../../openaireLibrary/login/utils/helper.class'; @Component({ selector: 'invite', @@ -242,4 +243,13 @@ export class InviteComponent implements OnInit { } console.log('Server responded: ' + error); } + allowEdit(){ + var email = Session.getUserEmail(); + var index =-1; + if(email && this.community != null && this.community.managers != null){ + index = this.community.managers.indexOf(email); + } + + return Session.isPortalAdministrator() || Session.isCommunityCurator() + } } diff --git a/src/app/utils/subscribe/invite/invite.module.ts b/src/app/utils/subscribe/invite/invite.module.ts index 1cfccf2..5995fe2 100644 --- a/src/app/utils/subscribe/invite/invite.module.ts +++ b/src/app/utils/subscribe/invite/invite.module.ts @@ -9,7 +9,7 @@ import {InviteRoutingModule} from './invite-routing.module'; import {PreviousRouteRecorder} from '../../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {FreeGuard} from '../../../openaireLibrary/login/freeGuard.guard'; +import {LoginGuard} from '../../../openaireLibrary/login/loginGuard.guard'; import {EmailService} from '../../../openaireLibrary/utils/email/email.service'; import {CommunityService} from '../../../openaireLibrary/connect/community/community.service'; import {ErrorMessagesModule} from '../../../openaireLibrary/utils/errorMessages.module'; @@ -22,7 +22,7 @@ import {ErrorMessagesModule} from '../../../openaireLibrary/utils/errorMe InviteComponent ], providers: [ - FreeGuard, PreviousRouteRecorder, + LoginGuard, PreviousRouteRecorder, EmailService, CommunityService ], exports: [ diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index d713c04..b9ca27d 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -9,18 +9,11 @@ "statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/", "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", "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/", - "searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", - - - "csvAPIURL" : "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/reports", - "searchCrossrefAPIURL" : "https://api.crossref.org/works", "searchDataciteAPIURL" : "https://api.datacite.org/works", - "searchOrcidURL" : "https://pub.orcid.org/v2.1/", "pmidURL" : "http://www.ncbi.nlm.nih.gov/pubmed/", "doiURL" : "https://dx.doi.org/", @@ -37,14 +30,12 @@ "h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020", "ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", "helpdesk" : "https://www.openaire.eu/support/helpdesk", - "uploadService" : "http://scoobydoo.di.uoa.gr:8000/upload", "vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/", "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", "logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=", @@ -62,7 +53,6 @@ "adminToolsAPIURL" :"http://scoobydoo.di.uoa.gr:8080/uoa-admin-tools", "adminToolsCommunity" :"openaire", - "datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/", "contextsAPI":"https://dev-openaire.d4science.org/openaire/context", "communityAPI": "https://dev-openaire.d4science.org/openaire/community/", @@ -105,7 +95,12 @@ "searchLinkToAdvancedPeople" : "/search/advanced/people", - "lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows", + "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/", + + + "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=", diff --git a/src/index.html b/src/index.html index 852d04e..b43dd32 100644 --- a/src/index.html +++ b/src/index.html @@ -55,14 +55,11 @@ } - - - + - - + - - - - - - - - - - - - -