Revision 46357
Added by Konstantina Galouni about 7 years ago
search.component.ts | ||
---|---|---|
3 | 3 |
import {ActivatedRoute, Router} from '@angular/router'; |
4 | 4 |
import {Location} from '@angular/common'; |
5 | 5 |
|
6 |
|
|
7 | 6 |
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class'; |
8 | 7 |
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class'; |
9 | 8 |
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class'; |
... | ... | |
20 | 19 |
|
21 | 20 |
import {OpenaireProperties} from '../../utils/properties/openaireProperties'; |
22 | 21 |
import {SearchFields} from '../../utils/properties/searchFields'; |
23 |
import { ErrorCodes} from '../../utils/properties/openaireProperties'; |
|
22 |
import {ErrorCodes} from '../../utils/properties/openaireProperties'; |
|
23 |
import {RouterHelper} from '../../utils/routerHelper.class'; |
|
24 | 24 |
|
25 | 25 |
@Component({ |
26 | 26 |
changeDetection: ChangeDetectionStrategy.Default, |
... | ... | |
89 | 89 |
<ul id="searchtabs" class="uk-switcher uk-margin-left uk-width-large-3-4 uk-width-small-1-1"> |
90 | 90 |
<li id="pubsTab" class="uk-active"> |
91 | 91 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
92 |
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
92 |
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10"> |
|
93 |
<!--a [href] = "linkToSearchPublications"--> |
|
94 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
95 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"> |
|
96 |
View all {{fetchPublications.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
97 |
</a> |
|
98 |
</div> |
|
93 | 99 |
<search-result [(results)]="fetchPublications.results" |
94 | 100 |
[(status)]= "fetchPublications.searchUtils.status" showLoading = true |
95 | 101 |
type="publication" urlParam="articleId"> |
... | ... | |
101 | 107 |
</li> |
102 | 108 |
<li id="dataTab"> |
103 | 109 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
104 |
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
110 |
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10"> |
|
111 |
<!--a [href] = "linkToSearchDatasets"--> |
|
112 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
113 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets"> |
|
114 |
View all {{fetchDatasets.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
115 |
</a> |
|
116 |
</div> |
|
105 | 117 |
<search-result [(results)]="fetchDatasets.results" |
106 | 118 |
[(status)]= "fetchDatasets.searchUtils.status" showLoading = true |
107 | 119 |
type="dataset" urlParam="datasetId"> |
... | ... | |
113 | 125 |
</li> |
114 | 126 |
<li id="projectsTab" > |
115 | 127 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
116 |
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
128 |
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10"> |
|
129 |
<!--a [href] = "linkToSearchProjects"--> |
|
130 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
131 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchProjects"> |
|
132 |
View all {{fetchProjects.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
133 |
</a> |
|
134 |
</div> |
|
117 | 135 |
<search-result [(results)]="fetchProjects.results" |
118 | 136 |
[(status)]= "fetchProjects.searchUtils.status" showLoading = true |
119 | 137 |
type="project" urlParam="projectId"> |
... | ... | |
125 | 143 |
</li> |
126 | 144 |
<li id="dataProviderTab"> |
127 | 145 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
128 |
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
146 |
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10"> |
|
147 |
<!--a [href] = "linkToSearchDataproviders"--> |
|
148 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
149 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders"> |
|
150 |
View all {{fetchDataproviders.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
151 |
</a> |
|
152 |
</div> |
|
129 | 153 |
<search-result [(results)]="fetchDataproviders.results" |
130 | 154 |
[(status)]= "fetchDataproviders.searchUtils.status" showLoading = true |
131 | 155 |
type="dataprovider" urlParam="datasourceId"> |
... | ... | |
137 | 161 |
</li> |
138 | 162 |
<li id="organizationsTab" > |
139 | 163 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
140 |
<div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
164 |
<div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10"> |
|
165 |
<!--a [href] = "linkToSearchOrganizations"--> |
|
166 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
167 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrganizations"> |
|
168 |
View all {{fetchOrganizations.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
169 |
</a> |
|
170 |
</div> |
|
141 | 171 |
<search-result [(results)]="fetchOrganizations.results" |
142 | 172 |
[(status)]= "fetchOrganizations.searchUtils.status" showLoading = true |
143 | 173 |
type="organization" urlParam="organizationId"> |
... | ... | |
149 | 179 |
</li> |
150 | 180 |
<li id="peopleTab"> |
151 | 181 |
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> |
152 |
<div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div> |
|
182 |
<div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10"> |
|
183 |
<!--a [href] = "linkToSearchPeople"--> |
|
184 |
<a [queryParams]="routerHelper.createQueryParam('keyword', keyword)" |
|
185 |
routerLinkActive="router-link-active" [routerLink]="linkToSearchPeople"> |
|
186 |
View all {{fetchPeople.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i> |
|
187 |
</a> |
|
188 |
</div> |
|
153 | 189 |
<search-result [(results)]="fetchPeople.results" |
154 | 190 |
[(status)]= "fetchPeople.searchUtils.status" showLoading = true |
155 | 191 |
type="person" urlParam="personId"> |
... | ... | |
201 | 237 |
public fetchDatasets: FetchDatasets; |
202 | 238 |
public fetchOrganizations: FetchOrganizations; |
203 | 239 |
public fetchPeople: FetchPeople; |
240 |
|
|
204 | 241 |
public searchFields:SearchFields = new SearchFields(); |
205 | 242 |
public errorCodes:ErrorCodes = new ErrorCodes(); |
243 |
public routerHelper:RouterHelper = new RouterHelper(); |
|
206 | 244 |
|
207 | 245 |
public subPub;public subData;public subProjects;public subOrg;public subPeople; public subDataPr; |
208 | 246 |
constructor ( private route: ActivatedRoute, |
... | ... | |
260 | 298 |
if(this.reloadPublications) { |
261 | 299 |
this.reloadPublications = false; |
262 | 300 |
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10); |
263 |
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications() + "?keyword=" + this.keyword; |
|
301 |
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();// + "?keyword=" + this.keyword;
|
|
264 | 302 |
} |
265 | 303 |
} |
266 | 304 |
public searchDatasets() { |
... | ... | |
268 | 306 |
if(this.reloadDatasets) { |
269 | 307 |
this.reloadDatasets = false; |
270 | 308 |
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10); |
271 |
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets() + "?keyword=" + this.keyword; |
|
309 |
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets();// + "?keyword=" + this.keyword;
|
|
272 | 310 |
} |
273 | 311 |
} |
274 | 312 |
public searchProjects() { |
... | ... | |
276 | 314 |
if(this.reloadProjects) { |
277 | 315 |
this.reloadProjects = false; |
278 | 316 |
this.fetchProjects.getResultsByKeyword(this.keyword, 1, 10); |
279 |
this.linkToSearchProjects = OpenaireProperties.getLinkToSearchProjects() + "?keyword=" + this.keyword; |
|
317 |
this.linkToSearchProjects = OpenaireProperties.getLinkToSearchProjects();// + "?keyword=" + this.keyword;
|
|
280 | 318 |
} |
281 | 319 |
} |
282 | 320 |
public searchDataProviders() { |
... | ... | |
284 | 322 |
if(this.reloadDataproviders) { |
285 | 323 |
this.reloadDataproviders = false; |
286 | 324 |
this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10); |
287 |
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders() + "?keyword=" + this.keyword; |
|
325 |
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();// + "?keyword=" + this.keyword;
|
|
288 | 326 |
} |
289 | 327 |
} |
290 | 328 |
public searchOrganizations() { |
... | ... | |
292 | 330 |
if(this.reloadOrganizations) { |
293 | 331 |
this.reloadOrganizations = false; |
294 | 332 |
this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10); |
295 |
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations() + "?keyword=" + this.keyword; |
|
333 |
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations();// + "?keyword=" + this.keyword;
|
|
296 | 334 |
} |
297 | 335 |
} |
298 | 336 |
public searchPeople() { |
... | ... | |
300 | 338 |
if(this.reloadPeople) { |
301 | 339 |
this.reloadPeople = false; |
302 | 340 |
this.fetchPeople.getResultsByKeyword(this.keyword, 1, 10); |
303 |
this.linkToSearchPeople = OpenaireProperties.getLinkToSearchPeople() + "?keyword=" + this.keyword; |
|
341 |
this.linkToSearchPeople = OpenaireProperties.getLinkToSearchPeople();// + "?keyword=" + this.keyword;
|
|
304 | 342 |
} |
305 | 343 |
} |
306 | 344 |
|
Also available in: Unified diff
Loading Message when building CSV files (project & organization landing page) | confirmation message before building publications CSV in organization landing page | Organization landing page: Publications CSV: no query for publications of a specific project when size of its publications = 0 | Lazy routing in 'View all' links | Remove href from tabs in landing pages & add class uk-animation-fade in tabs' content | fix how commas are displayed (no spaces between comma and previous word) in organizations and projects lists