From 8b69941b2b768c606f2a7cdbcd0815d22ebea58d Mon Sep 17 00:00:00 2001 From: Konstantinos Triantafyllou Date: Wed, 9 Oct 2019 09:05:56 +0000 Subject: [PATCH] [Monitor]: Delete connect folders git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor@57323 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../affiliations/affiliations.component.html | 93 -- .../affiliations/affiliations.component.ts | 100 --- src/app/affiliations/affiliations.module.ts | 30 - src/app/app-routing.module.ts | 81 +- src/app/app.module.ts | 3 +- .../browse-community.component.html | 88 -- .../browse-community.component.ts | 94 --- .../browse-community.module.ts | 29 - .../communities/communities-routing.module.ts | 17 - .../communities/communities.component.html | 242 ------ src/app/communities/communities.component.ts | 199 ----- src/app/communities/communities.module.ts | 41 - src/app/community/community-routing.module.ts | 16 - src/app/community/community.component.html | 559 ------------ src/app/community/community.component.ts | 367 -------- src/app/community/community.module.ts | 50 -- .../communityWrapper-routing.module.ts | 16 - .../communityWrapper.component.ts | 48 -- .../communityWrapper.module.ts | 27 - src/app/content/content-routing.module.ts | 16 - src/app/content/contentPage.component.html | 83 -- src/app/content/contentPage.component.ts | 81 -- src/app/content/contentPage.module.ts | 33 - ...ty-creation-instructions-routing.module.ts | 17 - ...mmunity-creation-instructions.component.ts | 416 --------- .../community-creation-instructions.module.ts | 26 - src/app/curators/curators-routing.module.ts | 15 - src/app/curators/curators.component.html | 142 ---- src/app/curators/curators.component.ts | 148 ---- src/app/curators/curators.module.ts | 30 - .../helper-test/helper-test.component.html | 1 - src/app/helper-test/helper-test.component.ts | 37 - src/app/helper-test/helper-test.module.ts | 27 - src/app/home/home.component.html | 225 ----- src/app/home/home.component.ts | 89 -- src/app/home/home.module.ts | 34 +- .../about/aboutPage-routing.module.ts | 17 - .../htmlPages/about/aboutPage.component.ts | 45 - src/app/htmlPages/about/aboutPage.module.ts | 26 - src/app/htmlPages/htmlPage.component.ts | 62 -- src/app/htmlPages/htmlPage.service.ts | 25 - src/app/htmlPages/htmlPages.module.ts | 21 - .../organizationsPage-routing.module.ts | 17 - .../organizationsPage.component.ts | 70 -- .../organizations/organizationsPage.module.ts | 28 - src/app/monitor/monitor.component.ts | 14 - .../my-communities-routing.module.ts | 17 - .../my-communities.component.html | 114 --- .../my-communities.component.ts | 232 ----- .../my-communities/my-communities.module.ts | 38 - .../results/results.component.ts | 89 -- .../searchCommunities-routing.module.ts | 14 - .../searchCommunities.component.ts | 484 ----------- .../communities/searchCommunities.module.ts | 24 - src/app/test/theme.component.html | 798 ------------------ src/app/test/theme.component.ts | 11 - 56 files changed, 61 insertions(+), 5605 deletions(-) delete mode 100644 src/app/affiliations/affiliations.component.html delete mode 100644 src/app/affiliations/affiliations.component.ts delete mode 100644 src/app/affiliations/affiliations.module.ts delete mode 100644 src/app/communities/browseCommunity/browse-community.component.html delete mode 100644 src/app/communities/browseCommunity/browse-community.component.ts delete mode 100644 src/app/communities/browseCommunity/browse-community.module.ts delete mode 100644 src/app/communities/communities-routing.module.ts delete mode 100644 src/app/communities/communities.component.html delete mode 100644 src/app/communities/communities.component.ts delete mode 100644 src/app/communities/communities.module.ts delete mode 100644 src/app/community/community-routing.module.ts delete mode 100644 src/app/community/community.component.html delete mode 100644 src/app/community/community.component.ts delete mode 100644 src/app/community/community.module.ts delete mode 100644 src/app/communitywrapper/communityWrapper-routing.module.ts delete mode 100644 src/app/communitywrapper/communityWrapper.component.ts delete mode 100644 src/app/communitywrapper/communityWrapper.module.ts delete mode 100644 src/app/content/content-routing.module.ts delete mode 100644 src/app/content/contentPage.component.html delete mode 100644 src/app/content/contentPage.component.ts delete mode 100644 src/app/content/contentPage.module.ts delete mode 100644 src/app/createCommunity/community-creation-instructions-routing.module.ts delete mode 100644 src/app/createCommunity/community-creation-instructions.component.ts delete mode 100644 src/app/createCommunity/community-creation-instructions.module.ts delete mode 100644 src/app/curators/curators-routing.module.ts delete mode 100644 src/app/curators/curators.component.html delete mode 100644 src/app/curators/curators.component.ts delete mode 100644 src/app/curators/curators.module.ts delete mode 100644 src/app/helper-test/helper-test.component.html delete mode 100644 src/app/helper-test/helper-test.component.ts delete mode 100644 src/app/helper-test/helper-test.module.ts delete mode 100644 src/app/htmlPages/about/aboutPage-routing.module.ts delete mode 100644 src/app/htmlPages/about/aboutPage.component.ts delete mode 100644 src/app/htmlPages/about/aboutPage.module.ts delete mode 100644 src/app/htmlPages/htmlPage.component.ts delete mode 100644 src/app/htmlPages/htmlPage.service.ts delete mode 100644 src/app/htmlPages/htmlPages.module.ts delete mode 100644 src/app/htmlPages/organizations/organizationsPage-routing.module.ts delete mode 100644 src/app/htmlPages/organizations/organizationsPage.component.ts delete mode 100644 src/app/htmlPages/organizations/organizationsPage.module.ts delete mode 100644 src/app/my-communities/my-communities-routing.module.ts delete mode 100644 src/app/my-communities/my-communities.component.html delete mode 100644 src/app/my-communities/my-communities.component.ts delete mode 100644 src/app/my-communities/my-communities.module.ts delete mode 100644 src/app/searchEntries/results/results.component.ts delete mode 100644 src/app/searchPages/communities/searchCommunities-routing.module.ts delete mode 100644 src/app/searchPages/communities/searchCommunities.component.ts delete mode 100644 src/app/searchPages/communities/searchCommunities.module.ts delete mode 100644 src/app/test/theme.component.html delete mode 100644 src/app/test/theme.component.ts diff --git a/src/app/affiliations/affiliations.component.html b/src/app/affiliations/affiliations.component.html deleted file mode 100644 index b1b8719..0000000 --- a/src/app/affiliations/affiliations.component.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - -
- {{organization.name.slice(0, 100)}}... -
-
- - - -
- -
-
- - - - - - -
-
-
- -
- Related Organizations ({{affiliations.length}}) -
- -
-
- -
- - - - -
-
- - View more details - -
-
- - - - diff --git a/src/app/affiliations/affiliations.component.ts b/src/app/affiliations/affiliations.component.ts deleted file mode 100644 index f964335..0000000 --- a/src/app/affiliations/affiliations.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Title, Meta} from '@angular/platform-browser'; -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 {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; -import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; -import {PiwikHelper} from "../utils/piwikHelper"; - -@Component({ - selector: 'affiliations', - templateUrl: './affiliations.component.html' -}) -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; - - communityId: string; - properties:EnvProperties; - - public piwiksub: any; - public url: string = null; - public pageTitle: string = "Related Organizations"; - - constructor ( private route: ActivatedRoute, private _router: Router, - private _meta: Meta, - private _title: Title, - private seoService: SEOService, - private _piwikService: PiwikService, - private affiliationService: AffiliationService) {} - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.route.queryParams.subscribe( - communityId => { - this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain); - if(!this.communityId) { - this.communityId = communityId['communityId']; - } - - this.properties = data.envSpecific; - if(this.longView) { - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe(); - } - this.url = this.properties.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(this.url); - this.updateUrl(this.url); - this.updateTitle(this.pageTitle); - this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, organizations"); - } - if(this.getAffiliationsFromAPI) { - this.showLoading = true; - this.affiliationService.initAffiliations(this.properties, this.properties.communityAPI + this.communityId + "/organizations"); - this.affiliationService.affiliations.subscribe( - affiliations => { - this.affiliations = affiliations; - this.showLoading = false; - }, - error => { - console.error("Affiliations Component: Error getting affiliations for community with id: "+this.communityId, error); - this.showLoading = false; - } - ); - } - }); - }); - } - - public ngOnDestroy() { - if (this.piwiksub) { - this.piwiksub.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'"); - } -} diff --git a/src/app/affiliations/affiliations.module.ts b/src/app/affiliations/affiliations.module.ts deleted file mode 100644 index 20e2528..0000000 --- a/src/app/affiliations/affiliations.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { NgModule, ModuleWithProviders } from '@angular/core'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -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 {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; - -@NgModule({ - imports: [ - CommonModule, RouterModule, Schema2jsonldModule, SEOServiceModule, - PiwikServiceModule - ], - declarations: [ - AffiliationsComponent - ], - providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled, AffiliationService], - exports: [ - AffiliationsComponent - ] -}) - - -export class AffiliationsModule{} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 439783a..31220c3 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,41 +1,51 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; -import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver'; -import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; +import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver'; +import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; -import { OpenaireErrorPageComponent } from './error/errorPage.component'; -import {ThemeComponent} from "./test/theme.component"; +import {OpenaireErrorPageComponent} from './error/errorPage.component'; const routes: Routes = [ - // Other Pages - { path: '', loadChildren: './home/home.module#HomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'monitor', loadChildren: './monitor/monitor.module#MonitorModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'}, - { path: 'about/learn-how', loadChildren: './learn-how/learn-how.module#LearnHowModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'about/learn-in-depth', loadChildren: './learn-how/learnInDepth/learn-in-depth.module#LearnInDepthModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'contact-us', loadChildren: './contact/contact.module#ContactModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'invite', loadChildren: './utils/subscribe/invite/invite.module#InviteModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'content', loadChildren: './content/contentPage.module#ContentPageModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'organizations', loadChildren: './htmlPages/organizations/organizationsPage.module#OrganizationsPageModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'curators', loadChildren: './curators/curators.module#CuratorsModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - - { path: 'myCommunities', loadChildren: './my-communities/my-communities.module#MyCommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - - // Search Pages - - { path: 'search/find/communities', loadChildren: './searchPages/communities/searchCommunities.module#SearchCommunitiesModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - - // Testing Page for help contents - { path: 'helper-test', loadChildren: './helper-test/helper-test.module#HelperTestModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - - - // help pages - do not exist in Admin portal/api/db - { path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'user-info', loadChildren: './login/libUser.module#LibUserModule', resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'error', component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}, - { path: 'theme', component: ThemeComponent}, - { path: '**',pathMatch: 'full',component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }} + {path: '', loadChildren: './home/home.module#HomeModule', resolve: {envSpecific: EnvironmentSpecificResolver}}, + { + path: 'monitor', + loadChildren: './monitor/monitor.module#MonitorModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + {path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'}, + { + path: 'about/learn-how', + loadChildren: './learn-how/learn-how.module#LearnHowModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + { + path: 'about/learn-in-depth', + loadChildren: './learn-how/learnInDepth/learn-in-depth.module#LearnInDepthModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + { + path: 'contact-us', + loadChildren: './contact/contact.module#ContactModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + { + path: 'reload', + loadChildren: './reload/libReload.module#LibReloadModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + { + path: 'user-info', + loadChildren: './login/libUser.module#LibUserModule', + resolve: {envSpecific: EnvironmentSpecificResolver} + }, + {path: 'error', component: OpenaireErrorPageComponent, resolve: {envSpecific: EnvironmentSpecificResolver}}, + { + path: '**', + pathMatch: 'full', + component: OpenaireErrorPageComponent, + resolve: {envSpecific: EnvironmentSpecificResolver} + } ]; @NgModule({ @@ -43,4 +53,5 @@ const routes: Routes = [ exports: [RouterModule], providers: [EnvironmentSpecificResolver, EnvironmentSpecificService] }) -export class AppRoutingModule { } +export class AppRoutingModule { +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e6bc615..e66359b 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -19,7 +19,6 @@ import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/en import {CommunitiesService} from './openaireLibrary/connect/communities/communities.service'; import {LayoutService} from "./openaireLibrary/services/layout.service"; import {SubscribeModule} from './utils/subscribe/subscribe.module'; -import {ThemeComponent} from "./test/theme.component"; @NgModule({ @@ -37,7 +36,7 @@ import {ThemeComponent} from "./test/theme.component"; BrowserModule.withServerTransition({appId: 'my-app'}), AppRoutingModule ], - declarations: [ AppComponent, OpenaireErrorPageComponent, ThemeComponent], + declarations: [ AppComponent, OpenaireErrorPageComponent], exports: [ AppComponent ], providers:[EnvironmentSpecificResolver, CommunitiesService, LayoutService], bootstrap: [AppComponent] diff --git a/src/app/communities/browseCommunity/browse-community.component.html b/src/app/communities/browseCommunity/browse-community.component.html deleted file mode 100644 index d264e26..0000000 --- a/src/app/communities/browseCommunity/browse-community.component.html +++ /dev/null @@ -1,88 +0,0 @@ -
-
- Private -
-
- Subscribed -
- - -
- -
-
- -
- You will be navigated to a new tab. Are you sure that you want to proceed? -
-
diff --git a/src/app/communities/browseCommunity/browse-community.component.ts b/src/app/communities/browseCommunity/browse-community.component.ts deleted file mode 100644 index 842c889..0000000 --- a/src/app/communities/browseCommunity/browse-community.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -import {Component, Input, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Location} from '@angular/common'; - -import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; -import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo'; -import {LocalStorageService} from "../../openaireLibrary/services/localStorage.service"; - -@Component({ - selector: 'browse-community', - templateUrl: 'browse-community.component.html' -}) - -export class BrowseCommunityComponent { - @Input() public community: CommunityInfo = null; - @Input() public showDescription: boolean = true; - @ViewChild('AlertModal') modal; - - public hiddenMessage: string = "Community is hidden to registered users. It is visible only to users that have privileges to manage community; delay: 100"; - // cut title too - // check title length, if is manager, if is private and cut description accordingly - public thresholdTitle: number = 50; - public thresholdDescription: number = 120; - properties: EnvProperties; - public directLink: boolean = true; - - constructor(private route: ActivatedRoute, - private router: Router, - private location: Location, - private localStorageService: LocalStorageService) { - } - - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.localStorageService.get().subscribe(value => { - this.directLink = value; - }); - }); - } - - public ngOnDestroy() { - } - - isProduction(): boolean { - return this.properties.environment != "development"; - } - - getProductionPrefix(): string { - return (this.properties.environment == "beta") ? "beta." : "" - } - - public confirmModalOpen() { - this.modal.cancelButton = true; - this.modal.okButton = true; - this.modal.alertTitle = 'You are going to visit ' + - ((this.community.title) ? this.community.title : this.community.shortTitle) + ' Gateway'; - this.modal.alertMessage = false; - this.modal.okButtonLeft = false; - this.modal.okButtonText = 'Yes'; - this.modal.cancelButtonText = 'No'; - this.modal.choice = true; - this.modal.open(); - } - - public getCommunityPageUrl(): string { - let url = ''; - if (this.isProduction()) { - url = 'https://' + this.getProductionPrefix() + this.community.communityId + '.openaire.eu'; - } else { - url = this.router.createUrlTree(['/'], { - queryParams: {'communityId': this.community.communityId} - }).toString(); - } - return url; - } - - public goToCommunityPage(data: any) { - if (data.value == true) { - this.localStorageService.setCommunityDirectLink(data.choice); - let url = ''; - if (this.isProduction()) { - url = 'https://' + this.getProductionPrefix() + this.community.communityId + '.openaire.eu'; - } else { - url = this.router.createUrlTree(['/'], { - queryParams: {'communityId': this.community.communityId} - }).toString(); - } - window.open(url, '_blank'); - } - } -} diff --git a/src/app/communities/browseCommunity/browse-community.module.ts b/src/app/communities/browseCommunity/browse-community.module.ts deleted file mode 100644 index 58edd4f..0000000 --- a/src/app/communities/browseCommunity/browse-community.module.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; - -import {BrowseCommunityComponent} from './browse-community.component'; - -import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; - -import {SearchFormModule} from '../../openaireLibrary/searchPages/searchUtils/searchForm.module'; -import {ManageModule} from '../../openaireLibrary/utils/manage/manage.module'; -import {AlertModalModule} from "../../openaireLibrary/utils/modal/alertModal.module"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - SearchFormModule, ManageModule, AlertModalModule - ], - declarations: [ - BrowseCommunityComponent - ], - providers:[ - FreeGuard - ], - exports: [ - BrowseCommunityComponent - ] -}) -export class BrowseCommunityModule { } diff --git a/src/app/communities/communities-routing.module.ts b/src/app/communities/communities-routing.module.ts deleted file mode 100644 index 4c792f3..0000000 --- a/src/app/communities/communities-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import{CommunitiesComponent} from './communities.component'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: CommunitiesComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class CommunitiesRoutingModule { } diff --git a/src/app/communities/communities.component.html b/src/app/communities/communities.component.html deleted file mode 100644 index 30fd6b4..0000000 --- a/src/app/communities/communities.component.html +++ /dev/null @@ -1,242 +0,0 @@ - - -
- - -
-
- - -
-
- -
-
-
Community Gateways in Action
-
- -
-
-
- -
-
-
- -
- -
- - -
-
- -
-
diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts deleted file mode 100644 index 6fe3472..0000000 --- a/src/app/communities/communities.component.ts +++ /dev/null @@ -1,199 +0,0 @@ -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 {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; -import {SubscribeService} from '../openaireLibrary/utils/subscribe/subscribe.service'; -import {CommunityInfo} from '../openaireLibrary/connect/community/communityInfo'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; - -import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; -import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; -import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; - -@Component({ - selector: 'communities', - templateUrl: 'communities.component.html', -}) - -export class CommunitiesComponent { - public piwiksub: any; - - public pageTitle = "OpenAIRE" - public researchCommunities = []; - public gifs: { "gif": string, "header": string, "text" }[] = []; - public pageContents = null; - public divContents = null; - // Message variables - public status: number; - public loading: boolean = true; - public subscriberErrorMessage: string = ""; - public errorCodes: ErrorCodes; - private errorMessages: ErrorMessagesComponent; - - properties: EnvProperties; - public keyword: string = ""; - public type: string = "all"; - - constructor( - private route: ActivatedRoute, - private _router: Router, - private _meta: Meta, - private _title: Title, - private _piwikService: PiwikService, - private _communitiesService: CommunitiesService, - private _subscribeService: SubscribeService, - private helper: HelperService, - private seoService: SEOService) { - - var description = "OpenAIRE - Connect, Community Dashboard, research community"; - var title = "OpenAIRE - Connect"; - - this._meta.updateTag({content: description}, "name='description'"); - this._meta.updateTag({content: description}, "property='og:description'"); - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - - this.errorCodes = new ErrorCodes(); - this.errorMessages = new ErrorMessagesComponent(); - this.status = this.errorCodes.LOADING; - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - var url = data.envSpecific.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(url, false); - this._meta.updateTag({content: url}, "property='og:url'"); - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe(); - } - this.getCommunities(); - this.createGifs(); - //this.getDivContents(); - this.getPageContents(); - }); - } - - private getPageContents() { - this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.pageContents = contents; - }) - } - - private getDivContents() { - this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.divContents = contents; - }) - } - - public getCommunities() { - this.loading = true; - this.status = this.errorCodes.LOADING; - this.subscriberErrorMessage = ""; - - this.researchCommunities = []; - - this._communitiesService.getCommunitiesState().subscribe( - communitiesResults => { - if(!communitiesResults){ - return; - } - if(communitiesResults.length == 0) { - this.status = this.errorCodes.DONE; - return; - } - this.sort(communitiesResults); - communitiesResults.forEach((community, index) => { - let showCommunity: boolean = true; - if (community['status'] == "hidden" || community['status'] == "manager") { - showCommunity = false; - } - if (showCommunity) { - this.researchCommunities.push(community); - } - this.status = this.errorCodes.DONE; - }); - this.loading = false; - }, - error => { - this.status = this.handleError("Error getting communities", error); - this.loading = false; - } - ); - } - - private createGifs() { - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/deposit.gif", - header: "Find a repository to deposit your research outcome", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/link.gif", - header: "Link your research output with your community, funding, and other research products", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/overview.gif", - header: "View community's overview at a glance", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/results.gif", - header: "Search & browse your community's research products. ", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/graph-analysis.gif", - header: "View statistics for your community's research products.", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - } - - private sort(results: CommunityInfo[]) { - results.sort((left, right): number => { - if (!right.date || left.date > right.date) { - return -1; - } else if (!left.date || left.date < right.date) { - return 1; - } else { - if (left.title > right.title) { - return 1; - } else if (left.title < right.title) { - return -1; - } else { - return 0; - } - } - }) - } - - public quote(param: string): string { - return StringUtils.quote(param); - } - - public ngOnDestroy() { - if (this.piwiksub) { - this.piwiksub.unsubscribe(); - } - } - - private handleError(message: string, error): number { - var code = ""; - if (!error.status) { - var error = error.json(); - code = error.code; - } else { - code = error.status; - } - - console.error("Communities (component): " + message, error); - - return this.errorMessages.getErrorCode(code); - } -} diff --git a/src/app/communities/communities.module.ts b/src/app/communities/communities.module.ts deleted file mode 100644 index 7874508..0000000 --- a/src/app/communities/communities.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {ManageModule} from '../openaireLibrary/utils/manage/manage.module'; - -import {CommunitiesComponent} from './communities.component'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; - -import {SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module'; -import {BrowseCommunityModule} from './browseCommunity/browse-community.module'; -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module"; -import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; -import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - ManageModule, ErrorMessagesModule, - SearchFormModule, BrowseCommunityModule, GifSliderModule, OtherPortalsModule, - HelperModule, Schema2jsonldModule, SEOServiceModule - ], - declarations: [ - CommunitiesComponent - ], - providers:[ - FreeGuard, PreviousRouteRecorder, - PiwikService - ], - exports: [ - CommunitiesComponent - ] -}) -export class CommunitiesModule { } diff --git a/src/app/community/community-routing.module.ts b/src/app/community/community-routing.module.ts deleted file mode 100644 index a3f8003..0000000 --- a/src/app/community/community-routing.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import{CommunityComponent} from './community.component'; -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: CommunityComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class CommunityRoutingModule { } diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html deleted file mode 100644 index c3ca521..0000000 --- a/src/app/community/community.component.html +++ /dev/null @@ -1,559 +0,0 @@ - - -
-
- -
-
-
-
-
-
- {{community.title}} -
-
- {{community.shortTitle}} -
-
-
- {{community.description.substring(0, 300)}}{{community.description.length > 300 ? '...' : ''}}
-
{{community.description}}
- - -
-
-
- -
-
- -
-
-
- -
-
-
-
-
- - - - -
- No graphs available -
-
-
-
-
{{statisticsSum[entity].total|number}}
-
Total - {{entityName}}
-
-
-
-
-
{{statisticsSum[entity].projects|number}}
-
Total projects linked to {{entityName}}
-
-
-
-
-
{{statisticsSum[entity].open_access|number}}
-
Open access - {{entityName}}
-
-
-
-
-
{{statisticsSum[entity].closed_access|number}}
-
Closed access - {{entityName}}
-
-
-
-
-
{{statisticsSum[entity].embargo|number}}
-
Embargoed - {{entityName}}
-
-
-
-
-
{{statisticsSum[entity].restricted|number}}
-
Restricted - {{entityName}}
-
-
-
-
-
-
- -
- -
-
    -
  • - -
    -
    - {{chartsInfoMap[chart].title}}
    - -
    -
  • -
-
- -
- - -
- -
- - -
- -
- -
- - -
-
-
-
-
-
- -
-
- {{chartsInfoMap[chart].title}}
- -
- -
- -
-
- -
-
- - -
Select view
- - - Overview - Graph Analysis - -
- - - - - -
- -
- - - - -
    -
  • -
    -
    - -
    - -
    -
    - - -
    - - -
  • -
  • -
    -
    - -
    - -
    -
    - - -
    - - -
  • -
  • -
    -
    - -
    - -
    -
    - - -
    - - -
  • -
  • -
    -
    - -
    - -
    -
    - - -
    - - -
  • -
-
- - - - -
-
-
- -
- -
- - - -
-
-
-
-
Created {{community.date | date:'dd-MM-yyyy'}}
- - -
-
- -
- -
-
-
-
- -
-
- -
-
-
-
- -
-
-
-
-
- No community chosen -
-
- -
-
-
- -
- -
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts deleted file mode 100644 index 19a062f..0000000 --- a/src/app/community/community.component.ts +++ /dev/null @@ -1,367 +0,0 @@ -import {Component, ElementRef, Input, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -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 {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.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 {PiwikHelper} from '../utils/piwikHelper'; -import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.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 {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; -import {UserManagementService} from "../openaireLibrary/services/user-management.service"; - -@Component({ - selector: 'community', - templateUrl: 'community.component.html', -}) - -export class CommunityComponent { - public url: string = null; - - public sub: any; - public piwiksub: any; - public subfunders: any; - - public publicationTotal = null; - public researchDataTotal = null; - public softwareTotal = null; - public orpTotal = null; - public projectTotal = null; - public contentProviderTotal = null; - public organizationTotal = null; - - params: any = {}; - properties: EnvProperties; - - public publicationResults = null; - public researchDataResults = null; - public softwareResults = null; - public orpResults = null; - - @Input() communityId = null; - public community = null; - - public communityInfo = null; - - public showLoading: boolean = true; - masterZenodoCommunity = null; - zenodoCommunityIdS = []; - showAllSubjects = false; - showAllDescription = false; - // TODO Unsubscribe - public subPublications; - public subResearchData; - public subSoftware; - public subOrps; - @ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null; - public activeTab = "publication"; - public show: string = 'overview'; - - searchLinkToPublications: string = null; - searchLinkToDatasets: string = null; - searchLinkToSoftware: string = null; - searchLinkToOrps: string = null; - searchLinkToProjects: string = null; - searchLinkToDataProviders: string = null; - searchLinkToAdvancedPublications: string = null; - shareInZenodoPage: string = null; - public routerHelper:RouterHelper = new RouterHelper(); - private user: User; - private loginCheck: boolean = false; - - constructor( - private element: ElementRef, - private route: ActivatedRoute, - private _router: Router, - private location: Location, - private _meta: Meta, - private _title: Title, - private _piwikService: PiwikService, - private config: ConfigurationService, - private _communityService: CommunityService, - private _searchCommunityDataprovidersService:SearchCommunityDataprovidersService, - private _searchCommunityProjectsService: SearchCommunityProjectsService, - private _searchResearchResultsService: SearchResearchResultsService, - private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService, - private _ΖenodoCommunitieService: ZenodoCommunitiesService, - private seoService: SEOService, - private userManagementService: UserManagementService) { - - var description = "OpenAIRE - Connect, Community Dashboard, research community"; - var title = "OpenAIRE - Connect"; - this._meta.updateTag({content: description}, "name='description'"); - this._meta.updateTag({content: description}, "property='og:description'"); - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.searchLinkToPublications = this.properties.searchLinkToPublications; - this.searchLinkToDatasets = this.properties.searchLinkToDatasets; - this.searchLinkToSoftware = this.properties.searchLinkToSoftware; - this.searchLinkToOrps = this.properties.searchLinkToOrps; - this.searchLinkToProjects = this.properties.searchLinkToProjects; - this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders; - this.searchLinkToAdvancedPublications = this.properties.searchLinkToAdvancedPublications; - this.shareInZenodoPage = this.properties.shareInZenodoPage; - this.url = data.envSpecific.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(this.url, false); - this._meta.updateTag({content: this.url}, "property='og:url'"); - this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe( user => { - this.user = user; - this.loginCheck = true; - }) - if (this.communityId != null && this.communityId != '') { - this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe( - community => { - if (typeof document !== 'undefined') { - HelperFunctions.scroll(); - } - this.community = community; - 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); - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId,this.properties.environment)).subscribe(); - } - if (this.community.zenodoCommunity) { - this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe( - result => { - this.masterZenodoCommunity = result; - - }, - error => { - // var emptyCommunity:ZenodoCommunityInfo = new ZenodoCommunityInfo(); - // emptyCommunity.id = this.masterZenodoCommunityId; - // emptyCommunity.title = this.masterZenodoCommunityId; - // this.masterZenodoCommunity = emptyCommunity; - //console.log("Master Zenodo community'" + this.community.zenodoCommunity + "' couldn't be loaded"); - this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunityId, error); - - } - ); - } - this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe( - result => { - this.zenodoCommunityIdS = result; - - - }, - error => { - //console.error("list of zenodo communities couldn't be loaded"); - this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error); - } //this.handleError('System error retrieving community profile', error) - ); - - //console.log(community); - }); - - this.countResearchResults("publication"); - this.countResearchResults("dataset"); - this.countResearchResults("software"); - this.countResearchResults("other"); - - this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId ).subscribe( - projectTotal => { - this.projectTotal = projectTotal; - //console.log(projectTotal); - }, - error => { - this.handleError("Error getting number of projects for community with id: " + this.communityId, error); - } - ); - - 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._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/organizations').subscribe( - // organizationTotal => { - // this.organizationTotal = organizationTotal; - // console.log(organizationTotal); - // }); - - - /**/ - this.config.getCommunityInformation(this.properties, this.communityId).subscribe( - res => { - this.communityInfo = res; - }, - error => { - //console.log(error) - this.handleError("Error getting community with id: " + this.communityId, error); - } - ); - } - }); - } - - public countResearchResults(resultType: string) { - this._searchResearchResultsService.countTotalResults(resultType, this.properties,"&fq=communityid=" + this.communityId).subscribe( - researchResultsTotal => { - this.setTotal(resultType, researchResultsTotal); - if(resultType == "publication") { - this.searchResearchResults(resultType, this.publicationTotal, this.publicationResults); - } - }, - error => { - this.handleError("Error getting number of "+this.getEntityName(resultType, true, true)+" for community with id: " + this.communityId, error); - } - ); - } - - public searchResearchResults(resultType: string, resultsTotal: number, results: Array) { - this.setActiveTab(resultType); - - if (resultsTotal > 0 && results == null) { - this.showLoading = true; - - this._searchResearchResultsService.search(resultType, "", "&fq=communityid=" + this.communityId, 1, 5, "resultdateofacceptance,descending", [], this.properties).subscribe( - researchResults => { - this.setResults(resultType, researchResults[1]); - this.showLoading = false; - }, - error => { - this.handleError("Error getting "+this.getEntityName(resultType, true, true)+" for community with id: " + this.communityId, error); - } - ); - } - } - - public ngOnDestroy() { - if (this.piwiksub) { - this.piwiksub.unsubscribe(); - } - } - - isEntityEnabled(entity: string) { - return this.communityInfo.entities.some(x => x['pid'] == entity && x['isEnabled'] === true); - } - - isRouteEnabled(route: string) { - return this.communityInfo.pages.some(x => x['route'] == route && x['isEnabled'] === true); - } - - showInvite() { - return this.loginCheck && 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.quote(StringUtils.URIEncode(param)); - } - - private setActiveTab(entityType: string) { - if(entityType == "other") { - this.activeTab = "orp"; - } else { - this.activeTab = entityType; - } - } - - private setResults(entityType: string, results: Array) { - if(entityType == "publication") { - this.publicationResults = results; - } else if(entityType == "dataset") { - this.researchDataResults = results; - } else if(entityType == "software") { - this.softwareResults = results; - } else if(entityType == "other") { - this.orpResults = results; - } - } - - private setTotal(entityType: string, total: number) { - if(entityType == "publication") { - this.publicationTotal = total; - } else if(entityType == "dataset") { - this.researchDataTotal = total; - } else if(entityType == "software") { - this.softwareTotal = total; - } else if(entityType == "other") { - this.orpTotal = total; - } - } - - 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"); - } - } -} diff --git a/src/app/community/community.module.ts b/src/app/community/community.module.ts deleted file mode 100644 index c0bfdf2..0000000 --- a/src/app/community/community.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {CommunityComponent} from './community.component'; -import {ResultsComponent} from '../searchEntries/results/results.component'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {CommunityService} from '../openaireLibrary/connect/community/community.service'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {SubscribeModule} from '../utils/subscribe/subscribe.module'; -import {InviteModule} from '../utils/subscribe/invite/invite.module'; -import {ManageModule} from '../openaireLibrary/utils/manage/manage.module'; - -import {StatisticsModule} from "../statistics/statistics.module"; -import {SearchZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module'; -import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module'; -import {SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module'; -import {SearchDataprovidersServiceModule} from "../openaireLibrary/connect/contentProviders/searchDataprovidersService.module"; -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 {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {MatSelectModule} from "@angular/material"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - SubscribeModule, StatisticsModule, ManageModule, InviteModule, - SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule, SearchFormModule, SearchDataprovidersServiceModule, SearchProjectsServiceModule, - SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule, - Schema2jsonldModule, SEOServiceModule, MatSelectModule - ], - declarations: [ - CommunityComponent, ResultsComponent - ], - providers:[ - FreeGuard, PreviousRouteRecorder, - PiwikService, CommunityService - ], - exports: [ - CommunityComponent - ] -}) -export class CommunityModule { } diff --git a/src/app/communitywrapper/communityWrapper-routing.module.ts b/src/app/communitywrapper/communityWrapper-routing.module.ts deleted file mode 100644 index d886195..0000000 --- a/src/app/communitywrapper/communityWrapper-routing.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import{CommunityWrapperComponent} from './communityWrapper.component'; -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: CommunityWrapperComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class CommunityWrapperRoutingModule { } diff --git a/src/app/communitywrapper/communityWrapper.component.ts b/src/app/communitywrapper/communityWrapper.component.ts deleted file mode 100644 index c5427e8..0000000 --- a/src/app/communitywrapper/communityWrapper.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -import {Component} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; - -import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; - -@Component({ - selector: 'community-wrapper', - template:` - - - ` -}) - -export class CommunityWrapperComponent { - communityId:string; - dashboard:boolean = null; - - constructor ( - private route: ActivatedRoute, - private _router: Router - - ) { - this.route.data - .subscribe((data: { envSpecific: any }) => { - this.route.queryParams.subscribe( - communityId => { - this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain); - if(!this.communityId) { - this.communityId = communityId['communityId']; - } - - if(this.communityId){ - this.dashboard = true; - }else{ - this.dashboard = false; - } - - }); - }); - - } - - public ngOnInit() { - } - - - -} diff --git a/src/app/communitywrapper/communityWrapper.module.ts b/src/app/communitywrapper/communityWrapper.module.ts deleted file mode 100644 index d45beb8..0000000 --- a/src/app/communitywrapper/communityWrapper.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - import{CommunityModule} from '../community/community.module'; - import{CommunitiesModule} from '../communities/communities.module'; -import {CommunityWrapperComponent} from './communityWrapper.component'; -import {CommunityWrapperRoutingModule} from './communityWrapper-routing.module'; -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - CommunityWrapperRoutingModule, CommunityModule, CommunitiesModule - ], - declarations: [ - CommunityWrapperComponent - ], - providers:[ - FreeGuard, PreviousRouteRecorder, - - ], - exports: [ - CommunityWrapperComponent - ] -}) -export class CommunityWrapperModule { } diff --git a/src/app/content/content-routing.module.ts b/src/app/content/content-routing.module.ts deleted file mode 100644 index d1abda4..0000000 --- a/src/app/content/content-routing.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import {ContentPageComponent} from './contentPage.component'; -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: ContentPageComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class ContentPageRoutingModule { } diff --git a/src/app/content/contentPage.component.html b/src/app/content/contentPage.component.html deleted file mode 100644 index 71cd4b9..0000000 --- a/src/app/content/contentPage.component.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - diff --git a/src/app/content/contentPage.component.ts b/src/app/content/contentPage.component.ts deleted file mode 100644 index 3f60795..0000000 --- a/src/app/content/contentPage.component.ts +++ /dev/null @@ -1,81 +0,0 @@ -import {Component} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Meta, Title} from '@angular/platform-browser'; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; -import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; -import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; -import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; - -@Component({ - selector: 'content', - templateUrl: './contentPage.component.html' -}) -export class ContentPageComponent { - - properties: EnvProperties; - public pageContents = null; - public divContents = null; - - public url: string = null; - public pageTitle: string = "OpenAIRE - Connect | Content Policy"; - piwiksub: any; - - constructor(private route: ActivatedRoute, private _router: Router, - private _meta: Meta, - private _title: Title, - private seoService: SEOService, - private _piwikService: PiwikService, - private helper: HelperService) {} - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe(); - } - this.url = this.properties.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(this.url); - this.updateUrl(this.url); - this.updateTitle(this.pageTitle); - this.updateDescription("content, open access"); - - //this.getDivContents(); - this.getPageContents(); - }); - } - - ngOnDestroy() { - if(this.piwiksub) { - this.piwiksub.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.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.pageContents = contents; - }) - } - - private getDivContents() { - this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.divContents = contents; - }) - } -} diff --git a/src/app/content/contentPage.module.ts b/src/app/content/contentPage.module.ts deleted file mode 100644 index 657e560..0000000 --- a/src/app/content/contentPage.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -import {ContentPageComponent} from './contentPage.component'; -import {ContentPageRoutingModule} from './content-routing.module'; -import {CommonModule} from "@angular/common"; -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; -import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; - - -@NgModule({ - imports: [ - ContentPageRoutingModule, RouterModule, CommonModule, HelperModule, - Schema2jsonldModule, SEOServiceModule, PiwikServiceModule - ], - declarations: [ - ContentPageComponent - ], - providers: [FreeGuard, PreviousRouteRecorder], - exports: [ - ContentPageComponent - ] -}) - - -export class ContentPageModule { -} diff --git a/src/app/createCommunity/community-creation-instructions-routing.module.ts b/src/app/createCommunity/community-creation-instructions-routing.module.ts deleted file mode 100644 index f37e14c..0000000 --- a/src/app/createCommunity/community-creation-instructions-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -import {CommunityCreationInstructionsComponent} from './community-creation-instructions.component'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: CommunityCreationInstructionsComponent, canActivate: [FreeGuard], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class CommunityCreationInstructionsRoutingModule { } diff --git a/src/app/createCommunity/community-creation-instructions.component.ts b/src/app/createCommunity/community-creation-instructions.component.ts deleted file mode 100644 index bbde140..0000000 --- a/src/app/createCommunity/community-creation-instructions.component.ts +++ /dev/null @@ -1,416 +0,0 @@ -import {Component, ElementRef, HostListener, Input, ViewChild} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Title, Meta} from '@angular/platform-browser'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; - -declare var UIkit: any; - -@Component({ - selector: 'community-creation-instructions', - template: ` -
-
-
-
-
-
-

Discover the power of OpenAIRE Connect community page builder

-
Gather all your research in one place
- - - - - - - - -
-
-
-
Contact OpenAIRE team, in order to create your community page
- -
-
-
-
-
-
-
-
-
- -
-
-
- -
-

OpenAIRE Connect community page builder at a glance

-
- OpenAIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
-

Community page

-
-
-
-

Contact OpenAIRE team, in order to create your community page

- -
-
-
-
- OpenAIRE - - - - - - - - - - - - - - - - - -
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-

- Why trust OpenAIRE? -

- -
-
-
-

It is the Open Access Infrastructure for Europe.

-
-
-
-
-

It is community based and independent.

-
-
-
-
-

Provides organizational and technical framework to support OpenScience.

-
-
-
-
-

Provides access to over 25 million research outputs and services that enable their access, link and reuse.

-
-
-
-
-

Provides organizational and technical framework to support OpenScience.

-
-
-
-
-

Ensures that all data come from trusted sources.

-
-
-
-
-
-
-
- ` - }) - -export class CommunityCreationInstructionsComponent { - public piwiksub: any; - - public pageTitle = "OpenAIRE" - - public admin_portal_image_hidden: boolean = true; - @ViewChild('adminPortalImage') admin_portal_image: ElementRef; - - public community_image_hidden: boolean = true; - @ViewChild('communityImage') community_image: ElementRef; - - properties:EnvProperties; - - constructor ( - private route: ActivatedRoute, - private _router: Router, - private _title: Title, - private _piwikService:PiwikService) { - - var description = "OpenAIRE - Connect, Community Dashboard, research community"; - var title = "OpenAIRE - Connect | Create and manage your community page"; - this._title.setTitle(title); - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - var url = data.envSpecific.baseLink+this._router.url; - - if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ - this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect | Create and manage your community page", this.properties.piwikSiteId).subscribe(); - } - - //UIkit.tooltip('.configure-profile').show(); - }); - } - -/* - public openTooltips() { - console.debug("open these tooltips!"); - UIkit.tooltip('.configure-profile').show(); - UIkit.tooltip('.connect-with').show(); - UIkit.tooltip('.choose-statistics').show(); - } -*/ - - - public ngAfterViewInit() { - /* if (typeof document !== 'undefined') { - - if (document.getElementById('enableFadeOutScrollScript')) { - document.getElementById('enableFadeOutScrollScript').remove(); - } - - const enableFadeOutScrollScript = document.createElement('script'); - enableFadeOutScrollScript.setAttribute('id', 'enableFadeOutScrollScript'); - enableFadeOutScrollScript.innerHTML = '\n' + - '$(document).ready(function() {\n' + - '\n' + - ' $(window).scroll( function(){\n' + - '\n' + - ' $(\'.my-tooltip\').each( function(i){\n' + - '\n' + - ' var bottom_of_object = $(this).position().top + $(this).outerHeight();\n' + - ' var bottom_of_window = $(window).scrollTop() + $(window).height();\n' + - '\n' + - ' if( bottom_of_window > bottom_of_object ){\n' + - '\n' + - ' $(this).animate({\'opacity\':\'1\'},1500);\n' + - //'\n' + 'this.hidden = true;' + - '\n' + - ' }\n' + - '\n' + - ' });\n' + - '\n' + - ' });\n' + - '\n' + - ' });'; - - document.body.appendChild(enableFadeOutScrollScript); -*/ - /*UIkit.util.on('#logo', 'beforehide', function () { - // do something - if(this.hide =http://www.equp4.wf/= false) { - return false; - } - }); - }*/ - } - - - - @HostListener('window:scroll', ['$event']) - scrollHandler(event) { - let offsetHeight = document.getElementById('stickyNavbar').offsetHeight; - let scrollPosition = window.pageYOffset; - - let admin_portal_image_idsToToggle: string[] = ['#logo', '#configure-profile', '#choose-statistics', '#connect-with', '#curate', '#help-texts', '#invite']; - let adminPortalImageHeight = this.admin_portal_image.nativeElement.offsetHeight; - let adminPortalImagePosition = this.admin_portal_image.nativeElement.offsetTop - offsetHeight; - - if(!this.admin_portal_image_hidden - && ((scrollPosition >= 0.7*adminPortalImagePosition+adminPortalImageHeight) || scrollPosition < 0.7*adminPortalImagePosition)) { - this.admin_portal_image_hidden = true; - admin_portal_image_idsToToggle.forEach((id: string) => { - UIkit.toggle(id, { - animation: 'uk-animation-fade uk-animation-reverse', - duration: 1500 - }).toggle(); - }); - } else if (this.admin_portal_image_hidden && (scrollPosition >= 0.7*adminPortalImagePosition)) { - this.admin_portal_image_hidden = false; - admin_portal_image_idsToToggle.forEach((id: string) => { - UIkit.toggle(id, { - animation: 'uk-animation-fade', - duration: 1500 - }).toggle(); - }); - } - - let community_image_idsToToggle: string[] = ['#community-content', '#locate-research-results', '#recent-research-results']; - let communityImageHeight = this.community_image.nativeElement.offsetHeight; - let communityImagePosition = this.community_image.nativeElement.offsetTop - offsetHeight; - - if(!this.community_image_hidden - && ((scrollPosition >= 0.9*communityImagePosition+communityImageHeight) || scrollPosition < 0.9*communityImagePosition)) { - this.community_image_hidden = true; - community_image_idsToToggle.forEach((id: string) => { - UIkit.toggle(id, { - animation: 'uk-animation-fade uk-animation-reverse', - duration: 1500 - }).toggle(); - }); - } else if (this.community_image_hidden && (scrollPosition >= 0.9*communityImagePosition)) { - this.community_image_hidden = false; - community_image_idsToToggle.forEach((id: string) => { - UIkit.toggle(id, { - animation: 'uk-animation-fade', - duration: 1500 - }).toggle(); - }); - } - } - - public ngOnDestroy() { - if(this.piwiksub){ - this.piwiksub.unsubscribe(); - } - } - - public createTooltip(content: string) : string { - return "
"+content+"
"; - } -} diff --git a/src/app/createCommunity/community-creation-instructions.module.ts b/src/app/createCommunity/community-creation-instructions.module.ts deleted file mode 100644 index 487daf9..0000000 --- a/src/app/createCommunity/community-creation-instructions.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; - -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; - -import {CommunityCreationInstructionsComponent} from './community-creation-instructions.component'; -import {CommunityCreationInstructionsRoutingModule} from './community-creation-instructions-routing.module'; - -@NgModule({ - imports: [ - CommonModule, RouterModule, CommunityCreationInstructionsRoutingModule - ], - declarations: [ - CommunityCreationInstructionsComponent - ], - exports: [ - CommunityCreationInstructionsComponent - ], - providers:[ - FreeGuard, PreviousRouteRecorder, PiwikService - ] -}) -export class CommunityCreationInstructionsModule { } diff --git a/src/app/curators/curators-routing.module.ts b/src/app/curators/curators-routing.module.ts deleted file mode 100644 index 590a7b7..0000000 --- a/src/app/curators/curators-routing.module.ts +++ /dev/null @@ -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 { -} diff --git a/src/app/curators/curators.component.html b/src/app/curators/curators.component.html deleted file mode 100644 index f496d6f..0000000 --- a/src/app/curators/curators.component.html +++ /dev/null @@ -1,142 +0,0 @@ - - - -
-
-
-
-
- -
- -
-
-

- Curators - ({{curators.length}}) -

-
-
- -
-
-
- Curator Photo - Curator Photo -
-
- {{curator.name}} -
-
-
- - -
-
-
- Affiliations -
- -
-
- -
-
- Affiliations -
- -
-
-
- Biography -
-
-

{{curator.bio}}}

-

{{_format(curator.bio)}}

-
-
- -
-
-
- -
-
-
-
-
-
- - - Curators - -
-
-
- Curator Photo - Curator Photo -
-
- {{curator.name}} -
-
-
-
- Curator Photo - Curator Photo -
-
- {{curator.name}} -
-
-
-
- - Affiliations - - ({{curator.affiliations.length}}) -
- -
-
- -
-
-
-
-
-
diff --git a/src/app/curators/curators.component.ts b/src/app/curators/curators.component.ts deleted file mode 100644 index c3667be..0000000 --- a/src/app/curators/curators.component.ts +++ /dev/null @@ -1,148 +0,0 @@ -import {Component, Input} 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 {CommunitiesService} from "../openaireLibrary/connect/communities/communities.service"; -import {ConnectHelper} from "../openaireLibrary/connect/connectHelper"; -import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class"; -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 {PiwikHelper} from "../utils/piwikHelper"; - -@Component({ - selector: 'curators', - templateUrl: './curators.component.html' - -}) - -export class CuratorsComponent { - @Input() managers: string[]; - @Input() communityId = null; - @Input() longView = true; - public downloadUrl = null; - public showLoading = true; - - public curators: Curator[]; - - public showMore = []; - public maxCharacters = 500; - - public properties: EnvProperties; - public pageContents = null; - public divContents = null; - - public piwiksub: any; - public url: string = null; - public pageTitle: string = "Curators"; - - constructor (private route: ActivatedRoute, - private curatorsService: CuratorService, - private communitiesService: CommunitiesService, - private _router: Router, - private helper: HelperService, - private _meta: Meta, - private _title: Title, - private seoService: SEOService, - private _piwikService: PiwikService) {} - - ngOnInit() { - this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { - this.showLoading = true; - this.properties = data.envSpecific; - if(this.longView) { - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe(); - } - this.url = this.properties.baseLink + 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.downloadUrl = this.properties.utilsService + '/download/'; - if(!this.longView) { - let emails = this.managers.join(); - this.curatorsService.getCurators(this.properties, - this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => { - this.curators = curators; - for(let i = 0; i < this.curators.length; i++) { - this.showMore[i]= false; - } - this.showLoading = false; - HelperFunctions.scroll(); - }) - } else { - this.route.queryParams.subscribe(data => { - this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain); - if(!this.communityId) { - this.communityId = data['communityId']; - } - //this.getDivContents(); - this.getPageContents(); - this.communitiesService.getCommunities(this.properties, - this.properties.communityAPI + this.communityId).subscribe(community => { - this.managers = community[0].managers; - let emails = this.managers.join(); - this.curatorsService.getCurators(this.properties, - this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => { - this.curators = curators; - for(let i = 0; i < this.curators.length; i++) { - this.showMore[i]= false; - } - this.showLoading = false; - HelperFunctions.scroll(); - }); - }) - }); - } - }); - } - - ngOnDestroy() { - if(this.piwiksub) { - this.piwiksub.unsubscribe(); - } - } - - private getPageContents() { - this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.pageContents = contents; - }) - } - - private getDivContents() { - this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.divContents = contents; - }) - } - - public toggle(index: number) { - this.showMore[index] = !this.showMore[index]; - } - - _format(name: string){ - if(name) { - return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name); - } else { - return null; - } - } - - 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'"); - } -} diff --git a/src/app/curators/curators.module.ts b/src/app/curators/curators.module.ts deleted file mode 100644 index 700946a..0000000 --- a/src/app/curators/curators.module.ts +++ /dev/null @@ -1,30 +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 {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; -import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - CuratorsRoutingModule, AffiliationsModule, HelperModule, - Schema2jsonldModule, SEOServiceModule, PiwikServiceModule - ], - declarations: [ - CuratorsComponent - ], - providers: [CuratorService], - exports: [ - CuratorsComponent - ] -}) -export class CuratorsModule {} diff --git a/src/app/helper-test/helper-test.component.html b/src/app/helper-test/helper-test.component.html deleted file mode 100644 index 6a3a073..0000000 --- a/src/app/helper-test/helper-test.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/app/helper-test/helper-test.component.ts b/src/app/helper-test/helper-test.component.ts deleted file mode 100644 index eb021f4..0000000 --- a/src/app/helper-test/helper-test.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; -import {ActivatedRoute, Router} from "@angular/router"; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; - - -@Component({ - selector: 'theme', - templateUrl: 'helper-test.component.html', -}) - -export class HelperTestComponent implements OnInit{ - - public pageContents = null; - properties:EnvProperties; - - constructor(private route: ActivatedRoute, - private _router: Router, - private helper: HelperService) { - - } - - ngOnInit(): void { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.getPageContents(); - }); - } - - private getPageContents() { - this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.pageContents = contents; - }) - } - -} diff --git a/src/app/helper-test/helper-test.module.ts b/src/app/helper-test/helper-test.module.ts deleted file mode 100644 index 48513ad..0000000 --- a/src/app/helper-test/helper-test.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { NgModule } from '@angular/core'; - -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {HelperTestComponent} from "./helper-test.component"; -import {CommonModule} from "@angular/common"; -import {RouterModule} from "@angular/router"; -import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; - -@NgModule({ - imports: [ - HelperModule, - CommonModule, - RouterModule.forChild([ - {path: '', component: HelperTestComponent, canActivate: [IsRouteEnabled]} - ]) - ], - declarations: [ - HelperTestComponent - ], - providers:[IsRouteEnabled], - exports: [ - HelperTestComponent - ] -}) - - -export class HelperTestModule{} diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 654c699..102ea01 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -8,232 +8,7 @@ tm-header-transparent="light" tm-header-transparent-placeholder=""> - -
- - -
-
- -
-
-
Community Gateways in Action
-
- -
-
-
- -
-
-
- -
- -
- -
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index f93f75e..ec7022c 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -23,11 +23,8 @@ export class HomeComponent { public piwiksub: any; public pageTitle = "OpenAIRE | Monitor"; - public researchCommunities = []; - public gifs: { "gif": string, "header": string, "text" }[] = []; public pageContents = null; public divContents = null; - // Message variables public status: number; public loading: boolean = true; public subscriberErrorMessage: string = ""; @@ -44,8 +41,6 @@ export class HomeComponent { private _meta: Meta, private _title: Title, private _piwikService: PiwikService, - private _communitiesService: CommunitiesService, - private _subscribeService: SubscribeService, private helper: HelperService, private seoService: SEOService) { @@ -72,8 +67,6 @@ export class HomeComponent { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Monitor", this.properties.piwikSiteId).subscribe(); } - this.getCommunities(); - this.createGifs(); //this.getDivContents(); this.getPageContents(); }); @@ -91,88 +84,6 @@ export class HomeComponent { }) } - public getCommunities() { - this.loading = true; - this.status = this.errorCodes.LOADING; - this.subscriberErrorMessage = ""; - - this.researchCommunities = []; - - this._communitiesService.getCommunitiesState().subscribe( - communitiesResults => { - if(!communitiesResults){ - return; - } - if(communitiesResults.length == 0) { - this.status = this.errorCodes.DONE; - return; - } - this.sort(communitiesResults); - communitiesResults.forEach((community, index) => { - let showCommunity: boolean = true; - if (community['status'] == "hidden" || community['status'] == "manager") { - showCommunity = false; - } - if (showCommunity) { - this.researchCommunities.push(community); - } - this.status = this.errorCodes.DONE; - }); - this.loading = false; - }, - error => { - this.status = this.handleError("Error getting communities", error); - this.loading = false; - } - ); - } - - private createGifs() { - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/deposit.gif", - header: "Find a repository to deposit your research outcome", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/link.gif", - header: "Link your research output with your community, funding, and other research products", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/overview.gif", - header: "View community's overview at a glance", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/results.gif", - header: "Search & browse your community's research products. ", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - this.gifs.push({ - gif: "assets/connect-assets/home/gifs/graph-analysis.gif", - header: "View statistics for your community's research products.", - text: "This is OpenAIRE’s key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box." - }); - } - - private sort(results: CommunityInfo[]) { - results.sort((left, right): number => { - if (!right.date || left.date > right.date) { - return -1; - } else if (!left.date || left.date < right.date) { - return 1; - } else { - if (left.title > right.title) { - return 1; - } else if (left.title < right.title) { - return -1; - } else { - return 0; - } - } - }) - } - public quote(param: string): string { return StringUtils.quote(param); } diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 13dd2e3..0438f47 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -1,37 +1,30 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {ManageModule} from '../openaireLibrary/utils/manage/manage.module'; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; -import {HomeComponent} from './home.component'; +import {HomeComponent} from './home.component'; -import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; +import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; - -import {SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module'; +import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; +import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module"; import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {BrowseCommunityModule} from "../communities/browseCommunity/browse-community.module"; import {HomeRoutingModule} from "./home-routing.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, - ManageModule, ErrorMessagesModule, - SearchFormModule, GifSliderModule, OtherPortalsModule, - HelperModule, Schema2jsonldModule, SEOServiceModule, HomeRoutingModule, BrowseCommunityModule + CommonModule, FormsModule, RouterModule, ErrorMessagesModule, OtherPortalsModule, + HelperModule, Schema2jsonldModule, SEOServiceModule, HomeRoutingModule, ], declarations: [ HomeComponent ], - providers:[ + providers: [ FreeGuard, PreviousRouteRecorder, PiwikService ], @@ -39,4 +32,5 @@ import {HomeRoutingModule} from "./home-routing.module"; HomeComponent ] }) -export class HomeModule { } +export class HomeModule { +} diff --git a/src/app/htmlPages/about/aboutPage-routing.module.ts b/src/app/htmlPages/about/aboutPage-routing.module.ts deleted file mode 100644 index 03e2c00..0000000 --- a/src/app/htmlPages/about/aboutPage-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import {AboutPageComponent} from './aboutPage.component'; -import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: AboutPageComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class AboutPageRoutingModule { } diff --git a/src/app/htmlPages/about/aboutPage.component.ts b/src/app/htmlPages/about/aboutPage.component.ts deleted file mode 100644 index 969c38b..0000000 --- a/src/app/htmlPages/about/aboutPage.component.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {Component, Input, Output, EventEmitter, ViewChild, ElementRef} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Title, Meta} from '@angular/platform-browser'; -import{EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; - -@Component({ - selector: 'about', - template: ` -
-
- -
-
- ` -}) -export class AboutPageComponent { - properties:EnvProperties; - - constructor ( private route: ActivatedRoute, private _router: Router, - private _meta: Meta, private _title: Title) {} - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.updateUrl(data.envSpecific.baseLink+this._router.url); - this.updateTitle("About"); - this.updateDescription("About, open access"); - }); - } - - private updateDescription(description:string){ - this._meta.updateTag({content:description},"name='description'"); - this._meta.updateTag({content:description},"property='og:description'"); - } - private updateTitle(title:string){ - var _prefix ="OpenAIRE | "; - var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); - this._title.setTitle(_title); - this._meta.updateTag({content:_title},"property='og:title'"); - } - private updateUrl(url:string){ - this._meta.updateTag({content:url},"property='og:url'"); - } -} diff --git a/src/app/htmlPages/about/aboutPage.module.ts b/src/app/htmlPages/about/aboutPage.module.ts deleted file mode 100644 index 357c86e..0000000 --- a/src/app/htmlPages/about/aboutPage.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule, ModuleWithProviders } from '@angular/core'; - -import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' - -import {AboutPageComponent} from './aboutPage.component'; -import {AboutPageRoutingModule} from './aboutPage-routing.module'; - -import {HtmlPagesModule} from '../htmlPages.module'; - -@NgModule({ - imports: [ - AboutPageRoutingModule, HtmlPagesModule - ], - declarations: [ - AboutPageComponent - ], - providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], - exports: [ - AboutPageComponent - ] -}) - - -export class AboutPageModule{} diff --git a/src/app/htmlPages/htmlPage.component.ts b/src/app/htmlPages/htmlPage.component.ts deleted file mode 100644 index 6080992..0000000 --- a/src/app/htmlPages/htmlPage.component.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Component, Input } from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; -import 'rxjs/Rx'; -import {HtmlPageService} from './htmlPage.service'; -import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; -import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; -import {SafeHtmlPipe} from '../openaireLibrary/utils/pipes/safeHTML.pipe'; - -@Component({ - selector: 'html-page', - template: ` -
-` -}) -export class HtmlPageComponent { - public content:string=""; - sub:any; - properties:EnvProperties; - private communityId: string = null; - constructor (private _service: HtmlPageService, private route: ActivatedRoute,) {} - - ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.route.queryParams.subscribe( - params => { - this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain); - if(!this.communityId) { - this.communityId = params['communityId']; - } - - if(!this.communityId){ - this.communityId = this.properties.adminToolsCommunity; - } - if(location){ - this.sub = this._service.getHtmlContent(location.pathname, this.properties, this.communityId).subscribe( - data => { - if(data.length > 0) { - this.content = data[0].content; - } - }, - err => { - //console.log(err); - this.handleError("Error getting html content with route: "+location.pathname+" for community with id: "+this.communityId, err); - } - ); - } - }); - }); - } - - ngOnDestroy() { - if(this.sub){ - this.sub.unsubscribe(); - } - } - - private handleError(message: string, error) { - console.error("Html Page: "+message, error); - } -} diff --git a/src/app/htmlPages/htmlPage.service.ts b/src/app/htmlPages/htmlPage.service.ts deleted file mode 100644 index 3099ab8..0000000 --- a/src/app/htmlPages/htmlPage.service.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {Injectable, Inject} from '@angular/core'; -import {HttpClient} from "@angular/common/http"; -import {Observable} from 'rxjs/Observable'; -import 'rxjs/add/observable/of'; -import 'rxjs/add/operator/do'; -import 'rxjs/add/operator/share'; -import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; - -@Injectable() -export class HtmlPageService { - constructor(private http: HttpClient) {} - - getHtmlContent (router: string, properties:EnvProperties, communityId:string ):any { - //console.info("get router html content for : "+router); - - let url = properties.adminToolsAPIURL + '/htmlpagecontent?community='+communityId+'&page='+router; - - return this.http.get>((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); - //.map(res => > res.json()); - - } - - - -} diff --git a/src/app/htmlPages/htmlPages.module.ts b/src/app/htmlPages/htmlPages.module.ts deleted file mode 100644 index 9675e6a..0000000 --- a/src/app/htmlPages/htmlPages.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; - -import {HtmlPageComponent} from './htmlPage.component'; -import {HtmlPageService} from './htmlPage.service'; -import {SafeHtmlPipeModule} from '../openaireLibrary/utils/pipes/safeHTMLPipe.module'; - -@NgModule({ - imports: [ - SafeHtmlPipeModule - ], - declarations: [ - HtmlPageComponent - ], - providers:[HtmlPageService], - exports: [ - HtmlPageComponent - ] -}) - - -export class HtmlPagesModule{} diff --git a/src/app/htmlPages/organizations/organizationsPage-routing.module.ts b/src/app/htmlPages/organizations/organizationsPage-routing.module.ts deleted file mode 100644 index 8500909..0000000 --- a/src/app/htmlPages/organizations/organizationsPage-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import {OrganizationsPageComponent} from './organizationsPage.component'; -import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard' - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: OrganizationsPageComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class OrganizationsPageRoutingModule { } diff --git a/src/app/htmlPages/organizations/organizationsPage.component.ts b/src/app/htmlPages/organizations/organizationsPage.component.ts deleted file mode 100644 index c2da0f6..0000000 --- a/src/app/htmlPages/organizations/organizationsPage.component.ts +++ /dev/null @@ -1,70 +0,0 @@ -import {Component} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Title, Meta} from '@angular/platform-browser'; -import{EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; -import {HelperService} from "../../openaireLibrary/utils/helper/helper.service"; -import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; - -@Component({ - selector: 'organizations', - template: ` -
-
-
Organizations related to the community -
- - -
-
- ` -}) -export class OrganizationsPageComponent { - properties:EnvProperties; - public pageContents = null; - public divContents = null; - public communityId = null; - - constructor ( private route: ActivatedRoute, private _router: Router, - private _meta: Meta, private _title: Title, - private helper: HelperService) {} - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain); - this.updateUrl(data.envSpecific.baseLink+this._router.url); - this.updateTitle("Organizations"); - this.updateDescription("Organizations, open access"); - //this.getDivContents(); - this.getPageContents(); - }); - } - - private updateDescription(description:string){ - this._meta.updateTag({content:description},"name='description'"); - this._meta.updateTag({content:description},"property='og:description'"); - } - private updateTitle(title:string){ - var _prefix ="OpenAIRE | "; - var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); - this._title.setTitle(_title); - this._meta.updateTag({content:_title},"property='og:title'"); - } - private updateUrl(url:string){ - this._meta.updateTag({content:url},"property='og:url'"); - } - - private getPageContents() { - this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => { - this.pageContents = contents; - }) - } - - private getDivContents() { - this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => { - this.divContents = contents; - }) - } -} diff --git a/src/app/htmlPages/organizations/organizationsPage.module.ts b/src/app/htmlPages/organizations/organizationsPage.module.ts deleted file mode 100644 index ba38603..0000000 --- a/src/app/htmlPages/organizations/organizationsPage.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NgModule, ModuleWithProviders } from '@angular/core'; - -import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -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 {HelperModule} from "../../openaireLibrary/utils/helper/helper.module"; -import {CommonModule} from "@angular/common"; - -@NgModule({ - imports: [ - OrganizationsPageRoutingModule, AffiliationsModule, HelperModule, CommonModule - ], - declarations: [ - OrganizationsPageComponent - ], - providers:[FreeGuard,PreviousRouteRecorder, IsRouteEnabled], - exports: [ - OrganizationsPageComponent - ] -}) - - -export class OrganizationsPageModule{} diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index 3447c03..9630b83 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -96,18 +96,4 @@ export class MonitorComponent { this.piwiksub.unsubscribe(); } } - - private handleError(message: string, error): number { - var code = ""; - if (!error.status) { - var error = error.json(); - code = error.code; - } else { - code = error.status; - } - - console.error("Monitor (component): " + message, error); - - return this.errorMessages.getErrorCode(code); - } } diff --git a/src/app/my-communities/my-communities-routing.module.ts b/src/app/my-communities/my-communities-routing.module.ts deleted file mode 100644 index e359a0d..0000000 --- a/src/app/my-communities/my-communities-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {MyCommunitiesComponent} from "./my-communities.component"; -import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard"; -import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; - -@NgModule({ - imports: [ - RouterModule.forChild([ - {path: '', component: MyCommunitiesComponent, canActivate: [LoginGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder]} - - ]) - ] -}) -export class MyCommunitiesRoutingModule { -} diff --git a/src/app/my-communities/my-communities.component.html b/src/app/my-communities/my-communities.component.html deleted file mode 100644 index d97027b..0000000 --- a/src/app/my-communities/my-communities.component.html +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/src/app/my-communities/my-communities.component.ts b/src/app/my-communities/my-communities.component.ts deleted file mode 100644 index 0bd1af8..0000000 --- a/src/app/my-communities/my-communities.component.ts +++ /dev/null @@ -1,232 +0,0 @@ -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 {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; -import {SubscribeService} from '../openaireLibrary/utils/subscribe/subscribe.service'; -import {CommunityInfo} from '../openaireLibrary/connect/community/communityInfo'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {Session, User} from '../openaireLibrary/login/utils/helper.class'; -import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; - -import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; -import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; -import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; -import {UserManagementService} from "../openaireLibrary/services/user-management.service"; - -@Component({ - selector: 'my-communities', - templateUrl: 'my-communities.component.html', -}) - -export class MyCommunitiesComponent { - public piwiksub: any; - - public pageTitle = "OpenAIRE" - public subscriberOfCommunities = []; - public managerOfCommunities = []; - public researchCommunities = []; - public pageContents = null; - public divContents = null; - // Message variables - public status: number; - public loading: boolean = true; - public subscriberErrorMessage: string = ""; - public errorCodes: ErrorCodes; - private errorMessages: ErrorMessagesComponent; - - properties: EnvProperties; - private user: User; - - constructor( - private route: ActivatedRoute, - private _router: Router, - private _meta: Meta, - private _title: Title, - private _piwikService: PiwikService, - private _communitiesService: CommunitiesService, - private _subscribeService: SubscribeService, - private helper: HelperService, - private seoService: SEOService, - private userManagementService: UserManagementService) { - - var description = "OpenAIRE - Connect, Community Dashboard, research community " + - "| My managing and subscribed to Communities"; - var title = "OpenAIRE - Connect | My Communities"; - - this._meta.updateTag({content: description}, "name='description'"); - this._meta.updateTag({content: description}, "property='og:description'"); - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - - this.errorCodes = new ErrorCodes(); - this.errorMessages = new ErrorMessagesComponent(); - this.status = this.errorCodes.LOADING; - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - var url = data.envSpecific.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(url, false); - this._meta.updateTag({content: url}, "property='og:url'"); - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe(); - } - this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => { - this.user = user; - this.getCommunities(); - //this.getDivContents(); - //this.getPageContents(); - }); - }); - } - - private getPageContents() { - this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.pageContents = contents; - }) - } - - private getDivContents() { - this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => { - this.divContents = contents; - }) - } - - public getCommunities() { - this.loading = true; - this.status = this.errorCodes.LOADING; - this.subscriberErrorMessage = ""; - - this.subscriberOfCommunities = []; - this.managerOfCommunities = []; - this.researchCommunities = []; - - this._communitiesService.getCommunitiesState().subscribe( - communitiesResults => { - if(!communitiesResults){ - return; - } - if(communitiesResults.length == 0) { - this.status = this.errorCodes.DONE; - return; - }; - this.sort(communitiesResults); - - var subscribedLoading = communitiesResults.length; - var mail = this.user.email; - communitiesResults.forEach((community, index) => { - let showCommunity: boolean = true; - let isManager: boolean = false; - let isSubscriber: boolean = false; - - if (community['status'] == "hidden") { - showCommunity = false; - } else { - if (mail == null && community['status'] == "manager") { // no user - showCommunity = false; - } else if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) { - isManager = true; - } else if (community.managers.indexOf(mail) != -1) { - isManager = true; - } else if (community['status'] == "manager") { - showCommunity = false; - } - } - - if (showCommunity) { - this.researchCommunities.push(community); - if (isManager) { - community.isManager = true; - this.managerOfCommunities.push(community); - } - } - - this.status = this.errorCodes.DONE; - - if (mail != null && showCommunity) { - this._subscribeService.isSubscribedToCommunity(this.properties, community.communityId, mail).subscribe( - res => { - isSubscriber = res; - if (isSubscriber) { - community.isSubscribed = true; - if (isManager) { - this.subscriberOfCommunities.push(community); - } else { - this.subscriberOfCommunities.unshift(community); - } - } - - subscribedLoading--; - if (subscribedLoading == 0) { - this.loading = false; - } - }, - error => { - this.handleError("Error getting response if email: " + mail + " is subscribed to community with id: " + community.communityId, error); - subscribedLoading--; - if (subscribedLoading == 0) { - this.loading = false; - } - }); - } else { - subscribedLoading--; - if (subscribedLoading == 0) { - this.loading = false; - } - } - }); - }, - error => { - this.status = this.handleError("Error getting communities", error); - this.loading = false; - } - ); - } - - private sort(results: CommunityInfo[]) { - results.sort((left, right): number => { - if (!right.date || left.date > right.date) { - return -1; - } else if (!left.date || left.date < right.date) { - return 1; - } else { - if (left.title > right.title) { - return 1; - } else if (left.title < right.title) { - return -1; - } else { - return 0; - } - } - }) - } - - public quote(param: string): string { - return StringUtils.quote(param); - } - - public ngOnDestroy() { - if (this.piwiksub) { - this.piwiksub.unsubscribe(); - } - } - - private handleError(message: string, error): number { - var code = ""; - if (!error.status) { - var error = error.json(); - code = error.code; - } else { - code = error.status; - } - - console.error("Communities (component): " + message, error); - - return this.errorMessages.getErrorCode(code); - } -} diff --git a/src/app/my-communities/my-communities.module.ts b/src/app/my-communities/my-communities.module.ts deleted file mode 100644 index 6672fcc..0000000 --- a/src/app/my-communities/my-communities.module.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; -import {ManageModule} from '../openaireLibrary/utils/manage/manage.module'; - -import {MyCommunitiesComponent} from './my-communities.component'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; - -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; -import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard"; -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {BrowseCommunityModule} from "../communities/browseCommunity/browse-community.module"; -import {MyCommunitiesRoutingModule} from "./my-communities-routing.module"; -import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, HelperModule, - ManageModule, ErrorMessagesModule, BrowseCommunityModule, Schema2jsonldModule, SEOServiceModule, - MyCommunitiesRoutingModule - ], - declarations: [ - MyCommunitiesComponent - ], - providers: [ - LoginGuard, PreviousRouteRecorder, - PiwikService, IsRouteEnabled - ], - exports: [ - MyCommunitiesComponent - ] -}) -export class MyCommunitiesModule { -} diff --git a/src/app/searchEntries/results/results.component.ts b/src/app/searchEntries/results/results.component.ts deleted file mode 100644 index f317401..0000000 --- a/src/app/searchEntries/results/results.component.ts +++ /dev/null @@ -1,89 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo'; -import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; -import {SearchResult} from "../../openaireLibrary/utils/entities/searchResult"; - -@Component({ - selector: 'results-comp', - template: ` -
Recent research results
-
- -
-
- -
-
- - - -
- -
No results available
- - ` - -}) - -export class ResultsComponent { - - @Input() public results : SearchResult[]; - @Input() public resultType: string; - @Input() public params: any; - @Input() public community: CommunityInfo; - @Input() public total: any; - @Input() showLoading: boolean = true; - @Input() properties: EnvProperties; - - getresultTypeLink(type:string, plural:boolean){ - if((type == "publication" || type == "dataset") && plural){ - return type + "s"; - } - return type; - } - /* getParamId(type:string){ - let param =""; - if(type == "publication"){ - param="article"; - }else if(type == "other"){ - param="other"; - }else{ - param=type; - } - return param+"Id"; - }*/ -} diff --git a/src/app/searchPages/communities/searchCommunities-routing.module.ts b/src/app/searchPages/communities/searchCommunities-routing.module.ts deleted file mode 100644 index 56bdc63..0000000 --- a/src/app/searchPages/communities/searchCommunities-routing.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {SearchCommunitiesComponent} from "./searchCommunities.component"; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: SearchCommunitiesComponent, canDeactivate: [PreviousRouteRecorder] } - - ]) - ] -}) -export class SearchCommunitiesRoutingModule { } diff --git a/src/app/searchPages/communities/searchCommunities.component.ts b/src/app/searchPages/communities/searchCommunities.component.ts deleted file mode 100644 index 7bf56b9..0000000 --- a/src/app/searchPages/communities/searchCommunities.component.ts +++ /dev/null @@ -1,484 +0,0 @@ -import {Component, ViewChild} from "@angular/core"; -import {SearchUtilsClass} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {ErrorMessagesComponent} from "../../openaireLibrary/utils/errorMessages.component"; -import {ErrorCodes} from "../../openaireLibrary/utils/properties/errorCodes"; -import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; -import {SearchPageComponent} from "../../openaireLibrary/searchPages/searchUtils/searchPage.component"; -import {ActivatedRoute} from "@angular/router"; -import {Filter, Value} from "../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; -import {SearchFields} from "../../openaireLibrary/utils/properties/searchFields"; -import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service"; -import {Session, User} from "../../openaireLibrary/login/utils/helper.class"; -import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; -import {SubscribeService} from "../../openaireLibrary/utils/subscribe/subscribe.service"; -import {StringUtils} from "../../openaireLibrary/utils/string-utils.class"; -import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; -import {UserManagementService} from "../../openaireLibrary/services/user-management.service"; -import {url} from "inspector"; - -@Component({ - selector: 'search-communities', - template: ` - - - ` -}) -export class SearchCommunitiesComponent { - public piwikSiteId = null; - private errorCodes: ErrorCodes; - private errorMessages: ErrorMessagesComponent; - public results: CommunityInfo[] = []; - public totalResults: CommunityInfo[] = []; - public sub: any; public subResults: any; - public filters = []; - public searchFields:SearchFields = new SearchFields(); - public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - public disableForms: boolean = false; - public baseUrl: string = null; - public refineFields: string[] = this.searchFields.COMMUNITIES_SEARCH_FIELDS; - public showType = false; - properties:EnvProperties; - @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; - private user: User; - - constructor (private route: ActivatedRoute, - private _communitiesService: CommunitiesService, - private _subscribeService: SubscribeService, - private userManagementService: UserManagementService) { - this.errorCodes = new ErrorCodes(); - this.errorMessages = new ErrorMessagesComponent(); - this.searchUtils.status = this.errorCodes.LOADING; - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - this.piwikSiteId = this.properties.piwikSiteId; - this.baseUrl = data.envSpecific.searchLinkToCommunities; - }); - this.sub = this.route.queryParams.subscribe(params => { - this.searchPage.resultsPerPage = 10; - this.searchUtils.keyword = (params['keyword']?params['keyword']:''); - this.searchUtils.page = (params['page'] === undefined) ? 1: + params['page']; - this.searchUtils.sortBy = (params['sortBy'] === undefined)? '' : params['sortBy']; - this.searchUtils.size = (params['size'] === undefined) ? this.searchPage.resultsPerPage: +params['size']; - this.searchPage.searchUtils = this.searchUtils; - if(this.searchUtils.size != 5 && this.searchUtils.size != 10 && this.searchUtils.size != 20 && this.searchUtils.size != 50) { - this.searchUtils.size = this.searchPage.resultsPerPage; - } - if(this.searchUtils.sortBy && this.searchUtils.sortBy != "creationdate,descending" && this.searchUtils.sortBy != "creationdate,ascending") { - this.searchUtils.sortBy = ""; - } - this.searchPage.refineFields = this.refineFields; - let queryParams = this.searchPage.getQueryParamsFromUrl(params); - this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => { - this.user = user; - this.initCommunities(queryParams); - }); - }); - } - - public ngOnDestroy() { - if(this.sub){ - this.sub.unsubscribe(); - } - if(this.subResults){ - this.subResults.unsubscribe(); - } - } - - /** - * Initialize communities from Communities APIs - * - * @param params - */ - private initCommunities(params: Map) { - this.subResults = this._communitiesService.getCommunitiesState().subscribe( - data => { - if(!data){ - return; - } - for(let i = 0; i < data.length; i++) { - this.totalResults[i] = data[i]; - this.totalResults[i].isManager = false; - this.totalResults[i].isSubscribed = false; - if(this.user) { - this.totalResults[i].isManager = this.isCommunityManager(this.totalResults[i]); - } - } - if(this.user) { - this._subscribeService.getCommunitiesSubscribedTo(this.properties, this.user.email).subscribe( - res => { - for (let i = 0; i < this.totalResults.length; i++) { - this.totalResults[i].isSubscribed = (res.indexOf(this.totalResults[i].communityId) != -1); - } - this._getResults(params); - } - ); - } - else { - this._getResults(params); - } - }, - err => { - this.handleError('Error getting communities', err); - this.searchUtils.status = this.errorMessages.getErrorCode(err.status); - this.disableForms = false; - HelperFunctions.scroll(); - } - ); - } - - - /** - * Get all communities from Communities API and apply permission access validator, - * keyword searching, filter, paging and sorting. - * - * @param params, status - * @private - */ - private _getResults(params: Map){ - this.searchUtils.status = this.errorCodes.LOADING; - this.disableForms = true; - this.results = this.totalResults; - if(this.filters.length === 0) { - this.filters = this.createFilters(); - } - this.searchUtils.totalResults = 0; - this.applyParams(params); - } - - /** - * Return the communities in which user has permission to view or manage. - */ - private showCommunities() { - let ret: CommunityInfo[] = []; - for(let result of this.results) { - if (result.status == 'hidden') { - continue; - } else if (result.status == "manager") { - let mail = (this.user)?this.user.email:null; - if (mail == null) { // no user - continue; - } else if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) { - ret.push(result); - } else if (result.managers.indexOf(mail) != -1) { - ret.push(result); - } - continue; - } - ret.push(result); - } - this.results = ret; - } - - /** - * Apply permission access validator, - * keyword searching, filter, paging and sorting. - * - * @param params - * @param status - */ - public applyParams(params: Map) { - this.showCommunities(); - if(this.searchUtils.keyword && this.searchUtils.keyword != '') { - this.searchForKeywords(); - } - this.checkFilters(params); - this.sort(); - this.searchUtils.totalResults = this.results.length; - this.searchPage.checkSelectedFilters(this.filters); - this.searchPage.updateBaseUrlWithParameters(this.filters); - this.results = this.results.slice((this.searchUtils.page-1)*this.searchUtils.size, (this.searchUtils.page*this.searchUtils.size)); - this.searchUtils.status = this.errorCodes.DONE; - if(this.searchUtils.totalResults == 0 ){ - this.searchUtils.status = this.errorCodes.NONE; - } - this.disableForms = false; - if(this.searchUtils.status == this.errorCodes.DONE) { - // Page out of limit!!! - let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size); - if(!(Number.isInteger(totalPages))) { - totalPages = (parseInt(totalPages, 10) + 1); - } - if(totalPages < this.searchUtils.page) { - this.searchUtils.totalResults = 0; - this.searchUtils.status = this.errorCodes.OUT_OF_BOUND; - } - } - HelperFunctions.scroll(); - } - - - /** - * Parse the given keywords into array and check if any of the requirements field of a community includes - * one of the given words. - */ - private searchForKeywords() { - let ret: CommunityInfo[] = []; - let keywords: string[] = this.searchUtils.keyword.split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); - for(let i = 0; i < this.results.length; i++) { - for(let keyword of keywords) { - keyword = keyword.toLowerCase(); - if (keyword != '' && (this.results[i].title.toLowerCase().includes(keyword) || this.results[i].shortTitle.toLowerCase().includes(keyword) || - this.results[i].communityId.toLowerCase().includes(keyword) || this.results[i].description.toLowerCase().includes(keyword))) { - ret.push(this.results[i]); - break; - } - } - } - this.results = ret; - } - - /** - * Check the current results if they satisfy the values of each filter category and - * update the number of possible results in each value. - * - * @param params - */ - private checkFilters(params: Map) { - let typeResults: CommunityInfo[] = this.applyFilter('type', params); - let statusResults: CommunityInfo[] = this.results; - let roleResults: CommunityInfo[] = this.results; - if(this.user) { - statusResults = this.applyFilter('status', params); - roleResults = this.applyFilter('role', params); - this.resetFilterNumbers('status'); - this.updateFilterNumbers(typeResults.filter(value => { - return roleResults.includes(value); - }), 'status'); - this.resetFilterNumbers('role'); - this.updateFilterNumbers(statusResults.filter(value => { - return typeResults.includes(value); - }), 'role'); - } - this.resetFilterNumbers('type'); - this.updateFilterNumbers(statusResults.filter(value => { - return roleResults.includes(value); - }), 'type'); - this.results = statusResults.filter(value => { - return typeResults.includes(value); - }) - this.results = this.results.filter(value => { - return roleResults.includes(value); - }); - } - - /** - * Apply filter with filterId and return the results - * - * @param filterId - * @param params - */ - private applyFilter(filterId: string, params: Map): CommunityInfo[] { - let results:CommunityInfo[] = []; - let values: string[] = []; - if(params.get(filterId) != undefined) { - values = (StringUtils.URIDecode(params.get(filterId))).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); - } - if(filterId == 'type') { - for (let i = 0; i < this.results.length; i++) { - if (values.length == 0) { - results.push(this.results[i]); - } else { - for (let value of values) { - if (this.results[i].type == value.replace(/["']/g, "")) { - results.push(this.results[i]); - break; - } - } - } - } - } - else if(filterId == 'status') { - for (let i = 0; i < this.results.length; i++) { - if (values.length == 0) { - results.push(this.results[i]); - } else { - for (let value of values) { - if (value.replace(/["']/g, "") == 'subscribed') { - if (this.results[i].isSubscribed) { - results.push(this.results[i]); - break; - } - } else if (value.replace(/["']/g, "") == 'nonsubscribed') { - if (!this.results[i].isSubscribed) { - results.push(this.results[i]); - break; - } - } - } - } - } - } - else if(filterId == 'role') { - for (let i = 0; i < this.results.length; i++) { - if (values.length == 0) { - results.push(this.results[i]); - } else { - for (let value of values) { - if (value.replace(/["']/g, "") == 'manager') { - if (this.results[i].isManager) { - results.push(this.results[i]); - break; - } - } - } - } - } - } - return results; - } - - /** - * Reset the values of filter with id filterId with zero. - * - * @param filterId - */ - private resetFilterNumbers(filterId: string) { - for (let i = 0; i < this.filters.length; i++) { - if(this.filters[i].filterId == filterId) { - for (let j = 0; j < this.filters[i].values.length; j++) { - this.filters[i].values[j].number = 0; - } - break; - } - } - } - - /** - * Update the values of filter with id filterId based on - * results. - * - * @param results - * @param filterId - */ - private updateFilterNumbers(results: CommunityInfo[], filterId: string) { - for(let k = 0; k < results.length; k++) { - for (let i = 0; i < this.filters.length; i++) { - if(this.filters[i].filterId == filterId) { - if (this.filters[i].filterId == 'type') { - for (let j = 0; j < this.filters[i].values.length; j++) { - if (results[k].type == this.filters[i].values[j].id) { - this.filters[i].values[j].number++; - } - } - } - else if (this.filters[i].filterId == 'status') { - if (results[k].isSubscribed) { - this.filters[i].values[0].number++; - } else { - this.filters[i].values[1].number++; - } - } - else if (this.filters[i].filterId == 'role') { - if (results[k].isManager) { - this.filters[i].values[0].number++; - } - } - break; - } - } - } - } - - /** - * Sorting results based on sortBy. - */ - private sort() { - if(this.searchUtils.sortBy == '') { - this.results.sort((left, right): number => { - if (left.title > right.title) { - return 1; - } else if (left.title < right.title) { - return -1; - } else { - return 0; - } - }) - } else if(this.searchUtils.sortBy == 'creationdate,descending') { - this.results.sort((left, right): number => { - if (!right.date || left.date > right.date) { - return -1; - } else if (!left.date || left.date < right.date) { - return 1; - } else { - return 0; - } - }) - } else if(this.searchUtils.sortBy == 'creationdate,ascending') { - this.results.sort((left, right): number => { - if (!right.date || left.date > right.date) { - return 1; - } else if (!left.date || left.date < right.date) { - return -1; - } else { - return 0; - } - }) - } - } - - - private isCommunityManager(community: CommunityInfo): boolean { - return Session.isCommunityCurator(this.user) || community.managers.indexOf(this.user.email) != -1; - } - - /** - * Create Search Communities filters. - * - */ - private createFilters(): Filter[] { - let filter_names = []; - let filter_ids = []; - let searchFields = new SearchFields(); - let filter_original_ids = searchFields.COMMUNITIES_SEARCH_FIELDS; - let value_names = []; - let value_original_ids=[]; - this.showType = this.results.filter(community => community.type === 'ri').length > 0; - if(this.showType) { - filter_names.push("Type"); - filter_ids.push("type"); - value_names.push([ "Research Communities", "Research Initiatives" ]); - value_original_ids.push(["community","ri"]); - } else { - filter_original_ids = searchFields.COMMUNITIES_SEARCH_FIELDS.splice(0, 1); - } - if(this.user) { - filter_names.push("Status"); - filter_ids.push("status"); - value_names.push([ "Subscribed", "Non-subscribed"]); - value_original_ids.push(["subscribed", "nonsubscribed"]); - filter_names.push("Role"); - filter_ids.push("role"); - value_names.push([ "Manager"]); - value_original_ids.push(["manager"]); - } - let filters: Filter[] = []; - for(let i =0 ; i < filter_names.length; i++){ - let values: Value[] = []; - for(let j =0 ; j < value_names[i].length; j++){ - let value: Value = {name: value_names[i][j], id: value_original_ids[i][j], number:0, selected:false}; - values.push(value); - } - let filter: Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true , valueIsUnique: false}; - filters.push(filter); - } - return filters; - } - - private handleError(message: string, error) { - console.error('Communities Search Page: ' + message, error); - } - -} diff --git a/src/app/searchPages/communities/searchCommunities.module.ts b/src/app/searchPages/communities/searchCommunities.module.ts deleted file mode 100644 index d4d0f59..0000000 --- a/src/app/searchPages/communities/searchCommunities.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {NgModule} from "@angular/core"; -import {CommonModule} from "@angular/common"; -import {FormsModule} from "@angular/forms"; -import {SearchCommunitiesComponent} from "./searchCommunities.component"; -import {SearchPageModule} from "../../openaireLibrary/searchPages/searchUtils/searchPage.module"; -import {SearchFormModule} from "../../openaireLibrary/searchPages/searchUtils/searchForm.module"; -import {SearchCommunitiesRoutingModule} from "./searchCommunities-routing.module"; -import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; - -@NgModule({ - imports: [ - CommonModule, FormsModule, - SearchFormModule, SearchPageModule, - SearchCommunitiesRoutingModule - ], - declarations: [ - SearchCommunitiesComponent - ], - providers:[ PreviousRouteRecorder], - exports: [ - SearchCommunitiesComponent - ] -}) -export class SearchCommunitiesModule { } diff --git a/src/app/test/theme.component.html b/src/app/test/theme.component.html deleted file mode 100644 index 9ded157..0000000 --- a/src/app/test/theme.component.html +++ /dev/null @@ -1,798 +0,0 @@ -
- - - -
-
- -
-
- - - -
- -

Article Title

- -
- -

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

- -

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

- - - -
- -
-
- -
- -
-
-
- -
-
- -
-
- -
-
- -
-
- -
- -
-
- -
-
-
    -
  • em element
  • -
  • ins element
  • -
  • mark element
  • -
  • q inside a q
  • -
  • strong element
  • -
  • Link Reset
  • -
-
-
-
    -
  • Text Muted
  • -
  • Text Emphasis
  • -
  • Text Primary
  • -
  • Text Secondary
  • -
  • Text Success
  • -
  • Text Warning
  • -
  • Text Danger
  • -
  • Text Meta
  • -
-
-
-
    -
  • Default
  • -
  • Success
  • -
  • Warning
  • -
  • Danger
  • -
  • 1
  • -
  • - - - -
  • -
-
-
- -
<div class="myclass">...<div>
- -
-

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element.

- -
- -
-
- Read more -
- -
- -
- -
- -
    -
  • -
    -
    -
    -
    - -
    - -
    - -
    -
    -

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

    -
    -
    -
  • -
- -
    -
  • -
  • 1
  • -
  • ...
  • -
  • 4
  • -
  • 5
  • -
  • 6
  • -
  • 7
  • -
  • 8
  • -
  • 9
  • -
  • 10
  • -
  • ...
  • -
  • 20
  • -
  • -
- -
-
- -
- -
- - - -
-

Default

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- -
-

Primary

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- -
-

Secondary

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- -
-

Hover

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
- -
-
- -
- -
-
- -
-
- -
- -
- - -
- -
- -
- -
- -
- -
-
- -
-
- -
-
- -
- -
- -
- -
-
- -
- -
- - -
- -
- -
-
- -
-
- -
- -
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table HeadingTable HeadingTable Heading
Table DataTable DataTable Data
Table DataTable DataTable Data
Table DataTable DataTable Data
Table DataTable DataTable Data
-
- -
- -

Default

-
- -
- -

Primary

-
- -
- -

Success

-
- -
- -

Warning

-
- -
- -

Danger

-
- -
-
-
06
-
-
:
-
-
23
-
-
:
-
-
59
-
-
:
-
-
50
-
-
- - - -
-
- -

2XL

-

XLarge

-

Heading L

-

Heading M

-

Heading S

- -

Heading H1

-

Heading H2

-

Heading H3

-

Heading H4

-
Heading H5
-
Heading H6
- -

Heading Divider

-

Heading Bullet

-

Heading Line

- -
-
- -
- -
-
- -
- - - - -
- -
-
- -
- -
-

Default Lorem ipsum dolor sit amet, consectetur.

-
-
- -
-
- -
- -
-

Primary Lorem ipsum dolor sit amet, consectetur.

-
-
- -
-
- -
- -
- -
-
- -
-
- -
- -
-
- - - -
-
- - - - -
-
- -
    -
  • -
  • -
  • -
- -
-
- -
Tooltip
- -
-
- - 45% - -
-
- - - -
-
- - - -
-
- -
- -
-
- - - -
-
- - - -
-
- - - -
-
- -
- -
-
- -
    -
  • List item 1
  • -
  • List item 2
  • -
  • List item 3
  • -
- -
    -
  • List item 1
  • -
  • List item 2
  • -
  • List item 3
  • -
- -
-
- -
    -
  • List item 1
  • -
  • List item 2
  • -
  • List item 3
  • -
- -
-
Description lists
-
A description text
-
Description lists
-
A description text
-
- -
-
- -
    -
  • - - Item 1 -
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.

    -
    - -
  • -
  • - - Item 2 - - -
  • -
  • - - Item 3 - - -
  • -
- -
-
- -
-
- -
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- - - - - -
-
- -
portal-color
-
portal-secondary-color
-
portal-background-color
- portal-link -
portal-box
-
portal-icon-button - uk-icon-button uk-icon
- -
-
-
small container
- - -
-
-
large container
- - -
-
-
large container
- - -
- -. diff --git a/src/app/test/theme.component.ts b/src/app/test/theme.component.ts deleted file mode 100644 index 297bb14..0000000 --- a/src/app/test/theme.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {Component} from '@angular/core'; - - -@Component({ - selector: 'theme', - templateUrl: 'theme.component.html', -}) - -export class ThemeComponent { - -}