2017-02-13 15:05:00 -08:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
2017-03-24 20:56:31 -07:00
|
|
|
const {
|
|
|
|
get,
|
|
|
|
Controller,
|
|
|
|
inject: { service }
|
|
|
|
} = Ember;
|
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-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
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|