diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index ec518ba..c252cd2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -96,11 +96,11 @@ const routes: Routes = [ }, { path: 'sdgs', - loadChildren: () => import('./openaireLibrary/sdg/sdg.module').then(m => m.SdgModule) + loadChildren: () => import('./sdg/sdg.module').then(m => m.LibSdgModule) }, { path: 'fields-of-science', - loadChildren: () => import('./openaireLibrary/fos/fos.module').then(m => m.FosModule), data: {extraOffset: 100} + loadChildren: () => import('./fos/fos.module').then(m => m.LibFosModule), data: {extraOffset: 100} }, {path: 'user-info', loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule)}, {path: 'error', component: OpenaireErrorPageComponent} diff --git a/src/app/fos/fos-routing.module.ts b/src/app/fos/fos-routing.module.ts new file mode 100644 index 0000000..549c25f --- /dev/null +++ b/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 {AggregatorFosComponent} from "./fos.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { + path: '', + component: AggregatorFosComponent, + canDeactivate: [PreviousRouteRecorder] + } + ]) + ] +}) +export class LibFosRoutingModule { } \ No newline at end of file diff --git a/src/app/fos/fos.component.ts b/src/app/fos/fos.component.ts new file mode 100644 index 0000000..ba0aa00 --- /dev/null +++ b/src/app/fos/fos.component.ts @@ -0,0 +1,16 @@ +import {Component} from "@angular/core"; +import {properties} from "../../environments/environment"; + +@Component({ + selector: 'aggregator-fos', + template: ` + + ` +}) +export class AggregatorFosComponent { + piwikSiteId = properties.piwikSiteId; + + constructor() { + + } +} \ No newline at end of file diff --git a/src/app/fos/fos.module.ts b/src/app/fos/fos.module.ts new file mode 100644 index 0000000..34420aa --- /dev/null +++ b/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 {AggregatorFosComponent} from "./fos.component"; + +@NgModule({ + imports: [ + CommonModule, + LibFosRoutingModule, + FosRoutingModule, + FosModule + ], + declarations: [ + AggregatorFosComponent + ], + exports: [ + AggregatorFosComponent + ], + providers: [ + PreviousRouteRecorder + ] +}) +export class LibFosModule { } \ No newline at end of file diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 3bd6a28..510d48d 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 3bd6a28c1b90980135c04d6d4b52714357fa1853 +Subproject commit 510d48d9bf9b45b33c7be68aeeb47695e1d56905 diff --git a/src/app/sdg/sdg-routing.module.ts b/src/app/sdg/sdg-routing.module.ts new file mode 100644 index 0000000..825cdc1 --- /dev/null +++ b/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 {AggregatorSdgComponent} from "./sdg.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { + path: '', + component: AggregatorSdgComponent, + canDeactivate: [PreviousRouteRecorder] + } + ]) + ] +}) +export class LibSdgRoutingModule { } \ No newline at end of file diff --git a/src/app/sdg/sdg.component.ts b/src/app/sdg/sdg.component.ts new file mode 100644 index 0000000..a83f31c --- /dev/null +++ b/src/app/sdg/sdg.component.ts @@ -0,0 +1,26 @@ +import {Component} from "@angular/core"; +import {properties} from "../../environments/environment"; +import {ConnectHelper} from "../openaireLibrary/connect/connectHelper"; +import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class"; +import {AggregatorInfo, PortalAggregators} from "../utils/aggregators"; + +@Component({ + selector: 'aggregator-sdg', + template: ` + + ` +}) +export class AggregatorSdgComponent { + piwikSiteId = properties.piwikSiteId; + aggregatorId; + aggregator: AggregatorInfo; + customFilter: SearchCustomFilter = null; + + constructor() { + this.aggregatorId = ConnectHelper.getCommunityFromDomain(properties.domain); + this.aggregator = PortalAggregators.getFilterInfoByMenuId(this.aggregatorId); + this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(this.aggregator); + } + + public ngOnInit() {} +} \ No newline at end of file diff --git a/src/app/sdg/sdg.module.ts b/src/app/sdg/sdg.module.ts new file mode 100644 index 0000000..bf78a74 --- /dev/null +++ b/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 {AggregatorSdgComponent} from "./sdg.component"; + +@NgModule({ + imports: [ + CommonModule, + LibSdgRoutingModule, + SdgRoutingModule, + SdgModule + ], + declarations: [ + AggregatorSdgComponent + ], + exports: [ + AggregatorSdgComponent + ], + providers: [ + PreviousRouteRecorder + ] +}) +export class LibSdgModule { } \ No newline at end of file