2020-05-29 15:42:46 +00:00
|
|
|
import { computed } from '@ember/object';
|
2020-11-09 09:25:35 +00:00
|
|
|
import Controller from '@ember/controller';
|
2020-06-17 13:19:50 +00:00
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class IndexController extends Controller {
|
|
|
|
queryParams = {
|
2020-05-11 14:04:27 +00:00
|
|
|
sortBy: 'sort',
|
2020-09-01 18:13:11 +00:00
|
|
|
status: 'status',
|
|
|
|
source: 'source',
|
2020-11-13 15:55:40 +00:00
|
|
|
kind: 'kind',
|
2020-05-29 15:42:46 +00:00
|
|
|
search: {
|
2019-04-30 17:54:28 +00:00
|
|
|
as: 'filter',
|
2020-11-13 15:55:40 +00:00
|
|
|
replace: true,
|
2019-04-30 17:54:28 +00:00
|
|
|
},
|
2020-11-09 09:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@computed('items.[]')
|
|
|
|
get services() {
|
2020-04-08 17:09:36 +00:00
|
|
|
return this.items.filter(function(item) {
|
2020-05-05 16:29:51 +00:00
|
|
|
return item.Kind !== 'connect-proxy';
|
2020-04-08 17:09:36 +00:00
|
|
|
});
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@computed('services')
|
|
|
|
get externalSources() {
|
2020-09-01 18:13:11 +00:00
|
|
|
const sources = this.services.reduce(function(prev, item) {
|
|
|
|
return prev.concat(item.ExternalSources || []);
|
|
|
|
}, []);
|
|
|
|
// unique, non-empty values, alpha sort
|
|
|
|
return [...new Set(sources)].filter(Boolean).sort();
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|