| 
									
										
										
										
											2018-01-20 00:46:47 -08:00
										 |  |  | import Controller from '@ember/controller'; | 
					
						
							|  |  |  | import { get } from '@ember/object'; | 
					
						
							|  |  |  | import { inject as service } from '@ember/service'; | 
					
						
							| 
									
										
										
										
											2017-02-13 15:05:00 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  | export default Controller.extend({ | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * User session management service | 
					
						
							| 
									
										
										
										
											2017-04-01 14:18:38 -07:00
										 |  |  |    * @type {Ember.Service} | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |    */ | 
					
						
							|  |  |  |   session: service(), | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * Injected global search service | 
					
						
							| 
									
										
										
										
											2017-04-01 14:18:38 -07:00
										 |  |  |    * @type {Ember.Service} | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |    */ | 
					
						
							|  |  |  |   search: service(), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-01 14:18:38 -07:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * Looks up user names and properties from the partyEntities api | 
					
						
							|  |  |  |    * @type {Ember.Service} | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   ldapUsers: service('user-lookup'), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-28 01:38:47 -07:00
										 |  |  |   notifications: service(), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-01 11:37:30 -07:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * Adds the service for banners in order to trigger the application to render the banners when | 
					
						
							|  |  |  |    * they are triggered | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   banners: service(), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |   init() { | 
					
						
							|  |  |  |     this._super(...arguments); | 
					
						
							| 
									
										
										
										
											2017-04-01 14:18:38 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Primes the cache for keywords and userEntitiesSource
 | 
					
						
							|  |  |  |     get(this, 'ldapUsers.fetchUserNames')(); | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   actions: { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Invokes the search service api to transition to the | 
					
						
							|  |  |  |      *   search results page with the search string | 
					
						
							|  |  |  |      * @param {String} [keyword] the search string to search for | 
					
						
							| 
									
										
										
										
											2017-04-05 09:02:04 -07:00
										 |  |  |      * @param {String} [category] restrict search to results found here | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-04-05 09:02:04 -07:00
										 |  |  |     didSearch({ keyword, category }) { | 
					
						
							|  |  |  |       get(this, 'search').showSearchResults({ keyword, category }); | 
					
						
							| 
									
										
										
										
											2017-03-24 20:56:31 -07:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | }); |