Revision 47593
Added by Argiro Kokogiannaki almost 7 years ago
startOver.component.ts | ||
---|---|---|
1 |
import {Component, Input, Output, EventEmitter} from '@angular/core'; |
|
1 |
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
|
|
2 | 2 |
|
3 | 3 |
import {ClaimResult} from '../claim-utils/claimEntities.class'; |
4 |
import {AlertModal} from '../../utils/modal/alert'; |
|
4 | 5 |
|
5 | 6 |
@Component({ |
6 | 7 |
selector: 'start-over', |
7 |
template: `<button (click)="startOver()" class="uk-button uk-button-danger uk-align-right" > <span uk-icon="icon: refresh"></span> Clear All</button>`, |
|
8 |
template: ` |
|
9 |
<button (click)="confirmOpen()" class="uk-button uk-button-danger uk-align-left" > <span uk-icon="icon: refresh"></span> Clear All</button> |
|
10 |
<modal-alert (alertOutput)="confirmClose($event)"> |
|
11 |
</modal-alert> |
|
12 |
`, |
|
8 | 13 |
|
9 | 14 |
}) |
10 | 15 |
export class StartOverComponent { |
... | ... | |
24 | 29 |
@Input() public projects; |
25 | 30 |
@Input() public contexts; |
26 | 31 |
|
32 |
@ViewChild(AlertModal) alertApplyAll; |
|
27 | 33 |
|
34 |
confirmOpen(type: boolean, message: string){ |
|
35 |
this.alertApplyAll.cancelButton = true; |
|
36 |
this.alertApplyAll.okButton = true; |
|
37 |
this.alertApplyAll.alertTitle = "Remove selected"; |
|
38 |
this.alertApplyAll.message = "This action will delete every selected entity (projects, communities, research results). Do you wish to continue?"; |
|
39 |
this.alertApplyAll.okButtonText = "Yes"; |
|
40 |
this.alertApplyAll.cancelButtonText = "No"; |
|
41 |
this.alertApplyAll.open(); |
|
42 |
} |
|
43 |
confirmClose(data){ |
|
44 |
this.startOver(); |
|
45 |
} |
|
28 | 46 |
startOver(){ |
29 |
console.log("projects:"+this.projects.length +" contexts:"+this.contexts.length + " results:"+this.results.length ); |
|
30 | 47 |
if(this.type != null && this.linkTo != null){ |
31 | 48 |
console.log("inline"); |
32 | 49 |
if(this.linkTo == "project"){ |
Also available in: Unified diff
Remove person landing - links to landing pages of people - search pages for people | Linking: minor layout changes - add apply all functionality for result type change in dropdown