diff --git a/app.module.ts b/app.module.ts index d76a6f30..0c1d822d 100755 --- a/app.module.ts +++ b/app.module.ts @@ -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 }, diff --git a/claims/claim.module.ts b/claims/claim.module.ts deleted file mode 100644 index 113e8597..00000000 --- a/claims/claim.module.ts +++ /dev/null @@ -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 { } diff --git a/claims/claimsAdmin/claimsAdmin-routing.module.ts b/claims/claimsAdmin/claimsAdmin-routing.module.ts deleted file mode 100644 index f915d2e9..00000000 --- a/claims/claimsAdmin/claimsAdmin-routing.module.ts +++ /dev/null @@ -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 { } diff --git a/claims/claimsAdmin/claimsAdmin.module.ts b/claims/claimsAdmin/claimsAdmin.module.ts index 947bc901..c55e197c 100644 --- a/claims/claimsAdmin/claimsAdmin.module.ts +++ b/claims/claimsAdmin/claimsAdmin.module.ts @@ -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 { } diff --git a/claims/claimsByToken/claimsByToken-routing.module.ts b/claims/claimsByToken/claimsByToken-routing.module.ts deleted file mode 100644 index 3d50376a..00000000 --- a/claims/claimsByToken/claimsByToken-routing.module.ts +++ /dev/null @@ -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 { } diff --git a/claims/claimsByToken/claimsByToken.component.ts b/claims/claimsByToken/claimsByToken.component.ts index bab35bb1..dc30a911 100644 --- a/claims/claimsByToken/claimsByToken.component.ts +++ b/claims/claimsByToken/claimsByToken.component.ts @@ -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', @@ -44,7 +43,7 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
- Claims Administrator + Claims Administrator @@ -70,14 +69,14 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe'; {{totalPendingResults.count}} pending claims, page {{activePendingPage.page}} of {{totalPages(totalPendingResults.count)}} - +
+ - - - + + + @@ -123,8 +122,8 @@ import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe'; -
Research ResultClaimed ByClaimed Date Research Result Claimed By Claimed Date Approve
+
+ - + - - - - + + + + diff --git a/claims/claimsByToken/claimsByToken.module.ts b/claims/claimsByToken/claimsByToken.module.ts index 9f5827b5..100f6abb 100644 --- a/claims/claimsByToken/claimsByToken.module.ts +++ b/claims/claimsByToken/claimsByToken.module.ts @@ -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:[ diff --git a/claims/directLinking/directLinking-routing.module.ts b/claims/directLinking/directLinking-routing.module.ts deleted file mode 100644 index e9ed1f35..00000000 --- a/claims/directLinking/directLinking-routing.module.ts +++ /dev/null @@ -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 { } diff --git a/claims/directLinking/directLinking.component.html b/claims/directLinking/directLinking.component.html index 5dab8ae8..cf995879 100644 --- a/claims/directLinking/directLinking.component.html +++ b/claims/directLinking/directLinking.component.html @@ -38,7 +38,7 @@ -
Research ResultResearch Result Claimed byClaimed DateCurated byCuration DateClaimed by Claimed Date Curated by Curation Date Approved
+ +
- + - - +
Name - + Name + - Type - - - - + Type + - Country - - - - + Country + - Institution - - - - + Institution - Compatibility - - - - + Compatibility
{ + // 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(); -} + 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) { - this.searchUtils.page=page; - //this.table.mfActivePage=$event.value; - this.table.setPage(this.searchUtils.page, this.rowsOnPage); + 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) { @@ -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; + } } diff --git a/searchPages/searchUtils/searchPageTableView.module.ts b/searchPages/searchUtils/searchPageTableView.module.ts index 2586914e..fc3a1c05 100644 --- a/searchPages/searchUtils/searchPageTableView.module.ts +++ b/searchPages/searchUtils/searchPageTableView.module.ts @@ -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 { }