mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 02:37:05 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			61 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import Controller from '@ember/controller';
 | |
| import { get } from '@ember/object';
 | |
| import Session from 'ember-simple-auth/services/session';
 | |
| import Search from 'wherehows-web/services/search';
 | |
| import UserLookup from 'wherehows-web/services/user-lookup';
 | |
| import Notifications from 'wherehows-web/services/notifications';
 | |
| import BannerService from 'wherehows-web/services/banners';
 | |
| import { action } from '@ember-decorators/object';
 | |
| import { service } from '@ember-decorators/service';
 | |
| 
 | |
| export default class Application extends Controller {
 | |
|   /**
 | |
|    * User session management service
 | |
|    * @type {Session}
 | |
|    */
 | |
|   @service session: Session;
 | |
| 
 | |
|   /**
 | |
|    * Injected global search service
 | |
|    * @type {Search}
 | |
|    */
 | |
|   @service search: Search;
 | |
| 
 | |
|   /**
 | |
|    * Looks up user names and properties from the partyEntities api
 | |
|    * @type {UserLookup}
 | |
|    */
 | |
|   @service('user-lookup') ldapUsers: UserLookup;
 | |
| 
 | |
|   /**
 | |
|    * References the application notifications service
 | |
|    * @type {Notifications}
 | |
|    */
 | |
|   @service notifications: Notifications;
 | |
| 
 | |
|   /**
 | |
|    * Adds the service for banners in order to trigger the application to render the banners when
 | |
|    * they are triggered
 | |
|    * @type {BannerService}
 | |
|    */
 | |
|   @service('banners') banners: BannerService;
 | |
| 
 | |
|   constructor() {
 | |
|     super(...arguments);
 | |
| 
 | |
|     //@ts-ignore dot notation limitation with ts and ember object model
 | |
|     get(this, 'ldapUsers.fetchUserNames')();
 | |
|   }
 | |
| 
 | |
|   /**
 | |
|    * Invokes the search service api to transition to the
 | |
|    *   search results page with the search parameters
 | |
|    * @param {String} [keyword] the search string to search for
 | |
|    * @param {String} [category] restrict search to results found here
 | |
|    */
 | |
|   @action
 | |
|   didSearch({ keyword, category }: { keyword: string; category: string }) {
 | |
|     get(this, 'search').showSearchResults({ keyword, category });
 | |
|   }
 | |
| }
 | 
