John Cowen bb95738321
ui: Search/filtering 'Filtered by:' search status (#9442)
Adds a 'status' for the filtering/searching in the UI, without this its not super clear that you are filtering a recordset due to the menu selections being hidden once closed. You can also use the pills in this status view to delete individual filters.
2021-01-25 18:13:54 +00:00

33 lines
846 B
JavaScript

import { inject as service } from '@ember/service';
import Route from 'consul-ui/routing/route';
import WithNspaceActions from 'consul-ui/mixins/nspace/with-actions';
export default class IndexRoute extends Route.extend(WithNspaceActions) {
@service('data-source/service') data;
@service('repository/nspace') repo;
queryParams = {
sortBy: 'sort',
searchproperty: {
as: 'searchproperty',
empty: [['Name', 'Description', 'Role', 'Policy']],
},
search: {
as: 'filter',
replace: true,
},
};
async model(params) {
return {
items: await this.data.source(uri => uri`/*/*/namespaces`),
searchProperties: this.queryParams.searchproperty.empty[0],
};
}
setupController(controller, model) {
super.setupController(...arguments);
controller.setProperties(model);
}
}