diff --git a/app/app.routing.ts b/app/app.routing.ts index c42e326..6ec7cfe 100644 --- a/app/app.routing.ts +++ b/app/app.routing.ts @@ -104,7 +104,9 @@ const appRoutes: Routes = [ { path: 'stats', - component: StatsComponent,canActivate: [FreeGuard],resolve: { envSpecific: EnvironmentSpecificResolver } + component: StatsComponent, + canActivate: [FreeGuard], + resolve: { envSpecific: EnvironmentSpecificResolver } }, { path: '**',pathMatch: 'full',component: DashboardComponent } diff --git a/app/pages/stats/stats.component.html b/app/pages/stats/stats.component.html index 9f664bf..d3fba38 100644 --- a/app/pages/stats/stats.component.html +++ b/app/pages/stats/stats.component.html @@ -1,3 +1,4 @@ + + - +<!–
@@ -54,7 +56,8 @@ - + +<!– +–> -
Class Help Contents
@@ -96,12 +99,13 @@ -
+ –> -
+<!–
No pages found
-
+
–> @@ -109,4 +113,4 @@ - \ No newline at end of file +--> diff --git a/app/pages/stats/stats.component.ts b/app/pages/stats/stats.component.ts index 73ba9d8..5d49447 100644 --- a/app/pages/stats/stats.component.ts +++ b/app/pages/stats/stats.component.ts @@ -3,6 +3,7 @@ import {HelpContentService} from "../../services/help-content.service"; import {CommunityStatistics} from "../../domain/statistics-classes"; import {ActivatedRoute} from "@angular/router"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; +import { Community } from '../../domain/community'; @Component({ selector: 'stats', @@ -10,20 +11,30 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti }) export class StatsComponent implements OnInit { - stats: CommunityStatistics; + errorMessage: string; + loadingMessage: string; + + communities: Community[] = []; + selectedCommunityPid: string; + + stats: CommunityStatistics = null; tableNames: string[] = []; - properties:EnvProperties = null; + public properties: EnvProperties = null; constructor(private contentService: HelpContentService, private route: ActivatedRoute) {} ngOnInit() { - this.route.data + console.log(`TRYING TO LOAD COMMUNITIES !!!`); +/* this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; - this.getStatistics(); - }); + this.getCommunities(); + }, + error => console.log(`E R R O R!!`) + );*/ + this.getCommunities(); } getStatistics() { @@ -42,4 +53,20 @@ export class StatsComponent implements OnInit { } ); } + + getCommunities() { + this.contentService.getCommunities(this.properties.adminToolsAPIURL).subscribe( +/* this.contentService.getCommunities('http://duffy.di.uoa.gr:8080/uoa-admin-tools/').subscribe(*/ + comms => { + this.communities = comms; + this.selectedCommunityPid = this.communities[0].pid; + }, + error => { + console.log(error); + }, + () => { + console.log(`I got ${JSON.stringify(this.communities)}`); + } + ); + } }