[Trunk|Admin]: Add material toggle slider for activation of an entity.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56108 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-06-18 15:06:13 +00:00
parent 285cce6767
commit 4bdb91d142
21 changed files with 352 additions and 146 deletions

View File

@ -22,6 +22,7 @@
], ],
"styles": [ "styles": [
"src/styles.css", "src/styles.css",
"src/material.scss",
"node_modules/datatables.net-dt/css/jquery.dataTables.css", "node_modules/datatables.net-dt/css/jquery.dataTables.css",
"node_modules/interactiveminingv3/assets/css/interactive-mining.css", "node_modules/interactiveminingv3/assets/css/interactive-mining.css",
"node_modules/interactiveminingv3/assets/css/animations.css" "node_modules/interactiveminingv3/assets/css/animations.css"
@ -145,4 +146,4 @@
"prefix": "app" "prefix": "app"
} }
} }
} }

View File

@ -58,7 +58,6 @@ export class AppComponent implements OnInit{
localStorage.setItem('isCommunityManager', Session.isCommunityCurator() + ''); localStorage.setItem('isCommunityManager', Session.isCommunityCurator() + '');
this.isPortalAdministrator = Session.isPortalAdministrator(); this.isPortalAdministrator = Session.isPortalAdministrator();
/*this.isPortalAdministrator = true;*/
} }
this._communitiesService.updateCommunities(this.properties, this.properties.communityAPI + 'communities'); this._communitiesService.updateCommunities(this.properties, this.properties.communityAPI + 'communities');

View File

@ -30,6 +30,7 @@ import {CommunityService} from './openaireLibrary/connect/community/community.se
import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.service'; import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.service';
import {ConnectRIGuard} from './openaireLibrary/connect/communityGuard/connectRIGuard.guard'; import {ConnectRIGuard} from './openaireLibrary/connect/communityGuard/connectRIGuard.guard';
import {SideBarModule} from "./openaireLibrary/sharedComponents/sidebar/sideBar.module"; import {SideBarModule} from "./openaireLibrary/sharedComponents/sidebar/sideBar.module";
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
@NgModule({ @NgModule({
imports: [ imports: [
@ -42,7 +43,8 @@ import {SideBarModule} from "./openaireLibrary/sharedComponents/sidebar/sideBar.
ErrorModule, ErrorModule,
AlertModalModule, SafeHtmlPipeModule, FABModule, AlertModalModule, SafeHtmlPipeModule, FABModule,
InteractiveMiningModule, InteractiveMiningModule,
SideBarModule SideBarModule,
BrowserAnimationsModule
], ],
declarations: [ declarations: [
AppComponent, AppComponent,

View File

@ -121,12 +121,8 @@
<div class="content" [innerHTML]="check.divHelpContent.content | safeHtml"></div> <div class="content" [innerHTML]="check.divHelpContent.content | safeHtml"></div>
</td> </td>
<td> <td>
<div *ngIf="check.divHelpContent.isActive" class="activated" > <mat-slide-toggle [checked]="check.divHelpContent.isActive"
<input (click)="toggleDivHelpContents(false,[check.divHelpContent._id])" class="deactivate" src="assets/imgs/check-icon.png" title="Deactivate" width="20" type="image" height="20"> (change)="($event.source.checked = check.divHelpContent.isActive);toggleDivHelpContents(!check.divHelpContent.isActive,[check.divHelpContent._id])"></mat-slide-toggle>
</div>
<div *ngIf="!check.divHelpContent.isActive" class="deactivated" >
<input (click)="toggleDivHelpContents(true,[check.divHelpContent._id])" class="activate" src="assets/imgs/x-icon.png" title="Activate" width="20" type="image" height="20">
</div>
</td> </td>
<td> <td>
<div class="actions" href="#"> <div class="actions" href="#">

View File

@ -238,7 +238,6 @@ export class DivHelpContentsComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this.router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this.router.url} }); this.router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this.router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ""; this.updateErrorMessage = "";
this._helpService.toggleDivHelpContents(ids,status, this.properties.adminToolsAPIURL).subscribe( this._helpService.toggleDivHelpContents(ids,status, this.properties.adminToolsAPIURL).subscribe(
@ -249,8 +248,6 @@ export class DivHelpContentsComponent implements OnInit {
} }
this.countDivHelpContents(); this.countDivHelpContents();
this.applyCheck(false); this.applyCheck(false);
this.showLoading = false;
}, },
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
); );

View File

@ -9,12 +9,13 @@ import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.mod
import {DivHelpContentsRoutingModule} from './div-help-contents-routing.module'; import {DivHelpContentsRoutingModule} from './div-help-contents-routing.module';
import {SafeHtmlPipeModule} from '../../openaireLibrary/utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../openaireLibrary/utils/pipes/safeHTMLPipe.module';
import {DivHelpContentsComponent} from './div-help-contents.component'; import {DivHelpContentsComponent} from './div-help-contents.component';
import {MatSlideToggleModule} from '@angular/material';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, FABModule, SafeHtmlPipeModule, CommonModule, RouterModule, FormsModule, FABModule, SafeHtmlPipeModule,
AlertModalModule, ReactiveFormsModule, DivHelpContentsRoutingModule AlertModalModule, ReactiveFormsModule, DivHelpContentsRoutingModule, MatSlideToggleModule
], ],
declarations: [ declarations: [
DivHelpContentsComponent DivHelpContentsComponent
], ],

View File

@ -72,12 +72,8 @@
<div class="name" href="#">{{check.entity.name}}</div> <div class="name" href="#">{{check.entity.name}}</div>
</td> </td>
<td> <td>
<div *ngIf="check.entity.isEnabled" class="activated" > <mat-slide-toggle [checked]="check.entity.isEnabled"
<input (click)="toggleEntities(false,[check.entity._id])" class="deactivate" src="assets/imgs/check-icon.png" title="Disable" width="20" type="image" height="20" value="Deactivate"> (change)="($event.source.checked = check.entity.isEnabled);toggleEntities(!check.entity.isEnabled,[check.entity._id])"></mat-slide-toggle>
</div>
<div *ngIf="!check.entity.isEnabled" class="deactivated" >
<input (click)="toggleEntities(true,[check.entity._id])" class="deactivate" src="assets/imgs/x-icon.png" title="Enable" width="20" type="image" height="20" value="Activate">
</div>
</td> </td>
<td *ngIf="isPortalAdministrator"> <td *ngIf="isPortalAdministrator">
<div class="actions" href="#"> <div class="actions" href="#">

View File

@ -307,7 +307,6 @@ export class EntitiesComponent implements OnInit {
this._router.navigate(['/user-info'], this._router.navigate(['/user-info'],
{ queryParams: { 'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} }); { queryParams: { 'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ''; this.updateErrorMessage = '';
this._helpContentService.toggleEntities( this._helpContentService.toggleEntities(
this.selectedCommunityPid, this.toggleIds, this.toggleStatus, this.properties.adminToolsAPIURL).subscribe( this.selectedCommunityPid, this.toggleIds, this.toggleStatus, this.properties.adminToolsAPIURL).subscribe(
@ -317,7 +316,6 @@ export class EntitiesComponent implements OnInit {
this.checkboxes[i].entity.isEnabled = this.toggleStatus; this.checkboxes[i].entity.isEnabled = this.toggleStatus;
} }
this.applyCheck(false); this.applyCheck(false);
this.showLoading = false;
}, },
error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error) error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error)
); );

View File

@ -9,12 +9,13 @@ import {FABModule} from '../../utils/fabModule.module';
import {EntityFormComponent} from './entity-form.component'; import {EntityFormComponent} from './entity-form.component';
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module';
import {EntitiesRoutingModule} from './entities-routing.module'; import {EntitiesRoutingModule} from './entities-routing.module';
import {MatSlideToggleModule} from '@angular/material';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, FABModule, CommonModule, RouterModule, FormsModule, FABModule,
AlertModalModule, ReactiveFormsModule, EntitiesRoutingModule AlertModalModule, ReactiveFormsModule, EntitiesRoutingModule, MatSlideToggleModule
], ],
declarations: [EntitiesComponent, EntityFormComponent], declarations: [EntitiesComponent, EntityFormComponent],
providers: [IsCommunity, ConnectAdminLoginGuard], providers: [IsCommunity, ConnectAdminLoginGuard],
exports: [EntitiesComponent] exports: [EntitiesComponent]

View File

@ -120,12 +120,8 @@
</div> </div>
</td> </td>
<td> <td>
<div *ngIf="check.pageHelpContent.isActive" class="activated" > <mat-slide-toggle [checked]="check.pageHelpContent.isActive"
<input (click)="togglePageHelpContents(false,[check.pageHelpContent._id])" class="deactivate" src="assets/imgs/check-icon.png" title="Deactivate" width="20" type="image" height="20"> (change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"></mat-slide-toggle>
</div>
<div *ngIf="!check.pageHelpContent.isActive" class="deactivated" >
<input (click)="togglePageHelpContents(true,[check.pageHelpContent._id])" class="activate" src="assets/imgs/x-icon.png" title="Activate" width="20" type="image" height="20">
</div>
</td> </td>
<td> <td>
<div class="actions" href="#"> <div class="actions" href="#">

View File

@ -252,7 +252,6 @@ export class PageHelpContentsComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this.router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this.router.url} }); this.router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this.router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ""; this.updateErrorMessage = "";
this._helpService.togglePageHelpContents(ids,status, this.properties.adminToolsAPIURL).subscribe( this._helpService.togglePageHelpContents(ids,status, this.properties.adminToolsAPIURL).subscribe(
@ -263,8 +262,6 @@ export class PageHelpContentsComponent implements OnInit {
} }
this.countPageHelpContents(); this.countPageHelpContents();
this.applyCheck(false); this.applyCheck(false);
this.showLoading = false;
}, },
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
); );

View File

@ -9,12 +9,13 @@ import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.mod
import {PageHelpContentsRoutingModule} from './page-help-contents-routing.module'; import {PageHelpContentsRoutingModule} from './page-help-contents-routing.module';
import {PageHelpContentsComponent} from './page-help-contents.component'; import {PageHelpContentsComponent} from './page-help-contents.component';
import {SafeHtmlPipeModule} from '../../openaireLibrary/utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../openaireLibrary/utils/pipes/safeHTMLPipe.module';
import {MatSlideToggleModule} from '@angular/material';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, FABModule, SafeHtmlPipeModule, CommonModule, RouterModule, FormsModule, FABModule, SafeHtmlPipeModule,
AlertModalModule, ReactiveFormsModule, PageHelpContentsRoutingModule AlertModalModule, ReactiveFormsModule, PageHelpContentsRoutingModule, MatSlideToggleModule
], ],
declarations: [ declarations: [
PageHelpContentsComponent PageHelpContentsComponent
], ],

View File

@ -86,12 +86,8 @@
<div class="name" href="#">{{check.page.name}}</div> <div class="name" href="#">{{check.page.name}}</div>
</td> </td>
<td> <td>
<div *ngIf="check.page.isEnabled" class="activated" > <mat-slide-toggle [checked]="check.page.isEnabled"
<input (click)="togglePages(false,[check.page._id])" class="deactivate" src="assets/imgs/check-icon.png" title="Disable" width="20" type="image" height="20"> (change)="($event.source.checked = check.page.isEnabled);togglePages(!check.page.isEnabled,[check.page._id])"></mat-slide-toggle>
</div>
<div *ngIf="!check.page.isEnabled" class="deactivated" >
<input (click)="togglePages(true,[check.page._id])" class="deactivate" src="assets/imgs/x-icon.png" title="Enable" width="20" type="image" height="20">
</div>
</td> </td>
<td *ngIf="!pagesType"> <td *ngIf="!pagesType">
<div class="type" href="#">{{check.page.type}}</div> <div class="type" href="#">{{check.page.type}}</div>

View File

@ -336,7 +336,6 @@ export class PagesComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ""; this.updateErrorMessage = "";
this._helpContentService.togglePages(this.selectedCommunityPid,ids,status, this.properties.adminToolsAPIURL).subscribe( this._helpContentService.togglePages(this.selectedCommunityPid,ids,status, this.properties.adminToolsAPIURL).subscribe(
@ -346,7 +345,6 @@ export class PagesComponent implements OnInit {
this.checkboxes[i].page.isEnabled=status; this.checkboxes[i].page.isEnabled=status;
} }
this.applyCheck(false); this.applyCheck(false);
this.showLoading = false;
}, },
error => this.handleUpdateError('System error changing the status of the selected page(s)', error) error => this.handleUpdateError('System error changing the status of the selected page(s)', error)
); );

View File

@ -9,12 +9,13 @@ import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.mod
import {PagesComponent} from './pages.component'; import {PagesComponent} from './pages.component';
import {PageFormComponent} from './page-form.component'; import {PageFormComponent} from './page-form.component';
import {PagesRoutingModule} from './pages-routing.module'; import {PagesRoutingModule} from './pages-routing.module';
import {MatSlideToggleModule} from '@angular/material';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, FABModule, CommonModule, RouterModule, FormsModule, FABModule,
AlertModalModule, ReactiveFormsModule, PagesRoutingModule AlertModalModule, ReactiveFormsModule, PagesRoutingModule, MatSlideToggleModule
], ],
declarations: [PagesComponent, PageFormComponent], declarations: [PagesComponent, PageFormComponent],
providers: [IsCommunity, ConnectAdminLoginGuard], providers: [IsCommunity, ConnectAdminLoginGuard],
exports: [PagesComponent] exports: [PagesComponent]

View File

@ -53,8 +53,224 @@
<div class="uk-heading-divider"> <div class="uk-heading-divider">
<h3>{{ entitiesMap.get(entity) }} <small *ngIf="deactivatedEntity" class="uk-text-danger uk-text-small">(this entity has been deactivated)</small></h3> <h3>{{ entitiesMap.get(entity) }} <small *ngIf="deactivatedEntity" class="uk-text-danger uk-text-small">(this entity has been deactivated)</small></h3>
<div class="uk-text-bold uk-text-uppercase uk-margin-top"> <div uk-grid>
<span> <div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].total|number}}</div>
<div>Total
{{ entity == 'dataset' ? 'Research Data' : entitiesMap.get(entity) }}</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['total'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','total')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['total'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','total')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].projects|number}}</div>
<div>Projects</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['project'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','project')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['project'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','project')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].open_access|number}}</div>
<div>Open
{{ entity == 'dataset' ? 'Research Data' : entitiesMap.get(entity) }}</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['open'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','open')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['open'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','open')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].closed_access|number}}</div>
<div>Closed
{{ entity == 'dataset' ? 'Research Data' : entitiesMap.get(entity) }}</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['closed'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','closed')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['closed'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','closed')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].restricted|number}}</div>
<div>Restricted
{{ entity == 'dataset' ? 'Research Data' : entitiesMap.get(entity) }}</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['restricted'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','restricted')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['restricted'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','restricted')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-flex uk-flex-middle uk-padding uk-padding-remove-top" uk-grid>
<div class="uk-card portal-card uk-text-right uk-padding-small uk-width-1-2">
<div
class="uk-text-large">{{statisticsSum[entity].embargo|number}}</div>
<div>Embargo
{{ entity == 'dataset' ? 'Research Data' : entitiesMap.get(entity) }}</div>
</div>
<div class="uk-width-expand">
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead>
<tr>
<th>Show</th>
<th class="uk-text-center">#</th>
</tr>
</thead>
<tbody>
<tr>
<th>In Graph Analysis</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['embargo'].showInMonitor"
(change)="toggleShowInMonitor(entity,'numbers','embargo')"></mat-slide-toggle>
</th>
</tr>
<tr>
<th>In Overview</th>
<th class="uk-text-center">
<mat-slide-toggle [checked]="statisticsDisplay.entities[entity].numbers.map['embargo'].showInDashboard"
(change)="toggleShowInDashboard(entity,'numbers','embargo')"></mat-slide-toggle>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--<span>
<a (click)="toggleShowInMonitor(entity,'numbers','total')" <a (click)="toggleShowInMonitor(entity,'numbers','total')"
data-uk-tooltip data-uk-tooltip
[title]="statisticsDisplay.entities[entity].numbers.map['total'].showInMonitor ? 'Hide in monitor' : 'Show in monitor'" [title]="statisticsDisplay.entities[entity].numbers.map['total'].showInMonitor ? 'Hide in monitor' : 'Show in monitor'"
@ -116,7 +332,7 @@
{{statisticsSum[entity].embargo | number}} {{statisticsSum[entity].embargo | number}}
</a> </a>
{{statisticsSum[entity].embargo == 1 ? 'is' : 'are'}} still in embargo. {{statisticsSum[entity].embargo == 1 ? 'is' : 'are'}} still in embargo.
</span> </span>-->
</div> </div>
</div> </div>
<div *ngIf="statisticsSum[entity].total==0" <div *ngIf="statisticsSum[entity].total==0"
@ -130,7 +346,9 @@
chartsUrlMap[entity + 'Timeline']" chartsUrlMap[entity + 'Timeline']"
class="uk-grid"> class="uk-grid">
<div class="uk-width-expand@m uk-width-3-4@l"> <div class="uk-width-expand@m uk-width-3-4@l">
<iframe [src]="chartsUrlMap[displayedTimeline]" width="1000" height="450"></iframe> <div class=" iframeContainer uk-height-large uk-margin-top">
<iframe [src]=chartsUrlMap[displayedTimeline] scrolling="no" class=""></iframe>
</div>
</div> </div>
<div class="uk-margin-top"> <div class="uk-margin-top">
<h6>Display options</h6> <h6>Display options</h6>
@ -143,22 +361,18 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th>In Monitor</th> <th>In Graph Analysis</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInMonitor(entity,'charts','timeline')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['timeline'].showInMonitor"
<img [src]="statisticsDisplay.entities[entity].charts.map['timeline'].showInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInMonitor(entity,'charts','timeline')"></mat-slide-toggle>
width="20"> </th>
</a>
</td>
</tr> </tr>
<tr> <tr>
<th>In Dashboard</th> <th>In Overview</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInDashboard(entity,'charts','timeline')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['timeline'].showInDashboard"
<img [src]="statisticsDisplay.entities[entity].charts.map['timeline'].showInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInDashboard(entity,'charts','timeline')"></mat-slide-toggle>
width="20"> </th>
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -186,11 +400,13 @@
chartsUrlMap[entity + 'Graph']" chartsUrlMap[entity + 'Graph']"
class="uk-grid"> class="uk-grid">
<div class="uk-width-expand@m uk-width-3-4@l"> <div class="uk-width-expand@m uk-width-3-4@l">
<iframe [src]="chartsUrlMap[displayedGraph]" width="1000" height="450"></iframe> <div class=" iframeContainer uk-height-large uk-margin-top">
<iframe [src]=chartsUrlMap[displayedGraph] scrolling="no" class=""></iframe>
</div>
</div> </div>
<div class="uk-margin-top"> <div class="uk-margin-top">
<h6>Display options</h6> <h6>Display options</h6>
<table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l"> <table class="uk-table uk-table-striped uk-width-expand@m uk-width-1-1@l">
<thead> <thead>
<tr> <tr>
<th>Show</th> <th>Show</th>
@ -199,22 +415,18 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th>In Monitor</th> <th>In Graph Analysis</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInMonitor(entity,'charts','graph')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['graph'].showInMonitor"
<img [src]="statisticsDisplay.entities[entity].charts.map['graph'].showInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInMonitor(entity,'charts','graph')"></mat-slide-toggle>
width="20"> </th>
</a>
</td>
</tr> </tr>
<tr> <tr>
<th>In Dashboard</th> <th>In Overview</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInDashboard(entity,'charts','graph')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['graph'].showInDashboard"
<img [src]="statisticsDisplay.entities[entity].charts.map['graph'].showInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInDashboard(entity,'charts','graph')"></mat-slide-toggle>
width="20"> </th>
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -247,17 +459,25 @@
<ul id="projectChartTabs" class="uk-switcher uk-margin"> <ul id="projectChartTabs" class="uk-switcher uk-margin">
<li> <li>
<div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')"> <div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')">
<iframe [src]="chartsUrlMap[displayedProjectChart]" width="1000" height="450"></iframe> <div class=" iframeContainer uk-height-large uk-margin-top">
<iframe [src]=chartsUrlMap[displayedProjectChart] scrolling="no" class=""></iframe>
</div>
</div> </div>
</li> </li>
<li> <li>
<div *ngIf="displayedProjectChart == (entity + 'Projectpie')"> <div *ngIf="displayedProjectChart == (entity + 'Projectpie')">
<iframe [src]="chartsUrlMap[displayedProjectChart]" width="1000" height="450"></iframe> <div class=" iframeContainer uk-height-large uk-margin-top">
<iframe [src]=chartsUrlMap[displayedProjectChart] scrolling="no" class=""></iframe>
</div>
</div> </div>
</li> </li>
<li> <li>
<div *ngIf="displayedProjectChart == (entity + 'Projecttable')"> <div *ngIf="displayedProjectChart == (entity + 'Projecttable')">
<iframe [src]="chartsUrlMap[displayedProjectChart]" width="1000" height="450"></iframe> <div class=" iframeContainer uk-height-large uk-margin-top">
<iframe [src]=chartsUrlMap[displayedProjectChart] scrolling="no" class=""></iframe>
</div>
</div> </div>
</li> </li>
</ul> </ul>
@ -276,58 +496,44 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th>In Monitor</th> <th>In Graph Analysis</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInMonitor(entity,'charts','projectColumn')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectColumn'].showInMonitor"
<img [src]="statisticsDisplay.entities[entity].charts.map['projectColumn'].showInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInMonitor(entity,'charts','projectColumn')"></mat-slide-toggle>
width="20"> </th>
</a> <th class="uk-text-center">
</td> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectPie'].showInMonitor"
<td class="uk-text-center"> (change)="toggleShowInMonitor(entity,'charts','projectPie')"></mat-slide-toggle>
<a (click)="toggleShowInMonitor(entity,'charts','projectPie')"> </th>
<img [src]="statisticsDisplay.entities[entity].charts.map['projectPie'].showInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" <th class="uk-text-center">
width="20"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectTable'].showInMonitor"
</a> (change)="toggleShowInMonitor(entity,'charts','projectTable')"></mat-slide-toggle>
</td> </th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInMonitor(entity,'charts','projectTable')"> <mat-slide-toggle [checked]="showAllInMonitor"
<img [src]="statisticsDisplay.entities[entity].charts.map['projectTable'].showInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowAllInMonitor(entity)"></mat-slide-toggle>
width="20">
</a> </th>
</td>
<td class="uk-text-center">
<a (click)="toggleShowAllInMonitor(entity)">
<img [src]="showAllInMonitor ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'"
width="20">
</a>
</td>
</tr> </tr>
<tr> <tr>
<th>In Dashboard</th> <th>In Overview</th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInDashboard(entity,'charts','projectColumn')"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectColumn'].showInDashboard"
<img [src]="statisticsDisplay.entities[entity].charts.map['projectColumn'].showInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowInDashboard(entity,'charts','projectColumn')"></mat-slide-toggle>
width="20"> </th>
</a> <th class="uk-text-center">
</td> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectPie'].showInDashboard"
<td class="uk-text-center"> (change)="toggleShowInDashboard(entity,'charts','projectPie')"></mat-slide-toggle>
<a (click)="toggleShowInDashboard(entity,'charts','projectPie')"> </th>
<img [src]="statisticsDisplay.entities[entity].charts.map['projectPie'].showInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" <th class="uk-text-center">
width="20"> <mat-slide-toggle [checked]="statisticsDisplay.entities[entity].charts.map['projectTable'].showInDashboard"
</a> (change)="toggleShowInDashboard(entity,'charts','projectTable')"></mat-slide-toggle>
</td> </th>
<td class="uk-text-center"> <th class="uk-text-center">
<a (click)="toggleShowInDashboard(entity,'charts','projectTable')"> <mat-slide-toggle [checked]="showAllInDashboard"
<img [src]="statisticsDisplay.entities[entity].charts.map['projectTable'].showInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'" (change)="toggleShowAllInDashboard(entity)"></mat-slide-toggle>
width="20">
</a> </th>
</td>
<td class="uk-text-center">
<a (click)="toggleShowAllInDashboard(entity)">
<img [src]="showAllInDashboard ? '/assets/imgs/check-icon.png' : '/assets/imgs/x-icon.png'"
width="20">
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -404,7 +404,6 @@ export class StatsComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ""; this.updateErrorMessage = "";
this.contentService.postCommunityAdminStatisticsChoices( this.contentService.postCommunityAdminStatisticsChoices(
@ -419,7 +418,6 @@ export class StatsComponent implements OnInit {
error => this.handleUpdateError('The changes could not be saved', error),//console.log(error), error => this.handleUpdateError('The changes could not be saved', error),//console.log(error),
() => { () => {
this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInMonitor = !this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInMonitor; this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInMonitor = !this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInMonitor;
this.showLoading = false;
} }
); );
} }
@ -429,7 +427,6 @@ export class StatsComponent implements OnInit {
if(!Session.isLoggedIn()){ if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else { } else {
this.showLoading = true;
this.updateErrorMessage = ""; this.updateErrorMessage = "";
this.contentService.postCommunityAdminStatisticsChoices( this.contentService.postCommunityAdminStatisticsChoices(
@ -444,7 +441,6 @@ export class StatsComponent implements OnInit {
error => this.handleUpdateError('The changes could not be saved', error),//console.log(error), error => this.handleUpdateError('The changes could not be saved', error),//console.log(error),
() => { () => {
this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInDashboard = !this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInDashboard; this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInDashboard = !this.statisticsDisplay.entities[entity][chartsOrNumbers].map[title].showInDashboard;
this.showLoading = false;
} }
); );
} }

View File

@ -5,10 +5,11 @@ import {IsCommunity} from '../../openaireLibrary/connect/communityGuard/isCommun
import {ConnectAdminLoginGuard} from '../../openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard'; import {ConnectAdminLoginGuard} from '../../openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
import {StatsComponent} from './stats.component'; import {StatsComponent} from './stats.component';
import {StatsRoutingModule} from './stats-routing.module'; import {StatsRoutingModule} from './stats-routing.module';
import {MatSlideToggleModule} from '@angular/material';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, StatsRoutingModule, RouterModule CommonModule, StatsRoutingModule, RouterModule, MatSlideToggleModule
], ],
declarations: [StatsComponent], declarations: [StatsComponent],
providers: [IsCommunity, ConnectAdminLoginGuard], providers: [IsCommunity, ConnectAdminLoginGuard],

View File

@ -104,4 +104,16 @@
.communitiesImageBox{ .communitiesImageBox{
width:284px; height:109px; width:284px; height:109px;
/*width:107px; height:57px;*/ /*width:107px; height:57px;*/
} }
.iframeContainer{
overflow:hidden;
}
.iframeContainer iframe{
width:100%;
height:100%;
border:0;
}

9
src/material.scss Normal file
View File

@ -0,0 +1,9 @@
@import '~@angular/material/theming';
@include mat-core();
$my-app-primary: mat-palette($mat-blue-grey);
$my-app-accent: mat-palette($mat-green);
$my-app-warn: mat-palette($mat-deep-orange);
$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent, $my-app-warn);
@include angular-material-theme($my-app-theme);

View File

@ -1 +1,3 @@
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */