Fixing claim pages to be used as library cmponents - modules | use new version of datatables

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@50240 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-01-03 13:12:31 +00:00
parent 86e750754b
commit fa98e7f34f
21 changed files with 219 additions and 326 deletions

View File

@ -69,10 +69,24 @@ import {AdvancedSearchOrganizationsComponent} from './searchPages/advanced/advan
import {EntityRegistriesModule} from './searchPages/dataProviders/entityRegistries.module';
import {SearchEntityRegistriesComponent} from './searchPages/dataProviders/entityRegistries.component';
import {EntityRegistriesTableModule} from './searchPages/dataProviders/entityRegistriesTable.module';
import {SearchEntityRegistriesTableComponent} from './searchPages/dataProviders/entityRegistriesTable.component';
import {CompatibleDataProvidersModule} from './searchPages/dataProviders/compatibleDataProviders.module';
import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProviders/compatibleDataProviders.component';
import {ClaimsAdminModule} from './claims/claimsAdmin/claimsAdmin.module';
import {ClaimsAdminComponent} from './claims/claimsAdmin/claimsAdmin.component';
import {MyClaimsModule} from './claims/myClaims/myClaims.module';
import {MyClaimsComponent} from './claims/myClaims/myClaims.component';
import {ClaimsByTokenModule} from './claims/claimsByToken/claimsByToken.module';
import {ClaimsByTokenComponent} from './claims/claimsByToken/claimsByToken.component';
import {DirectLinkingModule} from './claims/directLinking/directLinking.module';
import {DirectLinkingComponent} from './claims/directLinking/directLinking.component';
import {LinkingGenericModule} from './claims/linking/linkingGeneric.module';
import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component';
@NgModule({
imports: [
@ -88,7 +102,8 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule,
AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule,
PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule,
EntityRegistriesModule,CompatibleDataProvidersModule,
EntityRegistriesModule, EntityRegistriesTableModule, CompatibleDataProvidersModule,
ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule,
BrowserModule.withServerTransition({appId: 'my-app'}),
RouterModule.forRoot([
{ path: '', component: SearchComponent},
@ -114,7 +129,7 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
{ path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent},
{ path: 'search/content-providers-table', loadChildren: './searchPages/dataProviders/compatibleDataProvidersTable.module#CompatibleDataProvidersTableModule' },
{ path: 'search/entity-registries',component: SearchEntityRegistriesComponent},
{ path: 'search/entity-registries-table', loadChildren: './searchPages/dataProviders/entityRegistriesTable.module#EntityRegistriesTableModule' },
{ 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/advanced/publications', component: AdvancedSearchPublicationsComponent },
@ -124,11 +139,11 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
{ path: 'search/advanced/dataproviders', component: AdvancedSearchPublicationsComponent },
{ path: 'search/advanced/projects', component: AdvancedSearchPublicationsComponent },
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/htmlProjectReport.module#HtmlProjectReportModule' },
{ path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#MyClaimsModule' },
{ path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#ClaimsAdminModule' },
{ path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LinkingGenericModule' },
{ path: 'participate/direct-claim', loadChildren: './claims/directLinking/directLinking.module#DirectLinkingModule' },
{ path: 'claims-project-manager', loadChildren: './claims/claimsByToken/claimsByToken.module#ClaimsByTokenModule' },
{ path: 'myclaims',component: MyClaimsComponent },
{ path: 'claims', component: ClaimsAdminComponent },
{ path: 'participate/claim', component: LinkingGenericComponent},
{ path: 'participate/direct-claim',component: DirectLinkingComponent},
{ path: 'claims-project-manager', component: ClaimsByTokenComponent },
{ path: 'reload', loadChildren: './reload/reload.module#ReloadModule' },
{ path: 'user-info', loadChildren: './login/user.module#UserModule' },
{ path: 'error', component: ErrorPageComponent },

View File

@ -1,68 +0,0 @@
// import { NgModule} from '@angular/core';
// import { CommonModule } from '@angular/common';
// import { FormsModule } from '@angular/forms';
// //
// import {UtilsModule} from '../utils/utils.module';
// import {ServicesModule} from '../services/services.module';
//
// import { ClaimsService} from '../services/claims.service';
// //main
// import {ClaimComponent} from './claim/claim.component';
// import {ClaimsAdminComponent} from './claims/claimsAdmin.component';
// import {MyClaimsComponent} from './myClaims/myClaims.component';
// import {LinkingHomeComponent} from './linking/linkingHome.component';
// import {LinkingComponent} from './linking/linking.component';
// import { BulkLinkingComponent } from './linking/bulkLinking.component';
//
// import {BulkClaimComponent} from './linking/bulkClaim/bulkClaim.component';
// import {ClaimsComponent} from './claim-utils/claims.component';
//
// import {ClaimContextComponent} from './claim-utils/claimContext.component';
// import {ClaimProjectsComponent} from './claim-utils/claimProject.component';
// import {ClaimResultComponent} from './claim-utils/claimResult.component';
// import {ClaimPublicationComponent} from './claim-utils/claimPublication.component';
// import {ClaimDatasetComponent} from './claim-utils/claimDataset.component';
//
// import {ClaimInsertComponent} from './linking/insertClaim/insertClaim.component';
//
// import {ClaimSelectedContextsComponent} from './linking/selected/selectedContexts.component';
// import {ClaimSelectedComponent} from './linking/selected/selected.component';
// import {ClaimSelectedDatasetsComponent} from './linking/selected/selectedDatasets.component';
// import {ClaimSelectedResultsComponent} from './linking/selected/selectedResults.component';
// import {ClaimSelectedProjectsComponent} from './linking/selected/selectedProjects.component';
// import {ClaimSelectedPublicationsComponent} from './linking/selected/selectedPublications.component';
//
// import {LinkingGenericComponent} from './linking/linkingGeneric.component';
//
// import {InlineClaimContextComponent} from './inlineClaims/inlineClaimContext.component';
// import {InlineClaimProjectComponent} from './inlineClaims/inlineClaimProject.component';
// import {InlineClaimResultComponent} from './inlineClaims/inlineClaimResult.component';
// import {ClaimEntityFormatter} from '../utils/claimEntityFormatter.component';
//
// import { Claim } from '../utils/entities/claim';
// //helpers
//
// import { ClaimRoutingModule } from './claim-routing.module';
// @NgModule({
// imports: [
// CommonModule, FormsModule,
// UtilsModule,
// ServicesModule,
// ClaimRoutingModule
//
// ],
// declarations: [
// ClaimsAdminComponent, MyClaimsComponent, ClaimComponent, ClaimsComponent,
// BulkLinkingComponent, LinkingComponent, LinkingHomeComponent, LinkingGenericComponent,
// InlineClaimContextComponent, InlineClaimProjectComponent, InlineClaimResultComponent, ClaimSelectedComponent,
// ClaimContextComponent, ClaimSelectedContextsComponent, ClaimInsertComponent, ClaimProjectsComponent, ClaimSelectedProjectsComponent,
// ClaimResultComponent, ClaimSelectedPublicationsComponent, ClaimSelectedDatasetsComponent, ClaimSelectedResultsComponent, ClaimPublicationComponent,
// ClaimDatasetComponent, BulkClaimComponent,
// ClaimEntityFormatter
// ],
// providers: [ ClaimsService ],
// exports: [
// InlineClaimContextComponent, InlineClaimProjectComponent, InlineClaimResultComponent
// ]
// })
// export class ClaimModule { }

View File

@ -1,16 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { AdminLoginGuard} from'../../login/adminLoginGuard.guard';
import { ClaimsAdminComponent } from './claimsAdmin.component';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: ClaimsAdminComponent, canActivate: [IsRouteEnabled, AdminLoginGuard],
data: {redirect: '/error'}, canDeactivate: [PreviousRouteRecorder]}])
]
})
export class ClaimsAdminRoutingModule { }

View File

@ -2,8 +2,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { ClaimsAdminComponent } from './claimsAdmin.component';
import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module';
// import{ClaimServiceModule} from '../claim-utils/service/claimsService.module';
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
import { AdminLoginGuard} from'../../login/adminLoginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -12,14 +10,13 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
SharedModule,
ClaimsAdminRoutingModule,
// ClaimServiceModule,
DisplayClaimsModule
],
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled],
declarations: [
ClaimsAdminComponent
]
],
exports:[ClaimsAdminComponent]
})
export class ClaimsAdminModule { }

View File

@ -1,15 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LoginGuard} from'../../login/loginGuard.guard';
import { ClaimsByTokenComponent } from './claimsByToken.component';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: ClaimsByTokenComponent, canActivate: [IsRouteEnabled, LoginGuard],
data: {redirect: '/error'}, canDeactivate: [PreviousRouteRecorder]}])
]
})
export class ClaimsByTokenRoutingModule { }

View File

@ -12,8 +12,7 @@ import {Session} from '../../login/utils/helper.class';
import {RouterHelper} from '../../utils/routerHelper.class';
import { Meta} from '../../../angular2-meta';
import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
//import {DataTable} from "angular2-datatable";
import { DataTableDirective } from 'angular-datatables';
@Component({
selector: 'claims-project-manager',
@ -70,14 +69,14 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
{{totalPendingResults.count}} pending claims, page {{activePendingPage.page}} of {{totalPages(totalPendingResults.count)}}
<paging-no-load class="uk-float-right" [currentPage]="activePendingPage.page" [totalResults]="totalPendingResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table1, $event, 'pending')"></paging-no-load>
</span>
<table #filtered1 *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped"
[mfData]="pending_claims | claimsDatatable : [filterQuery, totalPendingResults, activePendingPage]" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1">
<table #filtered1 *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped">
<!--[mfData]="pending_claims | claimsDatatable : [filterQuery, totalPendingResults, activePendingPage]" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
<!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"-->
<thead>
<tr>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed By</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate1">Claimed Date</mfDefaultSorter></th>
<th> Research Result </th>
<th class="uk-text-center">Claimed By </th>
<th class="uk-text-center">Claimed Date </th>
<th class="uk-text-center">Approve</th>
</tr>
</thead>
@ -123,8 +122,8 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
<paging-no-load class="uk-float-right" [currentPage]="activeCuratedPage.page" [totalResults]="totalCuratedResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table2, $event, 'curated')"> </paging-no-load>
</span>
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped"
[mfData]="curated_claims | claimsDatatable : [filterQuery2, totalCuratedResults, activeCuratedPage]" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1">
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped" >
<!--[mfData]="curated_claims | claimsDatatable : [filterQuery2, totalCuratedResults, activeCuratedPage]" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
<!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"-->
<thead>
<!--tr>
@ -141,12 +140,12 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
</td>
</tr-->
<tr>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th>
<th>Research Result</th>
<!--th>Link to</th-->
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed by</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate2">Claimed Date</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter by="curatedBy">Curated by</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByCurationDate2">Curation Date</mfDefaultSorter></th>
<th class="uk-text-center">Claimed by </th>
<th class="uk-text-center">Claimed Date </th>
<th class="uk-text-center">Curated by </th>
<th class="uk-text-center">Curation Date </th>
<th class="uk-text-center">Approved</th>
</tr>
</thead>

View File

@ -1,15 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import {DataTableModule} from "angular2-datatable";
import {DataTablesModule} from 'angular-datatables';
import { SharedModule } from '../../shared/shared.module';
import { ClaimsByTokenComponent } from './claimsByToken.component';
import { ClaimsByTokenService } from './claimsByToken.service';
import { ClaimsByTokenRoutingModule } from './claimsByToken-routing.module';
import {ClaimEntityFormatterModule} from '../claim-utils/entityFormatter/claimEntityFormatter.module';
// import{ClaimServiceModule} from '../claim-utils/service/claimsService.module';
//import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
import {SelectModalModule} from '../../utils/modal/selectModal.module';
import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
@ -24,15 +21,12 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule,
DataTableModule,
DataTablesModule,
SharedModule,
ClaimsByTokenRoutingModule,
ClaimEntityFormatterModule,
SelectModalModule,
LoadingModalModule,
PagingModule
// ClaimServiceModule,
//DisplayClaimsModule
],
providers:[

View File

@ -1,19 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LoginGuard} from'../../login/loginGuard.guard';
import { DirectLinkingComponent } from './directLinking.component';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: DirectLinkingComponent, canActivate: [IsRouteEnabled, LoginGuard], data: {
redirect: '/error'
}, canDeactivate: [PreviousRouteRecorder]},
])
]
})
export class DirectLinkingRoutingModule { }

View File

@ -38,7 +38,7 @@
</div-->
<ul uk-accordion>
<ul uk-accordion *ngIf=" ! (linkTo =='result' && show=='claim') ">
<li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title ">
<span class="uk-icon"><svg xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" height="28px" id="my-box" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="28px" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><g> <path d="M480,320v128H32V320h78.859l64.016,96h162.25l64-96H480 M384,32H128L0,288v192h512V288L384,32L384,32z M35.781,288l112-224 h216.438l112,224H384l-64,96H192l-64.016-96H35.781L35.781,288z" fill="#b5b5b5"></path></g> </svg> </span>
@ -113,7 +113,7 @@
<claim-selected-results *ngIf=" linkTo =='result' " title= "Selected Research Results" [results]="results" [bulkMode]=false showSearch = false showAccessRights = true>
</claim-selected-results>
<div class="uk-width-1-1 uk-margin-small-top">
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [inlineEntity] = "inlineResult" [show] = "show"
<claim-insert class="uk-float-right" [contexts]="contexts" [results]="results" [projects]="projects" [inlineEntity] = "inlineResult" [show] = "show"
(showChange)="showChange($event)" ></claim-insert>
</div>
</div>

View File

@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { DirectLinkingComponent } from './directLinking.component';
import { DirectLinkingRoutingModule } from './directLinking-routing.module';
import {SelectedProjectsModule} from '../linking/selected/selectedProjects.module';
import {SelectedContextsModule} from '../linking/selected/selectedContexts.module';
@ -26,7 +25,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
SharedModule,
DirectLinkingRoutingModule,SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule,
SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, ClaimResultSearchFormModule

View File

@ -13,7 +13,7 @@ import {ClaimResult} from '../../claim-utils/claimEntities.class';
selector: 'bulk-claim',
template: `
<div class="uk-animation " style=" ">
<form class=" uk-padding uk-panel uk-background-muted ">
<form class=" uk-padding ">
<div class="uk-clearfix">
<a class="uk-float-right" uk-toggle="target: #uploadInfo; animation: uk-animation-fade"><span class="uk-icon">

View File

@ -1,19 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LoginGuard} from'../../login/loginGuard.guard';
import { LinkingGenericComponent } from './linkingGeneric.component';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: LinkingGenericComponent, canActivate: [IsRouteEnabled, LoginGuard], data: {
redirect: '/error'
}, canDeactivate: [PreviousRouteRecorder]},
])
]
})
export class LinkingRoutingModule { }

View File

@ -1,16 +0,0 @@
// import {Component, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
// import {LinkingGenericComponent} from './linkingGeneric.component';
//
// @Component({
// selector: 'linking',
// template: `
// <linking-generic [bulkMode]=false> </linking-generic>
// `
//
// })
// export class LinkingComponent {
// constructor () {
// }
//
// }

View File

@ -9,7 +9,6 @@ import {LinkingGenericComponent} from './linkingGeneric.component';
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module';
import { LinkingRoutingModule } from './linking-routing.module';
import {StartOverModule} from '../claim-utils/startOver.module';
import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -25,7 +24,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule,
InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, LinkingRoutingModule, StartOverModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],

View File

@ -1,16 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LoginGuard} from'../../login/loginGuard.guard';
import { MyClaimsComponent } from './myClaims.component';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: MyClaimsComponent, canActivate: [IsRouteEnabled, LoginGuard],
data: {redirect: '/error'}, canDeactivate: [PreviousRouteRecorder]}])
]
})
export class MyClaimsRoutingModule { }

View File

@ -2,8 +2,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { MyClaimsComponent } from './myClaims.component';
import { MyClaimsRoutingModule } from './myClaims-routing.module';
// import{ClaimServiceModule} from '../claim-utils/service/claimsService.module';
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -12,14 +10,12 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({
imports: [
SharedModule,
MyClaimsRoutingModule,
// ClaimServiceModule,
DisplayClaimsModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [
MyClaimsComponent
]
], exports: [MyClaimsComponent]
})
export class MyClaimsModule { }

View File

@ -1,51 +0,0 @@
// import {Component, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
// import { Router } from '@angular/router';
//
//
//
// @Component({
// selector: 'my-claims-demo',
// template: `
// <div *ngIf="user" class="container">
// <div class="page-header">
// <h1> My Claims Demo</h1>
// </div>
// <div>
// <div class=""><a routerLink="/Linking">Linking</a></div>
// <div class=""><a routerLink]="/MyClaims">MyClaims</a></div>
// <div class=""><a routerLink="/Claims">Claims Admin</a></div>
// <p> Extra parameters for claims admin</p>
// <div class=""><a href="claims?fetchBy=User&fetchId=amelie.baecker@uni-bielefeld.de">Claims By user</a></div>
// <div class=""><a href="claims?fetchBy=Project&fetchId=corda_______::2c37878a0cede85dbbd1081bb9b4a2f8">Claims By project</a></div>
// <div class=""><a href="claims?fetchBy=Context&fetchId=egi::country::gr">Claims By context</a></div>
//
// <!-- <p>Orcid
// <p>N.M.
// 0000-0002-3477-3082
// </p>
// </p> -->
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>
// <!--<div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>-->
// </div>
// </div>
//
//
//
// `
// //(click)="changeOrderby('target')"
// //od_______908::3a5b2885656a91307156325644e73b92
//
// })
// export class MyClaimsDemoComponent {
// constructor ( private _router: Router ) {
// }
// user:string="argirok@di.uoa.gr";
// ngOnInit() {
//
// }
// goToPub(id: number){
// this._router.navigate( ['Publication', { articleId: id}] );
// }
// }

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" [(searchUtils)] = "searchUtils"
[(results)] = "results" [filteredResults] = "results" [(searchUtils)] = "searchUtils"
[showResultCount]=false
[disableForms]="disableForms"
[searchViewLink]="'/search/entity-registries'"

View File

@ -57,7 +57,7 @@
<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">
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
{{filteredResults.length}}--> {{results.length}} {{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>
@ -80,46 +80,33 @@
</div>
<div class="uk-overflow-container custom-dataTable-content">
<table class="uk-table uk-table-striped divider-table" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]">
<!-- #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">
<thead *ngIf="searchUtils.totalResults > 0">
<thead >
<tr>
<!-- Name Type Country Institution Compatibility -->
<th class="uk-text-left"><mfDefaultSorter by="title.name">Name</mfDefaultSorter>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<th class="uk-text-left">Name
<!--svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg>
</svg-->
</th>
<th class="uk-text-center"><mfDefaultSorter by="type">Type</mfDefaultSorter>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg>
<th class="uk-text-center"> Type
</th>
<th class="uk-text-center"><mfDefaultSorter by="countries">Country</mfDefaultSorter>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg>
<th class="uk-text-center"> Country
</th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByOrganization">Institution</mfDefaultSorter>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg>
<th class="uk-text-center"> Institution
</th>
<th class="uk-text-center"><mfDefaultSorter by="compatibility">Compatibility</mfDefaultSorter>
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<polygon fill="#767779" points="4 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg>
<th class="uk-text-center"> Compatibility
</th>
</tr>
</thead>
<tbody>
<tr class="uk-table-middle" *ngFor="let dataprovider of mf.data">
<tr class="uk-table-middle" *ngFor="let dataprovider of filteredResults">
<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,5 +1,6 @@
import {Component, Input, ViewChild, Output, EventEmitter, ChangeDetectorRef} from '@angular/core';
import {Component, Input, ViewChild, Output, EventEmitter, ViewEncapsulation} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import {Location} from '@angular/common';
import { Filter, Value} from './searchHelperClasses.class';
import {SearchResult} from '../../utils/entities/searchResult';
@ -12,16 +13,24 @@ import{SearchFilterComponent} from './searchFilter.component';
import {SearchFilterModalComponent} from './searchFilterModal.component';
import { ErrorCodes} from '../../utils/properties/openaireProperties';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {ContentProvidersDatatablePipe} from '../../utils/pipes/contentProvidersDatatable.pipe';
import {PiwikService} from '../../utils/piwik/piwik.service';
// import { DataTableDirective } from 'angular-datatables';
@Component({
selector: 'search-page-table',
templateUrl:'searchPageTableView.component.html'
templateUrl:'searchPageTableView.component.html',
styles: [`
#dpTable_info, #dpTable_paginate{
/*display: none;*/
}
`],
encapsulation: ViewEncapsulation.None // this used in order styles to work
})
export class SearchPageTableViewComponent {
@Input() pageTitle = "";
@Input() results;
@Input() filteredResults;
@Input() filters = [];
@Input() type:string = "";
@Input() entityType: string = "";
@ -47,16 +56,24 @@ export class SearchPageTableViewComponent {
public triggerPipe: boolean = false;
public rowsOnPage:number = 10;
@ViewChild('mf') table: any;//DataTable;
// @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, public cd: ChangeDetectorRef) { }
constructor (private location: Location , private _meta: Meta, private _piwikService:PiwikService ) { }
ngOnInit() {
this.dtOptions = {
"paging": true,
"searching": false,
"lengthChange": false,
"pageLength": this.rowsOnPage
};
this.updateTitle(this.pageTitle);
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle);
if(typeof window !== 'undefined') {
@ -65,11 +82,24 @@ 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) {
@ -87,9 +117,14 @@ export class SearchPageTableViewComponent {
}
refreshTable(page:number) {
console.log("refreshTable s");
// if(this.searchUtils.page!=page){
this.searchUtils.page=page;
//this.table.mfActivePage=$event.value;
this.table.setPage(this.searchUtils.page, this.rowsOnPage);
var table = $('#dpTable').DataTable();
table.page( page - 1 ).draw( false );
console.log("refreshTable e");
// }
}
toggleModal($event) {
@ -228,13 +263,15 @@ public getParametersFromUrl(params) {
this.goTo(1, true);
}
goTo(page:number = 1, triggerPipe:boolean = true){
this.filteredResults = this.transform();
this.refreshTable(page);
var urlParameters = this.createUrlParameters(this.filters,true);
this.location.go(location.pathname,urlParameters);
if(triggerPipe) {
this.triggerPipe = !this.triggerPipe;
}
// if(triggerPipe) {
// this.triggerPipe = !this.triggerPipe;
// }
}
filterChanged($event){
@ -269,4 +306,106 @@ public getParametersFromUrl(params) {
return selected;
}
transform(): any {
if(this.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));
let oldTotal = this.searchUtils.totalResults;
this.searchUtils.totalResults = result.length;
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){
this.searchUtils.status = errorCodes.NONE;
}
// if(oldTotal != this.searchUtils.totalResults) {
// args[3].detectChanges();
// }
return result;
}
return [];
}
filterAll(row: any, query: string, filters:Filter[]) {
let returnValue: boolean = false;
if(query) {
if(row.title.name.toLowerCase().indexOf(query) > -1) {
returnValue = true;
}
if(row.type.toLowerCase().indexOf(query) > -1) {
returnValue = true;
}
if(row.countries && row.countries.length > 0) {
for(let country of row.countries) {
if(country.toLowerCase().indexOf(query) > -1) {
returnValue = true;
break;
}
}
}
if(row.compatibility && row.compatibility.toLowerCase().indexOf(query) > -1) {
returnValue = true;
}
if(row.organizations && row.organizations.length > 0) {
for(let organization of row.organizations) {
if(organization.name.toLowerCase().indexOf(query) > -1) {
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){
// make it generic in future commit
let field:string = "";
if(filter.title == "Type") {
field = "type";
} else if(filter.title == "Compatibility Level") {
field = "compatibility";
}
if(row[field] == value.name) {
returnValue = true;
if(filter.filterOperator == "or") {
break;
}
} else {
if(filter.filterOperator == "and") {
return false;
}
returnValue = false;
}
}
}
if(!returnValue) {
return false;
}
}
}
return true;
}
}

View File

@ -6,9 +6,6 @@ import { RouterModule } from '@angular/router';
import{SearchPageTableViewComponent} from './searchPageTableView.component';
import{SearchFormModule} from './searchForm.module';
import{SearchResultsModule} from './searchResults.module';
//import{DatasourceTableViewModule} from './datasourceTableView.module';
//import{SearchFilterComponent} from './searchFilter.component';
//import{SearchFilterModalComponent} from './searchFilterModal.component';
import {SearchFilterModule} from './searchFilter.module';
import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {ReportsServiceModule} from '../../services/reportsService.module';
@ -16,8 +13,7 @@ import{SearchPagingModule} from './searchPaging.module';
import {SearchDownloadModule} from './searchDownload.module';
import {ModalModule} from '../../utils/modal/modal.module';
import {PagingModule} from '../../utils/paging.module';
import {DataTableModule} from "angular2-datatable";
import {ContentProvidersDatatablePipe} from '../../utils/pipes/contentProvidersDatatable.pipe';
import {DataTablesModule} from 'angular-datatables';
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -29,25 +25,17 @@ import {ErrorMessagesModule} from '../../utils/errorMessages.module';
imports: [
CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule,
DataTableModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule
DataTablesModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule
],
declarations: [
SearchPageTableViewComponent//,
//SearchFilterComponent,
//SearchFilterModalComponent
,
ContentProvidersDatatablePipe
SearchPageTableViewComponent
],
providers:[
PreviousRouteRecorder
],
exports: [
SearchPageTableViewComponent//,
//SearchFilterComponent,
//SearchFilterModalComponent
,
ContentProvidersDatatablePipe
SearchPageTableViewComponent
]
})
export class SearchPageTableViewModule { }