mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-07 01:00:41 +00:00
46 lines
1017 B
JavaScript
46 lines
1017 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {
|
|
get,
|
|
Controller,
|
|
inject: { service }
|
|
} = Ember;
|
|
|
|
export default Controller.extend({
|
|
/**
|
|
* User session management service
|
|
* @type {Ember.Service}
|
|
*/
|
|
session: service(),
|
|
/**
|
|
* Injected global search service
|
|
* @type {Ember.Service}
|
|
*/
|
|
search: service(),
|
|
|
|
/**
|
|
* Looks up user names and properties from the partyEntities api
|
|
* @type {Ember.Service}
|
|
*/
|
|
ldapUsers: service('user-lookup'),
|
|
|
|
init() {
|
|
this._super(...arguments);
|
|
|
|
// Primes the cache for keywords and userEntitiesSource
|
|
get(this, 'ldapUsers.fetchUserNames')();
|
|
},
|
|
|
|
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
|
|
* @param {String} [category] restrict search to results found here
|
|
*/
|
|
didSearch({ keyword, category }) {
|
|
get(this, 'search').showSearchResults({ keyword, category });
|
|
}
|
|
}
|
|
});
|