Revision 47314
Added by Konstantina Galouni almost 7 years ago
claimsByToken.component.ts | ||
---|---|---|
10 | 10 |
import {Session} from '../../login/utils/helper.class'; |
11 | 11 |
|
12 | 12 |
import {RouterHelper} from '../../utils/routerHelper.class'; |
13 |
import { Meta} from '../../../angular2-meta'; |
|
14 |
//import {DataTable} from "angular2-datatable"; |
|
13 | 15 |
|
14 | 16 |
@Component({ |
15 | 17 |
selector: 'claims-project-manager', |
... | ... | |
84 | 86 |
<thead> |
85 | 87 |
<tr> |
86 | 88 |
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th> |
87 |
<th class="uk-text-center"><mfDefaultSorter by="claim1.userMail">Claimed By</mfDefaultSorter></th>
|
|
89 |
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed By</mfDefaultSorter></th> |
|
88 | 90 |
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate1">Claimed Date</mfDefaultSorter></th> |
89 | 91 |
<th class="uk-text-center">Approve</th> |
90 | 92 |
</tr> |
91 | 93 |
</thead> |
92 | 94 |
<tbody> |
93 | 95 |
<tr class="uk-table-middle" *ngFor="let claim1 of mf1.data"> |
94 |
<td class="uk-width-2-6" *ngIf="claim1.targetType != 'project'"><claim-entity [entity]="claim1.target" [type]="claim1.targetType" > </claim-entity></td>
|
|
95 |
<td class="uk-width-1-6 uk-text-center" *ngIf="claim1.sourceType != 'project'"><claim-entity [entity]="claim1.source" [type]="claim1.sourceType" > </claim-entity></td>
|
|
96 |
<td class="uk-width-1-6 uk-text-center">{{claim1.userMail}}</td>
|
|
97 |
<td class="uk-width-1-6 uk-text-center">{{claim1.date}}</td>
|
|
98 |
<td class="uk-width-1-6 uk-text-center">
|
|
96 |
<td class="uk-width-2-5" *ngIf="claim1.targetType != 'project'"><claim-entity [entity]="claim1.target" [type]="claim1.targetType" > </claim-entity></td>
|
|
97 |
<td class="uk-width-2-5 uk-text-center" *ngIf="claim1.sourceType != 'project'"><claim-entity [entity]="claim1.source" [type]="claim1.sourceType" > </claim-entity></td>
|
|
98 |
<td class="uk-width-1-5 uk-text-center">{{claim1.userMail}}</td>
|
|
99 |
<td class="uk-width-1-5 uk-text-center">{{claim1.date}}</td>
|
|
100 |
<td class="uk-width-1-5 uk-text-center">
|
|
99 | 101 |
|
100 |
<label> |
|
102 |
<label>
|
|
101 | 103 |
Yes <input [id]="claim1.id" type="checkbox" (click)="selectApprove(claim1.id,$event)" [ngModel]="isSelectedRight(claim1.id)"/> |
102 | 104 |
</label> |
103 | 105 |
<label> |
... | ... | |
106 | 108 |
</td> |
107 | 109 |
</tr> |
108 | 110 |
</tbody> |
109 |
<tfoot>
|
|
110 |
<div> |
|
111 |
<paging-no-load [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf1, $event)"></paging-no-load>
|
|
112 |
</div>
|
|
111 |
<!--paging-no-load [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" ></paging-no-load-->
|
|
112 |
|
|
113 |
<tfoot class="uk-child-width-1-1">
|
|
114 |
<!--paging-no-load class="uk-width-1-1" [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf1, $event)"></paging-no-load-->
|
|
113 | 115 |
</tfoot> |
114 | 116 |
</table> |
117 |
<paging-no-load class="uk-float-right" [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(table1, $event)"></paging-no-load> |
|
118 |
|
|
115 | 119 |
</div> |
116 | 120 |
|
117 | 121 |
<h2> Already Curated Claims</h2> |
... | ... | |
191 | 195 |
<!--td><button class="uk-button" (click)="editable.add(i)">Edit</button></td--> |
192 | 196 |
</tr> |
193 | 197 |
</tbody> |
194 |
<tfoot> |
|
198 |
<!--tfoot>
|
|
195 | 199 |
<tr> |
196 | 200 |
<td> |
197 |
<!--mfBootstrapPaginator></mfBootstrapPaginator-->
|
|
201 |
<mfBootstrapPaginator></mfBootstrapPaginator>
|
|
198 | 202 |
</td> |
199 | 203 |
<td></td> |
200 | 204 |
<td></td> |
... | ... | |
204 | 208 |
<paging-no-load [currentPage]="1" [totalResults]="curated_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf2, $event)"> </paging-no-load> |
205 | 209 |
</td> |
206 | 210 |
</tr> |
207 |
</tfoot> |
|
211 |
</tfoot-->
|
|
208 | 212 |
</table> |
213 |
<paging-no-load class="uk-float-right" [currentPage]="1" [totalResults]="curated_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(table2, $event)"> </paging-no-load> |
|
209 | 214 |
|
215 |
|
|
210 | 216 |
</div> |
211 | 217 |
|
212 | 218 |
<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> |
... | ... | |
237 | 243 |
public rowsOnPage = 5; |
238 | 244 |
public sortOrder = "asc"; |
239 | 245 |
|
246 |
@ViewChild('mf1') table1: any;//DataTable; |
|
247 |
@ViewChild('mf2') table2: any;//DataTable; |
|
240 | 248 |
|
249 |
|
|
241 | 250 |
@ViewChild (ModalSelect) selectModal : ModalSelect; |
242 | 251 |
@ViewChild (ModalLoading) loading : ModalLoading ; |
243 | 252 |
|
244 | 253 |
public routerHelper:RouterHelper = new RouterHelper(); |
245 | 254 |
|
246 |
constructor ( private route: ActivatedRoute, private _router:Router, private claimsByTokenService: ClaimsByTokenService ) {
|
|
255 |
constructor ( private route: ActivatedRoute, private _router:Router, private claimsByTokenService: ClaimsByTokenService, private _meta: Meta) {
|
|
247 | 256 |
|
248 | 257 |
} |
249 | 258 |
ngOnInit() { |
... | ... | |
256 | 265 |
//this.setMessageSelect("Please select your identity:"); |
257 | 266 |
//this.setOptionsSelect(this.contact_person); |
258 | 267 |
this.validateJWTandToken(); |
268 |
this.updateTitle("Claims By Token"); |
|
269 |
this.updateDescription(""); |
|
259 | 270 |
} |
260 | 271 |
); |
261 | 272 |
} |
262 | 273 |
|
263 |
refreshTable(mf:any, $event:any) {
|
|
264 |
mf.mfActivePage=$event.value;
|
|
265 |
mf.setPage(mf.mfActivePage, this.rowsOnPage);
|
|
274 |
refreshTable(table:any, $event:any) {
|
|
275 |
table.mfActivePage=$event.value;
|
|
276 |
table.setPage(table.mfActivePage, this.rowsOnPage);
|
|
266 | 277 |
} |
267 | 278 |
|
268 | 279 |
public sortByClaimDate1 = (claim: any) => { |
... | ... | |
424 | 435 |
this.selectModal.options = options; |
425 | 436 |
} |
426 | 437 |
} |
438 |
|
|
439 |
updateDescription(description:string){ |
|
440 |
this._meta.updateMeta("description", description); |
|
441 |
this._meta.updateMeta("og:description", description); |
|
442 |
} |
|
443 |
updateTitle(title:string){ |
|
444 |
var _suffix ="| OpenAIRE"; |
|
445 |
var _title = ((title.length> 50 ) ?title.substring(0,50):title) + _suffix; |
|
446 |
this._meta.setTitle(_title ); |
|
447 |
this._meta.updateMeta("og:title",_title); |
|
448 |
} |
|
427 | 449 |
} |
Also available in: Unified diff
searchPage.component: clear All (for filters) became an <a> tag | searchFilter.component: accordion removed - filters always open | browseStatistic.component: modal fixed for View more options | search.component + publication.component: added responsiveness in tabs | claimsByToken.component: added metadata information (description + title -> to be changed) - datatables' paging and column width with slightly better appearance