e8593ec1bb
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.
19 lines
553 B
JavaScript
19 lines
553 B
JavaScript
import Route from '@ember/routing/route';
|
|
|
|
export default class OptimizeIndexRoute extends Route {
|
|
async activate() {
|
|
// This runs late in the loading lifecycle to ensure .filteredSummaries is populated
|
|
const summaries = this.controllerFor('optimize').filteredSummaries;
|
|
|
|
if (summaries.length) {
|
|
const firstSummary = summaries.objectAt(0);
|
|
|
|
return this.transitionTo('optimize.summary', firstSummary.slug, {
|
|
queryParams: {
|
|
jobNamespace: firstSummary.jobNamespace || 'default',
|
|
},
|
|
});
|
|
}
|
|
}
|
|
}
|