Revision 46561
Added by Argiro Kokogiannaki about 7 years ago
claimContextSearchForm.component.ts | ||
---|---|---|
20 | 20 |
<option *ngIf="communities" (click)="communityChanged(communities.id, communities.label)" [value]="communities.id" >{{communities.label}}</option> |
21 | 21 |
</select> |
22 | 22 |
</td> |
23 |
<td><select class="custom-select-mini" name="select_funder" > |
|
24 |
<option value="0" (click)="categoryChanged('0','Category:')">Select Community:</option>
|
|
23 |
<td *ngIf="selectedCommunityId != 0 && categories.length > 0"><select class="custom-select-mini" name="select_funder" >
|
|
24 |
<option value="0" (click)="categoryChanged('0','Category:')">Select Category:</option>
|
|
25 | 25 |
<option *ngFor="let category of categories" (click)="categoryChanged(category.id, category.label)" [value]="category.id" >{{category.label}}</option> |
26 | 26 |
</select> |
27 | 27 |
</td><td > |
... | ... | |
29 | 29 |
</td></tr> |
30 | 30 |
|
31 | 31 |
</table> |
32 |
<div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div> |
|
33 |
<div *ngIf="infoMessage.length > 0" class="alert alert-info" role="alert">{{infoMessage}}</div> |
|
32 |
<div *ngIf="loading" class="uk-alert uk-alert-info" role="alert">Loading...</div> |
|
33 |
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div> |
|
34 |
<div *ngIf="infoMessage.length > 0" class="uk-alert uk-alert-info" role="alert">{{infoMessage}}</div> |
|
34 | 35 |
</div> |
35 | 36 |
|
36 | 37 |
` |
... | ... | |
56 | 57 |
public concepts = []; |
57 | 58 |
public warningMessage = ""; |
58 | 59 |
public infoMessage = ""; |
59 |
|
|
60 |
public loading:boolean = false; |
|
60 | 61 |
ngOnInit() { |
61 | 62 |
this.getCommunities(); |
62 | 63 |
} |
... | ... | |
101 | 102 |
} |
102 | 103 |
|
103 | 104 |
getCommunities () { |
105 |
this.loading = true; |
|
104 | 106 |
this._contextService.getCommunities().subscribe( |
105 | 107 |
data => { |
106 | 108 |
this.communities = data.communities; |
109 |
this.loading = false; |
|
107 | 110 |
}, |
108 |
err => console.log(err) |
|
111 |
err => { |
|
112 |
console.log(err); |
|
113 |
this.loading = false; |
|
114 |
} |
|
109 | 115 |
); |
110 | 116 |
} |
111 | 117 |
getCategories () { |
112 | 118 |
console.log(" Getting Categories... "); |
113 |
|
|
119 |
this.loading = true; |
|
114 | 120 |
this.categories=[]; |
115 | 121 |
if(this.selectedCommunityId != '0'){ |
116 | 122 |
this._contextService.getCategories(this.selectedCommunityId).subscribe( |
... | ... | |
122 | 128 |
var event = {value: ""}; |
123 | 129 |
event.value = this.query; |
124 | 130 |
} |
125 |
|
|
131 |
this.loading = false; |
|
126 | 132 |
}, |
127 |
err => console.log(err) |
|
133 |
err => { |
|
134 |
console.log(err); |
|
135 |
this.loading = false; |
|
136 |
} |
|
128 | 137 |
); |
129 | 138 |
} |
130 | 139 |
} |
131 | 140 |
getConcepts () { |
141 |
this.loading = true; |
|
132 | 142 |
if(this.selectedCategoryId != '0'){ |
133 | 143 |
this._contextService.getConcepts(this.selectedCategoryId, "").subscribe( |
134 | 144 |
data => { |
... | ... | |
139 | 149 |
event.value = this.query; |
140 | 150 |
// this.filter(event); |
141 | 151 |
} |
152 |
this.loading = false; |
|
142 | 153 |
}, |
143 |
err => console.log(err) |
|
154 |
err => { |
|
155 |
console.log(err); |
|
156 |
this.loading = false; |
|
157 |
} |
|
144 | 158 |
); |
145 | 159 |
}else{ |
146 | 160 |
this.concepts=[]; |
161 |
this.loading = false; |
|
147 | 162 |
} |
148 | 163 |
} |
149 | 164 |
communityChanged(communityId:string, communityLabel:string){ |
Also available in: Unified diff
more layout changes for linking - simplify linking - easy switch between bulk and search mode