diff --git a/portal-2/package.json b/portal-2/package.json
index 06548ad4..8d54ace0 100644
--- a/portal-2/package.json
+++ b/portal-2/package.json
@@ -53,6 +53,7 @@
"@angularclass/bootloader": "~1.0.1",
"@angularclass/idle-preload": "~1.0.4",
"@types/clipboard": "^1.5.31",
+ "angular2-datatable": "^0.6.0",
"angular2-express-engine": "~2.1.0-rc.1",
"angular2-platform-node": "~2.1.0-rc.1",
"angular2-universal": "~2.1.0-rc.1",
diff --git a/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts b/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts
index cde79125..13de793f 100644
--- a/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts
+++ b/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts
@@ -15,10 +15,6 @@ import {RouterHelper} from '../../utils/routerHelper.class';
selector: 'claims-project-manager',
template: `
-
-
Claimed by |
Claimed Date |
Approve |
@@ -69,14 +65,6 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
{{claim.userMail}} |
{{claim.date}} |
-
|
-
+
- Already Curated Claims
+
+
+
+ Already Curated Claims
-
0" class="uk-table uk-table-striped">
+
Claimed by |
Claimed Date |
Curated by |
@@ -111,6 +141,42 @@ import {RouterHelper} from '../../utils/routerHelper.class';
+ |
+ |
+ {{claim.userMail}} |
+ {{claim.date}} |
+ {{claim.curatedBy}} |
+ {{claim.curationDate}} |
+
+
+
+
+
+ |
+
+
+
+
+ 0" class="uk-table uk-table-striped"
+ [mfData]="curated_claims" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"
+ [(mfSortBy)]="sortByCurationDate" [(mfSortOrder)]="sortOrder">
+
+
+ Research Result |
+
+ Claimed by |
+ Claimed Date |
+ Curated by |
+ Curation Date |
+ Approved |
+
+
+
+
|
|
{{claim.userMail}} |
@@ -132,8 +198,23 @@ import {RouterHelper} from '../../utils/routerHelper.class';
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+ |
+
+
+
*Note that claims you did not approved or disapproved are considered as right (but not curated)
@@ -160,6 +241,10 @@ export class ClaimsByTokenComponent {
// when 'empty' show form to fill email, when 'valid' show proper claims, when 'invalid' show no matched entry-wanna retry
public accessStatus: string;// = "empty";
+ public rowsOnPage = 5;
+ public sortOrder = "desc";
+
+
@ViewChild (ModalSelect) selectModal : ModalSelect;
@ViewChild (ModalLoading) loading : ModalLoading ;
@@ -182,6 +267,27 @@ export class ClaimsByTokenComponent {
);
}
+refreshTable(mf:any, $event:any) {
+ mf.mfActivePage=$event.value;
+ mf.setPage(mf.mfActivePage, this.rowsOnPage);
+}
+
+public sortByClaimDate = (claim: any) => {
+ return new Date(claim.date);
+}
+
+public sortByCurationDate = (claim: any) => {
+ return new Date(claim.curationDate);
+}
+
+public sortByTitle = (claim: any) => {
+ if(claim.targetType != 'project') {
+ return claim.target.title;
+ } else {
+ return claim.source.title;
+ }
+}
+
validateJWTandToken() {
var jwtToken=Session.getUserJwt();
if(this.token) {
diff --git a/portal-2/src/app/claims/claimsByToken/claimsByToken.module.ts b/portal-2/src/app/claims/claimsByToken/claimsByToken.module.ts
index a9e68591..f91537ee 100644
--- a/portal-2/src/app/claims/claimsByToken/claimsByToken.module.ts
+++ b/portal-2/src/app/claims/claimsByToken/claimsByToken.module.ts
@@ -1,6 +1,8 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
+import {DataTableModule} from "angular2-datatable";
+
import { SharedModule } from '../../shared/shared.module';
import { ClaimsByTokenComponent } from './claimsByToken.component';
import { ClaimsByTokenService } from './claimsByToken.service';
@@ -13,14 +15,18 @@ import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {LoginGuard} from'../../login/loginGuard.guard';
+import {PagingModule} from '../../utils/paging.module';
+
@NgModule({
imports: [
RouterModule,
+ DataTableModule,
SharedModule,
ClaimsByTokenRoutingModule,
ClaimEntityFormatterModule,
SelectModalModule,
- LoadingModalModule
+ LoadingModalModule,
+ PagingModule
// ClaimServiceModule,
//DisplayClaimsModule
diff --git a/portal-2/src/app/claims/claimsByToken/claimsByToken.service.ts b/portal-2/src/app/claims/claimsByToken/claimsByToken.service.ts
index d38a7c96..c5295fc8 100644
--- a/portal-2/src/app/claims/claimsByToken/claimsByToken.service.ts
+++ b/portal-2/src/app/claims/claimsByToken/claimsByToken.service.ts
@@ -13,18 +13,18 @@ export class ClaimsByTokenService {
getClaims(token: string, jwtToken: string):any {
console.info("getClaims in service");
- let url = OpenaireProperties.getClaimsAPIURL()+"projects/corda__h2020::94c962e736df90a5075a7f660ba3d7f6/claims"
- +"?&token="+jwtToken;
+ let url = OpenaireProperties.getClaimsAPIURL()+"project/claims?token="+jwtToken+"&projectToken="+token;
+
let key = url;
- if (this._cache.has(key)) {
- return Observable.of(this._cache.get(key));
- }
+ //if (this._cache.has(key)) {
+ // return Observable.of(this._cache.get(key));
+ //}
return this.http.get(url)
//.map(res => res.text())
- .map(request => request.json())
- .do(res => {
- this._cache.set(key, res);
- });
+ .map(request => request.json());
+ //.do(res => {
+ // this._cache.set(key, res);
+ //});
}