From e52500730b6b603963535e8ae57e088ff23fdec4 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 30 Apr 2020 13:09:07 +0000 Subject: [PATCH] [Admin | Trunk]: Add message when no statistics exist. Disable customization route. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@58583 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/app.component.ts | 9 ++----- src/app/app.routing.ts | 4 +-- .../pages/dashboard/dashboard.component.html | 4 +-- src/app/pages/stats/stats.component.html | 27 +++++++++++-------- src/app/pages/stats/stats.component.ts | 8 +++--- 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 98051cf..518cd5d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -242,16 +242,11 @@ export class AppComponent implements OnInit { '/organizations', false, [], [], {communityId: this.communityId}), items: [] }); - community.items.push({ + /*community.items.push({ rootItem: new MenuItem('layout', 'Customize Layout', '/customize-layout', '/customize-layout', false, [], [], {communityId: this.communityId}), items: [] - }); - /*community.items.push({ - rootItem: new MenuItem('communityLayout', 'Community Layout', '/community-layout', - '/community-layout', false, [], [], {communityId: this.communityId}), - items: [] - })*/ + });*/ this.sideMenuItems.push(community); const communityContent: SideMenuItem = { rootItem: new MenuItem('communityContent', 'Community Content', '', diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index f5bac61..0c09942 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -143,11 +143,11 @@ const appRoutes: Routes = [ loadChildren: './pages/community/content-providers/communityContentProviders.module#CommunityContentProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver } }, - { + /*{ path: 'customize-layout', loadChildren: './pages/customization/customization.module#CustomizationModule', resolve: { envSpecific: EnvironmentSpecificResolver } - }, + },*/ { path: 'manage-content-providers/criteria', loadChildren: './pages/community/content-providers/criteria/criteria.module#CriteriaModule', diff --git a/src/app/pages/dashboard/dashboard.component.html b/src/app/pages/dashboard/dashboard.component.html index 819c6a3..9f599f3 100644 --- a/src/app/pages/dashboard/dashboard.component.html +++ b/src/app/pages/dashboard/dashboard.component.html @@ -15,9 +15,9 @@
Community Profile
Organizations
- Customize Layout + class="uk-button uk-button-text">Customize Layout-->
diff --git a/src/app/pages/stats/stats.component.html b/src/app/pages/stats/stats.component.html index 78e032a..1c13d96 100644 --- a/src/app/pages/stats/stats.component.html +++ b/src/app/pages/stats/stats.component.html @@ -1,12 +1,4 @@
- -
@@ -15,11 +7,16 @@
{{ loadingMessage }}
--> +
+ Statistics + +
- + -
+
@@ -28,7 +25,15 @@
-
+
+
+ + + There are no available statistics for your community yet.
+
+
+
+
diff --git a/src/app/pages/stats/stats.component.ts b/src/app/pages/stats/stats.component.ts index 951a470..294027c 100644 --- a/src/app/pages/stats/stats.component.ts +++ b/src/app/pages/stats/stats.component.ts @@ -87,9 +87,11 @@ export class StatsComponent implements OnInit { this.statisticsDisplay = null; this.contentService.getCommunityStatistics(this.properties.statisticsAPIURL, this.communityId).subscribe( stats => { - this.statisticsSum = stats; - if(stats["other"]){ //hack because in stats API the entity name is "other" while in admin API is "orp". This component uses also "orp" name - this.statisticsSum["orp"]=stats["other"]; + if(stats) { + this.statisticsSum = stats; + if(stats["other"]){ //hack because in stats API the entity name is "other" while in admin API is "orp". This component uses also "orp" name + this.statisticsSum["orp"]=stats["other"]; + } } }, error => {