Fix namespace save on close action redirection
This commit is contained in:
@@ -93,9 +93,11 @@ export default function (ComposeAPI) {
|
||||
},
|
||||
|
||||
setPreviousPage ({ commit }, value) {
|
||||
// This prevents saving previous page for pages that causes incorrect redirection even though they are previous pages
|
||||
const shouldNotSavePage = value.name !== 'admin.pages.builder' &&
|
||||
!value.query.layoutID && value.name !== 'admin.modules.create' &&
|
||||
value.name !== 'admin.charts.create'
|
||||
value.name !== 'admin.charts.create' &&
|
||||
value.name !== 'namespace.create'
|
||||
|
||||
if (value && value.name && shouldNotSavePage) {
|
||||
commit(types.setPreviousPage, value)
|
||||
|
||||
@@ -365,6 +365,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters({
|
||||
can: 'rbac/can',
|
||||
previousPage: 'ui/previousPage',
|
||||
}),
|
||||
|
||||
canCreateApplication () {
|
||||
@@ -617,7 +618,7 @@ export default {
|
||||
this.processing = false
|
||||
|
||||
if (closeOnSuccess) {
|
||||
this.$router.go(-1)
|
||||
this.$router.push(this.previousPage || { name: 'namespace.manage' })
|
||||
} else if (!this.isEdit || this.isClone) {
|
||||
this.$router.push({ name: 'namespace.edit', params: { namespaceID: this.namespace.namespaceID } })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user