claimsByToken: 'token' is not used anymore for claims. Instead it is used 'projectId'.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@53230 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-09-24 10:01:05 +00:00
parent c946e668f1
commit 5fe8c67e43
3 changed files with 12 additions and 9 deletions

View File

@ -12,7 +12,7 @@
<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 *ngIf="project" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
routerLinkActive="router-link-active" routerLinkActive="router-link-active"
routerLink="/search/project" > routerLink="/search/project" >
{{project['name']}} ({{project['funderName']}}) {{project['name']}} ({{project['funderName']}})
@ -83,7 +83,7 @@
<div *ngIf="(selectedWrong_PendingMode.size+selectedRight_PendingMode.size) > 0" class="uk-alert-primary" uk-alert> <div *ngIf="(selectedWrong_PendingMode.size+selectedRight_PendingMode.size) > 0" class="uk-alert-primary" uk-alert>
You have selected <span class="uk-badge">{{(selectedWrong_PendingMode.size+selectedRight_PendingMode.size)}}</span> claim(s) to curate You have selected <span class="uk-badge">{{(selectedWrong_PendingMode.size+selectedRight_PendingMode.size)}}</span> claim(s) to curate
</div> </div>
<div class="uk-float-right"> <div *ngIf="totalPendingResults.count > 0" class="uk-float-right">
<button (click)="clearCheckboxes()" [class]="((selectedWrong_PendingMode.size+selectedRight_PendingMode.size) == 0) ? 'uk-button uk-disabled' : 'uk-button'">Reset</button> <button (click)="clearCheckboxes()" [class]="((selectedWrong_PendingMode.size+selectedRight_PendingMode.size) == 0) ? 'uk-button uk-disabled' : 'uk-button'">Reset</button>
<span title="Approve or dissaprove at least one claim" <span title="Approve or dissaprove at least one claim"

View File

@ -34,7 +34,7 @@ import {ClaimsByTokenService} from './claimsByToken.service';
}) })
export class ClaimsByTokenComponent { export class ClaimsByTokenComponent {
public token: string = ""; public openaireId: string = "";
public sub: any; public sub: any;
public project: any; public project: any;
private claims:any = []; private claims:any = [];
@ -97,7 +97,7 @@ export class ClaimsByTokenComponent {
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.mode = "pending"; this.mode = "pending";
this.token = params['token']; this.openaireId = params['openaireId'];
this.selectedRight_PendingMode = new Set<string>(); this.selectedRight_PendingMode = new Set<string>();
this.selectedWrong_PendingMode = new Set<string>(); this.selectedWrong_PendingMode = new Set<string>();
this.selectedRight_CuratedMode = new Set<string>(); this.selectedRight_CuratedMode = new Set<string>();
@ -253,7 +253,7 @@ refreshTable(page:number, whichTable: string) {
validateJWTandToken() { validateJWTandToken() {
if(this.token) { if(this.openaireId) {
this.pending_status = this.errorCodes.LOADING; this.pending_status = this.errorCodes.LOADING;
this.curated_status = this.errorCodes.LOADING; this.curated_status = this.errorCodes.LOADING;
@ -266,7 +266,7 @@ refreshTable(page:number, whichTable: string) {
this.activeCuratedPage.page = 1; this.activeCuratedPage.page = 1;
this.totalCuratedResults.count = 0; this.totalCuratedResults.count = 0;
this.claimsByTokenService.getClaims(this.token, this.properties.claimsAPIURL).subscribe( this.claimsByTokenService.getClaims(this.openaireId, this.properties.claimsAPIURL).subscribe(
data => { data => {
//this.closeLoading(); //this.closeLoading();
this.accessStatus = "valid"; this.accessStatus = "valid";
@ -288,7 +288,9 @@ refreshTable(page:number, whichTable: string) {
this.totalPendingResults.count = this.pending_claims.length; this.totalPendingResults.count = this.pending_claims.length;
this.totalCuratedResults.count = this.curated_claims.length; this.totalCuratedResults.count = this.curated_claims.length;
if(this.project) {
this.updateTitle("Claims For Project Managers - "+this.project.name); this.updateTitle("Claims For Project Managers - "+this.project.name);
}
this.showTables = true; this.showTables = true;
if(!this.triggered) { if(!this.triggered) {

View File

@ -11,10 +11,11 @@ export class ClaimsByTokenService {
constructor(private http: Http ) {} constructor(private http: Http ) {}
getClaims(token: string, apiURL:string):any { getClaims(openaireId: string, apiURL:string):any {
console.info("getClaims in service"); console.info("getClaims in service");
let url = apiURL+"project/claims?projectToken="+token; //let url = apiURL+"project/claims?projectToken="+token;
let url = apiURL+"projects/"+openaireId+"/all_claims";
let key = url; let key = url;