Prevent sticky query params for plugin alloc filtering

This commit is contained in:
Michael Lange
2020-05-20 14:34:16 -07:00
parent 57bad784ed
commit 5302c08b9b

View File

@@ -0,0 +1,27 @@
import Route from '@ember/routing/route';
import { collect } from '@ember/object/computed';
import { watchRecord } from 'nomad-ui/utils/properties/watch';
import WithWatchers from 'nomad-ui/mixins/with-watchers';
export default Route.extend(WithWatchers, {
startWatchers(controller, model) {
if (!model) return;
controller.set('watchers', {
model: this.watch.perform(model),
});
},
resetController(controller, isExiting) {
if (isExiting) {
controller.setProperties({
currentPage: 1,
qpType: '',
qpHealth: '',
});
}
},
watch: watchRecord('plugin'),
watchers: collect('watch'),
});