From 25629733e9dcf3f24792bc006609a94fc2d3f917 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 5 Feb 2024 09:42:52 +0200 Subject: [PATCH] [plugins-functionality | WIP] move curators component in openaireLibrary, update submodules --- .../affiliations/affiliations.component.html | 8 +- src/app/app-routing.module.ts | 2 +- src/app/community/community.module.ts | 11 +- src/app/curators/curators-routing.module.ts | 15 -- src/app/curators/curators.component.html | 152 ----------------- src/app/curators/curators.component.ts | 155 ------------------ src/app/curators/curators.module.ts | 35 ---- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 10 files changed, 15 insertions(+), 369 deletions(-) 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 diff --git a/src/app/affiliations/affiliations.component.html b/src/app/affiliations/affiliations.component.html index 6b3c9b5..c8b6e9f 100644 --- a/src/app/affiliations/affiliations.component.html +++ b/src/app/affiliations/affiliations.component.html @@ -37,12 +37,12 @@ -
+
-

+

Supporting Organizations

- Browse all @@ -50,7 +50,7 @@
-
+
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 6fc032e..f8229a9 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -99,7 +99,7 @@ const routes: Routes = [ // }, { path: 'curators', - loadChildren: () => import('./curators/curators.module').then(m => m.CuratorsModule), + loadChildren: () => import('./openaireLibrary/connect/components/curators/curators.module').then(m => m.CuratorsModule), data: {hasQuickContact: false}, canActivate: [IsCommunity] }, { diff --git a/src/app/community/community.module.ts b/src/app/community/community.module.ts index ae4a3ee..60c02c3 100644 --- a/src/app/community/community.module.ts +++ b/src/app/community/community.module.ts @@ -23,7 +23,7 @@ import { import {SearchProjectsServiceModule} from '../openaireLibrary/connect/projects/searchProjectsService.module'; import {SearchResearchResultsServiceModule} from "../openaireLibrary/services/searchResearchResultsService.module"; import {SearchResultsModule} from "../openaireLibrary/searchPages/searchUtils/searchResults.module"; -import {CuratorsModule} from "../curators/curators.module"; +import {CuratorsModule} from "../openaireLibrary/connect/components/curators/curators.module"; import {AffiliationsModule} from "../affiliations/affiliations.module"; import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; import {MatSelectModule} from "@angular/material/select"; @@ -40,6 +40,8 @@ import {InputModule} from '../openaireLibrary/sharedComponents/input/input.modul import {QuickSelectionsModule} from '../openaireLibrary/searchPages/searchUtils/quick-selections.module'; import {IconsModule} from '../openaireLibrary/utils/icons/icons.module'; import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-paging.module'; +import {NumberRoundModule} from '../openaireLibrary/utils/pipes/number-round.module'; +import {PluginsService} from '../openaireLibrary/services/plugins.service'; @NgModule({ imports: [ @@ -49,16 +51,17 @@ import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-p SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule, SEOServiceModule, MatSelectModule, EntitiesSelectionModule, TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule, - AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule, NoLoadPaging + AdvancedSearchInputModule, InputModule, QuickSelectionsModule, IconsModule, NoLoadPaging, NumberRoundModule ], declarations: [ CommunityComponent ], providers:[ - PreviousRouteRecorder, PiwikService + PreviousRouteRecorder, PiwikService, PluginsService ], exports: [ CommunityComponent ] }) -export class CommunityModule { } +export class CommunityModule { +} 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 55f1cd8..0000000 --- a/src/app/curators/curators.component.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - -
-
-
-
-

- {{curatorInModal.name}} -

- Curator Photo - Curator Photo -
-
- -
    -
  • -
    - Biography -
    -
    - {{curatorInModal.bio}} -
    -
  • -
  • -
    -
    - - - - - - -
    -
    -
  • -
-
-
-
-
-
diff --git a/src/app/curators/curators.component.ts b/src/app/curators/curators.component.ts deleted file mode 100644 index 25b62d0..0000000 --- a/src/app/curators/curators.component.ts +++ /dev/null @@ -1,155 +0,0 @@ -import {Component, Input, ViewChild} from '@angular/core'; -import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; -import {CuratorService} from "../openaireLibrary/connect/curators/curator.service"; -import {Curator} from "../openaireLibrary/utils/entities/CuratorInfo"; -import {ActivatedRoute, Router} from "@angular/router"; -import {CommunityService} from "../openaireLibrary/connect/community/community.service"; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; -import {Meta, Title} from "@angular/platform-browser"; -import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; -import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; -import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component"; -import {Subscription} from "rxjs"; -import {properties} from "../../environments/environment"; -import {UserRegistryService} from "../openaireLibrary/services/user-registry.service"; -import {FullScreenModalComponent} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component'; -import {CommunityInfo} from "../openaireLibrary/connect/community/communityInfo"; - -@Component({ - selector: 'curators', - templateUrl: './curators.component.html' - -}) -export class CuratorsComponent { - @Input() longView = true; - community: CommunityInfo; - public downloadUrl = null; - public showLoading = true; - - public curators: Curator[] = []; - - public curatorsLimit: number = 5; - public numberOfCurators: number = 5; - - public showMore = []; - public maxCharacters = 450; - public viewingMore: boolean = false; - public curatorInModal; - - public properties: EnvProperties; - public pageContents = null; - public divContents = null; - - public url: string = null; - public pageTitle: string = "Curators"; - - public breadcrumbs: Breadcrumb[] = [{name: 'Home', route: '/'}, {name: 'About - Curators'}]; - - subs: Subscription[] = []; - - @ViewChild('fsModal', { static: true }) fsModal: FullScreenModalComponent; - - constructor(private route: ActivatedRoute, - private curatorsService: CuratorService, - private communityService: CommunityService, - private userRegistryService: UserRegistryService, - private _router: Router, - private helper: HelperService, - private _meta: Meta, - private _title: Title, - private seoService: SEOService, - private _piwikService: PiwikService) { - } - - ngOnInit() { - this.showLoading = true; - this.properties = properties; - this.downloadUrl = this.properties.utilsService + '/download/'; - //if (properties.environment !== 'development') { - if (!this.longView) { - this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => { - if (community) { - this.community = community; - this.getCurators(); - } - })); - } else { - this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => { - if (community) { - this.community = community; - this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe()); - this.url = this.properties.domain + this._router.url; - this.seoService.createLinkForCanonicalURL(this.url); - this.updateUrl(this.url); - this.updateTitle(this.pageTitle); - this.updateDescription("OpenAIRE - Connect, Community Gateway, research community"); - //this.getDivContents(); - this.getPageContents(); - this.getCurators(); - } - })); - } - } - - ngOnDestroy() { - for (let sub of this.subs) { - sub.unsubscribe(); - } - } - - private getCurators() { - this.subs.push(this.curatorsService.getCurators(this.properties, this.community.communityId).subscribe(curators => { - this.curators = curators; - this.showLoading = false; - }, error => { - console.error(error); - this.curators = []; - this.showLoading = false; - })); - } - - private getPageContents() { - this.subs.push(this.helper.getPageHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => { - this.pageContents = contents; - })); - } - - private getDivContents() { - this.subs.push(this.helper.getDivHelpContents(this.properties, this.community.communityId, this._router.url).subscribe(contents => { - this.divContents = contents; - })); - } - - format(name: string) { - if (name) { - return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name); - } else { - return null; - } - } - - public viewMore() { - this.viewingMore = !this.viewingMore; - } - - public openFsModal(curator) { - this.curatorInModal = curator; - this.fsModal.title = this.community.shortTitle + ' Curator'; - this.fsModal.open(); - } - - private updateDescription(description: string) { - this._meta.updateTag({content: description}, "name='description'"); - this._meta.updateTag({content: description}, "property='og:description'"); - } - - private updateTitle(title: string) { - var _title = ((title.length > 50) ? title.substring(0, 50) : title); - this._title.setTitle(_title); - this._meta.updateTag({content: _title}, "property='og:title'"); - } - - private updateUrl(url: string) { - this._meta.updateTag({content: url}, "property='og:url'"); - } -} diff --git a/src/app/curators/curators.module.ts b/src/app/curators/curators.module.ts deleted file mode 100644 index e86f062..0000000 --- a/src/app/curators/curators.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; - -import {CuratorsComponent} from './curators.component'; -import {CuratorService} from "../openaireLibrary/connect/curators/curator.service"; -import {CuratorsRoutingModule} from "./curators-routing.module"; -import {AffiliationsModule} from "../affiliations/affiliations.module"; -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; -import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module"; -import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module"; -import {LoadingModule} from '../openaireLibrary/utils/loading/loading.module'; -import {FullScreenModalModule} from '../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.module'; - -@NgModule({ - imports: [ - CommonModule, FormsModule, RouterModule, - CuratorsRoutingModule, AffiliationsModule, HelperModule, - Schema2jsonldModule, SEOServiceModule, PiwikServiceModule, - BreadcrumbsModule, UrlPrefixModule, LoadingModule, - FullScreenModalModule - ], - declarations: [ - CuratorsComponent - ], - providers: [CuratorService], - exports: [ - CuratorsComponent - ] -}) -export class CuratorsModule {} diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index d0b4fa7..552edbd 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit d0b4fa7750a8dde3cfa6b5b81c18302380e10c35 +Subproject commit 552edbd0e25e236dc277abcdcc2d953d28bba726 diff --git a/src/assets/common-assets b/src/assets/common-assets index ee22e97..6cef9eb 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit ee22e97b114be823b7ab4e6c41a9cbff93b24e3a +Subproject commit 6cef9ebed0db7ecbcca023bae824239106907960 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index df6a052..52eca9a 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit df6a0527e9bce69f016da8d28b79885c351104c6 +Subproject commit 52eca9abe84c941a7e78a5690f273d8c8e3194f9