Merge branch 'develop'

This commit is contained in:
argirok 2024-06-13 11:06:36 +03:00
commit be730e7857
45 changed files with 786 additions and 2248 deletions

View File

@ -197,7 +197,7 @@
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
"src/styles.less"
],
"scripts": [],
"assets": [

View File

@ -5,9 +5,9 @@
"ng": "ng",
"start": "ng serve --disable-host-check --host 0.0.0.0 --port 4200",
"build": "ng build",
"build-dev": "ng build --configuration=development",
"build-beta": "ng build --configuration=beta",
"build-prod": "ng build --configuration production",
"build-dev": "ng build --configuration=development && ng test --watch=false",
"build-beta": "ng build --configuration=beta && ng test --watch=false",
"build-prod": "ng build --configuration production && ng test --watch=false",
"webpack-bundle-analyzer": "ng build --stats-json && webpack-bundle-analyzer dist/connect/browser/stats.json --host 0.0.0.0",
"test": "ng test",
"e2e": "ng e2e",

View File

@ -128,8 +128,13 @@ export function app() {
referer = isArray(req.headers.referer) ? req.headers.referer[0] : (<string>req.headers.referer);
referer = referer.split("?")[0];
}
if (referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") != -1 || referer.indexOf(".d4science.org") != -1)) {
// res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
if (referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") != -1 || referer.indexOf(".d4science.org") != -1 || referer.indexOf(".di.uoa.gr") != -1 || referer.indexOf(".openaire.eu") != -1 )) {
res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
res.header('Access-Control-Allow-Origin',req.headers.origin);
res.header('Access-Control-Allow-Methods', 'GET, HEAD, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Cache-control, Expires, Content-Type, Pragma');
res.header('Allow', 'GET, HEAD, OPTIONS');
} else {
res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');
}
@ -198,6 +203,30 @@ export function app() {
buildCss(req.params.id, req.params.suffix, variables);
res.status(200).send({code: 200, message: 'CSS build for ' + req.params.id + ' layout was successful'});
});
server.get('/health-check', async (_req, res, _next) => {
var uptime = process.uptime();
const date = new Date(uptime*1000);
const days = date.getUTCDate() - 1,
hours = date.getUTCHours(),
minutes = date.getUTCMinutes(),
seconds = date.getUTCSeconds(),
milliseconds = date.getUTCMilliseconds();
const healthcheck = {
uptime: days + " days, " + hours + " hours, " + minutes + " minutes, " + seconds + " seconds, " + milliseconds + " milliseconds",
message: 'OK',
timestamp: new Date()
};
try {
res.send(healthcheck);
} catch (error) {
healthcheck.message = error;
res.status(503).send();
}
});
// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser

View File

@ -1,69 +0,0 @@
<ng-template #card let-organization="organization" let-fullView="fullView">
<div [class]="fullView?'uk-card-body uk-height-1-1 uk-flex uk-flex-column uk-flex-around':''">
<div class="affiliation-logo">
<img *ngIf="organization.logo_url"
[src]="organization.logo_url | urlPrefix"
alt="{{(organization.name)?organization.name:''}} logo"
class="uk-blend-multiply uk-height-max-xsmall" loading="lazy">
</div>
<div class="affiliation-name multi-line-ellipsis lines-3" *ngIf="organization.name && fullView">
<p class="uk-text-emphasis uk-text-bold uk-margin-remove">
{{organization.name}}
</p>
</div>
</div>
</ng-template>
<ng-container *ngIf="affiliations.length > 0">
<div *ngIf="showLoading" class="uk-animation-fade uk-width-1-1" role="alert">
<span class="loading-gif uk-align-center"></span>
</div>
<div *ngIf="longView"
class="uk-child-width-1-5@xl uk-child-width-1-4@l uk-child-width-1-3@m uk-child-width-1-2@s uk-text-center uk-grid"
uk-height-match="target: .affiliation-logo, .affiliation-name"
uk-scrollspy="cls: uk-animation-fade; target: .uk-card; repeat: false"
uk-grid>
<div *ngFor="let affiliation of affiliations;">
<div>
<div class="uk-card uk-card-default uk-card-hover affiliationCard">
<a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix" class="uk-link-reset">
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation, fullView: true}"></ng-container>
</a>
<span *ngIf="!affiliation.website_url" class="uk-link-reset">
<ng-container *ngTemplateOutlet="card; context: { organization: affiliation, fullView: true}"></ng-container>
</span>
</div>
</div>
</div>
</div>
<div *ngIf="affiliations.length > 0 && communityFirstPage && !longView" class="uk-margin-large-top uk-margin-large-bottom uk-grid" uk-grid>
<div class="uk-width-1-3@m">
<h2>
Supporting Organizations
</h2>
<a class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-margin-top"
routerLinkActive="router-link-active" routerLink="/organizations">
<span class="uk-flex uk-flex-middle">
<span>Browse all</span>
</span>
</a>
</div>
<div class="uk-width-2-3@m">
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-2@s supportingOrganizations" uk-grid>
<div *ngFor="let affiliation of affiliations.slice(0,9);">
<a *ngIf="affiliation.website_url" target="_blank" [href]="affiliation.website_url | urlPrefix" class="uk-link-reset">
<ng-container *ngTemplateOutlet="card; context: {organization: affiliation, fullView: false}"></ng-container>
</a>
<span *ngIf="!affiliation.website_url" class="uk-link-reset">
<ng-container *ngTemplateOutlet="card; context: {organization: affiliation, fullView: false}"></ng-container>
</span>
</div>
</div>
</div>
</div>
</ng-container>
<!--<div *ngIf="affiliations.length == 0 && longView" class="uk-animation-fade uk-alert uk-alert-primary" role="alert">-->
<!-- No affiliations available-->
<!--</div>-->

View File

@ -1,18 +0,0 @@
.affiliationCard {
width: 260px !important;
height: 260px !important;
}
.supportingOrganizations a {
img, svg {
-webkit-filter: grayscale(1);
filter: grayscale(1);
transition-duration: 0.3s;
}
&:hover img, svg {
-webkit-filter: grayscale(0);
filter: grayscale(0);
transition-duration: 0.3s;
}
}

View File

@ -1,58 +0,0 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
import {Affiliation} from "../openaireLibrary/utils/entities/CuratorInfo";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
@Component({
selector: 'affiliations',
templateUrl: './affiliations.component.html',
styleUrls: ['./affiliations.component.less']
})
export class AffiliationsComponent {
@Input() getAffiliationsFromAPI: boolean = false;
@Input() longView: boolean = false;
@Input() communityFirstPage: boolean = false;
@Input() affiliationsInSlider: number = 5;
@Input() affiliations: Affiliation[] = [];
@Input() sliderOptions = '';
@Input() arrows = true;
public showLoading: boolean = false;
public communityId: string;
public properties: EnvProperties = properties;
private subscriptions = [];
constructor(private route: ActivatedRoute, private affiliationService: AffiliationService) {
}
public ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (this.getAffiliationsFromAPI) {
this.showLoading = true;
this.affiliationService.initAffiliations(this.communityId);
this.subscriptions.push(this.affiliationService.affiliations.subscribe(
affiliations => {
this.affiliations = affiliations.filter((affiliation) => this.longView || !!affiliation['logo_url']);
this.showLoading = false;
},
error => {
console.error("Affiliations Component: Error getting affiliations for community with id: " + this.communityId, error);
this.showLoading = false;
}
));
}
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
this.affiliationService.clearSubscriptions();
}
}

View File

@ -1,26 +0,0 @@
import {NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard'
import {RouterModule} from '@angular/router';
import {AffiliationsComponent} from './affiliations.component';
import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
import {CommonModule} from "@angular/common";
import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module";
@NgModule({
imports: [
CommonModule, RouterModule, UrlPrefixModule
],
declarations: [
AffiliationsComponent
],
providers:[PreviousRouteRecorder, IsRouteEnabled, AffiliationService],
exports: [
AffiliationsComponent
]
})
export class AffiliationsModule{}

View File

@ -2,7 +2,7 @@ import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {OpenaireErrorPageComponent} from './error/errorPage.component';
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard";
import {CommunityAccessGuard} from "./utils/communityAccess.guard";
const routes: Routes = [
// ORCID Pages
@ -40,37 +40,33 @@ const routes: Routes = [
{
path: 'content',
loadChildren: () => import('./content/contentPage.module').then(m => m.ContentPageModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'sdgs',
loadChildren: () => import('./sdg/sdg.module').then(m => m.LibSdgModule),
data: {hasQuickContact: false}
},
{
path: 'fields-of-science',
loadChildren: () => import('./fos/fos.module').then(m => m.LibFosModule),
data: {extraOffset: 100, hasQuickContact: false}
},
{path: 'fields-of-science', loadChildren: () => import('./openaireLibrary/fos/fos.module').then(m => m.FosModule), data: {extraOffset: 100, hasQuickContact: false}},
{
path: 'organizations',
loadChildren: () => import('./htmlPages/organizations/organizationsPage.module').then(m => m.OrganizationsPageModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'publications',
loadChildren: () => import('./htmlPages/publications/publications-page.module').then(m => m.PublicationsPageModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'projects',
loadChildren: () => import('./htmlPages/projects/projectsPage.module').then(m => m.ProjectsPageModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'national-bulletins',
loadChildren: () => import('./htmlPages/nationalBulletins/nationalBulletinsPage.module').then(m => m.NaionalBulletinPageModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'faqs',
@ -88,24 +84,24 @@ const routes: Routes = [
// {
// path: '',
// loadChildren: () => import('./htmlPages/featured/featuredPage.module').then(m => m.FeaturedPageModule),
// data: {hasQuickContact: false}, canActivateChild: [IsCommunity],
// data: {hasQuickContact: false}, canActivateChild: [CommunityAccessGuard],
// },
// {
// path: '**',
// loadChildren: () => import('./htmlPages/featured/featuredPage.module').then(m => m.FeaturedPageModule),
// data: {hasQuickContact: false}, canActivateChild: [IsCommunity],
// data: {hasQuickContact: false}, canActivateChild: [CommunityAccessGuard],
// },
// ]
// },
{
path: 'curators',
loadChildren: () => import('./curators/curators.module').then(m => m.CuratorsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
loadChildren: () => import('./openaireLibrary/connect/components/curators/curators.module').then(m => m.CuratorsModule),
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'subjects',
loadChildren: () => import('./subjects/subjects.module').then(m => m.SubjectsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'myCommunities',
@ -114,7 +110,7 @@ const routes: Routes = [
{
path: 'develop',
loadChildren: () => import('./develop/develop.module').then(m => m.DevelopModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
/** Testing Page for help contents */
{path: 'helper-test', loadChildren: () => import('./helper-test/helper-test.module').then(m => m.HelperTestModule)},
@ -122,41 +118,41 @@ const routes: Routes = [
{
path: 'search/result',
loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/publication',
loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/dataset',
loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/software',
loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/project',
loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/dataprovider',
loadChildren: () => import('././landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/organization',
loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule),
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [IsCommunity]
data: {hasQuickContact: false, hasMenuSearchBar: true}, canActivate: [CommunityAccessGuard]
},
/** Search Pages */
{path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'},
@ -168,86 +164,86 @@ const routes: Routes = [
{
path: 'search/find/research-outcomes',
loadChildren: () => import('./searchPages/simple/searchResearchResults.module').then(m => m.OpenaireSearchResearchResultsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/publications',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/datasets',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/software',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/other',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/projects',
loadChildren: () => import('./searchPages/simple/searchProjects.module').then(m => m.LibSearchProjectsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/find/dataproviders',
loadChildren: () => import('./searchPages/simple/searchDataProviders.module').then(m => m.LibSearchDataProvidersModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
/** Advanced Search Pages */
{
path: 'search/advanced/research-outcomes',
loadChildren: () => import('./searchPages/advanced/searchResearchResults.module').then(m => m.OpenaireAdvancedSearchResearchResultsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/publications',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/datasets',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/software',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/other',
component: PageURLResolverComponent,
data: {hasQuickContact: false},
canActivate: [IsCommunity]
canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/organizations',
loadChildren: () => import('./searchPages/advanced/advancedSearchOrganizations.module').then(m => m.LibAdvancedSearchOrganizationsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/dataproviders',
loadChildren: () => import('./searchPages/advanced/advancedSearchDataProviders.module').then(m => m.LibAdvancedSearchDataProvidersModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'search/advanced/projects',
loadChildren: () => import('./searchPages/advanced/advancedSearchProjects.module').then(m => m.LibAdvancedSearchProjectsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
/** Deposit Pages */
{ path: 'participate/deposit-datasets',
@ -271,37 +267,42 @@ const routes: Routes = [
{
path: 'participate/deposit/learn-how',
loadChildren: () => import('./deposit/deposit.module').then(m => m.LibDepositModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'participate/deposit/search',
loadChildren: () => import('./deposit/searchDataprovidersToDeposit.module').then(m => m.LibSearchDataprovidersToDepositModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'participate/deposit/zenodo',
loadChildren: () => import('./deposit/zenodo/shareInZenodo.module').then(m => m.ShareInZenodoModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'participate/deposit/suggested',
loadChildren: () => import('./deposit/suggested/suggestedRepositories.module').then(m => m.SuggestedRepositoriesModule),
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
/** Linking Pages */
{
path: 'myclaims', loadChildren: () => import('./claims/myClaims/myClaims.module').then(m => m.LibMyClaimsModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'participate/claim',
loadChildren: () => import('./claims/linking/linkingGeneric.module').then(m => m.LibLinkingGenericModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'participate/direct-claim',
loadChildren: () => import('./claims/directLinking/directLinking.module').then(m => m.LibDirectLinkingModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
{
path: 'preview',
loadChildren: () => import('./demo/demo.module').then(m => m.DemoModule),
data: {hasQuickContact: false}, canActivate: [IsCommunity]
data: {hasQuickContact: false}, canActivate: [CommunityAccessGuard]
},
/** help pages - do not exist in Admin portal/api/db */
{

View File

@ -0,0 +1,19 @@
import {TestBed } from '@angular/core/testing';
import {properties} from "../environments/environment";
describe('Environment Configuration', () => {
beforeEach(() => {
TestBed.configureTestingModule({
});
});
it('should have correct setting for piwik tracking based on environment', () => {
if (properties.environment == "beta" || properties.environment == "production") {
expect(properties.enablePiwikTrack).toBe(true,`Piwik tracking: Expected enablePiwikTrack to be true but it is ${properties.enablePiwikTrack}`);
} else {
expect(properties.enablePiwikTrack).toBe(false, `Piwik tracking: Expected enablePiwikTrack to be false but it is ${properties.enablePiwikTrack}`);
}
});
// Add more tests for other properties as needed
});

View File

@ -78,7 +78,7 @@ import {Meta} from "@angular/platform-browser";
<schema2jsonld *ngIf="properties && showMenu && communityId && communityId.length > 0 && community"
[URL]="properties.domain + properties.baseLink"
[logoURL]="community.logoUrl" type="home" [searchActionRoute]="properties.searchLinkToResults"
[name]="(community.shortTitle) ? community.shortTitle : community.title"
[name]="(community.displayShortTitle) ? community.displayShortTitle : community.diplayTitle"
[description]="community.description">
</schema2jsonld>
<div class="custom-main-content">
@ -116,7 +116,7 @@ import {Meta} from "@angular/platform-browser";
[contactForm]="contactForm" [sending]="sending"></quick-contact>
<modal-alert #modal [overflowBody]="false"></modal-alert>
<role-verification *ngIf="community" service="connect"
[id]="community.communityId" [name]="community.title"
[id]="community.communityId" [name]="community.displayTitle"
[type]="community.type"></role-verification>
</div>
`
@ -189,6 +189,7 @@ export class AppComponent implements OnInit, OnDestroy {
ngOnInit() {
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.previewLayout = (data['previewLayout'] && data['previewLayout'].length > 0 ? data['previewLayout'] : null);
this.properties.forceCacheReload = (data['forceCacheReload'] ? true : false);
if (this.properties.environment == "production" || this.properties.environment == "development") {
this._meta.updateTag({content: 'all', name: 'robots'});
this.seoService.removeLinkForPrevURL();
@ -376,10 +377,11 @@ export class AppComponent implements OnInit, OnDestroy {
if (this.community && !ConnectHelper.isPrivate(this.community, this.user)) {
this.communityId = this.community.communityId;
this.initAdminToolCommunity(this.communityId);
this.properties.footerGrantText = ""; //
this.header = {
// url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
route: "/",
title: (this.community.shortTitle) ? this.community.shortTitle : this.community.title,
title: (this.community.displayShortTitle) ? this.community.displayShortTitle : this.community.displayTitle,
logoUrl: (this.community.isUpload) ? (properties.utilsService + '/download/' + this.community.logoUrl) : (StringUtils.urlPrefix(this.community.logoUrl) + this.community.logoUrl),
logoSmallUrl: (this.community.isUpload) ? (properties.utilsService + '/download/' + this.community.logoUrl) : (StringUtils.urlPrefix(this.community.logoUrl) + this.community.logoUrl),
position: 'left',

View File

@ -22,12 +22,12 @@ import {PageURLResolverModule} from "./openaireLibrary/utils/pageURLResolver.mod
import {Schema2jsonldModule} from "./openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard";
import {SubscribeService} from "./openaireLibrary/utils/subscribe/subscribe.service";
import {RoleVerificationModule} from "./openaireLibrary/role-verification/role-verification.module";
import {QuickContactModule} from "./openaireLibrary/sharedComponents/quick-contact/quick-contact.module";
import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module";
import {CustomizationService} from "./openaireLibrary/services/customization.service";
import {CommunityAccessGuard} from "./utils/communityAccess.guard";
@NgModule({
@ -49,7 +49,7 @@ import {CustomizationService} from "./openaireLibrary/services/customization.ser
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],
providers: [
CommunitiesService, CustomizationService, IsCommunity, SubscribeService,
CommunitiesService, CustomizationService, CommunityAccessGuard, SubscribeService,
{provide: APP_ID, useValue: 'serverApp'},
{
provide: HTTP_INTERCEPTORS,

View File

@ -26,18 +26,18 @@
uk-padding-small uk-padding-remove-vertical uk-margin-top uk-margin-bottom">
<div>
<img *ngIf="community.logoUrl != null && community.logoUrl != ''" src="{{community | logoUrl}}"
alt="{{(community.title)?community.title:community.shortTitle}} logo" class="uk-height-max-xsmall">
alt="{{(community.displayTitle)?community.displayTitle:community.displayShortTitle}} logo" class="uk-height-max-xsmall">
</div>
</div>
<div class="uk-card-body uk-padding-remove uk-margin-small-bottom">
<h3 class="uk-text-center uk-h6 uk-link" [ngClass]="(showDescription)?'uk-margin-small-bottom':''">
<span *ngIf="community.title">
{{community.title.slice(0, thresholdTitle)}}
<span *ngIf="community.title.length > thresholdTitle">...</span>
<span *ngIf="community.displayTitle">
{{community.displayTitle.slice(0, thresholdTitle)}}
<span *ngIf="community.displayTitle.length > thresholdTitle">...</span>
</span>
<span *ngIf="!community.title && community.shortTitle">
{{community.shortTitle.slice(0, thresholdTitle)}}
<span *ngIf="community.shortTitle.length > thresholdTitle">...</span>
<span *ngIf="!community.displayTitle && community.displayShortTitle">
{{community.displayShortTitle.slice(0, thresholdTitle)}}
<span *ngIf="community.displayShortTitle.length > thresholdTitle">...</span>
</span>
</h3>
<div class="uk-text-center" *ngIf="community.description != null && showDescription">

View File

@ -1,837 +1,14 @@
<div>
<ng-template #tab_content
let-resultType="resultType" let-fetch="fetch" let-searchLinkToAdvancedPage="searchLinkToAdvancedPage"
let-params="params" let-type="type" let-typeName="typeName">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding uk-padding-remove-horizontal">
<search-tab [fetch]="fetch" [resultType]="resultType" [params]="params"
[searchLinkToAdvancedPage]="searchLinkToAdvancedPage" [properties]="properties">
</search-tab>
</div>
</div>
</ng-template>
<ng-template #analytics_tab_content
let-type="type" let-typeName="typeName">
<div *ngIf="analyticsActiveTab == type && isEntityEnabled(type)
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum[type].total>0
&& (statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|| statistics.statisticsDisplay.entities[type].numbers.map['project']['showInMonitor']
|| statistics.statisticsDisplay.entities[type].numbers.map['open']['showInMonitor']
|| statistics.statisticsDisplay.entities[type].numbers.map['closed']['showInMonitor']
|| statistics.statisticsDisplay.entities[type].numbers.map['embargo']['showInMonitor']
|| statistics.statisticsDisplay.entities[type].numbers.map['restricted']['showInMonitor']
|| (statistics.allowedEntitiesMode['showInMonitor'] && statistics.statisticsSum
&& statistics.allowedChartsMode['showInMonitor'] && statistics.statisticsSum[type]
&& statistics.allowedChartsMode['showInMonitor'][type] && statistics.statisticsSum[type].total > 0
&& statistics.allowedChartsMode['showInMonitor'][type].length > 0) )">
<div class="tab-header uk-margin-bottom">
{{typeName}}
</div>
<ng-container *ngTemplateOutlet="stats; context: {
entity: type, entityName: typeName,
statisticsSum:statistics.statisticsSum, statisticsDisplay:statistics.statisticsDisplay,
allowedEntities: statistics.allowedEntitiesMode['showInMonitor'],
allowedCharts:statistics.allowedChartsMode['showInMonitor'],
showChartTitle: statistics.chartTitlesMode['showInMonitor'],
chartsInfoMap:statistics.chartsInfoMap, showIn:'showInMonitor'}">
</ng-container>
</div>
</ng-template>
<ng-template #stats let-entity="entity" let-entityName="entityName" let-statisticsSum="statisticsSum"
let-statisticsDisplay="statisticsDisplay" let-allowedEntities="allowedEntities"
let-allowedCharts="allowedCharts" let-chartsInfoMap="chartsInfoMap"
let-showChartTitle="showChartTitle"
let-showIn="showIn">
<div *ngIf=" showIn == 'showInMonitor' && allowedCharts && allowedCharts[entity] && allowedCharts[entity].length == 0 &&
!statisticsDisplay.entities[entity].numbers.map['total'][showIn] && !statisticsDisplay.entities[entity].numbers.map['project'][showIn] &&
!statisticsDisplay.entities[entity].numbers.map['open'][showIn] && !statisticsDisplay.entities[entity].numbers.map['closed'][showIn] &&
!statisticsDisplay.entities[entity].numbers.map['embargo'][showIn] && !statisticsDisplay.entities[entity].numbers.map['restricted'][showIn]"
class="uk-alert uk-alert-primary">
No graphs available
</div>
<div *ngIf="statisticsSum && statisticsDisplay && statisticsSum[entity].total > 0"
[class]="'uk-grid uk-grid-small uk-grid-match ' + (showIn == 'showInMonitor' ? ' uk-child-width-1-3@s uk-child-width-1-6@m' : ' uk-child-width-1-1@s uk-child-width-1-3@m')"
uk-grid>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][showIn]">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].total|number}}
</div>
<div>
Total
</div>
</div>
</div>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['project'][showIn] && statisticsSum[entity].projects">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].projects|number}}
</div>
<div>
Total linked projects
</div>
</div>
</div>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][showIn] && statisticsSum[entity].open_access">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].open_access|number}}
</div>
<div>
Open access
</div>
</div>
</div>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['closed'][showIn] && statisticsSum[entity].closed_access">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].closed_access|number}}
</div>
<div>
Closed access
</div>
</div>
</div>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['embargo'][showIn] && statisticsSum[entity].embargo">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].embargo|number}}
</div>
<div>
Embargoed
</div>
</div>
</div>
<div *ngIf="statisticsDisplay.entities[entity].numbers.map['restricted'][showIn] && statisticsSum[entity].restricted">
<div class="uk-card uk-card-default uk-padding-small">
<div class="uk-h4 uk-text-bold">
{{statisticsSum[entity].restricted|number}}
</div>
<div>
Restricted
</div>
</div>
</div>
</div>
<div *ngIf="allowedEntities &&
statisticsSum && allowedCharts && statisticsSum[entity] &&
allowedCharts[entity] && statisticsSum[entity].total>0 &&
allowedCharts[entity].length>0">
<div *ngIf="showIn == 'showInDashboard'">
<div>
<div class="uk-position-relative">
<ul class="uk-list">
<li *ngFor="let chart of allowedCharts[entity]">
<div class="iframeContainer uk-height-medium uk-margin-medium-top uk-card uk-card-default uk-card-body">
<div *ngIf="showChartTitle[chart]">
{{chartsInfoMap[chart].title}}
</div>
<iframe [src]=chartsInfoMap[chart].url scrolling="no"></iframe>
</div>
</li>
</ul>
</div>
</div>
</div>
<div *ngIf="showIn == 'showInMonitor'" class="uk-grid uk-child-width-1-2@l uk-child-width-1-1@m ">
<div *ngFor="let chart of allowedCharts[entity]" class="uk-clearfix uk-margin-bottom">
<div class="iframeContainer uk-height-large uk-margin-medium-top uk-card uk-card-default uk-card-body">
<div *ngIf="showChartTitle[chart]">
{{chartsInfoMap[chart].title}}
</div>
<iframe [src]=chartsInfoMap[chart].url scrolling="no"></iframe>
</div>
</div>
</div>
</div>
</ng-template>
<div *ngIf="portal && community && !isPrivate()" >
<div *ngIf="portal && community" class="generalSearchForm heroBackground"> <!-- this div will have the
customized color or image -->
<div class="uk-container uk-container-large uk-flex uk-flex-center">
<div class="uk-width-2-3@m uk-width-1-2@l uk-margin-large-top uk-margin-large-bottom">
<h1 *ngIf="community.title" class="uk-text-center uk-h2 uk-margin-remove">
{{community.shortTitle}}
</h1>
<div *ngIf="community.shortTitle && community.title != community.shortTitle"
class="uk-text-center uk-margin-top">
{{community.title}}
</div>
<!-- <div [class.uk-invisible]="disableSelect" class="uk-margin-medium-top">-->
<!-- <advanced-search-input #advanced (searchEmitter)="goTo(true)">-->
<!-- <entities-selection [simpleView]="true" currentEntity="result" [selectedEntity]="selectedEntity" [customFilter]="customFilter"-->
<!-- (selectionChange)="entityChanged($event);advanced.focusNext(input, $event)" (disableSelectEmitter)="disableSelectChange($event)"-->
<!-- [onChangeNavigate]="false"></entities-selection>-->
<!-- <div input #input placeholder="Scholary works" [searchable]="true" [hint]="'Search in OpenAIRE'" [(value)]="keyword"></div>-->
<!-- </advanced-search-input>-->
<!-- <div *ngIf="selectedEntity === 'result' && input.focused" (click)="$event.stopPropagation();advanced.focusNext(input, $event)" class="uk-dropdown uk-display-block uk-margin-small-top uk-width-auto">-->
<!-- <div class="uk-padding-small">-->
<!-- <quick-selections [resultTypes]="resultTypes" [quickFilter]="resultsQuickFilter"></quick-selections>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div [class.uk-invisible]="disableSelect" class="uk-margin-medium-top">
<advanced-search-input #advanced (searchEmitter)="goTo(true)">
<entities-selection class="uk-width-1-3" [simpleView]="true" currentEntity="result" [selectedEntity]="selectedEntity" [customFilter]="customFilter"
(selectionChange)="entityChanged($event);advanced.focusNext(input, $event)" (disableSelectEmitter)="disableSelectChange($event)"
[onChangeNavigate]="false"></entities-selection>
<div input #input class="uk-width-expand" placeholder="Scholary works" [searchable]="true" [hint]="'Search in OpenAIRE'" [(value)]="keyword"></div>
</advanced-search-input>
<div *ngIf="selectedEntity === 'result' && input.focused" (click)="$event.stopPropagation();advanced.focusNext(input, $event)" class="uk-dropdown uk-display-block uk-margin-small-top uk-width-auto" uk-dropdown="mode: click">
<div class="uk-padding-small">
<quick-selections [resultTypes]="resultTypes" [quickFilter]="resultsQuickFilter"></quick-selections>
</div>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="portal && community" class=" uk-container uk-container-large uk-section uk-section-small">
<div *ngIf="communityId" >
<div>
<div class="main-tabs-div">
<!-- <ng-template #summary_tab>
<div *ngIf="community" class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding uk-inline">
<div *ngIf="community.description" class="uk-margin-bottom ">
<div [innerHTML]="community.description | safeHtml"></div>
</div>
<div *ngIf="isRouteEnabled('/curators')" class="uk-margin-small-bottom">
<curators [longView]="false"></curators>
</div>
<div [class]="community.date || subscribers ? 'uk-margin-small-bottom' : ''">
<span *ngIf="community.date" class="uk-margin-right">
<span
class="lowOpacityColor uk-text-meta">Created: </span> {{community.date | date:'dd-MMM-yyyy'}}
</span>
<span>
<subscribe *ngIf="communityId" [communityId]="communityId" showNumbers=true
(countSubscribersEvent)="countSubscribersEvent($event)"></subscribe>
</span>
</div>
<div [class]="((projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)) ||
(contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders)))
? 'uk-margin-small-bottom' : ''">
<span
*ngIf="projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)">
<span class="uk-text-meta">Projects: </span>
<a class="uk-margin-auto-vertical uk-margin-auto portal-link" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToProjects">{{projectTotal|number}}
</a>
</span>
<span
*ngIf="contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders)"
[class]="'uk-display-inline-block '+((projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)) ? 'uk-margin-left' : '')">
<span class="uk-text-meta">Content Providers: </span>
<a class="uk-margin-auto-vertical uk-margin-auto portal-link" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToDataProviders">{{contentProviderTotal|number}}
</a>
</span>
<span *ngIf="projectsCalculated && contentProvidersCalculated &&
((projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects))
|| (contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders)))"
class="uk-icon uk-text-meta uk-margin-small-left"
title="{{buildProjectsAndContentProvidesTooltip()}}"
uk-tooltip="pos:bottom-right; delay:10; cls: community-page-tooltip uk-width-medium">
<svg width="15" height="15" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question"
ratio="1">
<circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle>
<circle cx="10.44" cy="14.42" r="1.05"></circle>
<path fill="none" stroke="#000" stroke-width="1.2"
d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path>
</svg>
</span>
</div>
<div
*ngIf="(zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0) > 0) && isRouteEnabled(shareInZenodoPage)"
class="">
<span class="lowOpacityColor uk-text-meta">Linked to</span>
<a class="portal-link uk-margin-small-left uk-margin-small-right" [queryParams]=params
routerLinkActive="router-link-active" [routerLink]="shareInZenodoPage">
<span>{{zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0)}}</span>
</a>
<span class="lowOpacityColor uk-text-meta">Zenodo Communities</span>
<span class="uk-icon uk-text-meta uk-margin-small-left"
title="{{buildZenodoCommunitiesTooltip()}}"
uk-tooltip="pos:bottom-right; delay:10; cls: community-page-tooltip uk-width-medium">
<svg width="15" height="15" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question"
ratio="1">
<circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle>
<circle cx="10.44" cy="14.42" r="1.05"></circle>
<path fill="none" stroke="#000" stroke-width="1.2"
d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path>
</svg>
</span>
</div>
</div>
<div *ngIf="isRouteEnabled('/subjects') && community.subjects && community.subjects.length > 0"
class="uk-width-1-3@m uk-padding right-column uk-inline">
<div class="uk-margin-bottom">
<div class="uk-text-meta uk-margin-small-bottom">Subjects</div>
<span *ngFor="let subject of community.subjects.slice(0,20) let i=index">
<span *ngIf="subject != ''">
<a class="portal-link"
[queryParams]="{f0:'resultsubject',fv0:createParams(subject)}"
routerLinkActive="router-link-active" [routerLink]="searchLinkToAdvancedResults">
<span>{{subject}}</span>
</a>
<span *ngIf="i < community.subjects.length-1 && i != 19">, </span>
</span>
</span>
<div
class="uk-margin-top uk-animation-fade uk-padding uk-padding-remove-top uk-position-bottom-right">
<a class="portal-link" routerLinkActive="router-link-active" [routerLink]="'/subjects'">
View all
</a>
</div>
</div>
</div>
</div>
</ng-template>
<ng-template #publications_tab>
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'publication', fetch: fetchPublications,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('publications'),
type: 'publication', typeName: 'publication',
showImpactFactors:(community.communityId == 'elixir-gr' || community.communityId == 'inspired-ris' )}">
</ng-container>
</ng-template>
<ng-template #datasets_tab>
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'dataset', fetch: fetchDatasets,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('datasets'),
type: 'dataset', typeName: 'research data',
showImpactFactors:(community.communityId == 'elixir-gr' || community.communityId == 'inspired-ris')}">
</ng-container>
</ng-template>
<ng-template #software_tab>
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'software', fetch: fetchSoftware,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('software'),
type: 'software', typeName: 'software',
showImpactFactors:(community.communityId == 'elixir-gr' || community.communityId == 'inspired-ris')}">
</ng-container>
</ng-template>
<ng-template #other_tab>
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'other', fetch: fetchOrps,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('other'),
type: 'orp', typeName: 'other products',
showImpactFactors:(community.communityId == 'elixir-gr' || community.communityId == 'inspired-ris')}">
</ng-container>
</ng-template>
<ng-template #analytics_tab>
<div *ngIf="statistics && statistics.statisticsDisplay && statistics.statisticsDisplay.isActive"
class="content-overflow uk-overflow-auto">
<div *ngIf="statistics && activeTab=='analytics'" class="uk-width-expand uk-padding">
<div class="uk-text-center">
<button *ngIf="isEntityEnabled('publication')
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum['publication'].total>0
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum['publication'].total>0
&&
( statistics.statisticsDisplay.entities['publication'].numbers.map['total']['showInMonitor']
|| statistics.statisticsDisplay.entities['publication'].numbers.map['project']['showInMonitor']
|| statistics.statisticsDisplay.entities['publication'].numbers.map['open']['showInMonitor']
|| statistics.statisticsDisplay.entities['publication'].numbers.map['closed']['showInMonitor']
|| statistics.statisticsDisplay.entities['publication'].numbers.map['embargo']['showInMonitor']
|| statistics.statisticsDisplay.entities['publication'].numbers.map['restricted']['showInMonitor']
|| ( statistics.allowedEntitiesMode['showInMonitor'] && statistics.statisticsSum
&& statistics.allowedChartsMode['showInMonitor'] && statistics.statisticsSum['publication']
&& statistics.allowedChartsMode['showInMonitor']['publication'] && statistics.statisticsSum['publication'].total > 0
&& statistics.allowedChartsMode['showInMonitor']['publication'].length > 0))"
[class]="(analyticsActiveTab == 'publication' ? 'active ' : '')+' publicationAnalytics uk-icon uk-icon-button uk-margin-right'"
uk-tooltip="title: Publications" (click)="analyticsActiveTab = 'publication'">
<img src="assets/connect-assets/home/entities/publication.svg">
</button>
<button *ngIf="isEntityEnabled('dataset')
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum['dataset'].total>0
&&
( statistics.statisticsDisplay.entities['dataset'].numbers.map['total']['showInMonitor']
|| statistics.statisticsDisplay.entities['dataset'].numbers.map['project']['showInMonitor']
|| statistics.statisticsDisplay.entities['dataset'].numbers.map['open']['showInMonitor']
|| statistics.statisticsDisplay.entities['dataset'].numbers.map['closed']['showInMonitor']
|| statistics.statisticsDisplay.entities['dataset'].numbers.map['embargo']['showInMonitor']
|| statistics.statisticsDisplay.entities['dataset'].numbers.map['restricted']['showInMonitor']
|| ( statistics.allowedEntitiesMode['showInMonitor'] && statistics.statisticsSum
&& statistics.allowedChartsMode['showInMonitor'] && statistics.statisticsSum['dataset']
&& statistics.allowedChartsMode['showInMonitor']['dataset'] && statistics.statisticsSum['dataset'].total > 0
&& statistics.allowedChartsMode['showInMonitor']['dataset'].length > 0))"
[class]="(analyticsActiveTab == 'dataset' ? 'active ' : '')+' datasetAnalytics uk-icon uk-icon-button uk-margin-right'"
uk-tooltip="title: Research Data" (click)="analyticsActiveTab = 'dataset'">
<img src="assets/connect-assets/home/entities/dataset.svg">
</button>
<button *ngIf="isEntityEnabled('software')
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum['software'].total>0
&&
( statistics.statisticsDisplay.entities['software'].numbers.map['total']['showInMonitor']
|| statistics.statisticsDisplay.entities['software'].numbers.map['project']['showInMonitor']
|| statistics.statisticsDisplay.entities['software'].numbers.map['open']['showInMonitor']
|| statistics.statisticsDisplay.entities['software'].numbers.map['closed']['showInMonitor']
|| statistics.statisticsDisplay.entities['software'].numbers.map['embargo']['showInMonitor']
|| statistics.statisticsDisplay.entities['software'].numbers.map['restricted']['showInMonitor']
|| ( statistics.allowedEntitiesMode['showInMonitor'] && statistics.statisticsSum
&& statistics.allowedChartsMode['showInMonitor'] && statistics.statisticsSum['software']
&& statistics.allowedChartsMode['showInMonitor']['software'] && statistics.statisticsSum['software'].total > 0
&& statistics.allowedChartsMode['showInMonitor']['software'].length > 0))"
[class]="(analyticsActiveTab == 'software' ? 'active ' : '')+' softwareAnalytics uk-icon uk-icon-button uk-margin-right'"
uk-tooltip="title: Software" (click)="analyticsActiveTab = 'software'">
<img src="assets/connect-assets/home/entities/software.svg">
</button>
<button *ngIf="isEntityEnabled('orp')
&& statistics.statisticsSum && statistics.statisticsDisplay && statistics.statisticsSum['orp'].total>0
&&
( statistics.statisticsDisplay.entities['orp'].numbers.map['total']['showInMonitor']
|| statistics.statisticsDisplay.entities['orp'].numbers.map['project']['showInMonitor']
|| statistics.statisticsDisplay.entities['orp'].numbers.map['open']['showInMonitor']
|| statistics.statisticsDisplay.entities['orp'].numbers.map['closed']['showInMonitor']
|| statistics.statisticsDisplay.entities['orp'].numbers.map['embargo']['showInMonitor']
|| statistics.statisticsDisplay.entities['orp'].numbers.map['restricted']['showInMonitor']
|| ( statistics.allowedEntitiesMode['showInMonitor'] && statistics.statisticsSum
&& statistics.allowedChartsMode['showInMonitor'] && statistics.statisticsSum['orp']
&& statistics.allowedChartsMode['showInMonitor']['orp'] && statistics.statisticsSum['orp'].total > 0
&& statistics.allowedChartsMode['showInMonitor']['orp'].length > 0))"
[class]="(analyticsActiveTab == 'orp' ? 'active ' : '')+' otherAnalytics uk-icon uk-icon-button'"
uk-tooltip="title: Other Research Products" (click)="analyticsActiveTab = 'orp'">
<img src="assets/connect-assets/home/entities/other.svg">
</button>
</div>
<hr>
<ng-container *ngTemplateOutlet="analytics_tab_content; context: {
type: 'publication', typeName: 'publications'}">
</ng-container>
<ng-container *ngTemplateOutlet="analytics_tab_content; context: {
type: 'dataset', typeName: 'research data'}">
</ng-container>
<ng-container *ngTemplateOutlet="analytics_tab_content; context: {
type: 'software', typeName: 'software'}">
</ng-container>
<ng-container *ngTemplateOutlet="analytics_tab_content; context: {
type: 'orp', typeName: 'other products'}">
</ng-container>
</div>
</div>
</ng-template>
<ng-template #enermaps_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<search-tab [fetch]="fetchFeaturedDatasets" [resultType]="'dataset'"
[properties]="properties" customTitle="Featured Datasets"
[showImpactFactors]="false" [showEnermaps]="true">
<div class="uk-margin-top uk-margin-bottom uk-text-meta">
<div>Here are listed some of the most important energy datasets as selected by energy experts.</div>
<div>
Check them if you want to easily explore and visualize the European energy landscape,
using only well-known datasets which you can trust.
</div>
</div>
</search-tab>
</div>
</div>
</ng-template>
<ng-template #mapping_tab>
<div *ngIf="activeTab == 'mapping'">
<div
class="uk-margin-left tab-header uk-margin uk-margin-top ">
Browse OpenAIRE Research Graph through a map of the main concepts linked to Coronavirus
</div>
<div class="uk-padding">
<iframe src="https://openaire.opscidia.com/?iframe=true&keyword=covid19&mapping_size=4"
title="Opscidia Ontology mapping" class="uk-width-1-1" style="height:700px"></iframe>
<span
class=" uk-text-baseline uk-text-meta uk-text-left ">Powered by <a
href="http://www.opscidia.com/" target="_blank" class="">Opscidia</a> and <a
href="https://graph.openaire.eu/" target="_blank" class="">OpenAIRE Research Graph</a> </span>
<span class="uk-text-right uk-float-right uk-text-baseline uk-text-meta"> Visit <a
class=" uk-margin-right uk-margin-small-top"
href="https://openaire.opscidia.com/?iframe=true&keyword=covid19&mapping_size=4" target="_blank" >
Opscidia Tool
</a></span>
</div>
</div>
</ng-template>
<ng-template #twitter_tab *ngIf="properties.environment == 'development'">
<div>
<div>
<a href="https://twitter.com/{{ communityInfo.twitterAccount }}?ref_src=twsrc%5Etfw" class="twitter-timeline" data-height="900">
Tweets by {{ communityInfo.twitterAccount }}
</a>
</div>
</div>
</ng-template> -->
<div id="mytabs" class="uk-grid uk-margin-remove-left uk-position-relative">
<div class="uk-margin-medium-right uk-margin-top uk uk-padding-remove uk-width-expand">
<div class="uk-width-1-1" uk-slider="finite: true">
<div class="uk-position-relative " >
<div class="uk-slider-container ">
<ul class=" uk-slider-items " style="flex-wrap: nowrap !important;" >
<li (click)="onSelectActiveTab('summary')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'summary'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
Summary
</a>
</li>
</ul>
</li>
<li *ngIf="fetchPublications.searchUtils.totalResults > 0 && isEntityEnabled('publication')"
(click)="onSelectActiveTab('publications')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'publication'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
{{openaireEntities.PUBLICATIONS}} ({{fetchPublications.searchUtils.totalResults | number}})
</a>
</li>
</ul>
</li>
<li *ngIf="fetchDatasets.searchUtils.totalResults > 0 && isEntityEnabled('dataset')"
(click)="onSelectActiveTab('datasets')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'dataset'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
{{openaireEntities.DATASETS}} ({{fetchDatasets.searchUtils.totalResults | number}})
</a>
</li>
</ul>
</li>
<li *ngIf="fetchSoftware.searchUtils.totalResults > 0 && isEntityEnabled('software')"
(click)="onSelectActiveTab('software')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'software'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
{{openaireEntities.SOFTWARE}} ({{fetchSoftware.searchUtils.totalResults | number}})
</a>
</li>
</ul>
</li>
<li *ngIf="fetchOrps.searchUtils.totalResults > 0 && isEntityEnabled('orp')"
(click)="onSelectActiveTab('other')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'orp'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
{{openaireEntities.OTHER}} ({{fetchOrps.searchUtils.totalResults | number}})
</a>
</li>
</ul>
</li>
<li *ngIf="properties.environment == 'development' && portal.twitterAccount"
(click)="onSelectActiveTab('twitter')">
<ul class="uk-tab">
<li [class.uk-active]="activeTab == 'twitter'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center">
Twitter
</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="">
<a class="uk-position-center-left uk-blur-background" uk-slider-item="previous"><span uk-icon="chevron-left"></span></a>
<a class="uk-position-center-right uk-blur-background" uk-slider-item="next"><span uk-icon="chevron-right"></span></a>
</div>
</div>
</div>
</div>
<div class="uk-padding-small uk-padding-remove-bottom uk-padding-remove-right">
<ul class="uk-tab uk-height-1-1">
<li *ngIf="properties.environment != 'production' && communityId == 'covid-19'" (click)="onSelectActiveTab('mapping')" [class.uk-active]="activeTab == 'mapping'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center featuredTab">
Ontology Mapping
</a>
</li>
<li
*ngIf="communityId == 'enermaps' && fetchFeaturedDatasets.searchUtils.totalResults > 0 && isEntityEnabled('dataset')"
(click)="onSelectActiveTab('enermaps')" [class.uk-active]="activeTab == 'enermaps'">
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center featuredTab">
Featured Datasets ({{fetchFeaturedDatasets.searchUtils.totalResults | number}})
</a>
</li>
</ul>
</div>
</div>
<div *ngIf="activeTab == 'summary'">
<div *ngIf="community" class="uk-grid uk-grid-divider uk-padding uk-padding-remove-horizontal" uk-grid>
<div class="uk-width-expand">
<div *ngIf="community.description" class="uk-margin-bottom ">
<div [innerHTML]="community.description | safeHtml">
</div>
</div>
<div class="uk-card uk-card-default uk-padding-small">
<div *ngIf="isRouteEnabled('/curators')" class="uk-margin-bottom">
<curators [longView]="false"></curators>
</div>
<div class="uk-grid uk-grid-divider uk-child-width-1-2@m" uk-grid>
<div>
<div *ngIf="community.date" class="uk-margin-small-bottom">
<span class="uk-text-meta">Created: </span> {{community.date | date:'dd-MMM-yyyy'}}
</div>
<div [class]="projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects) ? 'uk-margin-small-bottom' : ''">
<span *ngIf="projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)">
<span class="uk-text-meta">Projects: </span>
<a [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToProjects">{{projectTotal|number}}
</a>
<a *ngIf="projectsCalculated && (projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects))"
[title]="buildProjectsTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-display-inline-block uk-margin-small-left">
<svg width="15" height="15" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1">
<circle fill="none" stroke="#8E8E8E" stroke-width="1.1" cx="10" cy="10" r="9"></circle>
<circle fill="none" stroke="#8E8E8E" cx="10.44" cy="14.42" r="1.05"></circle>
<path fill="none" stroke="#8E8E8E" stroke-width="1.2"
d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path>
</svg>
</a>
</span>
</div>
<div *ngIf="(zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0) > 0) && isRouteEnabled(shareInZenodoPage)">
<span class="uk-text-meta">Linked Zenodo Communities: </span>
<a [queryParams]=params
routerLinkActive="router-link-active" [routerLink]="shareInZenodoPage">
<span>{{zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0)}}</span>
</a>
<a [title]="buildZenodoCommunitiesTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-display-inline-block uk-margin-small-left">
<svg width="15" height="15" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1">
<circle fill="none" stroke="#8E8E8E" stroke-width="1.1" cx="10" cy="10" r="9"></circle>
<circle fill="none" stroke="#8E8E8E" cx="10.44" cy="14.42" r="1.05"></circle>
<path fill="none" stroke="#8E8E8E" stroke-width="1.2"
d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path>
</svg>
</a>
</div>
</div>
<div>
<div [class]="community.date || subscribers ? 'uk-margin-small-bottom' : ''">
<span>
<subscribe *ngIf="communityId" [communityId]="communityId" showNumbers=true
(countSubscribersEvent)="countSubscribersEvent($event)">
</subscribe>
</span>
</div>
<div [class]="contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders) ? 'uk-margin-small-bottom' : ''">
<span *ngIf="contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders)">
<span class="uk-text-meta">Content Providers: </span>
<a [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToDataProviders">{{contentProviderTotal|number}}
</a>
<a *ngIf="contentProvidersCalculated && (contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders))"
[title]="buildContentProvidersTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-display-inline-block uk-margin-small-left">
<svg width="15" height="15" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1">
<circle fill="none" stroke="#8E8E8E" stroke-width="1.1" cx="10" cy="10" r="9"></circle>
<circle fill="none" stroke="#8E8E8E" cx="10.44" cy="14.42" r="1.05"></circle>
<path fill="none" stroke="#8E8E8E" stroke-width="1.2"
d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path>
</svg>
</a>
</span>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="isRouteEnabled('/subjects') && displayedAllSubjects && displayedAllSubjects.length > 0" class="uk-width-1-3@m">
<div>
<div class="uk-text-meta uk-margin-small-bottom">Subjects</div>
<span *ngFor="let item of displayedAllSubjects.slice(0,20) let i=index">
<span *ngIf="item.value != ''">
<a class="portal-link"
[queryParams]="{f0:item.type,fv0:createParams(item.value)}"
routerLinkActive="router-link-active" [routerLink]="searchLinkToAdvancedResults">
<span>{{item.value}}</span>
</a>
<span *ngIf="i < displayedAllSubjects.length-1 && i != 19">, </span>
</span>
</span>
<div class="uk-animation-fade uk-margin-top">
<a class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text" routerLinkActive="router-link-active" [routerLink]="'/subjects'">
View all
</a>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="activeTab == 'publication' && fetchPublications.searchUtils.totalResults > 0 && isEntityEnabled('publication')">
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'publication', fetch: fetchPublications,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('publications'),
type: 'publication', typeName: 'publication'}">
</ng-container>
</div>
<div *ngIf="activeTab == 'dataset' && fetchDatasets.searchUtils.totalResults > 0 && isEntityEnabled('dataset')">
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'dataset', fetch: fetchDatasets,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('datasets'),
type: 'dataset', typeName: 'research data'}">
</ng-container>
</div>
<div *ngIf="activeTab == 'software' && fetchSoftware.searchUtils.totalResults > 0 && isEntityEnabled('software')">
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'software', fetch: fetchSoftware,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('software'),
type: 'software', typeName: 'software'}">
</ng-container>
</div>
<div *ngIf="activeTab == 'orp' && fetchOrps.searchUtils.totalResults > 0 && isEntityEnabled('orp')">
<ng-container *ngTemplateOutlet="tab_content; context: {
resultType: 'other', fetch: fetchOrps,
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('other'),
type: 'orp', typeName: 'other products'}">
</ng-container>
</div>
<div *ngIf="activeTab == 'twitter' && properties.environment == 'development' && portal.twitterAccount">
<div>
<div>
<a href="https://twitter.com/{{ portal.twitterAccount }}?ref_src=twsrc%5Etfw" class="twitter-timeline" data-height="900">
Tweets by {{portal.twitterAccount}}
</a>
</div>
</div>
</div>
<div *ngIf="activeTab == 'mapping' && properties.environment != 'production' && communityId == 'covid-19'"
class="uk-padding uk-padding-remove-horizontal">
<div>
Browse OpenAIRE Research Graph through a map of the main concepts linked to Coronavirus
</div>
<div class="uk-margin-medium-top">
<iframe src="https://openaire.opscidia.com/?iframe=true&keyword=covid19&mapping_size=4"
title="Opscidia Ontology mapping" class="uk-width-1-1" style="height:700px"></iframe>
<span class=" uk-text-baseline uk-text-meta uk-text-left ">
Powered by
<a href="http://www.opscidia.com/" target="_blank" class="">Opscidia</a> and
<a href="https://graph.openaire.eu/" target="_blank" class="">OpenAIRE Research Graph</a>
</span>
<span class="uk-text-right uk-float-right uk-text-baseline uk-text-meta"> Visit
<a class="uk-margin-right uk-margin-small-top" href="https://openaire.opscidia.com/?iframe=true&keyword=covid19&mapping_size=4" target="_blank">
Opscidia Tool
</a>
</span>
</div>
</div>
<div
*ngIf="activeTab == 'enermaps' && communityId == 'enermaps' && fetchFeaturedDatasets.searchUtils.totalResults > 0 && isEntityEnabled('dataset')">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding uk-padding-remove-horizontal">
<div class="uk-flex uk-flex-between uk-flex-middle uk-margin-bottom" >
<div class="uk-text-meta uk-text-large uk-text-uppercase">
<span>Featured Datasets</span>
</div>
</div>
<div class="uk-margin-top uk-margin-medium-bottom uk-text-meta">
<div>Here are listed some of the most important energy datasets as selected by energy experts.</div>
<div>
Check them if you want to easily explore and visualize the European energy landscape,
using only well-known datasets which you can trust.
</div>
</div>
<no-load-paging *ngIf="fetchFeaturedDatasets && fetchFeaturedDatasets.searchUtils.totalResults > size" [type]="'Featured Datasets'"
(pageChange)="updatePage($event)"
[page]="fetchFeaturedDatasets.searchUtils.page" [pageSize]="size"
[totalResults]="fetchFeaturedDatasets.searchUtils.totalResults" >
</no-load-paging>
<search-result [properties]="properties"
[results]="fetchFeaturedDatasets.results"
[status]="fetchFeaturedDatasets.searchUtils.status"
[type]="'dataset'" [showEnermaps]="true" >
</search-result>
</div>
</div>
</div>
</div>
</div>
</div>
<ng-container *ngIf="showLoading">
<div class="uk-container uk-container-large uk-section">
<loading></loading>
</div>
<!-- <ng-container *ngIf="communityId == 'enermaps'">
<div class="uk-section uk-container uk-container-large tm-middle">
<div class="uk-margin-large-bottom">
<h2 class="uk-margin-top uk-text-center">
About Enermaps
</h2>
<div class="uk-padding uk-grid uk-child-width-1-1@s uk-child-width-1-2@m uk-child-width-1-4@l uk-grid-large uk-margin-medium-top" uk-grid>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="icon-wrapper uk-flex uk-flex-center uk-flex-middle">
<img src="assets/connect-assets/home/website.svg">
</div>
<div class="uk-margin-medium-top">
<a href="https://enermaps.eu/" target="_blank" class="uk-button uk-button-text uk-text-bolder custom-text">Project Website</a>
</div>
</div>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="icon-wrapper uk-flex uk-flex-center uk-flex-middle">
<img src="assets/connect-assets/home/map.svg">
</div>
<div class="uk-margin-medium-top">
<a href="https://lab.idiap.ch/enermaps/" target="_blank" class="uk-button uk-button-text uk-text-bolder custom-text">Open Data Management Tool</a>
</div>
</div>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="icon-wrapper uk-flex uk-flex-center uk-flex-middle">
<img src="assets/connect-assets/home/wiki.svg">
</div>
<div class="uk-margin-medium-top">
<a href="https://enermaps-wiki.herokuapp.com/" target="_blank" class="uk-button uk-button-text uk-text-bolder custom-text">Wiki</a>
</div>
</div>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="icon-wrapper uk-flex uk-flex-center uk-flex-middle">
<img src="assets/connect-assets/home/training.svg">
</div>
<div class="uk-margin-medium-top">
<a href="https://www.youtube.com/watch?v=fHBeaKWS8Ss&list=PLhwt57nEFA8n295WJq_ickGCIBYHDcjm3&ab_channel=REVOLVE" target="_blank" class="uk-button uk-button-text uk-text-bolder custom-text">Training</a>
</div>
</div>
</div>
</div>
</div>
</ng-container> -->
<div *ngIf="communityId && portal && isRouteEnabled('/organizations')"
class="uk-container uk-container-large">
<affiliations [longView]="false" [getAffiliationsFromAPI]="true" [communityFirstPage]="true"></affiliations>
</div>
<div *ngIf="(communityId == null || communityId == '' ) && !portal"
class="uk-section tm-middle uk-container uk-margin-large-top ">
<div class="uk-container uk-margin-bottom uk-grid">
<div class="uk-width-expand uk-padding-remove">
<article class="uk-article ">
<div class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-alert uk-alert-primary">
No community chosen
</div>
<div *ngIf="communityId">
</div>
</article>
</div>
</div>
</div>
</div>
<error *ngIf="portal && community && isPrivate()" [page]="community.status == 'manager'?'-1':null">
</error>
</div>
</ng-container>
<ng-container *ngIf="!showLoading">
<ng-container *ngFor="let pluginGroup of pluginsByPlacement.get('top') ; let i=index">
<ng-container *ngIf="(pluginGroup.template.portalSpecific.length == 0 || pluginGroup.template.portalSpecific.indexOf(community.communityId) != -1 ) &&
(pluginGroup.template.plan == 'Default'|| pluginGroup.template.plan == 'Standard'|| pluginGroup.template.plan == community.plan ) && pluginGroup.plugin.active">
<plugin-wrapper [pluginTemplate]="pluginGroup.template" [plugin]="pluginGroup.plugin"
[pluginObject]="pluginGroup.plugin.object"></plugin-wrapper>
</ng-container>
</ng-container>
</ng-container>

View File

@ -1,146 +1,42 @@
import {ChangeDetectorRef, Component, ElementRef, Inject, Input, Renderer2, ViewChild} from '@angular/core';
import {Component, ElementRef, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {DOCUMENT, Location} from '@angular/common';
import {Location} from '@angular/common';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {Session, User} from '../openaireLibrary/login/utils/helper.class';
import {StatisticsForDashboardComponent} from '../statistics/statistics.component';
import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service";
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
import {User} from '../openaireLibrary/login/utils/helper.class';
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {FetchResearchResults} from "../openaireLibrary/utils/fetchEntitiesClasses/fetchResearchResults.class";
import {ErrorCodes} from "../openaireLibrary/utils/properties/errorCodes";
import {Subscription} from "rxjs";
import {properties} from "../../environments/environment";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
import {OpenaireEntities} from '../openaireLibrary/utils/properties/searchFields';
import {PluginsService} from "../openaireLibrary/services/plugins.service";
import {PluginTemplate} from "../openaireLibrary/utils/entities/adminTool/pluginTemplate";
import {Plugin} from "../openaireLibrary/utils/entities/adminTool/plugin";
import {PluginUtils} from "../openaireLibrary/dashboard/plugins/utils/pluginUtils";
@Component({
selector: 'community',
templateUrl: 'community.component.html',
styles: [
`
#mytabs .uk-tab::before {
border-bottom: none;
}
#mytabs::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
border-bottom: 1px solid #eaeaea;
}
`
]
})
export class CommunityComponent {
public url: string = null;
public projectTotal = null;
public contentProviderTotal = null;
public projectsCalculated: boolean = false;
public contentProvidersCalculated: boolean = false;
params: any = {};
properties: EnvProperties = properties;
public errorCodes: ErrorCodes = new ErrorCodes();
// Request results of each tab only the one time (first time tab is clicked)
private reloadPublications: boolean = true;
private reloadDatasets: boolean = true;
private reloadSoftware: boolean = true;
private reloadOrps: boolean = true;
private reloadFeaturedDatasets: boolean = true;
// Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications: FetchResearchResults;
public fetchDatasets: FetchResearchResults;
public fetchSoftware: FetchResearchResults;
public fetchOrps: FetchResearchResults;
public fetchFeaturedDatasets: FetchResearchResults;
public searchNumber: number = 5;
@Input() communityId = null;
public community = null;
public portal = null;
public showLoading: boolean = true;
masterZenodoCommunity = null;
zenodoCommunityIdS = [];
showAllDescription = false;
public thresholdDescription: number = 500;
public descriptionDiff: number = 100;
page = 1;
size = 5;
subscribers: number = 0;
subs: Subscription[] = [];
displayedAllSubjects = [];
displayedSubjects = [];
displayedSdg = [];
displayedFos = [];
@ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null;
public activeTab = "summary";
public show: string = 'overview';
public analyticsActiveTab: string = "";
public analyticsChecked: boolean = false;
searchLinkToResults: string = null;
searchLinkToProjects: string = null;
searchLinkToDataProviders: string = null;
searchLinkToAdvancedResults: string = null;
shareInZenodoPage: string = null;
public routerHelper: RouterHelper = new RouterHelper();
subscriptions: Subscription[] = [];
private user: User;
selectedEntity = 'result';
selectedEntitySimpleUrl;
selectedEntityAdvancedUrl;
resultTypes: Filter = {
values: [],
filterId: "type",
countSelectedValues: 0,
filterType: 'checkbox',
originalFilterId: "",
valueIsExact: true,
title: "Type",
filterOperator: "or"
};
showPublications: boolean = false;
showDatasets: boolean = false;
showSoftware: boolean = false;
showOrp: boolean = false;
showProjects: boolean = false;
showDataProviders: boolean = false;
keyword: string = "";
customFilter;
placeholderText = "Search by title, author, abstract, DOI, orcid... ";
resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
filter: null,
selected: true,
filterId: "resultbestaccessright",
value: "Open Access"
};
disableSelect: boolean = true;
openaireEntities= OpenaireEntities;
public showLoading = true;
pluginTemplates: PluginTemplate[] = [];
plugins: Plugin[] = [];
public pluginsByPlacement: Map<string,{plugin:Plugin, template:PluginTemplate}[]> = new Map();
public pluginUtils = new PluginUtils();
constructor(
private element: ElementRef,
@ -152,15 +48,10 @@ export class CommunityComponent {
private _piwikService: PiwikService,
private config: ConfigurationService,
private _communityService: CommunityService,
private _searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
private _searchCommunityProjectsService: SearchCommunityProjectsService,
private _searchResearchResultsService: SearchResearchResultsService,
private _zenodoCommunitieService: ZenodoCommunitiesService,
private seoService: SEOService,
private userManagementService: UserManagementService,
private _renderer2: Renderer2,
private cdr: ChangeDetectorRef,
@Inject(DOCUMENT) private _document: Document) {
private _pluginsService:PluginsService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
var title = "OpenAIRE - Connect";
@ -169,500 +60,88 @@ export class CommunityComponent {
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService);
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
this.fetchFeaturedDatasets = new FetchResearchResults(this._searchResearchResultsService);
}
public ngOnInit() {
this.searchLinkToResults = this.properties.searchLinkToResults;
this.searchLinkToProjects = this.properties.searchLinkToProjects;
this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders;
this.searchLinkToAdvancedResults = this.properties.searchLinkToAdvancedResults;
this.shareInZenodoPage = this.properties.shareInZenodoPage;
this.url = properties.domain + properties.baseLink + this._router.url;
this.url = properties.domain + properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);
this._meta.updateTag({content: this.url}, "property='og:url'");
this.subs.push(this.userManagementService.getUserInfo().subscribe(user => {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
}));
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
this.subscriptions.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
this.community = community;
if(community && !ConnectHelper.isPrivate(community, this.user)) {
this.displayedSubjects = community.subjects;
this.displayedSdg = community.sdg;
this.displayedFos = community.fos;
this.displayedSubjects.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'resultsubject'});
});
this.displayedSdg.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'sdg'});
});
this.displayedFos.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'fos'});
});
if (community.description != null && (community.description.length - this.thresholdDescription <= this.descriptionDiff)) {
this.thresholdDescription = community.description.length;
}
if (this.properties.environment == "development") {
this.params = {communityId: community.communityId};
}
this._meta.updateTag({content: community.description}, "name='description'");
this._meta.updateTag({content: community.description}, "property='og:description'");
this._meta.updateTag({content: community.title}, "property='og:title'");
this._title.setTitle(community.title);
this.subs.push(this._piwikService.trackView(this.properties, community.title).subscribe());
if (this.community.zenodoCommunity) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.community.zenodoCommunity).subscribe(
result => {
this.masterZenodoCommunity = result;
},
error => {
this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunity, error);
}
));
}
this.zenodoCommunityIdS = this.community.otherZenodoCommunities;
this._meta.updateTag({content: community.displayTitle}, "property='og:title'");
this._title.setTitle(community.displayTitle);
this.subscriptions.push(this._piwikService.trackView(this.properties, community.displayTitle).subscribe());
this.getPagePlugins();
}
}));
this.countResearchResults("publication");
this.countResearchResults("dataset");
this.countResearchResults("software");
this.countResearchResults("other");
if(this.communityId == "enermaps"){
this.countResearchResults("dataset", "enermaps::selection" );
}
}
getPagePlugins() {
this.showLoading = true;
this.subscriptions.push(this._pluginsService.getPluginTemplatesByPageRoute(this.properties.adminToolsAPIURL, this.community.communityId, this._router.url.split('?')[0] ).subscribe(
templates => {
this.pluginTemplates = templates;
this.subscriptions.push(this._pluginsService.getPluginsByPageRoute(this.properties.adminToolsAPIURL, this.community.communityId, this._router.url.split('?')[0]).subscribe(
plugins => {
this.plugins = plugins;
this.pluginsByPlacement = new Map();
for(let pos of this.pluginUtils.placementsOptions){
this.pluginsByPlacement.set(pos.value,[]);
}
let self = this;
this.pluginTemplates.forEach(_ => {
let plugin:Plugin = null;
if(!_.custom) {
for (let pl of plugins) {
if (pl.templateId == _._id) {
plugin = pl;
}
}
if (!plugin) {
plugin = new Plugin("", "", _);
this.plugins.push(plugin);
}
plugin.object = PluginUtils.initializeObjectAndCompare(_.code, plugin.object)
this.pluginsByPlacement.get(plugin.placement).push({plugin: plugin, template: _});
}
});
//add custom plugins in the list
this.plugins.forEach(_ => {
if(_.custom == true){
let customTemplate = null;
this.pluginTemplates.forEach(template => {
if (_.templateId == template._id) {
customTemplate = template;
}
});
if(customTemplate && customTemplate.custom){
this.pluginsByPlacement.get(customTemplate.placement).push({plugin: _, template: customTemplate});
}
}
});
for(let placement of this.pluginUtils.placementsOptions){
this.pluginsByPlacement.get(placement.value).sort(function (a, b) {
return a.plugin.order - b.plugin.order;
})
}
this.showLoading = false;
},
error => {}));
this.subs.push(this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId).subscribe(
projectTotal => {
this.projectTotal = projectTotal;
},
error => {
this.handleError("Error getting number of projects for community with id: " + this.communityId, error);
},
() => {
this.projectsCalculated = true;
}
));
this.subs.push(this._searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.communityId).subscribe(
contentProviderTotal => {
this.contentProviderTotal = contentProviderTotal;
//console.log(contentProviderTotal);
},
error => {
this.handleError("Error getting number of content providers for community with id: " + this.communityId, error);
},
() => {
this.contentProvidersCalculated = true;
}
));
this.subs.push(this.config.portalAsObservable.subscribe(
res => {
this.portal = res;
// loading twitter widget script conditionally
if (properties.environment == "development") {
if (this.portal && this.portal.twitterAccount) {
let script = this._renderer2.createElement('script');
script.charset = "utf-8";
script.src = "https://platform.twitter.com/widgets.js";
this._renderer2.appendChild(this._document.body, script);
}
}
},
error => {
//console.log(error)
this.handleError("Error getting community with id: " + this.communityId, error);
}
));
this.subs.push(this.config.portalAsObservable.subscribe(data => {
if (data) {
var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) {
showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
}
this.showPublications = !!showEntity["publication"];
this.showDatasets = !!showEntity["dataset"];
this.showSoftware = !!showEntity["software"];
this.showOrp = !!showEntity["orp"];
this.showProjects = !!showEntity["project"];
this.showDataProviders = !!showEntity["datasource"];
this.resultTypes.values = [];
if (this.showPublications) {
this.resultTypes.values.push({
name: this.openaireEntities.PUBLICATIONS,
id: "publications",
selected: false,
number: 0
});
}
if (this.showDatasets) {
this.resultTypes.values.push({
name: this.openaireEntities.DATASETS,
id: "datasets",
selected: false,
number: 0
});
}
if (this.showSoftware) {
this.resultTypes.values.push({
name: this.openaireEntities.SOFTWARE,
id: "software",
selected: false,
number: 0
});
}
if (this.showOrp) {
this.resultTypes.values.push({name: this.openaireEntities.OTHER, id: "other", selected: false, number: 0});
}
}
}));
}
private searchPublications(page: number, size: number) {
this.setActiveTab("publication");
if (this.reloadPublications &&
(this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
(this.fetchPublications.searchUtils.status == this.errorCodes.DONE && this.fetchPublications.searchUtils.totalResults > 0)
)
) {
this.fetchPublications.getResultsForCommunity("publication", this.communityId, page, size, this.properties);
}
this.reloadPublications = false;
}
private searchDatasets(page: number, size: number) {
this.setActiveTab("dataset");
if (this.reloadDatasets &&
(this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
(this.fetchDatasets.searchUtils.status == this.errorCodes.DONE && this.fetchDatasets.searchUtils.totalResults > 0)
)
) {
this.fetchDatasets.getResultsForCommunity("dataset", this.communityId, page, size, this.properties);
}
this.reloadDatasets = false;
}
private searchSoftware(page: number, size: number) {
this.setActiveTab("software");
if (this.reloadSoftware &&
(this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
(this.fetchSoftware.searchUtils.status == this.errorCodes.DONE && this.fetchSoftware.searchUtils.totalResults > 0)
)
) {
this.fetchSoftware.getResultsForCommunity("software", this.communityId, page, size, this.properties);
}
this.reloadSoftware = false;
}
private searchOrps(page: number, size: number) {
this.setActiveTab("other");
if (this.reloadOrps &&
(this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
(this.fetchOrps.searchUtils.status == this.errorCodes.DONE && this.fetchOrps.searchUtils.totalResults > 0)
)
) {
this.fetchOrps.getResultsForCommunity("other", this.communityId, page, size, this.properties);
}
this.reloadOrps = false;
}
private searchFeaturedDatasets(page: number, size: number) {
this.setActiveTab("enermaps");
if (this.reloadFeaturedDatasets &&
(this.fetchFeaturedDatasets.searchUtils.status == this.errorCodes.LOADING ||
(this.fetchFeaturedDatasets.searchUtils.status == this.errorCodes.DONE && this.fetchFeaturedDatasets.searchUtils.totalResults > 0)
)
) {
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, page, size, this.properties, "enermaps::selection");
}
this.reloadFeaturedDatasets = false;
}
private countResearchResults(resultType: string, contextId = null) {
let fetch: FetchResearchResults;
if (resultType == "publication") {
fetch = this.fetchPublications;
} else if (resultType == "dataset" && !contextId) {
fetch = this.fetchDatasets;
} else if (resultType == "software") {
fetch = this.fetchSoftware;
} else if (resultType == "other") {
fetch = this.fetchOrps;
} else if (resultType == "dataset" && contextId) {
fetch = this.fetchFeaturedDatasets;
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, 0, 0, this.properties, contextId);
return;
}
fetch.getNumForCommunity(resultType, this.communityId, this.properties, contextId);
}
public ngOnDestroy() {
for (let sub of this.subs) {
sub.unsubscribe();
}
this.fetchPublications.clearSubscriptions();
this.fetchDatasets.clearSubscriptions();
this.fetchOrps.clearSubscriptions();
this.fetchSoftware.clearSubscriptions();
this.fetchFeaturedDatasets.clearSubscriptions();
}
isEntityEnabled(entity: string) {
return this.portal.entities.some(x => x['pid'] == entity && x['isEnabled'] === true);
}
isRouteEnabled(route: string) {
return this.portal.pages.some(x => x['route'] == route && x['isEnabled'] === true);
}
showInvite() {
return this.isManager();
}
isManager() {
if (!this.user) {
return false;
}
var email = this.user.email;
var index = -1;
if (email && this.community != null && this.community.managers != null) {
index = this.community.managers.indexOf(email);
}
return Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || index != -1;
}
private handleError(message: string, error) {
console.error("Community (component): " + message, error);
}
getSearchPlaceHolder() {
var entities = [];
if (this.isEntityEnabled("publication")) {
entities.push("publications");
}
if (this.isEntityEnabled("dataset")) {
entities.push("research data");
}
if (this.isEntityEnabled("software")) {
entities.push("software");
}
if (this.isEntityEnabled("orp")) {
entities.push("other research products");
}
return "Search" + ((entities.length > 0) ? (" for " + entities.join(', ') + "...") : "");
}
countOtherGraphs() {
var count = 0;
if (this.statistics && this.statistics.allowedEntities) {
for (var entity of this.statistics.allowedEntities) {
if (this.statistics.statisticsSum[entity].total > 0 && this.statistics.allowedCharts[entity].length > 0 && this.activeTab != entity) {
count += this.statistics.allowedCharts[entity].length;
}
}
}
return count;
}
createParams(param) {
return StringUtils.URIEncode(param);
}
private setActiveTab(entityType: string) {
if (entityType == "other") {
this.activeTab = "orp";
} else {
this.activeTab = entityType;
}
}
public getParamsForSearchLink(type: string = "") {
if (type) {
return this.routerHelper.createQueryParams(['type', 'qf', 'sortBy'], [type, 'false', 'resultdateofacceptance,descending']);
} else {
return {};
}
}
private getEntityName(entityType: string, plural: boolean, full: boolean): string {
if (entityType == "publication") {
return "publication" + (plural ? "s" : "");
} else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
} else if (entityType == "software") {
return "software";
} else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
}
}
public buildProjectsTooltip(): string {
let tooltipContent: string = "<div>";
if (this.projectTotal != null && this.projectTotal > 0 && this.isEntityEnabled('project') && this.isRouteEnabled(this.searchLinkToProjects)) {
tooltipContent += "<span class='uk-text-bold'>Projects</span>";
}
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
tooltipContent += "</div>";
return tooltipContent;
}
public buildContentProvidersTooltip(): string {
let tooltipContent: string = "<div>";
if (this.contentProviderTotal != null && this.contentProviderTotal > 0 && this.isEntityEnabled('datasource') && this.isRouteEnabled(this.searchLinkToDataProviders)) {
tooltipContent += "<span class='uk-text-bold'>Content Providers</span>";
}
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
tooltipContent += "</div>";
return tooltipContent;
}
public buildZenodoCommunitiesTooltip(): string {
let tooltipContent: string = "<div>";
tooltipContent += "<span class='uk-text-bold'>Zenodo</span> is a catch-all repository for OpenAIRE.";
tooltipContent += "<div class='uk-margin-small-top'>A <span class='uk-text-bold'>Zenodo Community</span> is created and curated by Zenodo users.</div>";
tooltipContent += "</div>";
return tooltipContent;
}
entityChanged($event) {
this.selectedEntity = $event.entity;
this.selectedEntitySimpleUrl = $event.simpleUrl;
this.selectedEntityAdvancedUrl = $event.advancedUrl;
if (this.selectedEntity == 'result') {
this.placeholderText = "Search by title, author, abstract, DOI, orcid... ";
} else if (this.selectedEntity == 'project') {
this.placeholderText = "Search by project title, grant id, funder...";
} else if (this.selectedEntity == 'dataprovider') {
this.placeholderText = "Search by name...";
} else {
this.placeholderText = "Search community content";
}
}
goTo(simple: boolean) {
let url = (simple) ? this.selectedEntitySimpleUrl : this.selectedEntityAdvancedUrl;
let parameterNames = [];
let parameterValues = [];
if (this.selectedEntity == "result" && this.resultsQuickFilter && this.resultsQuickFilter.selected) {
parameterNames.push(this.resultsQuickFilter.filterId);
parameterValues.push('"'+ encodeURIComponent(this.resultsQuickFilter.value)+'"');
}
if (this.keyword.length > 0) {
parameterNames.push("fv0");
parameterValues.push(this.keyword);
parameterNames.push("f0");
parameterValues.push("q");
}
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
}
public countSubscribersEvent($event) {
this.subscribers = $event.value;
}
public checkStatistics(type: string) {
return !!(this.isEntityEnabled(type)
&& this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive
&& this.statistics.statisticsSum && this.statistics.statisticsSum[type] && this.statistics.statisticsSum[type].total > 0
&&
(this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|| this.statistics.statisticsDisplay.entities[type].numbers.map['project']['showInMonitor']
|| this.statistics.statisticsDisplay.entities[type].numbers.map['open']['showInMonitor']
|| this.statistics.statisticsDisplay.entities[type].numbers.map['closed']['showInMonitor']
|| this.statistics.statisticsDisplay.entities[type].numbers.map['embargo']['showInMonitor']
|| this.statistics.statisticsDisplay.entities[type].numbers.map['restricted']['showInMonitor']
|| (this.statistics.allowedEntitiesMode['showInMonitor']
&& this.statistics.allowedChartsMode['showInMonitor'][type]
&& this.statistics.allowedChartsMode['showInMonitor'][type].length > 0)));
}
public initializeAnalyticsActiveTab() {
if (!this.analyticsChecked) {
if (this.checkStatistics("publication")) {
this.analyticsActiveTab = "publication";
} else if (this.checkStatistics("dataset")) {
this.analyticsActiveTab = "dataset";
} else if (this.checkStatistics("software")) {
this.analyticsActiveTab = "software";
} else if (this.checkStatistics("orp")) {
this.analyticsActiveTab = "orp";
}
}
}
public showAnalyticsTab() {
this.initializeAnalyticsActiveTab();
return this.analyticsActiveTab;
}
public onSelectActiveTab(activeTabId) {
if (this.activeTab != "activaTabId") { // tab really changed
if (activeTabId == 'summary') {
this.activeTab = 'summary';
} else if (activeTabId == 'publications') {
this.show = 'overview';
this.searchPublications(1, this.searchNumber);
} else if (activeTabId == 'datasets') {
this.show = 'overview';
this.searchDatasets(1, this.searchNumber);
} else if (activeTabId == 'software') {
this.show = 'overview';
this.searchSoftware(1, this.searchNumber);
} else if (activeTabId == 'other') {
this.show = 'overview';
this.searchOrps(1, this.searchNumber);
} else if (activeTabId == 'analytics') {
this.show = 'analysis';
this.activeTab = 'analytics';
this.analyticsChecked = true;
} else if (activeTabId == 'mapping') {
this.show = 'mapping';
this.activeTab = 'mapping';
} else if (activeTabId == 'enermaps') {
this.show = 'enermaps';
this.activeTab = 'enermaps';
this.searchFeaturedDatasets(1, this.fetchFeaturedDatasets.searchUtils.totalResults);
} else if (activeTabId == 'twitter') {
this.show = 'twitter';
this.activeTab = 'twitter';
}
}
}
isPrivate(){
return ConnectHelper.isPrivate(this.community, this.user);
}
disableSelectChange(event: boolean) {
this.disableSelect = event;
this.cdr.detectChanges();
}
public updatePage(event) {
this.page = event.value;
this.fetchFeaturedDatasets.searchUtils.page = event.value;
this.fetchFeaturedDatasets.results = this.fetchFeaturedDatasets.allResults.slice((this.page - 1) * this.searchNumber, this.page * this.searchNumber) ;
error => {}));
}
}

View File

@ -23,8 +23,8 @@ import {
import {SearchProjectsServiceModule} from '../openaireLibrary/connect/projects/searchProjectsService.module';
import {SearchResearchResultsServiceModule} from "../openaireLibrary/services/searchResearchResultsService.module";
import {SearchResultsModule} from "../openaireLibrary/searchPages/searchUtils/searchResults.module";
import {CuratorsModule} from "../curators/curators.module";
import {AffiliationsModule} from "../affiliations/affiliations.module";
import {CuratorsModule} from "../openaireLibrary/connect/components/curators/curators.module";
import {AffiliationsModule} from "../openaireLibrary/connect/affiliations/affiliations.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {MatSelectModule} from "@angular/material/select";
import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module";
@ -40,6 +40,10 @@ import {InputModule} from '../openaireLibrary/sharedComponents/input/input.modul
import {QuickSelectionsModule} from '../openaireLibrary/searchPages/searchUtils/quick-selections.module';
import {IconsModule} from '../openaireLibrary/utils/icons/icons.module';
import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-paging.module';
import {NumberRoundModule} from '../openaireLibrary/utils/pipes/number-round.module';
import {PluginsService} from '../openaireLibrary/services/plugins.service';
import {PluginWrapperModule} from "../openaireLibrary/dashboard/plugins/wrapper/plugin-wrapper.module";
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
@NgModule({
imports: [
@ -49,16 +53,17 @@ import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-p
SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule,
SEOServiceModule, MatSelectModule, EntitiesSelectionModule,
TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule,
AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule, NoLoadPaging
AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule, NoLoadPaging, NumberRoundModule, PluginWrapperModule, LoadingModule
],
declarations: [
CommunityComponent
],
providers:[
PreviousRouteRecorder, PiwikService
PreviousRouteRecorder, PiwikService, PluginsService
],
exports: [
CommunityComponent
]
})
export class CommunityModule { }
export class CommunityModule {
}

View File

@ -1,15 +0,0 @@
import { NgModule} from '@angular/core';
import { RouterModule } from '@angular/router';
import {CuratorsComponent} from "./curators.component";
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: CuratorsComponent, canActivate: [IsRouteEnabled], canDeactivate: [PreviousRouteRecorder]}
])
]
})
export class CuratorsRoutingModule {
}

View File

@ -1,152 +0,0 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-container *ngIf="longView else shortView">
<div style="min-height: 650px;">
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
<div class="uk-container uk-container-large uk-section uk-section-small">
<div *ngIf="showLoading" class="uk-margin-large uk-padding-large uk-padding-remove-horizontal">
<loading></loading>
</div>
<div *ngIf="!showLoading">
<h1 class="uk-margin-top">
Curators
</h1>
<div *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" class="uk-margin-medium">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']">
</helper>
</div>
<div *ngIf="curators" class="uk-margin-large-top">
<div *ngFor="let curator of curators let i=index;" class="uk-card uk-card-default uk-padding uk-margin-medium-bottom">
<div class="uk-grid" uk-grid>
<div class="uk-width-2-3@m uk-flex uk-flex-middle">
<div class="uk-width-small">
<img *ngIf="curator.photo && curator.photo !== ''" class="uk-border-circle" style="width: 150px; height: 150px;"
src="{{downloadUrl + curator.photo}}" alt="Curator Photo">
<img *ngIf="!curator.photo || curator.photo == ''" class="uk-border-circle" style="width: 150px; height: 150px;"
src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
</div>
<div class="uk-width-expand">
<div class="uk-padding">
<h4 class="uk-margin-remove">{{curator.name}}</h4>
<div *ngIf="curator.bio" class="uk-margin-top uk-height-max-large uk-overflow-auto">
<div class="uk-text-muted uk-margin-small-bottom">
Biography
</div>
<div>
<div *ngIf="!viewingMore">{{format(curator.bio)}}</div>
<div *ngIf="viewingMore">{{curator.bio}}</div>
<div *ngIf="curator.bio.length >= maxCharacters" class="uk-text-right uk-margin-small-top">
<a *ngIf="curator.bio.length >= maxCharacters"
(click)="openFsModal(curator)">
View details
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="curator.affiliations && curator.affiliations.length > 0" class="uk-width-1-3@m uk-padding" style="border-left: 1px solid #eaeaea">
<div class="uk-text-muted uk-margin-bottom">
Affiliations
</div>
<div class="uk-grid uk-flex-middle uk-child-width-1-2" uk-grid>
<div *ngFor="let affiliation of curator.affiliations">
<span *ngIf="!affiliation.website_url">
<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</span>
<a *ngIf="affiliation.website_url"
target="_blank" [href]="affiliation.website_url | urlPrefix">
<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="uk-margin-medium">
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']">
</helper>
</div>
</div>
</div>
</ng-container>
<!-- Short view for community's homepage -->
<ng-template #shortView>
<div *ngIf=" curators && curators.length > 0" class="uk-grid">
<span class="uk-text-meta uk-width-auto">
Curated by:
</span>
<div class="uk-width-expand uk-padding-remove uk-overflow-auto">
<div class="uk-height-max-medium uk-margin-xsmall-left">
<a routerLink="/curators">
<span *ngFor="let curator of curators.slice(0,curatorsLimit) let i=index;">
{{curator.name}}
<span *ngIf="i < curators.length-1 && i < curatorsLimit-1">, </span>
</span>
<span *ngIf="curators.length > curatorsLimit">
+{{curators.length-curatorsLimit}} more
</span>
</a>
</div>
</div>
</div>
</ng-template>
<fs-modal #fsModal classTitle="">
<div *ngIf="curatorInModal" class="uk-width-1-1 uk-height-1-1">
<div class="uk-container uk-container-large uk-section">
<div class="uk-margin-large-top uk-grid uk-grid-large" uk-grid>
<div class="uk-width-1-3@m">
<h2>
{{curatorInModal.name}}
</h2>
<img *ngIf="curatorInModal.photo && curatorInModal.photo !== ''" class="uk-width-2-3 uk-border-circle uk-margin-top uk-margin-bottom"
src="{{downloadUrl + curatorInModal.photo}}" alt="Curator Photo">
<img *ngIf="!curatorInModal.photo || curatorInModal.photo == ''" class="uk-width-2-3 uk-border-circle uk-margin-top uk-margin-bottom"
src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
</div>
<div class="uk-width-2-3@m">
<ul class="uk-tab" uk-tab>
<li>
<a>Biography</a>
</li>
<li *ngIf="curatorInModal.affiliations && curatorInModal.affiliations.length > 0">
<a>Affiliations</a>
</li>
</ul>
<ul class="uk-switcher">
<li class="uk-padding uk-padding-remove-left">
<h5>
Biography
</h5>
<div>
{{curatorInModal.bio}}
</div>
</li>
<li *ngIf="curatorInModal.affiliations && curatorInModal.affiliations.length > 0" class="uk-padding uk-padding-remove-left">
<div class="uk-grid uk-flex-middle uk-child-width-1-3" uk-grid>
<div *ngFor="let affiliation of curatorInModal.affiliations">
<span *ngIf="!affiliation.website_url">
<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</span>
<a *ngIf="affiliation.website_url"
target="_blank" [href]="affiliation.website_url | urlPrefix">
<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
</a>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</fs-modal>

View File

@ -1,155 +0,0 @@
import {Component, Input, ViewChild} from '@angular/core';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {CuratorService} from "../openaireLibrary/connect/curators/curator.service";
import {Curator} from "../openaireLibrary/utils/entities/CuratorInfo";
import {ActivatedRoute, Router} from "@angular/router";
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {Subscription} from "rxjs";
import {properties} from "../../environments/environment";
import {UserRegistryService} from "../openaireLibrary/services/user-registry.service";
import {FullScreenModalComponent} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component';
import {CommunityInfo} from "../openaireLibrary/connect/community/communityInfo";
@Component({
selector: 'curators',
templateUrl: './curators.component.html'
})
export class CuratorsComponent {
@Input() longView = true;
community: CommunityInfo;
public downloadUrl = null;
public showLoading = true;
public curators: Curator[] = [];
public curatorsLimit: number = 5;
public numberOfCurators: number = 5;
public showMore = [];
public maxCharacters = 450;
public viewingMore: boolean = false;
public curatorInModal;
public properties: EnvProperties;
public pageContents = null;
public divContents = null;
public url: string = null;
public pageTitle: string = "Curators";
public breadcrumbs: Breadcrumb[] = [{name: 'Home', route: '/'}, {name: 'About - Curators'}];
subs: Subscription[] = [];
@ViewChild('fsModal', { static: true }) fsModal: FullScreenModalComponent;
constructor(private route: ActivatedRoute,
private curatorsService: CuratorService,
private communityService: CommunityService,
private userRegistryService: UserRegistryService,
private _router: Router,
private helper: HelperService,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService) {
}
ngOnInit() {
this.showLoading = true;
this.properties = properties;
this.downloadUrl = this.properties.utilsService + '/download/';
//if (properties.environment !== 'development') {
if (!this.longView) {
this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if (community) {
this.community = community;
this.getCurators();
}
}));
} else {
this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if (community) {
this.community = community;
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
//this.getDivContents();
this.getPageContents();
this.getCurators();
}
}));
}
}
ngOnDestroy() {
for (let sub of this.subs) {
sub.unsubscribe();
}
}
private getCurators() {
this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => {
this.curators = curators;
this.showLoading = false;
}, error => {
console.error(error);
this.curators = [];
this.showLoading = false;
}));
}
private getPageContents() {
this.subs.push(this.helper.getPageHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents;
}));
}
private getDivContents() {
this.subs.push(this.helper.getDivHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => {
this.divContents = contents;
}));
}
format(name: string) {
if (name) {
return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name);
} else {
return null;
}
}
public viewMore() {
this.viewingMore = !this.viewingMore;
}
public openFsModal(curator) {
this.curatorInModal = curator;
this.fsModal.title = this.community.shortTitle + ' Curator';
this.fsModal.open();
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
}

View File

@ -1,35 +0,0 @@
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {CuratorsComponent} from './curators.component';
import {CuratorService} from "../openaireLibrary/connect/curators/curator.service";
import {CuratorsRoutingModule} from "./curators-routing.module";
import {AffiliationsModule} from "../affiliations/affiliations.module";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module";
import {LoadingModule} from '../openaireLibrary/utils/loading/loading.module';
import {FullScreenModalModule} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.module';
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule,
CuratorsRoutingModule, AffiliationsModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, PiwikServiceModule,
BreadcrumbsModule, UrlPrefixModule, LoadingModule,
FullScreenModalModule
],
declarations: [
CuratorsComponent
],
providers: [CuratorService],
exports: [
CuratorsComponent
]
})
export class CuratorsModule {}

View File

@ -8,6 +8,7 @@ import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommuni
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {Subscriber, Subscription} from "rxjs";
import {properties} from "../../environments/environment";
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
@Component({
selector: 'openaire-deposit',
@ -30,7 +31,8 @@ export class OpenaireDepositComponent {
constructor(private route: ActivatedRoute,
private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService) {
private _communityService: CommunityService,
private searchCommunityDataprovidersService: SearchCommunityDataprovidersService) {
this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService);
}
@ -46,6 +48,16 @@ export class OpenaireDepositComponent {
this.zenodoInformation.url = this.properties.zenodo;
this.zenodoInformation.name = "Zenodo";
}
this.subs.push(this.searchCommunityDataprovidersService.searchDataproviders(this.properties, this.communityId, true).subscribe(
res => {
if(res && res.length > 0){
this.zenodoInformation.hasSuggestedRepositories = true;
}
},
error => {
console.log(error);
}
));
}
}));
if (!this.zenodoInformation.shareInZenodoUrl) {

View File

@ -9,6 +9,7 @@ import {DepositRoutingModule} from "./deposit-routing.module";
import {DepositFirstPageModule} from "../openaireLibrary/deposit/depositFirstPage.module";
import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service";
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
@NgModule({
imports: [
@ -21,7 +22,7 @@ import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommuni
exports: [
OpenaireDepositComponent,
],
providers: [PreviousRouteRecorder, IsRouteEnabled,
providers: [PreviousRouteRecorder, IsRouteEnabled, SearchCommunityDataprovidersService,
ZenodoCommunitiesService]
})
export class LibDepositModule { }

View File

@ -9,6 +9,7 @@ import {ZenodoInformationClass} from '../openaireLibrary/deposit/utils/zenodoInf
import {FetchZenodoInformation} from './utils/fetchZenodoInformation.class';
import {Subscriber, Subscription} from "rxjs";
import {properties} from "../../environments/environment";
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
@Component({
selector: 'openaire-search-deposit',
@ -28,7 +29,8 @@ export class OpenaireSearchDataprovidersToDepositComponent {
constructor(private route: ActivatedRoute,
private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService) {
private _communityService: CommunityService,
private searchCommunityDataprovidersService: SearchCommunityDataprovidersService) {
this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService);
}
@ -44,6 +46,16 @@ export class OpenaireSearchDataprovidersToDepositComponent {
this.zenodoInformation.url = this.properties.zenodo;
this.zenodoInformation.name = "Zenodo";
}
this.subs.push(this.searchCommunityDataprovidersService.searchDataproviders(this.properties, this.communityId, true).subscribe(
res => {
if(res && res.length > 0){
this.zenodoInformation.hasSuggestedRepositories = true;
}
},
error => {
console.log(error);
}
));
}
}
));

View File

@ -9,6 +9,7 @@ import {SearchDataprovidersToDepositModule} from '../openaireLibrary/deposit/sea
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard';
import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
@NgModule({
imports: [
@ -23,6 +24,6 @@ import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoC
exports: [
OpenaireSearchDataprovidersToDepositComponent,
],
providers: [PreviousRouteRecorder, IsRouteEnabled]
providers: [PreviousRouteRecorder, IsRouteEnabled, SearchCommunityDataprovidersService]
})
export class LibSearchDataprovidersToDepositModule { }

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
import {SuggestedRepositoriesComponent} from "./suggestedRepositories.component";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: SuggestedRepositoriesComponent, canActivate: [IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class SuggestedRepositoriesRoutingModule { }

View File

@ -0,0 +1,79 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="title" type="other"></schema2jsonld>
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
<div class="uk-container uk-container-large uk-section uk-section-small uk-margin-medium-bottom" id="tm-main">
<div class="uk-container uk-container-large uk-margin-bottom">
<div class=" uk-grid uk-flex uk-flex-middle">
<h2 class="uk-margin-top uk-margin-medium-bottom uk-width-1-2@m">Repositories suggested by the curators.</h2>
<div class="uk-flex uk-flex-center uk-flex-middle uk-width-expand@m uk-width-1-1@s">
<div class="uk-padding">
<div page-enabled [pageRoute]="'/participate/deposit/zenodo'" class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<img src="assets/common-assets/common/logo-zenodo.png" alt="Zenodo logo" class="uk-width-small ">
<div *ngIf="this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0" class="">
<a class="uk-button uk-button-text" [routerLink]="['../zenodo']" >
Use related Zenodo communities
</a>
</div>
<div *ngIf="!(this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0)"
class="">
<a class="uk-button uk-button-text custom-external" [href]="properties.zenodo" target="_blank">
Zenodo Repository
</a>
</div>
</div>
<div page-enabled [pageRoute]="'/participate/deposit/search'" class="uk-flex uk-flex-column uk-flex-middle">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo" class="uk-width-small uk-margin-bottom">
<a routerLink="/participate/deposit/search" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
OpenAIRE Compliant Repositories
</a>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="zenodoSearchUtils.status == errorCodes.LOADING"
class="uk-animation-fade uk-margin-large uk-padding-large uk-padding-remove-horizontal" role="alert">
<loading></loading>
</div>
<div *ngIf="(zenodoSearchUtils.status == errorCodes.ERROR || zenodoSearchUtils.status == errorCodes.NONE)"
class="uk-animation-fade uk-margin-top uk-width-1-1 uk-alert uk-alert-warning" role="alert">
No suggested repositories found
</div>
<div class="uk-section">
<div *ngIf="contentProviders && contentProviders.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid
uk-height-match="target: .header, .body">
<ng-template ngFor let-item [ngForOf]="contentProviders" let-i="index">
<div
class="uk-animation-fade">
<div class="uk-card uk-card-default uk-card-body uk-card-hover">
<a [routerLink]="properties.searchLinkToDataProvider.split('?')[0]" [queryParams]="{datasourceId : item.openaireId}" >{{item.officialname?item.officialname:item.name}}</a>
<hr>
<div class="uk-text-small" [innerHTML]="item.message">
</div>
<!-- update with link to dataprovider -->
<!--<div class="uk-flex uk-flex-right uk-margin-small-top">
<a [href]="properties.connectPortalUrl + properties.searchLinkToDataProvider + item.openaireId " class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text" target="_blank">
<span class="uk-flex uk-flex-middle">
<icon [name]="'file_upload'" [type]="'outlined'" class="uk-margin-small-right"></icon>
<span>Go to repository</span>
</span>
</a>
</div>-->
</div>
</div>
</ng-template>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>

View File

@ -0,0 +1,141 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
import {RouterHelper} from "../../openaireLibrary/utils/routerHelper.class";
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../../openaireLibrary/utils/piwik/piwik.service";
import {Breadcrumb} from "../../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {properties} from "../../../environments/environment";
import {Subscriber, Subscription} from "rxjs";
import {SearchCommunityDataprovidersService} from "../../openaireLibrary/connect/contentProviders/searchDataproviders.service";
@Component({
selector: 'suggested-repositories',
templateUrl: './suggestedRepositories.component.html'
})
export class SuggestedRepositoriesComponent {
public url: string = null;
public title: string = "Suggested Repositories";
properties: EnvProperties = properties;
communityId: string = null;
community: CommunityInfo = null;
public pageContents = null;
public divContents = null;
// public warningMessage = "";
// public infoMessage = "";
masterZenodoCommunityId = null;
masterZenodoCommunity = null;
communityIds = null;
communities = [];
page = 1;
size = 5;
zenodoCommunitiesLoadedCount = 0;
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
errorCodes: ErrorCodes = new ErrorCodes();
depositLink = "https://zenodo.org/deposit/new?c=";
depositLearnHowPage: string = null;
public routerHelper: RouterHelper = new RouterHelper();
breadcrumbs: Breadcrumb[] = [];
subs: Subscription[] = [];
contentProviders;
constructor(private route: ActivatedRoute,
private _router: Router,
private _meta: Meta,
private _title: Title,
private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService,
private searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
private helper: HelperService,
private _piwikService: PiwikService,
private seoService: SEOService) {
}
public ngOnInit() {
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.url = properties.domain + properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);
this.updateUrl(this.url);
this.updateTitle(this.title);
this.updateDescription("sugested repositories, deposit");
this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.breadcrumbs.push({name: 'home', route: '/'}, {
name: "Deposit",
route: this.depositLearnHowPage
}, {name: "Suggested Repositories", route: null});
//this.getDivContents();
this.getPageContents();
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
if (community) {
this.communityId = community.communityId;
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe());
this.community = community;
this.masterZenodoCommunityId = this.community.zenodoCommunity;
this.subs.push(this.searchCommunityDataprovidersService.searchDataproviders(this.properties, this.community.communityId, true).subscribe(
res => {
this.contentProviders = res;
this.zenodoSearchUtils.status = this.contentProviders && this.contentProviders.length > 0 ? this.errorCodes.DONE: this.errorCodes.NONE;
},
error => {
console.log(error);
}
));
}
}));
}
public ngOnDestroy() {
for (let sub of this.subs) {
if (sub instanceof Subscriber) {
sub.unsubscribe();
}
}
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((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'");
}
private getPageContents() {
this.subs.push(this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents;
}));
}
private getDivContents() {
this.subs.push(this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.divContents = contents;
}));
}
private handleError(message: string, error) {
console.error("Share in Zenodo Page: " + message, error);
}
}

View File

@ -0,0 +1,39 @@
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {RouterModule} from "@angular/router";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
import {PiwikServiceModule} from "../../openaireLibrary/utils/piwik/piwikService.module";
import {Schema2jsonldModule} from "../../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {BreadcrumbsModule} from "../../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {NoLoadPaging} from "../../openaireLibrary/searchPages/searchUtils/no-load-paging.module";
import {IconsModule} from 'src/app/openaireLibrary/utils/icons/icons.module';
import {LoadingModule} from 'src/app/openaireLibrary/utils/loading/loading.module';
import {SuggestedRepositoriesRoutingModule} from "./suggestedRepositories-routing.module";
import {SuggestedRepositoriesComponent} from "./suggestedRepositories.component";
import {SearchCommunityDataprovidersService} from "../../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {IsPageEnabledModule} from "../../openaireLibrary/utils/isPageEnabled/isPageEnabled.module";
@NgModule({
imports: [
CommonModule, SuggestedRepositoriesRoutingModule, ZenodoCommunitiesServiceModule,
RouterModule, HelperModule, LoadingModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule, IsPageEnabledModule
],
declarations: [
SuggestedRepositoriesComponent
],
providers:[PreviousRouteRecorder, IsRouteEnabled, SearchCommunityDataprovidersService],
exports: [
SuggestedRepositoriesComponent
]
})
export class SuggestedRepositoriesModule {}

View File

@ -1,150 +1,157 @@
<schema2jsonld *ngIf="url" [URL]="url" [name]="title" type="other"></schema2jsonld>
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
<div class="uk-container uk-container-large uk-section uk-section-small uk-margin-medium-bottom" id="tm-main">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div class="uk-container uk-container-large uk-margin-bottom">
<h2 class="uk-margin-top uk-margin-medium-bottom uk-width-2-5@m">Deposit your research in Zenodo.</h2>
<div *ngIf="masterZenodoCommunity" class="uk-animation-fade uk-margin-medium-top uk-margin-large-bottom">
<h6 class="uk-margin-medium-bottom">Main Zenodo community</h6>
<div class="uk-grid uk-grid-large uk-child-width-1-2@s" uk-grid>
<div>
<div class="uk-card uk-card-default">
<div class="uk-card-body">
<div class="uk-grid uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto" *ngIf="masterZenodoCommunity.logoUrl">
<a target="_blank" [href]="masterZenodoCommunity.link">
<img *ngIf="masterZenodoCommunity.logoUrl"
src="{{masterZenodoCommunity.logoUrl}}" width="80" height="80" alt="">
</a>
</div>
<div class="uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="masterZenodoCommunity.link" class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank"
href="{{masterZenodoCommunity.link}}">
<span *ngIf="masterZenodoCommunity.title">{{masterZenodoCommunity.title}}</span>
<span *ngIf="!masterZenodoCommunity.title">[no name available]</span>
</a>
<span *ngIf="!masterZenodoCommunity.link">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div class="uk-container uk-container-large uk-margin-bottom">
<div class="uk-grid uk-grid-large uk-child-width-1-2@s uk-flex uk-flex-middle" uk-grid>
<div>
<h2 class="uk-margin-top uk-margin-medium-bottom">Deposit your research in Zenodo.</h2>
<div *ngIf="masterZenodoCommunity" class="uk-animation-fade uk-margin-medium-top uk-margin-large-bottom">
<h6 class="uk-margin-medium-bottom">Main Zenodo community</h6>
<div class="uk-card uk-card-default">
<div class="uk-card-body">
<div class="uk-grid uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto" *ngIf="masterZenodoCommunity.logoUrl">
<a target="_blank" [href]="masterZenodoCommunity.link">
<img *ngIf="masterZenodoCommunity.logoUrl"
src="{{masterZenodoCommunity.logoUrl}}" width="80" height="80" alt="">
</a>
</div>
<div class="uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="masterZenodoCommunity.link"
class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank"
href="{{masterZenodoCommunity.link}}">
<span *ngIf="masterZenodoCommunity.title">{{masterZenodoCommunity.title}}</span>
<span *ngIf="!masterZenodoCommunity.title">[no name available]</span>
</a>
<span *ngIf="!masterZenodoCommunity.link">
<span *ngIf="masterZenodoCommunity.title">{{masterZenodoCommunity.title}}</span>
<span *ngIf="!masterZenodoCommunity.title">[no name available]</span>
</span>
</h2>
<div *ngIf="masterZenodoCommunity.date" class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Last update: </span>{{masterZenodoCommunity.date | date:'yyyy/MM/dd'}}
</div>
</div>
</div>
<div *ngIf="masterZenodoCommunity.description" class="uk-margin-top uk-margin-bottom uk-text-small">
<p *ngIf="masterZenodoCommunity.description" class="uk-margin-remove" [innerHTML]="masterZenodoCommunity.description"></p>
</div>
<div>
</h2>
<div *ngIf="masterZenodoCommunity.date" class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Last update: </span>{{masterZenodoCommunity.date | date:'yyyy/MM/dd'}}
</div>
</div>
</div>
<div *ngIf="masterZenodoCommunity.description" class="uk-margin-top uk-margin-bottom uk-text-small">
<p *ngIf="masterZenodoCommunity.description" class="uk-margin-remove"
[innerHTML]="masterZenodoCommunity.description"></p>
</div>
<div>
<span class="uk-width-expand uk-flex-right">
<a [href]="depositLink + masterZenodoCommunity.id" target="_blank" type="submit"
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
<icon name="file_upload" type="outlined" [flex]="true" class="uk-margin-small-right"></icon>
<span>New upload</span>
</span>
</a>
</span>
</div>
</div>
</div>
</div>
<div class="uk-flex uk-flex-center uk-flex-middle">
<div class="uk-padding">
<!-- <div class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<img src="assets/connect-assets/deposit/suggested-repositories.svg" alt="Suggested Repositories" class="uk-width-small uk-margin-bottom" style="height: 70px;">
<a routerLink="/participate/deposit/search" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
Suggested Repositories
</a>
</div> -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo" class="uk-width-small uk-margin-bottom">
<a routerLink="/participate/deposit/search" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
OpenAIRE Compliant Repositories
</a>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="zenodoSearchUtils.status == errorCodes.LOADING"
class="uk-animation-fade uk-margin-large uk-padding-large uk-padding-remove-horizontal" role="alert">
<loading></loading>
</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>
<div class="uk-section">
<h6 *ngIf="masterZenodoCommunity" class="uk-margin-medium-bottom">Other related Zenodo communities</h6>
<h6 *ngIf="!masterZenodoCommunity" class="uk-margin-medium-bottom">Related Zenodo communities</h6>
<div *ngIf="!masterZenodoCommunity" class="uk-margin-top uk-text-center uk-margin-medium-bottom">
<a routerLink="/participate/deposit/search" target="_blank" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
OpenAIRE Compliant Repositories
</a>
</div>
<no-load-paging *ngIf="communityIds && communityIds.length > size" [type]="'Zenodo communities'"
(pageChange)="getCommunities($event)"
[page]="page" [pageSize]="size"
[totalResults]="communityIds.length" >
</no-load-paging>
<div *ngIf="communityIds && communityIds.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid
uk-height-match="target: .header, .body">
<ng-template ngFor let-item [ngForOf]="communityIds" let-i="index">
<div *ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]]"
class="uk-animation-fade">
<div class="uk-card uk-card-default">
<div class="uk-card-body">
<div class="header uk-grid uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto" *ngIf="communities[this.communityIds[i]].logoUrl">
<a target="_blank" [href]="communities[this.communityIds[i]].link">
<img *ngIf="communities[this.communityIds[i]].logoUrl"
src="{{communities[this.communityIds[i]].logoUrl}}" width="80" height="80" alt="">
</a>
</div>
<div class="uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank"
href="{{communities[this.communityIds[i]].link}}">
<span *ngIf="communities[this.communityIds[i]].title">{{communities[this.communityIds[i]].title}}</span>
<span *ngIf="!communities[this.communityIds[i]].title">[no name available]</span>
</a>
</h2>
<div class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Last update: </span>{{communities[this.communityIds[i]].date | date:'yyyy/MM/dd'}}
</div>
</div>
</div>
<div class="body uk-margin-top uk-margin-bottom uk-text-small multi-line-ellipsis lines-3"> <!-- uk-height-max-small uk-overflow-auto -->
<p *ngIf="communities[this.communityIds[i]].description" class="uk-margin-remove" [innerHtml]="communities[this.communityIds[i]].description"></p>
</div>
<div>
</div>
</div>
</div>
</div>
</div>
<div class="uk-flex uk-flex-center uk-flex-middle">
<div class="uk-padding">
<div page-enabled [pageRoute]="'/participate/deposit/suggested'"
class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<img src="assets/connect-assets/deposit/suggested-repositories.svg" alt="Suggested Repositories"
class="uk-width-small uk-margin-bottom" style="height: 70px;">
<a routerLink="/participate/deposit/suggested" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
Suggested Repositories
</a>
</div>
<div page-enabled [pageRoute]="'/participate/deposit/search'" class="uk-flex uk-flex-column uk-flex-middle">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo"
class="uk-width-small uk-margin-bottom">
<a routerLink="/participate/deposit/search" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
OpenAIRE Compliant Repositories
</a>
</div>
</div>
</div>
</div>
<div *ngIf="zenodoSearchUtils.status == errorCodes.LOADING"
class="uk-animation-fade uk-margin-large uk-padding-large uk-padding-remove-horizontal" role="alert">
<loading></loading>
</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>
<div class="uk-section">
<h6 *ngIf="masterZenodoCommunity" class="uk-margin-medium-bottom">Other related Zenodo communities</h6>
<h6 *ngIf="!masterZenodoCommunity" class="uk-margin-medium-bottom">Related Zenodo communities</h6>
<no-load-paging *ngIf="communityIds && communityIds.length > size" [type]="'Zenodo communities'"
(pageChange)="getCommunities($event)"
[page]="page" [pageSize]="size"
[totalResults]="communityIds.length">
</no-load-paging>
<div *ngIf="communityIds && communityIds.length > 0"
class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid
uk-height-match="target: .header, .body">
<ng-template ngFor let-item [ngForOf]="communityIds" let-i="index">
<div
*ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]]"
class="uk-animation-fade">
<div class="uk-card uk-card-default">
<div class="uk-card-body">
<div class="header uk-grid uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto" *ngIf="communities[this.communityIds[i]].logoUrl">
<a target="_blank" [href]="communities[this.communityIds[i]].link">
<img *ngIf="communities[this.communityIds[i]].logoUrl"
src="{{communities[this.communityIds[i]].logoUrl}}" width="80" height="80" alt="">
</a>
</div>
<div class="uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank"
href="{{communities[this.communityIds[i]].link}}">
<span
*ngIf="communities[this.communityIds[i]].title">{{communities[this.communityIds[i]].title}}</span>
<span *ngIf="!communities[this.communityIds[i]].title">[no name available]</span>
</a>
</h2>
<div class="uk-text-small uk-margin-small-top">
<span
class="uk-text-meta">Last update: </span>{{communities[this.communityIds[i]].date | date:'yyyy/MM/dd'}}
</div>
</div>
</div>
<div class="body uk-margin-top uk-margin-bottom uk-text-small multi-line-ellipsis lines-3">
<!-- uk-height-max-small uk-overflow-auto -->
<p *ngIf="communities[this.communityIds[i]].description" class="uk-margin-remove"
[innerHtml]="communities[this.communityIds[i]].description"></p>
</div>
<div>
<span class="uk-width-expand uk-flex-right">
<a [href]="depositLink + communities[this.communityIds[i]].id" target="_blank" type="submit"
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
<icon name="file_upload" type="outlined" [flex]="true" class="uk-margin-small-right"></icon>
<span>New upload</span>
</span>
</a>
</span>
</div>
</div>
</div>
</div>
</ng-template>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>
</div>
</div>
</div>
</ng-template>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
</div>

View File

@ -24,7 +24,7 @@ export class ShareInZenodoComponent {
public title: string = "Share in Zenodo";
properties: EnvProperties = properties;
communityId: string = null;
private community: CommunityInfo = null;
community: CommunityInfo = null;
public pageContents = null;
public divContents = null;
@ -95,6 +95,9 @@ export class ShareInZenodoComponent {
}
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.communityIds = this.community.otherZenodoCommunities;
if(this.communityIds && this.masterZenodoCommunityId && this.communityIds.indexOf(this.masterZenodoCommunityId) !=-1){
this.communityIds.splice(this.communityIds.indexOf(this.masterZenodoCommunityId), 1)
}
this.zenodoSearchUtils.totalResults = this.communityIds.length;
if (this.communityIds.length == 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE;

View File

@ -17,17 +17,19 @@ import {BreadcrumbsModule} from "../../openaireLibrary/utils/breadcrumbs/breadcr
import {NoLoadPaging} from "../../openaireLibrary/searchPages/searchUtils/no-load-paging.module";
import {IconsModule} from 'src/app/openaireLibrary/utils/icons/icons.module';
import {LoadingModule} from 'src/app/openaireLibrary/utils/loading/loading.module';
import {SearchCommunityDataprovidersService} from "../../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {IsPageEnabledModule} from "../../openaireLibrary/utils/isPageEnabled/isPageEnabled.module";
@NgModule({
imports: [
CommonModule, ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule,
RouterModule, HelperModule, LoadingModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule, IsPageEnabledModule
],
declarations: [
ShareInZenodoComponent
],
providers:[PreviousRouteRecorder, IsRouteEnabled],
providers:[PreviousRouteRecorder, IsRouteEnabled, SearchCommunityDataprovidersService],
exports: [
ShareInZenodoComponent
]

View File

@ -1,20 +0,0 @@
import {NgModule} from "@angular/core";
import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {CommunityFosComponent} from "./fos.component";
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: CommunityFosComponent,
canActivate: [IsRouteEnabled],
canDeactivate: [PreviousRouteRecorder]
}
])
]
})
export class LibFosRoutingModule {
}

View File

@ -1,21 +0,0 @@
import {Component} from "@angular/core";
import {properties} from "../../environments/environment";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
@Component({
selector: 'community-fos',
template: `
<fos></fos>
`
})
export class CommunityFosComponent {
communityId;
constructor() {
}
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
}
}

View File

@ -1,27 +0,0 @@
import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {LibFosRoutingModule} from "./fos-routing.module";
import {FosRoutingModule} from "../openaireLibrary/fos/fos-routing.module";
import {FosModule} from "../openaireLibrary/fos/fos.module";
import {CommunityFosComponent} from "./fos.component";
@NgModule({
imports: [
CommonModule,
LibFosRoutingModule,
FosRoutingModule,
FosModule
],
declarations: [
CommunityFosComponent
],
exports: [
CommunityFosComponent
],
providers: [
PreviousRouteRecorder
]
})
export class LibFosModule {
}

View File

@ -6,7 +6,7 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
import {OrganizationsPageComponent} from './organizationsPage.component';
import {OrganizationsPageRoutingModule} from './organizationsPage-routing.module';
import {AffiliationsModule} from "../../affiliations/affiliations.module";
import {AffiliationsModule} from "../../openaireLibrary/connect/affiliations/affiliations.module";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
import {CommonModule} from "@angular/common";
import {HtmlPagesModule} from "../htmlPages.module";

@ -1 +1 @@
Subproject commit e30672043b03c607fb6c6c1c490d4fa34a772d3d
Subproject commit 2e2a71c3101660480ede67c06edc22aa00faa79d

View File

@ -2,22 +2,41 @@ import {Component} from "@angular/core";
import {properties} from "../../environments/environment";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {Router} from "@angular/router";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Subscription} from "rxjs";
@Component({
selector: 'community-sdg',
template: `
<sdg [customFilter]="customFilter"></sdg>
<sdg *ngIf="pageContents" [customFilter]="customFilter" [pageContents]="pageContents"></sdg>
`
})
export class CommunitySdgComponent {
communityId;
customFilter: SearchCustomFilter = null;
constructor() {
public pageContents = null;
subs: Subscription[] = [];
constructor(
private _router: Router,
private helper: HelperService) {
}
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.getPageContents();
}
ngOnDestroy() {
for (let sub of this.subs) {
sub.unsubscribe();
}
}
private getPageContents() {
this.subs.push(this.helper.getPageHelpContents(properties, this.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents;
console.log(this.pageContents)
}));
}
}

View File

@ -163,7 +163,7 @@ export class OpenaireSearchDataprovidersComponent {
this.searchUtils.totalResults = results.length;
this.results = results.slice((this.searchUtils.page - 1) * this.searchUtils.size, this.searchUtils.page *this.searchUtils.size );
this.searchUtils.status = this.results.length == 0 ? this.errorCodes.NONE: this.errorCodes.DONE;
this.searchPage.buildPageURLParameters(this.filters, [], [], false);
this.searchPage.buildPageURLParameters(this.filters, [], [], false);
this.disableForms = false;
this.enableSearchView = true;
}

View File

@ -96,7 +96,7 @@ export class OpenaireSearchProjectsComponent {
this.searchUtils.validateSize(params['size']);
this.keyword = decodeURIComponent(params['fv0']?params['fv0']:(params['keyword']?params['keyword']:''));
this.selectedFields = [];
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], [], this.fieldIdsMap, this.customFilter, params, "project");
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], ["funder"], this.fieldIdsMap, this.customFilter, params, "project");
if(this.initialLoad) {
this.initialLoad = false;
this._getCommunityFunders();

View File

@ -0,0 +1,74 @@
import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
import {forkJoin, Observable} from 'rxjs';
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {properties} from "../../environments/environment";
import {map, take} from "rxjs/operators";
import {LoginErrorCodes} from "../openaireLibrary/login/utils/guardHelper.class";
import {Session} from "../openaireLibrary/login/utils/helper.class";
@Injectable()
export class CommunityAccessGuard {
constructor(private router: Router,
private communityService: CommunityService, private userManagementService: UserManagementService) {
}
check(path: string): Observable<boolean> | boolean {
let community = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!community) {
this.router.navigate([properties.errorLink], {queryParams: {page: path}});
return false;
}
return forkJoin([
this.userManagementService.getUserInfo().pipe(take(1)),
this.communityService.getCommunity(community).pipe(take(1))
]).pipe(
map(([user, communityInfo]) => {
if (communityInfo) {
if (communityInfo.isPublic()) {
return true;
} else if (communityInfo.isPrivate()) {
this.router.navigate([properties.errorLink], {queryParams: {page: path}});
return false;
} else {
if (!user) {
this.router.navigate(['/user-info'], {
queryParams: {
'errorCode': LoginErrorCodes.NOT_LOGIN,
'redirectUrl': path
}
})
return false;
}
if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user) || Session.isSubscribedTo('community', community, user)) {
return true;
} else {
this.router.navigate(['/user-info'], {
queryParams: {
'errorCode': LoginErrorCodes.NOT_AUTHORIZED,
'redirectUrl': path
}
})
return false;
}
}
}
this.router.navigate([properties.errorLink], {queryParams: {page: path}});
return false;
})
);
}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url);
}
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return this.check(state.url);
}
}

@ -1 +1 @@
Subproject commit 3b437aafda7a716a0a89785a106456cbe520dce3
Subproject commit 5026b8b38fcae493ec7bcdc272bf167798c18fa3

View File

@ -61,3 +61,11 @@
.hook-inverse();
}
//services slider
@slider-nav-item-background-active: white;
slider-container slider-nav-item {
background-color:#FFFFFF80;
}
slider-container slider-nav-item when (@hero-fonts-mode = light) {
.hook-inverse
}

@ -1 +1 @@
Subproject commit 99ab54cdd7b973a2ba047f0a6b37667270b58439
Subproject commit 56f08f2c2eeecf7a2df1167757b4fc46f17ed82f

View File

@ -6,7 +6,7 @@ let props: EnvProperties = {
dashboard: 'connect',
adminToolsPortalType: "connect",
adminToolsCommunity: 'connect',
enablePiwikTrack: false,
enablePiwikTrack: true,
piwikSiteId: '80',
useCache: false,
useLongCache: true,
@ -14,6 +14,8 @@ let props: EnvProperties = {
showAddThis: false,
domain: 'https://beta.connect.openaire.eu',
baseLink : "",
monitorStatsFrameUrl:"https://beta.services.openaire.eu/stats-tool/"
};

View File

@ -6,7 +6,7 @@ let props: EnvProperties = {
dashboard: 'connect',
adminToolsPortalType: "connect",
adminToolsCommunity: 'connect',
enablePiwikTrack: false,
enablePiwikTrack: true,
piwikSiteId: '80',
useCache: false,
useLongCache: true,
@ -14,7 +14,9 @@ let props: EnvProperties = {
showAddThis: false,
domain: 'https://connect.openaire.eu',
baseLink : "",
hasMachineCache: true
hasMachineCache: true,
monitorStatsFrameUrl:"https://services.openaire.eu/stats-tool/"
};
export let properties: EnvProperties = {

View File

@ -19,6 +19,10 @@ let props: EnvProperties = {
domain: 'https://beta.connect.openaire.eu',
baseLink : "",
adminToolsAPIURL: 'http://scoobydoo.di.uoa.gr:8880/uoa-admin-tools/',
utilsService:"http://scoobydoo.di.uoa.gr:8000",
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
};