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
This commit is contained in:
argiro.kokogiannaki 2018-11-29 11:40:38 +00:00
parent 6eb317c739
commit 15a93413ac
11 changed files with 63 additions and 69 deletions

View File

@ -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",

View File

@ -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;

View File

@ -53,13 +53,13 @@
<subscribe *ngIf="communityId != null" [communityId]="communityId" showNumbers=true class="uk-margin-left"></subscribe>
<span *ngIf="masterZenodoCommunity || zenodoCommunityIdS.length > 0 && IsRouteEnabled('/participate/share-zenodo')" class="uk-margin-left">
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/participate/share-zenodo" >
Zenodo communities <span *ngIf=" zenodoCommunityIdS.length > 0">: {{zenodoCommunityIdS.length}}</span>
Zenodo communities:<span> {{zenodoCommunityIdS.length + ((masterZenodoCommunity)?1:0)}}</span>
</a>
</span>
</p>
</div>
<div *ngIf="communityId != null && communityId != ''" class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-grid" uk-grid="">
<div *ngIf="publicationTotal != null && IsEntityEnabled('publication') && IsRouteEnabled('/search/find/publications')" class="uk-first-column">
<div *ngIf="communityId != null && communityId != ''" class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-grid uk-grid-medium ">
<div *ngIf="publicationTotal != null && IsEntityEnabled('publication') && IsRouteEnabled('/search/find/publications')" class=" uk-padding-remove-left uk-first-column">
<div class="uk-card uk-card-default uk-card-small uk-card-body">
<div>
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/publications" ><h3 class="uk-card-title">{{publicationTotal|number}}</h3>
@ -136,7 +136,7 @@
</article>
</div>
<div class="uk-width-1-5@m uk-width-1-1@s uk-padding-small uk-margin-large-top">
<div *ngIf="showInvite()" class="uk-width-1-5@m uk-width-1-1@s uk-padding-small uk-margin-large-top">
<invite [longView]=false></invite>
</div>
</div>

View File

@ -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;
}
}

View File

@ -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=";

View File

@ -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] }
])
]

View File

@ -70,7 +70,7 @@
</tr> -->
<tr>
<td for="email.body" class="uk-text-bold uk-text-right">Message:</td>
<td class="uk-text-left">
<td *ngIf= "allowEdit()" class="uk-text-left">
<ckeditor (click)="resetMessages()"
class="form-control" [(ngModel)] = "body.paragraphs" id="message"
debounce="400"
@ -87,6 +87,10 @@
class="form-control uk-input uk-width-large@l uk-width-medium@s" [(ngModel)] = "email.body" id="message">
</textarea> -->
</td>
<td *ngIf= "!allowEdit()" class="uk-text-left">
<div [innerHtml] = "body.paragraphs"></div>
</td>
</tr>
<tr>
<td></td>

View File

@ -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()
}
}

View File

@ -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: [

View File

@ -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=",

View File

@ -55,14 +55,11 @@
}
</script>
<!-- <script src="assets/common-assets/jquery/jquery.min.js" type="text/javascript"></script> -->
<script src="assets/common-assets/common/jquery.js"></script>
<script src="assets/common-assets/citeproc.js"></script>
<script src="assets/common-assets/common/uikit.js"></script>
<!-- <script src="assets/common-assets/common/uikit.js"></script> -->
<script src="assets/common-assets/common/uikit-icons-max.js"></script>
<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
<script src="config.js"></script>
<script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
<script>
$(document).ready(function(){
console.log("Is ready - load uikit ***")
@ -71,44 +68,14 @@ $(document).ready(function(){
});
</script>
<script>
var logoutClicked = function(){
console.log("jqery logout!");
// no
// $("#logout1").load("https://dl067.madgik.di.uoa.gr/idp/profile/Logout");
//yes
// window.open('https://dl067.madgik.di.uoa.gr/idp/profile/Logout','_blank','toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,visible=none', '');
// no
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", "https://dl067.madgik.di.uoa.gr/idp/profile/Logout", true );
xmlHttp.send( null );
};
</script>
<!-- <script src="assets/common-assets/common/uikit.js"></script> -->
<!-- <script src="assets/common-assets/common/uikit-icons-max.js"></script> -->
<link rel="stylesheet" href="assets/common-assets/common/theme.css">
<link rel="stylesheet" href="assets/common-assets/common/custom.css">
<link rel="stylesheet" href="assets/common-assets/library.css">
<link rel="stylesheet" href="assets/connect-custom.css">
<!-- <script async src="assets/common-assets/common/theme.js"></script> -->
<script src="assets/common-assets/clipboard.min.js"></script>
<!--script type='text/javascript' src="node_modules/clipboard/dist/clipboard.min.js"></script-->
<!--script src="https://cdn.jsdelivr.net/clipboard.js/1.5.12/clipboard.min.js"></script-->
<!--script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/common-assets/embed.js'></script-->
<!-- End of Google sitelinks search markup-->
</head>