From 5302c08b9b5efacef80b77574d11c824d3ef3c98 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 20 May 2020 14:34:16 -0700 Subject: [PATCH] Prevent sticky query params for plugin alloc filtering --- .../routes/csi/plugins/plugin/allocations.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ui/app/routes/csi/plugins/plugin/allocations.js diff --git a/ui/app/routes/csi/plugins/plugin/allocations.js b/ui/app/routes/csi/plugins/plugin/allocations.js new file mode 100644 index 000000000..b46d2b5a5 --- /dev/null +++ b/ui/app/routes/csi/plugins/plugin/allocations.js @@ -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'), +});