Kubernetes config state updates (#19074)

* hides roles toolbar actions when k8s is not configured

* adds error page component to core addon

* moves fetch-config to decorator

* updates kubernetes prompt config logic

* adds kubernetes error route

* fixes tests

* adds error handling for kubernetes roles list view

* removes unneeded arg to withConfig decorator
This commit is contained in:
Jordan Reimer
2023-02-09 09:18:02 -07:00
committed by GitHub
parent dd9a3e05ae
commit 959ff1736c
21 changed files with 252 additions and 99 deletions

View File

@@ -1,11 +1,17 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { withConfig } from 'kubernetes/decorators/fetch-config';
import { hash } from 'rsvp';
import FetchConfigRoute from './fetch-config';
export default class KubernetesOverviewRoute extends FetchConfigRoute {
@withConfig()
export default class KubernetesOverviewRoute extends Route {
@service store;
@service secretMountPath;
async model() {
const backend = this.secretMountPath.get();
return hash({
config: this.configModel,
promptConfig: this.promptConfig,
backend: this.modelFor('application'),
roles: this.store.query('kubernetes/role', { backend }).catch(() => []),
});