Create new page "Share in Zenodo" (add componets, routing, menu item, properties)
remove unused my-communities folder git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@53934 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
e02f4ce6f3
commit
c720c86f44
|
@ -26,6 +26,7 @@ const routes: Routes = [
|
|||
{ path: 'participate/deposit-subject-result', loadChildren: './deposit/datasets/depositBySubjectResults.module#LibDepositBySubjectResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'participate/deposit-publications', loadChildren: './deposit/publications/depositPublications.module#LibDepositPublicationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'participate/deposit-publications-result', loadChildren: './deposit/publications/depositPublicationsResults.module#LibDepositPublicationsResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'participate/share-zenodo', loadChildren: './deposit/zenodo/shareInZenodo.module#ShareInZenodoModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule', 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 }},
|
||||
|
|
|
@ -96,8 +96,11 @@ export class AppComponent {
|
|||
items: []
|
||||
},
|
||||
{
|
||||
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{communityId:community.communityId}),
|
||||
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{communityId:community.communityId}),
|
||||
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets","/participate/share-zenodo"],{communityId:community.communityId}),
|
||||
items: [
|
||||
new MenuItem("","in Zenodo","","/participate/share-zenodo",false,[],[],{communityId:community.communityId}),
|
||||
new MenuItem("","in other content providers","","",false,[],[],{}),
|
||||
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})]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import {ShareInZenodoComponent} from './shareInZenodo.component';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: ShareInZenodoComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class ShareInZenodoRoutingModule { }
|
|
@ -0,0 +1,92 @@
|
|||
|
||||
<div class=" uk-section uk-margin-small-top tm-middle uk-container" id="tm-main">
|
||||
<div class="uk-container uk-margin-bottom">
|
||||
<div class="uk-article-title custom-article-title">
|
||||
Share in Zenodo
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="masterZenodoCommunity" class="uk-animation-fade uk-alert uk-alert-primary uk-padding-small uk-margin-large-top">
|
||||
<div class="uk-text-large uk-margin-bottom" >Master Zenodo community</div>
|
||||
<div class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid>
|
||||
|
||||
<div class="uk-width-auto">
|
||||
<a target="_blank" [href]="masterZenodoCommunity.link">
|
||||
<img *ngIf="masterZenodoCommunity.logoUrl" class="uk-comment-avatar" src="{{masterZenodoCommunity.logoUrl}}" width="80" height="80" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-expand">
|
||||
<h4 class="uk-comment-title uk-margin-remove">
|
||||
<a *ngIf="masterZenodoCommunity.link" class="custom-external" target="_blank" href="{{masterZenodoCommunity.link}}">
|
||||
<span *ngIf="masterZenodoCommunity.title">{{masterZenodoCommunity.title}}</span>
|
||||
<span *ngIf="!masterZenodoCommunity.title">[no name available]</span>
|
||||
</a>
|
||||
<div *ngIf="!masterZenodoCommunity.link">
|
||||
<span *ngIf="masterZenodoCommunity.title">{{masterZenodoCommunity.title}}</span>
|
||||
<span *ngIf="!masterZenodoCommunity.title">[no name available]</span>
|
||||
</div>
|
||||
</h4>
|
||||
<div *ngIf="masterZenodoCommunity.date" class="uk-comment-meta " >
|
||||
last update: {{masterZenodoCommunity.date | date:'yyyy/MM/dd'}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<a class="uk-button portal-button" target="_blank" [href]="depositLink + masterZenodoCommunity.id " >
|
||||
<span class="uk-icon"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="upload" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></span>
|
||||
<span> New upload</span>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-comment-body uk-text-meta">
|
||||
<p *ngIf="masterZenodoCommunity.description" [innerHtml]=masterZenodoCommunity.description></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="zenodoSearchUtils.status == errorCodes.LOADING "
|
||||
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
|
||||
<span class="loading-gif uk-align-center" ></span>
|
||||
</div>
|
||||
<div *ngIf=" (zenodoSearchUtils.status == errorCodes.ERROR || zenodoSearchUtils.status == errorCodes.NONE) && !masterZenodoCommunity "
|
||||
class="uk-animation-fade uk-margin-top uk-width-1-1 uk-alert uk-alert-warning" role="alert">
|
||||
No zenodo communities found
|
||||
</div>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
|
||||
<li *ngFor="let item of communities;" class="uk-animation-fade uk-margin-top">
|
||||
<div class="uk-comment-header uk-grid-medium uk-flex-middle" uk-grid>
|
||||
<div class="uk-width-auto">
|
||||
<a target="_blank" [href]="item.link">
|
||||
<img *ngIf="item.logoUrl" class="uk-comment-avatar" src="{{item.logoUrl}}" width="80" height="80" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-expand">
|
||||
<h4 class="uk-comment-title uk-margin-remove uk-grid">
|
||||
<a class="custom-external uk-width-expand" target="_blank" href="{{item.link}}">
|
||||
<span *ngIf="item.title">{{item.title}}</span>
|
||||
<span *ngIf="!item.title">[no name available]</span>
|
||||
</a>
|
||||
<span class="uk-width-1-6 uk-text-center">
|
||||
|
||||
|
||||
</span>
|
||||
</h4>
|
||||
<div class="uk-comment-meta ">
|
||||
last update: {{item.date | date:'yyyy/MM/dd'}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a class="uk-button portal-button" target="_blank" [href]="depositLink + item.id " >
|
||||
<span class="uk-icon"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="upload" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></span>
|
||||
<span> New upload</span>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-comment-body uk-text-meta">
|
||||
<p *ngIf="item.description" [innerHtml]=item.description></p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,159 @@
|
|||
import {Component, Input, Output, EventEmitter, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Title, Meta} from '@angular/platform-browser';
|
||||
import{EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
|
||||
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
|
||||
import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo';
|
||||
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
|
||||
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
|
||||
|
||||
@Component({
|
||||
selector: 'share-in-zenodo',
|
||||
templateUrl: './shareInZenodo.component.html'
|
||||
})
|
||||
export class ShareInZenodoComponent {
|
||||
properties:EnvProperties;
|
||||
private communityId: string = null;
|
||||
private community:CommunityInfo = null;
|
||||
|
||||
|
||||
// public warningMessage = "";
|
||||
// public infoMessage = "";
|
||||
|
||||
masterZenodoCommunityId = null;
|
||||
masterZenodoCommunity = null;
|
||||
|
||||
CommunityIds = null;
|
||||
communities = [];
|
||||
|
||||
zenodocommunitiesloadedCount = 0;
|
||||
zenodoSearchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||
private errorCodes: ErrorCodes = new ErrorCodes();;
|
||||
depositLink = "https://zenodo.org/deposit/new?c=";
|
||||
|
||||
|
||||
constructor ( private route: ActivatedRoute, private _router: Router,
|
||||
private _meta: Meta, private _title: Title, private _ΖenodoCommunitieService: ZenodoCommunitiesService,private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) {}
|
||||
|
||||
public ngOnInit() {
|
||||
this.zenodoSearchUtils.status = this.errorCodes.LOADING;;
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
this.updateTitle("Share in Zenodo");
|
||||
this.updateDescription("Zenodo, repository, deposit, share");
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(document.location.hostname);
|
||||
}
|
||||
|
||||
if(this.communityId) {
|
||||
|
||||
if (this.communityId != null && this.communityId != '') {
|
||||
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe (
|
||||
community => {
|
||||
this.community = community;
|
||||
this.masterZenodoCommunityId = this.community.zenodoCommunity;
|
||||
if(this.masterZenodoCommunityId){
|
||||
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities+this.masterZenodoCommunityId, null).subscribe(
|
||||
result => {
|
||||
this.masterZenodoCommunity = result;
|
||||
|
||||
},
|
||||
error => {
|
||||
// var emptyCommunity:ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
||||
// emptyCommunity.id = this.masterZenodoCommunityId;
|
||||
// emptyCommunity.title = this.masterZenodoCommunityId;
|
||||
// this.masterZenodoCommunity = emptyCommunity;
|
||||
console.log("Master Zenodo community'"+this.masterZenodoCommunityId+"' couldn't be loaded");
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
this.zenodoSearchUtils.status = this.errorCodes.LOADING;;
|
||||
this._searchZenodoCommunitiesService.searchZCommunities(this.properties,this.communityId).subscribe (
|
||||
result => {
|
||||
this.CommunityIds = result;
|
||||
this.zenodoSearchUtils.totalResults = this.CommunityIds.length;
|
||||
if(this.CommunityIds.length == 0){
|
||||
this.zenodoSearchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
for(let i=0; i< this.CommunityIds.length; i++){
|
||||
this.getZenodoCommunityById(this.CommunityIds[i]["zenodoid"], this.CommunityIds[i]["id"]);
|
||||
}
|
||||
|
||||
},
|
||||
error => {
|
||||
console.log("list of zenodo communities couldn't be loaded");
|
||||
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
|
||||
} //this.handleError('System error retrieving community profile', error)
|
||||
);
|
||||
|
||||
},
|
||||
error => {
|
||||
console.log("Community couldn't be loaded");
|
||||
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private updateDescription(description:string){
|
||||
this._meta.updateTag({content:description},"name='description'");
|
||||
this._meta.updateTag({content:description},"property='og:description'");
|
||||
}
|
||||
private updateTitle(title:string){
|
||||
var _prefix ="OpenAIRE | ";
|
||||
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
||||
this._title.setTitle(_title);
|
||||
this._meta.updateTag({content:_title},"property='og:title'");
|
||||
}
|
||||
private updateUrl(url:string){
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
}
|
||||
getZenodoCommunityById(zenodoid, openaireId){
|
||||
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities+zenodoid, openaireId).subscribe(
|
||||
result => {
|
||||
this.communities.push(result);
|
||||
this.zenodocommunitiesloadedCount++;
|
||||
if(this.zenodocommunitiesloadedCount >= this.CommunityIds.length){
|
||||
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error => {
|
||||
// var emptyCommunity:ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
||||
// emptyCommunity.id = zenodoid;
|
||||
// emptyCommunity.openaireId = openaireId;
|
||||
// emptyCommunity.title = zenodoid;
|
||||
// this.communities.push(emptyCommunity);
|
||||
this.zenodocommunitiesloadedCount++;
|
||||
if(this.zenodocommunitiesloadedCount >= this.CommunityIds.length){
|
||||
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
||||
}
|
||||
console.log("Zenodo community'"+zenodoid+"' couldn't be loaded");
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
|
||||
|
||||
import {ShareInZenodoComponent} from './shareInZenodo.component';
|
||||
import {ShareInZenodoRoutingModule} from './shareInZenodo-routing.module';
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
ShareInZenodoComponent
|
||||
],
|
||||
providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService],
|
||||
exports: [
|
||||
ShareInZenodoComponent
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
export class ShareInZenodoModule{}
|
|
@ -1,17 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import{MyCommunitiesComponent} from './communities.component';
|
||||
|
||||
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: MyCommunitiesComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class CommunitiesRoutingModule { }
|
|
@ -1,104 +0,0 @@
|
|||
|
||||
|
||||
<div class="image-front-topbar uk-section-muted uk-section-overlap uk-light" uk-scrollspy="{"target":"[uk-scrollspy-class]","cls":"uk-animation-slide-top","delay":false}" tm-header-transparent="light" tm-header-transparent-placeholder="">
|
||||
<div style=" background-color: #1e3040;" class=" mainPageSearchForm uk-background-norepeat uk-background-cover uk-background-top-center uk-background-fixed uk-section uk-section-large uk-padding-remove-bottom">
|
||||
<div class="tm-header-placeholder uk-margin-remove-adjacent" style="height: 84px;"></div>
|
||||
<div class="uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid uk-grid-stack" uk-grid="">
|
||||
<div class="uk-width-1-1@m uk-first-column">
|
||||
<h5 class="uk-margin-large uk-text-center uk-h1 uk-scrollspy-inview uk-animation-slide-top" uk-scrollspy-class="" style="">
|
||||
Research Community Dashboard
|
||||
</h5>
|
||||
<h1 class="uk-text-center uk-h2 uk-scrollspy-inview uk-animation-slide-top" uk-scrollspy-class="" style="">
|
||||
Your view to open science
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf= "communitiesResults != null && communitiesResults.length > 0">
|
||||
<div class="uk-container uk-margin-top uk-margin-bottom">
|
||||
<!--h2>Research Initiatives </h2-->
|
||||
<div class="uk-child-width-1-3@m uk-text-center uk-grid-match " uk-grid >
|
||||
<ng-container *ngFor="let item of communitiesResults; let i = index">
|
||||
<div *ngIf="showCommunity(item) && item.type=='ri'" class="uk-card uk-card-default uk-margin-bottom">
|
||||
<span >
|
||||
<div class="uk-card-media-top">
|
||||
<img *ngIf= "item.logoUrl != null && item.logoUrl != '' " src="{{item.logoUrl}}" alt="{{(item.title)?item.title:item.shortTitle}} logo" class="uk-height-small uk-responsive-height ">
|
||||
<span *ngIf= "item.logoUrl == null || item.logoUrl == '' " class="uk-icon uk-margin-top">
|
||||
<svg width="50" height="50" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle> <path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path> <path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<div class="uk-card-body">
|
||||
<div>
|
||||
<div *ngIf="item.status !='all'" class="uk-float-right" uk-tooltip="title: Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100">
|
||||
<span class="private-view-label uk-label uk-label-success " aria-expanded="false">Private view</span>
|
||||
</div>
|
||||
<div *ngIf="item.type =='ri'" class="" >
|
||||
<span class="ri-label uk-label uk-label-info " aria-expanded="false">Research Initiative</span>
|
||||
</div>
|
||||
<div *ngIf="item.type !='ri'" class="" >
|
||||
<span class="uk-label rc-label uk-label-warning " aria-expanded="false">Research Community</span>
|
||||
</div>
|
||||
<h3 class="uk-card-title">
|
||||
<a *ngIf="!isProduction()" [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/" target="_blank">
|
||||
{{(item.title)?item.title:item.shortTitle}}</a>
|
||||
<a *ngIf="isProduction()" href="{{'https://'+getProductionPrefix()+item.communityId+'.openaire.eu'}}" target="_blank">
|
||||
{{(item.title)?item.title:item.shortTitle}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<p *ngIf="item.description != null" >{{item.description}}</p>
|
||||
<subscribe [communityId]="item.communityId"></subscribe>
|
||||
<manage [communityId]="item.communityId"></manage>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<!--h2>Research communities </h2-->
|
||||
<div class="uk-child-width-1-3@m uk-text-center uk-grid-match " uk-grid >
|
||||
<ng-container *ngFor="let item of communitiesResults; let i = index">
|
||||
<div *ngIf="showCommunity(item) && item.type!='ri'" class="uk-card uk-card-default uk-margin-bottom">
|
||||
<span >
|
||||
<div class="uk-card-media-top">
|
||||
<img *ngIf= "item.logoUrl != null && item.logoUrl != '' " src="{{item.logoUrl}}" alt="{{(item.title)?item.title:item.shortTitle}} logo" class="uk-height-small uk-responsive-height ">
|
||||
<span *ngIf= "item.logoUrl == null || item.logoUrl == '' " class="uk-icon uk-margin-top">
|
||||
<svg width="50" height="50" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle> <path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path> <path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<div class="uk-card-body">
|
||||
<div>
|
||||
<div *ngIf="item.status !='all'" class="uk-float-right" uk-tooltip="title: Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100">
|
||||
<span class="private-view-label uk-label uk-label-success " aria-expanded="false">Private view</span>
|
||||
</div>
|
||||
<div *ngIf="item.type =='ri'" class="" >
|
||||
<span class="ri-label uk-label uk-label-info " aria-expanded="false">Research Initiative</span>
|
||||
</div>
|
||||
<div *ngIf="item.type !='ri'" class="" >
|
||||
<span class="uk-label rc-label uk-label-warning " aria-expanded="false">Research Community</span>
|
||||
</div>
|
||||
<h3 class="uk-card-title">
|
||||
<a *ngIf="!isProduction()" [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/" target="_blank">
|
||||
{{(item.title)?item.title:item.shortTitle}}</a>
|
||||
<a *ngIf="isProduction()" href="{{'https://'+getProductionPrefix()+item.communityId+'.openaire.eu'}}" target="_blank">
|
||||
{{(item.title)?item.title:item.shortTitle}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<p *ngIf="item.description != null" >{{item.description}}</p>
|
||||
<subscribe [communityId]="item.communityId"></subscribe>
|
||||
<manage [communityId]="item.communityId"></manage>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,101 +0,0 @@
|
|||
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
||||
import {ViewChild, ChangeDetectionStrategy} from '@angular/core';
|
||||
import {ViewEncapsulation} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
import {Title, Meta} from '@angular/platform-browser';
|
||||
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
import "rxjs/add/observable/zip";
|
||||
|
||||
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
||||
|
||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import {Session} from '../openaireLibrary/login/utils/helper.class';
|
||||
@Component({
|
||||
selector: 'communities',
|
||||
templateUrl: 'communities.component.html',
|
||||
})
|
||||
|
||||
export class MyCommunitiesComponent {
|
||||
public piwiksub: any;
|
||||
public subfunders: any;
|
||||
|
||||
public pageTitle = "OpenAIRE"
|
||||
|
||||
public communitiesResults = null;
|
||||
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
private location: Location,
|
||||
private _meta: Meta,
|
||||
private _title: Title,
|
||||
private _piwikService:PiwikService,
|
||||
private _communitiesService:CommunitiesService,
|
||||
private config: ConfigurationService) {
|
||||
|
||||
var description = "Community Dashboard";
|
||||
var title = "Community Dashboard";
|
||||
|
||||
this._meta.updateTag({content:description},"name='description'");
|
||||
this._meta.updateTag({content:description},"property='og:description'");
|
||||
this._meta.updateTag({content:title},"property='og:title'");
|
||||
this._title.setTitle(title);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
var url = data.envSpecific.baseLink+this._router.url
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();
|
||||
}
|
||||
|
||||
this._communitiesService.getCommunities(this.properties, this.properties.communitiesAPI).subscribe(
|
||||
communitiesResults => {
|
||||
this.communitiesResults = communitiesResults;
|
||||
//console.log(communitiesResults);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
if(this.piwiksub){
|
||||
this.piwiksub.unsubscribe();
|
||||
}
|
||||
}
|
||||
isProduction():boolean{
|
||||
return ConnectHelper.isProduction(document.location.hostname);
|
||||
|
||||
}
|
||||
getProductionPrefix():string{
|
||||
return ConnectHelper.getProductionPrefix(document.location.hostname);
|
||||
}
|
||||
showCommunity(community):boolean{
|
||||
if(community['status'] == "hidden"){
|
||||
return false;
|
||||
}else if(community['status'] == "manager"){
|
||||
var mail = Session.getUserEmail();
|
||||
if(mail == null){ // no user
|
||||
return false;
|
||||
}else if(Session.isCommunityCurator() || Session.isPortalAdministrator()){
|
||||
return true;
|
||||
}else if(community.managers.indexOf(mail)!=-1){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
import {CommunitiesRoutingModule} from './communities-routing.module';
|
||||
import {SubscribeModule} from '../utils/subscribe/subscribe.module';
|
||||
import {ManageModule} from '../utils/manage/manage.module';
|
||||
|
||||
import {MyCommunitiesComponent} from './communities.component';
|
||||
|
||||
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, RouterModule,
|
||||
CommunitiesRoutingModule,
|
||||
SubscribeModule, ManageModule
|
||||
],
|
||||
declarations: [
|
||||
MyCommunitiesComponent
|
||||
],
|
||||
providers:[
|
||||
FreeGuard, PreviousRouteRecorder, ConfigurationService,
|
||||
PiwikService, CommunitiesService
|
||||
],
|
||||
exports: [
|
||||
MyCommunitiesComponent
|
||||
]
|
||||
})
|
||||
export class MyCommunitiesModule { }
|
|
@ -30,6 +30,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",
|
||||
|
|
Loading…
Reference in New Issue