Clear some files | use new version of datatables for dataproviders tables

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@50277 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-01-11 10:55:54 +00:00
parent fa98e7f34f
commit 27794606e8
15 changed files with 244 additions and 130 deletions

View File

@ -9,8 +9,8 @@ import {Observable} from 'rxjs/Observable';
styles: [`
`],
template: `
<h1>Openaire Lib Component</h1>
<!--navbar></navbar-->
<navbar portal="explore" onlyTop=false userMenu=true></navbar>
<h1>Openaire Lib Component</h1>
<!--div id="tm-main" class=" uk-section uk-margin-large-top tm-middle custom-main-content" >

View File

@ -7,7 +7,7 @@ import { APP_BASE_HREF, CommonModule } from '@angular/common';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import {SharedComponentsModule} from './sharedComponents/sharedComponents.module'; //navbar
import {NavigationBarModule} from './sharedComponents/navigationBar.module';
import { CookieLawModule } from './sharedComponents/cookie-law/cookie-law.module';
import {Meta} from '../angular2-meta';
// import { ErrorModule } from './error/error.module';
@ -72,8 +72,16 @@ import {SearchEntityRegistriesComponent} from './searchPages/dataProviders/entit
import {EntityRegistriesTableModule} from './searchPages/dataProviders/entityRegistriesTable.module';
import {SearchEntityRegistriesTableComponent} from './searchPages/dataProviders/entityRegistriesTable.component';
import {JournalsTableModule} from './searchPages/dataProviders/journalsTable.module';
import {SearchJournalsTableComponent} from './searchPages/dataProviders/journalsTable.component';
import {JournalsModule} from './searchPages/dataProviders/journals.module';
import {SearchJournalsComponent} from './searchPages/dataProviders/journals.component';
import {CompatibleDataProvidersModule} from './searchPages/dataProviders/compatibleDataProviders.module';
import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProviders/compatibleDataProviders.component';
import {CompatibleDataProvidersTableModule} from './searchPages/dataProviders/compatibleDataProvidersTable.module';
import {SearchCompatibleDataprovidersTableComponent} from './searchPages/dataProviders/compatibleDataProvidersTable.component';
import {ClaimsAdminModule} from './claims/claimsAdmin/claimsAdmin.module';
import {ClaimsAdminComponent} from './claims/claimsAdmin/claimsAdmin.component';
@ -94,7 +102,7 @@ import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component
NoopAnimationsModule,
CommonModule,
HttpModule,
SharedComponentsModule,
NavigationBarModule,
CookieLawModule,
MainSearchModule,
ErrorModule,
@ -102,7 +110,8 @@ import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component
SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule,
AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule,
PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule,
EntityRegistriesModule, EntityRegistriesTableModule, CompatibleDataProvidersModule,
EntityRegistriesModule, CompatibleDataProvidersModule, JournalsModule,
JournalsTableModule, EntityRegistriesTableModule, CompatibleDataProvidersTableModule,
ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule,
BrowserModule.withServerTransition({appId: 'my-app'}),
RouterModule.forRoot([
@ -127,11 +136,11 @@ import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component
{ path: 'search/find/dataproviders', component:SearchDataprovidersComponent },
{ path: 'search/find/organizations', component:SearchOrganizationsComponent },
{ path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent},
{ path: 'search/content-providers-table', loadChildren: './searchPages/dataProviders/compatibleDataProvidersTable.module#CompatibleDataProvidersTableModule' },
{ path: 'search/content-providers-table', component: SearchCompatibleDataprovidersTableComponent},
{ path: 'search/entity-registries',component: SearchEntityRegistriesComponent},
{ path: 'search/entity-registries-table', component: SearchEntityRegistriesTableComponent},
{ path: 'search/journals', loadChildren: './searchPages/dataProviders/journals.module#JournalsModule' },
{ path: 'search/journals-table', loadChildren: './searchPages/dataProviders/journalsTable.module#JournalsTableModule' },
{ path: 'search/journals', component: SearchJournalsComponent },
{ path: 'search/journals-table', component: SearchJournalsTableComponent },
{ path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent },
{ path: 'search/advanced/datasets', component: AdvancedSearchPublicationsComponent },
{ path: 'search/advanced/software', component: AdvancedSearchPublicationsComponent },

View File

@ -40,7 +40,7 @@ export class Session{
var user:User = null;
var cookie= COOKIE.getCookie(COOKIE.cookieName_u);
if( typeof localStorage !== 'undefined') {
if(localStorage.getItem("user")) {
if(localStorage.getItem("user") && (cookie != null && cookie != "")) {
user = JSON.parse(localStorage.getItem("user"));
if(user && (user.fullname != null || user.lastname !=null || user.firstname !=null)){
@ -70,7 +70,7 @@ export class Session{
if( typeof localStorage !== 'undefined') {
localStorage.setItem("user", JSON.stringify(user));
if(user && user.email){
COOKIE.deleteCookie(COOKIE.cookieName_u); // delete cookie to avoid transfer through requests
// COOKIE.deleteCookie(COOKIE.cookieName_u); // delete cookie to avoid transfer through requests
return user;
}else{
return null;

View File

@ -100,6 +100,8 @@ export class SearchCompatibleDataprovidersTableComponent {
this.searchUtils.status = this.errorCodes.NONE;
}
this.disableForms = false;
this.searchPage.triggerInitialLoad();
this.searchPage.transform(this.results);
},
err => {
console.log(err);

View File

@ -14,7 +14,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
<search-page-table pageTitle="Registries/ Databases"
type="content providers" entityType="dataprovider" [(filters)] = "filters"
[(results)] = "results" [filteredResults] = "results" [(searchUtils)] = "searchUtils"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[showResultCount]=false
[disableForms]="disableForms"
[searchViewLink]="'/search/entity-registries'"
@ -89,7 +89,8 @@ export class SearchEntityRegistriesTableComponent {
this.searchUtils.status = this.errorCodes.NONE;
}
this.disableForms = false;
this.searchPage.triggerInitialLoad();
this.searchPage.transform(this.results);
},
err => {
console.log(err);

View File

@ -101,6 +101,8 @@ export class SearchJournalsTableComponent {
this.searchUtils.status = this.errorCodes.NONE;
}
this.disableForms = false;
this.searchPage.triggerInitialLoad();
this.searchPage.transform(this.results);
},
err => {
console.log(err);

View File

@ -53,11 +53,11 @@
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
</div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column" >
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column custom-dataTable-content" >
<div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom">
<div class="searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom">
<span class="uk-h6 uk-width-1-1@s uk-width-1-2@m">
{{filteredResults.length}}--> {{results.length}} {{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
</span>
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m">
<paging-no-load [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [size]="rowsOnPage" (pageChange)="goTo($event.value, false)"></paging-no-load>
@ -79,10 +79,12 @@
<errorMessages [status]="[searchUtils.status]" [type]="'results'"></errorMessages>
</div>
<div class="uk-overflow-container custom-dataTable-content">
<div class="uk-overflow-container ">
<!-- #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]" -->
<table *ngIf="searchUtils.totalResults > 0" datatable class="uk-table uk-table-striped divider-table" [dtOptions]="dtOptions" id="dpTable">
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]"
-->
<table datatable class="uk-table uk-table-striped divider-table" [dtOptions]="dtOptions" id="dpTable" [dtTrigger]="dtTrigger" dtInstance="dtInstanceCallback">
<thead >
<tr>
@ -106,7 +108,7 @@
</tr>
</thead>
<tbody>
<tr class="uk-table-middle" *ngFor="let dataprovider of filteredResults">
<tr class="uk-table-middle" *ngFor="let dataprovider of results">
<td class="uk-width-1-5 uk-text-left">
<a [queryParams]="{datasourceId: dataprovider.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
<span *ngIf="dataprovider.title.name"

View File

@ -1,4 +1,4 @@
import {Component, Input, ViewChild, Output, EventEmitter, ViewEncapsulation} from '@angular/core';
import {Component, Input, ViewChild, Output, EventEmitter, ViewEncapsulation, OnInit, AfterViewInit} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import {Location} from '@angular/common';
@ -14,23 +14,24 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
import { ErrorCodes} from '../../utils/properties/openaireProperties';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {PiwikService} from '../../utils/piwik/piwik.service';
// import { DataTableDirective } from 'angular-datatables';
import { DataTableDirective } from 'angular-datatables';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
@Component({
selector: 'search-page-table',
templateUrl:'searchPageTableView.component.html',
styles: [`
#dpTable_info, #dpTable_paginate{
/*display: none;*/
#dpTable_info, #dpTable_paginate, #dpTable_length, #dpTable_filter{
display: none;
}
`],
encapsulation: ViewEncapsulation.None // this used in order styles to work
})
export class SearchPageTableViewComponent {
export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
@Input() pageTitle = "";
@Input() results;
@Input() filteredResults;
@Input() filters = [];
@Input() type:string = "";
@Input() entityType: string = "";
@ -48,26 +49,24 @@ export class SearchPageTableViewComponent {
@ViewChild (ModalLoading) loading : ModalLoading ;
private searchFieldsHelper:SearchFields = new SearchFields();
private queryParameters: Map<string, string> = new Map<string,string>();
private sub: any;
public countFilters= 0;
public parameterNames:string[] =[];
public parameterValues:string[] =[];
public triggerPipe: boolean = false;
public rowsOnPage:number = 10;
// @ViewChild('mf') table: any;//DataTable;
@ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ;
public currentFilter: Filter;
public errorCodes:ErrorCodes = new ErrorCodes();
piwiksub: any;
dtOptions: DataTables.Settings = {};
constructor (private location: Location , private _meta: Meta, private _piwikService:PiwikService ) { }
showTable = false; filteringAdded = false;
@ViewChild(DataTableDirective) datatableElement: DataTableDirective;
dtTrigger: Subject<any> = new Subject(); //necessary
constructor (private location: Location , private _meta: Meta, private _piwikService:PiwikService, private _searchDataprovidersService: SearchDataprovidersService ) { }
ngOnInit() {
this.dtOptions = {
"paging": true,
"searching": false,
@ -82,31 +81,25 @@ export class SearchPageTableViewComponent {
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.pageTitle).subscribe();
}
// $.fn['dataTable'].ext.search.push((settings, data, dataIndex) => {
// const id = parseFloat(data[0]) || 0; // use data for the id column
// if ((isNaN(this.min) && isNaN(this.max)) ||
// (isNaN(this.min) && id <= this.max) ||
// (this.min <= id && isNaN(this.max)) ||
// (this.min <= id && id <= this.max)) {
// return true;
// }
// return false;
// });
}
}
ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
}
public createData(){
}
public sortByOrganization = (dataprovider: any) => {
if(dataprovider.organizations && dataprovider.organizations.length > 0) {
return dataprovider.organizations[0].name.toUpperCase();
ngAfterViewInit(): void {
$.fn['dataTable'].ext.search.push((settings, data, dataIndex) => {
if (this.filterData(data, this.searchUtils.keyword, this.filters)) {
return true;
}
return false;
});
}
return "-";
}
totalPages(): number {
let totalPages:any = this.searchUtils.totalResults/(this.rowsOnPage);
@ -116,20 +109,10 @@ export class SearchPageTableViewComponent {
return totalPages;
}
refreshTable(page:number) {
console.log("refreshTable s");
// if(this.searchUtils.page!=page){
this.searchUtils.page=page;
var table = $('#dpTable').DataTable();
table.page( page - 1 ).draw( false );
console.log("refreshTable e");
// }
}
toggleModal($event) {
this.currentFilter = $event.value;
this.searchFilterModal.open();
}
updateDescription(description:string){
@ -217,9 +200,6 @@ public getParametersFromUrl(params) {
this.parameterValues.push(this.searchUtils.keyword);
}
//if(this.searchUtils.page != 1 && includePage){
// allLimits+=((allLimits.length == 0)?'?':'&') + 'page=' + this.searchUtils.page;
//}
return allLimits;
}
@ -241,7 +221,7 @@ public getParametersFromUrl(params) {
if(this.searchUtils.keyword.length > 0 ){
this.searchUtils.keyword ='';
}
this.goTo(1, true);
this.goTo(1);
}
private clearFilters(){
for (var i =0 ; i < this.filters.length; i++) {
@ -260,26 +240,28 @@ public getParametersFromUrl(params) {
if(value.selected == true){
value.selected = false;
}
this.goTo(1, true);
this.goTo(1);
}
goTo(page:number = 1, triggerPipe:boolean = true){
this.filteredResults = this.transform();
goTo(page:number = 1){
this.refreshTable(page);
this.searchUtils.page=page;
var table = $('#dpTable').DataTable();
table.page( page - 1 ).draw( false );
// Object { page: 0, pages: 3, start: 0, end: 10, length: 10, recordsTotal: 28, recordsDisplay: 21, serverSide: false }
var info = table.page.info();
this.searchUtils.totalResults = info.recordsDisplay;
var urlParameters = this.createUrlParameters(this.filters,true);
this.location.go(location.pathname,urlParameters);
// if(triggerPipe) {
// this.triggerPipe = !this.triggerPipe;
// }
}
filterChanged($event){
this.goTo(1, true);
this.goTo(1);
}
keywordChanged($event) {
this.searchUtils.keyword = $event.value;
this.goTo(1, true);
this.goTo(1);
}
/*
downloadClicked($event) {
@ -306,19 +288,29 @@ public getParametersFromUrl(params) {
return selected;
}
/*
Trigger a table draw in order to get the initial filtering
*/
triggerInitialLoad(){
setTimeout(function(){
var table = $('#dpTable').DataTable();
table.page( 0 ).draw( false );
transform(): any {
if(this.results.length > 0) {
}, 500);
}
/*
Transform initial - not filtered results to get the filtered number
*/
transform(results): any {
if(results.length > 0) {
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
var result = this.results.filter(row=>this.filterAll(row, this.searchUtils.keyword.toLowerCase(),this.filters));
var result = results.filter(row=>this.filterAll(row, this.searchUtils.keyword.toLowerCase(),this.filters));
let oldTotal = this.searchUtils.totalResults;
console.log(" Length: "+result.length);
this.searchUtils.totalResults = result.length;
var errorCodes:ErrorCodes = new ErrorCodes();
@ -330,12 +322,13 @@ public getParametersFromUrl(params) {
// if(oldTotal != this.searchUtils.totalResults) {
// args[3].detectChanges();
// }
return result;
return result;
}
return [];
return [];
}
filterAll(row: any, query: string, filters:Filter[]) {
// console.log(row);
let returnValue: boolean = false;
if(query) {
@ -406,6 +399,65 @@ public getParametersFromUrl(params) {
}
}
return true;
}
filterQuery(data, query){
if(data.toLowerCase().indexOf(query.toLowerCase()) > -1){
return true;
}else{
return false;
}
}
filterData(row: any, query: string, filters:Filter[]) {
let returnValue: boolean = false;
if(query) {
for(var i=0; i <5; i++){
var r= this.filterQuery(row[i], query);
// console.log(query+" "+ row+" "+r);
if(r) {
returnValue = true;
break;
}
}
if(!returnValue) {
return false;
}
}
for (let filter of filters){
if(filter.countSelectedValues > 0){
for (let value of filter.values){
if(value.selected == true){
let field = 1;
if(filter.title == "Type") {
field = 1;
} else if(filter.title == "Compatibility Level") {
field = 4;
}
r= this.filterQuery(row[field], value.name);
if(r) {
returnValue = true;
if(filter.filterOperator == "or") {
break;
}
} else {
if(filter.filterOperator == "and") {
return false;
}
returnValue = false;
}
}
}
if(!returnValue) {
return false;
}
}
}
return true;
}
}

View File

@ -21,6 +21,7 @@ import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.gua
import {HelperModule} from '../../utils/helper/helper.module';
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
@NgModule({
imports: [
CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {BottomComponent} from './bottom.component';
@NgModule({
imports: [
CommonModule, FormsModule
],
declarations: [
BottomComponent
],
exports: [
BottomComponent
]
})
export class BottomModule{ }

View File

@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from "@angular/router";
import {FeedbackComponent} from './feedback.component';
@NgModule({
imports: [
CommonModule, FormsModule
],
declarations: [
FeedbackComponent
],
exports: [
FeedbackComponent
]
})
export class FeedbackModule{ }

View File

@ -1,19 +1,19 @@
<div class="tm-header-mobile uk-hidden@m">
<nav class="uk-navbar-container uk-navbar" uk-navbar="">
<div class="uk-navbar-left">
<div *ngIf="!onlyTop" class="uk-navbar-left">
<a class="uk-navbar-toggle" href="#tm-mobile" uk-toggle="" style="z-index:1000;">
<div uk-navbar-toggle-icon="" class="uk-navbar-toggle-icon uk-icon custom-navbar-toggle-icon"> </div>
</a>
</div>
<div class="uk-navbar-center">
<a class="uk-navbar-item uk-logo" routerLinkActive="uk-link" routerLink="/" >
<img src="assets/OA EXPLORE_B.png" alt="OpenAIRE" class="uk-responsive-height"> </a>
<img src="{{logoPath}}logo-small-{{portal}}.png" alt="OpenAIRE" class="uk-responsive-height"> </a>
</div>
<!--div class="uk-navbar-right uk-margin-xlarge-top">
<user-mini></user-mini>
</div-->
</nav>
<div id="tm-mobile" uk-offcanvas="" mode="slide" overlay="" class="uk-offcanvas">
<div *ngIf="!onlyTop" id="tm-mobile" uk-offcanvas="" mode="slide" overlay="" class="uk-offcanvas" >
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
<div class="uk-child-width-1-1 uk-grid" uk-grid="">
@ -57,7 +57,9 @@
<li><a routerLinkActive="uk-link" routerLink="/search/find/dataproviders" class="uk-offcanvas-close custom-offcanvas-close" >Browse all</a></li>
</ul>
</li>
<user-mini mobileView=true></user-mini>
<ng-container *ngIf="userMenu">
<user-mini mobileView=true></user-mini>
</ng-container>
</ul>
</div>
</div>
@ -69,7 +71,7 @@
<div *ngIf="specialAnnouncementContent" class="uk-hidden@m" [innerHTML]="specialAnnouncementContent">
</div>
<div class="tm-toolbar custom-discover-toolbar uk-visible@m">
<div class="tm-toolbar custom-{{portal}}-toolbar uk-visible@m">
<div class="uk-container uk-flex uk-flex-middle uk-container-expand">
<div class="uk-margin-auto-left">
<div class="uk-grid-medium uk-child-width-auto uk-flex-middle uk-grid uk-grid-stack" uk-grid="margin: uk-margin-small-top">
@ -78,13 +80,12 @@
<ul class="uk-subnav uk-subnav-line">
<li ><a href="https://beta.openaire.eu" class="home-icon"><span class="uk-responsive-height" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 20 20" height="20px" id="Layer_1" version="1.1" viewBox="0 0 48 48" width="20px" xml:space="preserve"><path id="home" clip-rule="evenodd" d="M44.715,23.711c-0.381,0.382-1,0.382-1.381,0l-8.939-8.938 c-0.064-0.051-0.119-0.106-0.17-0.171l-3.83-3.829c-0.064-0.051-0.119-0.106-0.17-0.171L24,4.377L4.667,23.711 c-0.381,0.382-1,0.382-1.381,0c-0.381-0.381-0.381-1,0-1.381L23.191,2.425c0.031-0.047,0.053-0.101,0.094-0.144 C23.482,2.085,23.742,1.994,24,2c0.258-0.006,0.518,0.084,0.715,0.281c0.043,0.042,0.062,0.096,0.096,0.144L30,7.616V4.997 c0,0,0,0,0,0c0-0.552,0.447-1,1-1h4c0.277,0,0.527,0.112,0.707,0.293C35.889,4.471,36,4.721,36,4.997v8.619l8.715,8.714 C45.096,22.711,45.096,23.33,44.715,23.711z M34,5.997h-2v3.619l2,2V5.997z M10,21.997c0.552,0,1,0.448,1,1v19c0,1.105,0.896,2,2,2 h6l0,0v-13c0-0.553,0.447-1,1-1h8c0.553,0,1,0.447,1,1v13l0,0h6c1.105,0,2-0.895,2-2v-19c0-0.552,0.447-1,1-1s1,0.448,1,1v19 c0,2.209-1.791,4-4,4H13c-2.209,0-4-1.791-4-4v-19C9,22.444,9.448,21.997,10,21.997z M27,43.996v-12h-6v12l0,0H27L27,43.996z" fill-rule="evenodd" fill="#fff"/></svg>
<!--img class="uk-responsive-height" src="assets/Home_24white.svg" alt="home"-->
</span></a></li>
<li class="custom-discover-li"><a routerLinkActive="uk-link" routerLink="/" title="Search in OA. Link your research">Explore</a></li>
<li class="line"><a href="#" title="Content Provider Dashboard">Provide</a></li>
<li class="line"><a href="https://connect.openaire.eu" title="Research Community Dashboard">Connect</a></li>
<li class="line"><a href="https://monitor.openaire.eu" title="Monitoring Dashboard">Monitor</a></li>
<li class="line custom-develop-li "><a href="https://api.openaire.eu" title="APIs">Develop</a></li>
<li [class]="(portal=='explore')?'custom-'+portal+'-li':''"><a href="https://beta.explore.openaire.eu" title="Search in OA. Link your research">Explore</a></li>
<li [class]="(portal=='provide')?'custom-'+portal+'-li':''"><a href="#" title="Content Provider Dashboard">Provide</a></li>
<li [class]="(portal=='connect')?'custom-'+portal+'-li':''"><a href="https://connect.openaire.eu" title="Research Community Dashboard">Connect</a></li>
<li [class]="(portal=='monitor')?'custom-'+portal+'-li':''"><a href="https://monitor.openaire.eu" title="Monitoring Dashboard">Monitor</a></li>
<li [class]="(portal=='develop')?'custom-'+portal+'-li':''"><a href="https://develop.openaire.eu" title="APIs">Develop</a></li>
</ul>
</div>
</div>
@ -101,13 +102,13 @@
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
<div class="uk-navbar-left uk-visible@l ">
<a routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item">
<img src="assets/OA EXPLORE_a.png" alt="OpenAIRE" class="uk-responsive-height"></a>
<img src="{{logoPath}}logo-large-{{portal}}.png" alt="OpenAIRE" class="uk-responsive-height"></a>
</div>
<div class="uk-navbar-left uk-visible@m uk-hidden@l">
<a routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item">
<img src="assets/OA EXPLORE_B.png" alt="OpenAIRE" class="uk-responsive-height"></a>
<img src="{{logoPath}}logo-small-{{portal}}.png" alt="OpenAIRE" class="uk-responsive-height"></a>
</div>
<div class="uk-navbar-center">
<div *ngIf="!onlyTop" class="uk-navbar-center">
<ul *ngIf= "isClient" class="uk-navbar-nav">
<li class="uk-parent">
<a routerLinkActive="uk-link" routerLink="/search/find" class="" aria-expanded="false">Search</a>
@ -173,31 +174,14 @@
</li>
</ul>
</div>
<div *ngIf= "isClient" class="uk-navbar-right">
<!--ul class="uk-navbar-nav">
<li class="uk-parent"-->
<div *ngIf="userMenu" class="uk-navbar-right">
<user-mini ></user-mini>
<!--a routerLinkActive="uk-link" routerLink="/search/content-providers" class="" aria-expanded="false">Resources</a-->
<!--div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" id="userMenu" (click)="onClick('userMenu')">
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
<div class="uk-first-column">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li><a href="" class="uk-offcanvas-close custom-offcanvas-close" >My profile</a></li>
<li><a routerLinkActive="uk-link" routerLink="/myclaims">My Claims</a></li>
<li *ngIf="isAuthorized"><a routerLinkActive="uk-link" routerLink="/claims">Manage all Claims</a></li>
<li><a routerLinkActive="uk-link" routerLink="/login">Log out</a></li>
</ul>
</div>
</div>
</div-->
<!--/li>
</ul-->
</div>
</nav>
</div>
</div>
<!--div class="uk-sticky-placeholder" style="height: 80px; margin: 0px;" hidden="hidden"></div>
<div class="uk-sticky-placeholder" style="height: 84px; margin: 0px;" hidden="hidden"></div-->
</div>
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid uk-grid-stack" uk-grid="">

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
// import 'rxjs/Rx';
import {ActivatedRoute, Router} from '@angular/router';
import {Observable} from 'rxjs/Observable';
@ -11,6 +11,10 @@ import { ConfigurationService } from '../utils/configuration/configuration.servi
templateUrl: 'navigationBar.component.html'
})
export class NavigationBarComponent {
@Input() portal:string = "connect";
@Input() onlyTop ;
@Input() logoPath:string = "assets/";
@Input() userMenu;
public isAuthorized: boolean = false;
sub:any;
isClient:boolean = false;
@ -40,7 +44,27 @@ export class NavigationBarComponent {
this.sub = this.route.queryParams.subscribe(params => {
this.initialize();
});
console.log("Before get entities");
if(this.userMenu == "true"){
this.userMenu = true;
}
else if(this.userMenu == "false"){
this.userMenu = false;
}
else{
this.userMenu = true;
}
if(this.onlyTop == "true"){
this.onlyTop = true;
}
else if(this.onlyTop == "false"){
this.onlyTop = false;
}
else{
this.onlyTop = false;
}
// const entityOne = this.config.isEntityEnabled("publication");
// const entityTwo = this.config.isEntityEnabled("dataset");
@ -76,8 +100,7 @@ export class NavigationBarComponent {
this.isAuthorized = false;
}
this.config.isEntityEnabled("publication").subscribe(data => {
console.log("heree");
this.showPublications = data;
this.showPublications = data;
});
this.config.isEntityEnabled("dataset").subscribe(data => { this.showDatasets = data;});
this.config.isEntityEnabled("software").subscribe(data => { this.showSoftware = data;})

View File

@ -5,27 +5,22 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from "@angular/router";
import {NavigationBarComponent} from './navigationBar.component';
import {BottomComponent} from './bottom.component';
import {FeedbackComponent} from './feedback/feedback.component';
import {UserMiniComponent} from '../login/userMini.component';
import {LogoutOpenaireService} from '../login/utils/logoutOpenaire.service';
import {MetaModule} from '../../meta.module';
import { ConfigurationServiceModule } from '../utils/configuration/configurationService.module';
import { ConfigurationServiceModule } from '../utils/configuration/configurationService.module';
@NgModule({
imports: [
CommonModule, FormsModule,
RouterModule, MetaModule, ConfigurationServiceModule
RouterModule, ConfigurationServiceModule
],
declarations: [
NavigationBarComponent,
BottomComponent,UserMiniComponent, FeedbackComponent
NavigationBarComponent, UserMiniComponent
],
providers:[LogoutOpenaireService],
exports: [
NavigationBarComponent,
BottomComponent,UserMiniComponent, FeedbackComponent
NavigationBarComponent,UserMiniComponent
]
})
export class SharedComponentsModule{ }
export class NavigationBarModule{ }

View File

@ -99,7 +99,8 @@ export class OpenaireProperties {
private static piwikBaseUrl =" https://analytics.openaire.eu/piwik.php?idsite=6";
private static loginUrl ="http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login";
private static loginUrl ="http://rudie.di.uoa.gr:8080/dnet-openaire-users-2.0.0-SNAPSHOT/openid_connect_login";
//"http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login";
private static loginUrl_pm ="https://beta.services.openaire.eu/uoa-user-management/openid_connect_login";
private static logoutUrl ="https://aai.openminted.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=";