15 |
15 |
selector: 'claims-project-manager',
|
16 |
16 |
template: `
|
17 |
17 |
|
18 |
|
<!--div class="page-header">
|
19 |
|
<h1> Claims Manager </h1>
|
20 |
|
</div-->
|
21 |
|
|
22 |
18 |
<!--div *ngIf="accessStatus=='empty'" class="uk-margin-top uk-width-medium-2-3 uk-container-center">
|
23 |
19 |
<div class="uk-block uk-block-primary uk-block-large uk-contrast uk-text-center">
|
24 |
20 |
<p class="uk-text-large">Please enter your email and then press 'See Claims' button.</p>
|
... | ... | |
40 |
36 |
</div>
|
41 |
37 |
|
42 |
38 |
<div *ngIf="accessStatus=='valid'">
|
43 |
|
<h1> Pending Claims for project:
|
|
39 |
<h1 class="page-header">
|
44 |
40 |
<a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
|
45 |
41 |
routerLinkActive="router-link-active"
|
46 |
42 |
routerLink="/search/project" >
|
47 |
43 |
{{project['name']}} ({{project['funderName']}})
|
48 |
44 |
</a>
|
49 |
|
</h1>
|
|
45 |
</h1>
|
|
46 |
<h2> Pending Claims</h2>
|
50 |
47 |
|
51 |
48 |
<div *ngIf=" pending_claims && pending_claims.length == 0" >
|
52 |
49 |
<div class = "uk-alert uk-alert-info " >No pending claims found.</div>
|
53 |
50 |
</div>
|
54 |
51 |
|
55 |
52 |
<div class="uk-overflow-container">
|
56 |
|
<table *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped">
|
|
53 |
<!--table *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped">
|
57 |
54 |
<thead>
|
58 |
55 |
<tr>
|
59 |
56 |
<th>Research Result</th>
|
60 |
|
<!--th>Link to</th-->
|
61 |
57 |
<th class="uk-text-center">Claimed by</th>
|
62 |
58 |
<th class="uk-text-center">Claimed Date</th>
|
63 |
59 |
<th class="uk-text-center">Approve</th>
|
... | ... | |
69 |
65 |
<td class="uk-width-1-6 uk-text-center" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
|
70 |
66 |
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
|
71 |
67 |
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
|
72 |
|
<!--td>
|
73 |
|
<label>
|
74 |
|
Yes <input [id]="claim.id" type="checkbox" (click)="selectApprove(claim.id,$event)" [ngModel]="isSelectedRight(claim.id)"/>
|
|
68 |
<td class="uk-width-1-6 uk-text-center">
|
|
69 |
|
|
70 |
<label>
|
|
71 |
Yes <input [id]="claim.id" type="checkbox" (click)="selectApprove(claim.id,$event)" [ngModel]="isSelectedRight(claim.id)"/>
|
75 |
72 |
</label>
|
76 |
73 |
<label>
|
77 |
|
No <input [id]="claim.id" type="checkbox" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isSelectedWrong(claim.id)"/>
|
|
74 |
No <input [id]="claim.id" type="checkbox" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isSelectedWrong(claim.id)"/>
|
78 |
75 |
</label>
|
79 |
|
</td-->
|
|
76 |
</td>
|
|
77 |
</tr>
|
|
78 |
</tbody>
|
|
79 |
</table-->
|
|
80 |
|
|
81 |
<table *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped"
|
|
82 |
[mfData]="pending_claims" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"
|
|
83 |
[(mfSortBy)]="sortByClaimDate" [(mfSortOrder)]="sortOrder">
|
|
84 |
<thead>
|
|
85 |
<tr>
|
|
86 |
<th><mfDefaultSorter [by]="sortByTitle">Research Result</mfDefaultSorter></th>
|
|
87 |
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed By</mfDefaultSorter></th>
|
|
88 |
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate">Claimed Date</mfDefaultSorter></th>
|
|
89 |
<th class="uk-text-center">Approve</th>
|
|
90 |
</tr>
|
|
91 |
</thead>
|
|
92 |
<tbody>
|
|
93 |
<tr class="uk-table-middle" *ngFor="let claim of mf.data">
|
|
94 |
<td class="uk-width-2-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
|
|
95 |
<td class="uk-width-1-6 uk-text-center" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
|
|
96 |
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
|
|
97 |
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
|
80 |
98 |
<td class="uk-width-1-6 uk-text-center">
|
81 |
99 |
|
82 |
100 |
<label>
|
... | ... | |
88 |
106 |
</td>
|
89 |
107 |
</tr>
|
90 |
108 |
</tbody>
|
|
109 |
<tfoot>
|
|
110 |
<tr>
|
|
111 |
<td>
|
|
112 |
<!--mfBootstrapPaginator></mfBootstrapPaginator-->
|
|
113 |
</td>
|
|
114 |
<td></td>
|
|
115 |
<td></td>
|
|
116 |
<td>
|
|
117 |
<paging-no-load [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf, $event)"></paging-no-load>
|
|
118 |
</td>
|
|
119 |
</tr>
|
|
120 |
</tfoot>
|
91 |
121 |
</table>
|
|
122 |
</div>
|
92 |
123 |
|
93 |
|
<h1> Already Curated Claims </h1>
|
|
124 |
<h2> Already Curated Claims</h2>
|
94 |
125 |
|
95 |
126 |
<div *ngIf=" curated_claims && curated_claims.length == 0" >
|
96 |
127 |
<div class = "uk-alert uk-alert-info " >No curated claims found.</div>
|
97 |
128 |
</div>
|
98 |
129 |
|
99 |
130 |
<div class="uk-overflow-container">
|
100 |
|
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped">
|
|
131 |
<!--table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped">
|
101 |
132 |
<thead>
|
102 |
133 |
<tr>
|
103 |
134 |
<th>Research Result</th>
|
104 |
|
<!--th>Link to</th-->
|
105 |
135 |
<th class="uk-text-center">Claimed by</th>
|
106 |
136 |
<th class="uk-text-center">Claimed Date</th>
|
107 |
137 |
<th class="uk-text-center">Curated by</th>
|
... | ... | |
126 |
156 |
<label>
|
127 |
157 |
No <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isWrong(claim)"/>
|
128 |
158 |
</label>
|
|
159 |
</td>
|
|
160 |
</tr>
|
|
161 |
</tbody>
|
|
162 |
</table-->
|
129 |
163 |
|
|
164 |
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped"
|
|
165 |
[mfData]="curated_claims" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"
|
|
166 |
[(mfSortBy)]="sortByCurationDate" [(mfSortOrder)]="sortOrder">
|
|
167 |
<thead>
|
|
168 |
<tr>
|
|
169 |
<th><mfDefaultSorter [by]="sortByTitle">Research Result</mfDefaultSorter></th>
|
|
170 |
<!--th>Link to</th-->
|
|
171 |
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed by</mfDefaultSorter></th>
|
|
172 |
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate">Claimed Date</mfDefaultSorter></th>
|
|
173 |
<th class="uk-text-center"><mfDefaultSorter by="curatedBy">Curated by</mfDefaultSorter></th>
|
|
174 |
<th class="uk-text-center"><mfDefaultSorter [by]="sortByCurationDate">Curation Date</mfDefaultSorter></th>
|
|
175 |
<th class="uk-text-center">Approved</th>
|
|
176 |
</tr>
|
|
177 |
</thead>
|
|
178 |
<tbody>
|
|
179 |
<tr class="uk-table-middle" *ngFor="let claim of mf.data let i=index">
|
|
180 |
<td class="uk-width-1-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
|
|
181 |
<td class="uk-width-1-6" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
|
|
182 |
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
|
|
183 |
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
|
|
184 |
<td class="uk-width-1-6 uk-text-center">{{claim.curatedBy}}</td>
|
|
185 |
<td class="uk-width-1-6 uk-text-center">{{claim.curationDate}}</td>
|
|
186 |
<td class="uk-width-1-6 uk-text-center">
|
|
187 |
|
|
188 |
<label>
|
|
189 |
Yes <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isRight(claim)"/>
|
|
190 |
</label>
|
|
191 |
|
|
192 |
<label>
|
|
193 |
No <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isWrong(claim)"/>
|
|
194 |
</label>
|
|
195 |
|
130 |
196 |
</td>
|
131 |
197 |
<!--td><input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isWrong(claim)"/></td-->
|
132 |
198 |
<!--td><button class="uk-button" (click)="editable.add(i)">Edit</button></td-->
|
133 |
199 |
</tr>
|
134 |
200 |
</tbody>
|
|
201 |
<tfoot>
|
|
202 |
<tr>
|
|
203 |
<td>
|
|
204 |
<!--mfBootstrapPaginator></mfBootstrapPaginator-->
|
|
205 |
</td>
|
|
206 |
<td></td>
|
|
207 |
<td></td>
|
|
208 |
<td></td>
|
|
209 |
<td></td>
|
|
210 |
<td>
|
|
211 |
<paging-no-load [currentPage]="1" [totalResults]="curated_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf, $event)"> </paging-no-load>
|
|
212 |
</td>
|
|
213 |
</tr>
|
|
214 |
</tfoot>
|
135 |
215 |
</table>
|
136 |
216 |
|
|
217 |
</div>
|
137 |
218 |
|
138 |
219 |
<div class="uk-text-small uk-text-right">*Note that claims you did not approved or disapproved are considered as right (but not curated)</div>
|
139 |
220 |
<button class="uk-button uk-button-success uk-float-right" type="button" (click)="saveChanges()">Save Changes</button>
|
... | ... | |
160 |
241 |
// when 'empty' show form to fill email, when 'valid' show proper claims, when 'invalid' show no matched entry-wanna retry
|
161 |
242 |
public accessStatus: string;// = "empty";
|
162 |
243 |
|
|
244 |
public rowsOnPage = 5;
|
|
245 |
public sortOrder = "desc";
|
|
246 |
|
|
247 |
|
163 |
248 |
@ViewChild (ModalSelect) selectModal : ModalSelect;
|
164 |
249 |
@ViewChild (ModalLoading) loading : ModalLoading ;
|
165 |
250 |
|
... | ... | |
182 |
267 |
);
|
183 |
268 |
}
|
184 |
269 |
|
|
270 |
refreshTable(mf:any, $event:any) {
|
|
271 |
mf.mfActivePage=$event.value;
|
|
272 |
mf.setPage(mf.mfActivePage, this.rowsOnPage);
|
|
273 |
}
|
|
274 |
|
|
275 |
public sortByClaimDate = (claim: any) => {
|
|
276 |
return new Date(claim.date);
|
|
277 |
}
|
|
278 |
|
|
279 |
public sortByCurationDate = (claim: any) => {
|
|
280 |
return new Date(claim.curationDate);
|
|
281 |
}
|
|
282 |
|
|
283 |
public sortByTitle = (claim: any) => {
|
|
284 |
if(claim.targetType != 'project') {
|
|
285 |
return claim.target.title;
|
|
286 |
} else {
|
|
287 |
return claim.source.title;
|
|
288 |
}
|
|
289 |
}
|
|
290 |
|
185 |
291 |
validateJWTandToken() {
|
186 |
292 |
var jwtToken=Session.getUserJwt();
|
187 |
293 |
if(this.token) {
|
claimsByToken page: claims displayed as datatables (https://www.npmjs.com/package/angular2-datatable)