open-nomad/ui/app/mixins/with-namespace-resetting.js
Michael Lange e8593ec1bb
ui: Update namespaces design (#10444)
This rethinks namespaces as a filter on list pages rather than a global setting.

The biggest net-new feature here is being able to select All (*) to list all jobs
or CSI volumes across namespaces.
2021-04-29 15:00:59 -05:00

20 lines
673 B
JavaScript

import { inject as controller } from '@ember/controller';
import { inject as service } from '@ember/service';
import Mixin from '@ember/object/mixin';
// eslint-disable-next-line ember/no-new-mixins
export default Mixin.create({
system: service(),
jobsController: controller('jobs'),
actions: {
gotoJobs(namespace) {
// Since the setupController hook doesn't fire when transitioning up the
// route hierarchy, the two sides of the namespace bindings need to be manipulated
// in order for the jobs route model to reload.
this.set('jobsController.jobNamespace', namespace.get('id'));
this.transitionToRoute('jobs');
},
},
});