allow doneRoute to be an object

This commit is contained in:
Nancy Butler 2022-05-10 18:07:27 -07:00
parent 3860e9a60c
commit 6149e97ea5
3 changed files with 9 additions and 3 deletions

View File

@ -24,7 +24,7 @@ export default {
props: {
doneRoute: {
type: String,
type: [String, Object],
default: null
},

View File

@ -5,6 +5,7 @@ import FileSelector from '@shell/components/form/FileSelector';
import Footer from '@shell/components/form/Footer';
import { ANNOTATIONS_TO_FOLD } from '@shell/config/labels-annotations';
import { ensureRegex } from '@shell/utils/string';
import { typeOf } from '@shell/utils/sort';
import {
_CREATE,
@ -46,7 +47,7 @@ export default {
},
doneRoute: {
type: String,
type: [String, Object],
default: null,
},
@ -314,6 +315,11 @@ export default {
if ( !this.doneRoute ) {
return;
}
if (typeOf(this.doneRoute) === 'object') {
this.$router.replace(this.doneRoute);
return;
}
this.$router.replace({
name: this.doneRoute,
params: { resource: this.value.type }

View File

@ -242,7 +242,7 @@ export default {
<template>
<CruResource
class="receiver"
:done-route="getReceiverDetailRoute(value.name)"
:done-route="alertmanagerConfigResource.getAlertmanagerConfigDetailRoute()"
:mode="mode"
:resource="alertmanagerConfigResource"
:subtypes="[]"