From b01e3f8ca87628b1809a0bd9c67051e192e4d8e2 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 3 Nov 2022 16:05:26 +0200 Subject: [PATCH] create fos/sdg components to call library components in order to use extra parameters, update submodules --- explore/src/app/app-routing.module.ts | 4 ++-- explore/src/app/fos/fos-routing.module.ts | 17 +++++++++++++++ explore/src/app/fos/fos.component.ts | 16 ++++++++++++++ explore/src/app/fos/fos.module.ts | 26 +++++++++++++++++++++++ explore/src/app/openaireLibrary | 2 +- explore/src/app/sdg/sdg-routing.module.ts | 17 +++++++++++++++ explore/src/app/sdg/sdg.component.ts | 15 +++++++++++++ explore/src/app/sdg/sdg.module.ts | 26 +++++++++++++++++++++++ explore/src/assets/openaire-theme | 2 +- 9 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 explore/src/app/fos/fos-routing.module.ts create mode 100644 explore/src/app/fos/fos.component.ts create mode 100644 explore/src/app/fos/fos.module.ts create mode 100644 explore/src/app/sdg/sdg-routing.module.ts create mode 100644 explore/src/app/sdg/sdg.component.ts create mode 100644 explore/src/app/sdg/sdg.module.ts diff --git a/explore/src/app/app-routing.module.ts b/explore/src/app/app-routing.module.ts index d1b545e1..106f02f2 100644 --- a/explore/src/app/app-routing.module.ts +++ b/explore/src/app/app-routing.module.ts @@ -8,8 +8,8 @@ const routes: Routes = [ {path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule)}, {path: 'home', redirectTo: '', pathMatch: 'full'}, {path: 'mail-preferences', loadChildren: () => import('./userEmailPreferences/mailPrefs.module').then(m => m.LibMailPrefsModule)}, - {path: 'sdgs', loadChildren: () => import('./openaireLibrary/sdg/sdg.module').then(m => m.SdgModule)}, - {path: 'fields-of-science', loadChildren: () => import('./openaireLibrary/fos/fos.module').then(m => m.FosModule), data: {extraOffset: 100}}, + {path: 'sdgs', loadChildren: () => import('./sdg/sdg.module').then(m => m.LibSdgModule)}, + {path: 'fields-of-science', loadChildren: () => import('./fos/fos.module').then(m => m.LibFosModule), data: {extraOffset: 100}}, {path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule), data: {hasQuickContact: false}}, // ORCID Pages {path: 'orcid', loadChildren: () => import('./orcid/orcid.module').then(m => m.LibOrcidModule)}, diff --git a/explore/src/app/fos/fos-routing.module.ts b/explore/src/app/fos/fos-routing.module.ts new file mode 100644 index 00000000..f5d36cd6 --- /dev/null +++ b/explore/src/app/fos/fos-routing.module.ts @@ -0,0 +1,17 @@ +import {NgModule} from "@angular/core"; +import {RouterModule} from "@angular/router"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {ExploreFosComponent} from "./fos.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { + path: '', + component: ExploreFosComponent, + canDeactivate: [PreviousRouteRecorder] + } + ]) + ] +}) +export class LibFosRoutingModule { } \ No newline at end of file diff --git a/explore/src/app/fos/fos.component.ts b/explore/src/app/fos/fos.component.ts new file mode 100644 index 00000000..d5f9e33f --- /dev/null +++ b/explore/src/app/fos/fos.component.ts @@ -0,0 +1,16 @@ +import {Component} from "@angular/core"; +import {properties} from "../../environments/environment"; + +@Component({ + selector: 'explore-fos', + template: ` + + ` +}) +export class ExploreFosComponent { + piwikSiteId = properties.piwikSiteId; + + constructor() { + + } +} \ No newline at end of file diff --git a/explore/src/app/fos/fos.module.ts b/explore/src/app/fos/fos.module.ts new file mode 100644 index 00000000..bf657703 --- /dev/null +++ b/explore/src/app/fos/fos.module.ts @@ -0,0 +1,26 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {LibFosRoutingModule} from "./fos-routing.module"; +import {FosRoutingModule} from "../openaireLibrary/fos/fos-routing.module"; +import {FosModule} from "../openaireLibrary/fos/fos.module"; +import {ExploreFosComponent} from "./fos.component"; + +@NgModule({ + imports: [ + CommonModule, + LibFosRoutingModule, + FosRoutingModule, + FosModule + ], + declarations: [ + ExploreFosComponent + ], + exports: [ + ExploreFosComponent + ], + providers: [ + PreviousRouteRecorder + ] +}) +export class LibFosModule { } \ No newline at end of file diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 3bd6a28c..1f30f9d8 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 3bd6a28c1b90980135c04d6d4b52714357fa1853 +Subproject commit 1f30f9d88aac7499585cde51fcf656466edeb7a8 diff --git a/explore/src/app/sdg/sdg-routing.module.ts b/explore/src/app/sdg/sdg-routing.module.ts new file mode 100644 index 00000000..2634df2c --- /dev/null +++ b/explore/src/app/sdg/sdg-routing.module.ts @@ -0,0 +1,17 @@ +import {NgModule} from "@angular/core"; +import {RouterModule} from "@angular/router"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {ExploreSdgComponent} from "./sdg.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { + path: '', + component: ExploreSdgComponent, + canDeactivate: [PreviousRouteRecorder] + } + ]) + ] +}) +export class LibSdgRoutingModule { } \ No newline at end of file diff --git a/explore/src/app/sdg/sdg.component.ts b/explore/src/app/sdg/sdg.component.ts new file mode 100644 index 00000000..7c90088a --- /dev/null +++ b/explore/src/app/sdg/sdg.component.ts @@ -0,0 +1,15 @@ +import {Component} from "@angular/core"; +import {properties} from "../../environments/environment"; + +@Component({ + selector: 'explore-sdg', + template: ` + + ` +}) +export class ExploreSdgComponent { + piwikSiteId = properties.piwikSiteId; + + constructor() { + } +} \ No newline at end of file diff --git a/explore/src/app/sdg/sdg.module.ts b/explore/src/app/sdg/sdg.module.ts new file mode 100644 index 00000000..dcded98a --- /dev/null +++ b/explore/src/app/sdg/sdg.module.ts @@ -0,0 +1,26 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {LibSdgRoutingModule} from "./sdg-routing.module"; +import {SdgRoutingModule} from "../openaireLibrary/sdg/sdg-routing.module"; +import {SdgModule} from "../openaireLibrary/sdg/sdg.module"; +import {ExploreSdgComponent} from "./sdg.component"; + +@NgModule({ + imports: [ + CommonModule, + LibSdgRoutingModule, + SdgRoutingModule, + SdgModule + ], + declarations: [ + ExploreSdgComponent + ], + exports: [ + ExploreSdgComponent + ], + providers: [ + PreviousRouteRecorder + ] +}) +export class LibSdgModule { } \ No newline at end of file diff --git a/explore/src/assets/openaire-theme b/explore/src/assets/openaire-theme index c2bf664c..a1cc7cb3 160000 --- a/explore/src/assets/openaire-theme +++ b/explore/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit c2bf664ce363f49f64ca5b05f3456dd902dcad5b +Subproject commit a1cc7cb31617c565d3ba94fae629e3e15a8e8bf9