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 {EntityRegistriesModule} from './searchPages/dataProviders/entityRegistries.module';
import {SearchEntityRegistriesComponent} from './searchPages/dataProviders/entityRegistries.component'; 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 {CompatibleDataProvidersModule} from './searchPages/dataProviders/compatibleDataProviders.module';
import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProviders/compatibleDataProviders.component'; 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({ @NgModule({
imports: [ imports: [
@ -88,7 +102,8 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule, SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule,
AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule, AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule,
PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule, PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule,
EntityRegistriesModule,CompatibleDataProvidersModule, EntityRegistriesModule, EntityRegistriesTableModule, CompatibleDataProvidersModule,
ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule,
BrowserModule.withServerTransition({appId: 'my-app'}), BrowserModule.withServerTransition({appId: 'my-app'}),
RouterModule.forRoot([ RouterModule.forRoot([
{ path: '', component: SearchComponent}, { path: '', component: SearchComponent},
@ -114,7 +129,7 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
{ path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent}, { path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent},
{ path: 'search/content-providers-table', loadChildren: './searchPages/dataProviders/compatibleDataProvidersTable.module#CompatibleDataProvidersTableModule' }, { path: 'search/content-providers-table', loadChildren: './searchPages/dataProviders/compatibleDataProvidersTable.module#CompatibleDataProvidersTableModule' },
{ path: 'search/entity-registries',component: SearchEntityRegistriesComponent}, { 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', loadChildren: './searchPages/dataProviders/journals.module#JournalsModule' },
{ path: 'search/journals-table', loadChildren: './searchPages/dataProviders/journalsTable.module#JournalsTableModule' }, { path: 'search/journals-table', loadChildren: './searchPages/dataProviders/journalsTable.module#JournalsTableModule' },
{ path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent }, { path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent },
@ -124,11 +139,11 @@ import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProvider
{ path: 'search/advanced/dataproviders', component: AdvancedSearchPublicationsComponent }, { path: 'search/advanced/dataproviders', component: AdvancedSearchPublicationsComponent },
{ path: 'search/advanced/projects', component: AdvancedSearchPublicationsComponent }, { path: 'search/advanced/projects', component: AdvancedSearchPublicationsComponent },
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/htmlProjectReport.module#HtmlProjectReportModule' }, { path: 'project-report', loadChildren: './landingPages/htmlProjectReport/htmlProjectReport.module#HtmlProjectReportModule' },
{ path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#MyClaimsModule' }, { path: 'myclaims',component: MyClaimsComponent },
{ path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#ClaimsAdminModule' }, { path: 'claims', component: ClaimsAdminComponent },
{ path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LinkingGenericModule' }, { path: 'participate/claim', component: LinkingGenericComponent},
{ path: 'participate/direct-claim', loadChildren: './claims/directLinking/directLinking.module#DirectLinkingModule' }, { path: 'participate/direct-claim',component: DirectLinkingComponent},
{ path: 'claims-project-manager', loadChildren: './claims/claimsByToken/claimsByToken.module#ClaimsByTokenModule' }, { path: 'claims-project-manager', component: ClaimsByTokenComponent },
{ path: 'reload', loadChildren: './reload/reload.module#ReloadModule' }, { path: 'reload', loadChildren: './reload/reload.module#ReloadModule' },
{ path: 'user-info', loadChildren: './login/user.module#UserModule' }, { path: 'user-info', loadChildren: './login/user.module#UserModule' },
{ path: 'error', component: ErrorPageComponent }, { 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 { SharedModule } from '../../shared/shared.module';
import { ClaimsAdminComponent } from './claimsAdmin.component'; 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 {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
import { AdminLoginGuard} from'../../login/adminLoginGuard.guard'; import { AdminLoginGuard} from'../../login/adminLoginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -12,14 +10,13 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
ClaimsAdminRoutingModule,
// ClaimServiceModule,
DisplayClaimsModule DisplayClaimsModule
], ],
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled], providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled],
declarations: [ declarations: [
ClaimsAdminComponent ClaimsAdminComponent
] ],
exports:[ClaimsAdminComponent]
}) })
export class ClaimsAdminModule { } 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 {RouterHelper} from '../../utils/routerHelper.class';
import { Meta} from '../../../angular2-meta'; import { Meta} from '../../../angular2-meta';
import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe'; import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
import { DataTableDirective } from 'angular-datatables';
//import {DataTable} from "angular2-datatable";
@Component({ @Component({
selector: 'claims-project-manager', selector: 'claims-project-manager',
@ -44,7 +43,7 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
<div *ngIf="accessStatus=='valid'"> <div *ngIf="accessStatus=='valid'">
<div class="uk-article-title custom-article-title"> <div class="uk-article-title custom-article-title">
Claims Administrator Claims Administrator
<a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" <a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
routerLinkActive="router-link-active" routerLinkActive="router-link-active"
routerLink="/search/project" > routerLink="/search/project" >
@ -70,14 +69,14 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
{{totalPendingResults.count}} pending claims, page {{activePendingPage.page}} of {{totalPages(totalPendingResults.count)}} {{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> <paging-no-load class="uk-float-right" [currentPage]="activePendingPage.page" [totalResults]="totalPendingResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table1, $event, 'pending')"></paging-no-load>
</span> </span>
<table #filtered1 *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped" <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"> <!--[mfData]="pending_claims | claimsDatatable : [filterQuery, totalPendingResults, activePendingPage]" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
<!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"--> <!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"-->
<thead> <thead>
<tr> <tr>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th> <th> Research Result </th>
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed By</mfDefaultSorter></th> <th class="uk-text-center">Claimed By </th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate1">Claimed Date</mfDefaultSorter></th> <th class="uk-text-center">Claimed Date </th>
<th class="uk-text-center">Approve</th> <th class="uk-text-center">Approve</th>
</tr> </tr>
</thead> </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> <paging-no-load class="uk-float-right" [currentPage]="activeCuratedPage.page" [totalResults]="totalCuratedResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table2, $event, 'curated')"> </paging-no-load>
</span> </span>
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped" <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"> <!--[mfData]="curated_claims | claimsDatatable : [filterQuery2, totalCuratedResults, activeCuratedPage]" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
<!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"--> <!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"-->
<thead> <thead>
<!--tr> <!--tr>
@ -141,12 +140,12 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
</td> </td>
</tr--> </tr-->
<tr> <tr>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th> <th>Research Result</th>
<!--th>Link to</th--> <!--th>Link to</th-->
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed by</mfDefaultSorter></th> <th class="uk-text-center">Claimed by </th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate2">Claimed Date</mfDefaultSorter></th> <th class="uk-text-center">Claimed Date </th>
<th class="uk-text-center"><mfDefaultSorter by="curatedBy">Curated by</mfDefaultSorter></th> <th class="uk-text-center">Curated by </th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByCurationDate2">Curation Date</mfDefaultSorter></th> <th class="uk-text-center">Curation Date </th>
<th class="uk-text-center">Approved</th> <th class="uk-text-center">Approved</th>
</tr> </tr>
</thead> </thead>

View File

@ -1,15 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import {DataTableModule} from "angular2-datatable"; import {DataTablesModule} from 'angular-datatables';
import { SharedModule } from '../../shared/shared.module'; import { SharedModule } from '../../shared/shared.module';
import { ClaimsByTokenComponent } from './claimsByToken.component'; import { ClaimsByTokenComponent } from './claimsByToken.component';
import { ClaimsByTokenService } from './claimsByToken.service'; import { ClaimsByTokenService } from './claimsByToken.service';
import { ClaimsByTokenRoutingModule } from './claimsByToken-routing.module';
import {ClaimEntityFormatterModule} from '../claim-utils/entityFormatter/claimEntityFormatter.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 {SelectModalModule} from '../../utils/modal/selectModal.module';
import {LoadingModalModule} from '../../utils/modal/loadingModal.module'; import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
@ -24,15 +21,12 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule, RouterModule,
DataTableModule, DataTablesModule,
SharedModule, SharedModule,
ClaimsByTokenRoutingModule,
ClaimEntityFormatterModule, ClaimEntityFormatterModule,
SelectModalModule, SelectModalModule,
LoadingModalModule, LoadingModalModule,
PagingModule PagingModule
// ClaimServiceModule,
//DisplayClaimsModule
], ],
providers:[ 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--> </div-->
<ul uk-accordion> <ul uk-accordion *ngIf=" ! (linkTo =='result' && show=='claim') ">
<li> <li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title "> <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> <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 *ngIf=" linkTo =='result' " title= "Selected Research Results" [results]="results" [bulkMode]=false showSearch = false showAccessRights = true>
</claim-selected-results> </claim-selected-results>
<div class="uk-width-1-1 uk-margin-small-top"> <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> (showChange)="showChange($event)" ></claim-insert>
</div> </div>
</div> </div>

View File

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

View File

@ -13,7 +13,7 @@ import {ClaimResult} from '../../claim-utils/claimEntities.class';
selector: 'bulk-claim', selector: 'bulk-claim',
template: ` template: `
<div class="uk-animation " style=" "> <div class="uk-animation " style=" ">
<form class=" uk-padding uk-panel uk-background-muted "> <form class=" uk-padding ">
<div class="uk-clearfix"> <div class="uk-clearfix">
<a class="uk-float-right" uk-toggle="target: #uploadInfo; animation: uk-animation-fade"><span class="uk-icon"> <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 {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module'; import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module'; import {DatasetsServiceModule} from '../../services/datasetsService.module';
import { LinkingRoutingModule } from './linking-routing.module';
import {StartOverModule} from '../claim-utils/startOver.module'; import {StartOverModule} from '../claim-utils/startOver.module';
import {LoginGuard} from'../../login/loginGuard.guard'; import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -25,7 +24,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
SharedModule, SelectedProjectsModule, SelectedContextsModule, SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule, SelectedPublicationsModule,
InsertClaimsModule, InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, LinkingRoutingModule, StartOverModule, EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule
], ],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], 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 { SharedModule } from '../../shared/shared.module';
import { MyClaimsComponent } from './myClaims.component'; 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 {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module';
import {LoginGuard} from'../../login/loginGuard.guard'; import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -12,14 +10,12 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
MyClaimsRoutingModule,
// ClaimServiceModule,
DisplayClaimsModule DisplayClaimsModule
], ],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [ declarations: [
MyClaimsComponent MyClaimsComponent
] ], exports: [MyClaimsComponent]
}) })
export class MyClaimsModule { } 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" <search-page-table pageTitle="Registries/ Databases"
type="content providers" entityType="dataprovider" [(filters)] = "filters" type="content providers" entityType="dataprovider" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [(results)] = "results" [filteredResults] = "results" [(searchUtils)] = "searchUtils"
[showResultCount]=false [showResultCount]=false
[disableForms]="disableForms" [disableForms]="disableForms"
[searchViewLink]="'/search/entity-registries'" [searchViewLink]="'/search/entity-registries'"

View File

@ -57,7 +57,7 @@
<div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom"> <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"> <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"> <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>
<span class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m"> <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> <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>
<div class="uk-overflow-container custom-dataTable-content"> <div class="uk-overflow-container custom-dataTable-content">
<table class="uk-table uk-table-striped divider-table" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" <!-- #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]"> [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> <tr>
<!-- Name Type Country Institution Compatibility --> <!-- Name Type Country Institution Compatibility -->
<th class="uk-text-left"><mfDefaultSorter by="title.name">Name</mfDefaultSorter> <th class="uk-text-left">Name
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <!--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 1 1 6 7 6"></polygon>
<polygon fill="#767779" points="4 13 1 8 7 8"></polygon> <polygon fill="#767779" points="4 13 1 8 7 8"></polygon>
</svg> </svg-->
</th> </th>
<th class="uk-text-center"><mfDefaultSorter by="type">Type</mfDefaultSorter> <th class="uk-text-center"> Type
<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> </th>
<th class="uk-text-center"><mfDefaultSorter by="countries">Country</mfDefaultSorter> <th class="uk-text-center"> Country
<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> </th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByOrganization">Institution</mfDefaultSorter> <th class="uk-text-center"> Institution
<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> </th>
<th class="uk-text-center"><mfDefaultSorter by="compatibility">Compatibility</mfDefaultSorter> <th class="uk-text-center"> Compatibility
<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> </th>
</tr> </tr>
</thead> </thead>
<tbody> <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"> <td class="uk-width-1-5 uk-text-left">
<a [queryParams]="{datasourceId: dataprovider.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> <a [queryParams]="{datasourceId: dataprovider.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
<span *ngIf="dataprovider.title.name" <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 {Observable} from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import { Filter, Value} from './searchHelperClasses.class'; import { Filter, Value} from './searchHelperClasses.class';
import {SearchResult} from '../../utils/entities/searchResult'; import {SearchResult} from '../../utils/entities/searchResult';
@ -12,16 +13,24 @@ import{SearchFilterComponent} from './searchFilter.component';
import {SearchFilterModalComponent} from './searchFilterModal.component'; import {SearchFilterModalComponent} from './searchFilterModal.component';
import { ErrorCodes} from '../../utils/properties/openaireProperties'; import { ErrorCodes} from '../../utils/properties/openaireProperties';
import {OpenaireProperties} 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 {PiwikService} from '../../utils/piwik/piwik.service';
// import { DataTableDirective } from 'angular-datatables';
@Component({ @Component({
selector: 'search-page-table', 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 { export class SearchPageTableViewComponent {
@Input() pageTitle = ""; @Input() pageTitle = "";
@Input() results; @Input() results;
@Input() filteredResults;
@Input() filters = []; @Input() filters = [];
@Input() type:string = ""; @Input() type:string = "";
@Input() entityType: string = ""; @Input() entityType: string = "";
@ -47,16 +56,24 @@ export class SearchPageTableViewComponent {
public triggerPipe: boolean = false; public triggerPipe: boolean = false;
public rowsOnPage:number = 10; public rowsOnPage:number = 10;
@ViewChild('mf') table: any;//DataTable; // @ViewChild('mf') table: any;//DataTable;
@ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ; @ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ;
public currentFilter: Filter; public currentFilter: Filter;
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
piwiksub: any; 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() { ngOnInit() {
this.dtOptions = {
"paging": true,
"searching": false,
"lengthChange": false,
"pageLength": this.rowsOnPage
};
this.updateTitle(this.pageTitle); this.updateTitle(this.pageTitle);
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle); this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle);
if(typeof window !== 'undefined') { if(typeof window !== 'undefined') {
@ -65,11 +82,24 @@ export class SearchPageTableViewComponent {
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){ if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.pageTitle).subscribe(); 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() { ngOnDestroy() {
if(this.piwiksub){ if(this.piwiksub){
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
}
public createData(){
} }
public sortByOrganization = (dataprovider: any) => { public sortByOrganization = (dataprovider: any) => {
if(dataprovider.organizations && dataprovider.organizations.length > 0) { if(dataprovider.organizations && dataprovider.organizations.length > 0) {
@ -87,9 +117,14 @@ export class SearchPageTableViewComponent {
} }
refreshTable(page:number) { refreshTable(page:number) {
this.searchUtils.page=page; console.log("refreshTable s");
//this.table.mfActivePage=$event.value; // if(this.searchUtils.page!=page){
this.table.setPage(this.searchUtils.page, this.rowsOnPage); this.searchUtils.page=page;
var table = $('#dpTable').DataTable();
table.page( page - 1 ).draw( false );
console.log("refreshTable e");
// }
} }
toggleModal($event) { toggleModal($event) {
@ -228,13 +263,15 @@ public getParametersFromUrl(params) {
this.goTo(1, true); this.goTo(1, true);
} }
goTo(page:number = 1, triggerPipe:boolean = true){ goTo(page:number = 1, triggerPipe:boolean = true){
this.filteredResults = this.transform();
this.refreshTable(page); this.refreshTable(page);
var urlParameters = this.createUrlParameters(this.filters,true); var urlParameters = this.createUrlParameters(this.filters,true);
this.location.go(location.pathname,urlParameters); this.location.go(location.pathname,urlParameters);
if(triggerPipe) { // if(triggerPipe) {
this.triggerPipe = !this.triggerPipe; // this.triggerPipe = !this.triggerPipe;
} // }
} }
filterChanged($event){ filterChanged($event){
@ -269,4 +306,106 @@ public getParametersFromUrl(params) {
return selected; 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{SearchPageTableViewComponent} from './searchPageTableView.component';
import{SearchFormModule} from './searchForm.module'; import{SearchFormModule} from './searchForm.module';
import{SearchResultsModule} from './searchResults.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 {SearchFilterModule} from './searchFilter.module';
import{LoadingModalModule} from '../../utils/modal/loadingModal.module'; import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {ReportsServiceModule} from '../../services/reportsService.module'; import {ReportsServiceModule} from '../../services/reportsService.module';
@ -16,8 +13,7 @@ import{SearchPagingModule} from './searchPaging.module';
import {SearchDownloadModule} from './searchDownload.module'; import {SearchDownloadModule} from './searchDownload.module';
import {ModalModule} from '../../utils/modal/modal.module'; import {ModalModule} from '../../utils/modal/modal.module';
import {PagingModule} from '../../utils/paging.module'; import {PagingModule} from '../../utils/paging.module';
import {DataTableModule} from "angular2-datatable"; import {DataTablesModule} from 'angular-datatables';
import {ContentProvidersDatatablePipe} from '../../utils/pipes/contentProvidersDatatable.pipe';
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -29,25 +25,17 @@ import {ErrorMessagesModule} from '../../utils/errorMessages.module';
imports: [ imports: [
CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule,
DataTableModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule DataTablesModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule
], ],
declarations: [ declarations: [
SearchPageTableViewComponent//, SearchPageTableViewComponent
//SearchFilterComponent,
//SearchFilterModalComponent
,
ContentProvidersDatatablePipe
], ],
providers:[ providers:[
PreviousRouteRecorder PreviousRouteRecorder
], ],
exports: [ exports: [
SearchPageTableViewComponent//, SearchPageTableViewComponent
//SearchFilterComponent,
//SearchFilterModalComponent
,
ContentProvidersDatatablePipe
] ]
}) })
export class SearchPageTableViewModule { } export class SearchPageTableViewModule { }