Skip to content

Commit

Permalink
Fix namespace save on close action redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
kelanik8 committed Sep 11, 2023
1 parent d0bde3b commit abe1eb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/web/compose/src/store/ui.js
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion client/web/compose/src/views/Namespace/Edit.vue
Expand Up @@ -365,6 +365,7 @@ export default {
computed: {
...mapGetters({
can: 'rbac/can',
previousPage: 'ui/previousPage',
}),
canCreateApplication () {
Expand Down Expand Up @@ -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 } })
}
Expand Down

0 comments on commit abe1eb6

Please sign in to comment.