mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-14 00:59:06 +00:00
Resolve "Navigation is messed up after introducing remembering the last view visited feature."
This commit is contained in:
parent
dfa83984c9
commit
2ae41b7e50
4 changed files with 30 additions and 4 deletions
changelog/entries/unreleased/bug
web-frontend
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"type": "bug",
|
||||||
|
"message": "Fix bug where the navigation history was wrong after last view.",
|
||||||
|
"issue_number": 2006,
|
||||||
|
"bullet_points": [],
|
||||||
|
"created_at": "2023-10-05"
|
||||||
|
}
|
|
@ -34,10 +34,10 @@
|
||||||
<EditableViewName ref="rename" :view="view"></EditableViewName>
|
<EditableViewName ref="rename" :view="view"></EditableViewName>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<span v-else-if="view !== null">
|
<template v-else-if="view !== null">
|
||||||
<i class="header__filter-icon iconoir-nav-arrow-down"></i>
|
<i class="header__filter-icon iconoir-nav-arrow-down"></i>
|
||||||
{{ $t('table.chooseView') }}
|
{{ $t('table.chooseView') }}
|
||||||
</span>
|
</template>
|
||||||
</a>
|
</a>
|
||||||
<ViewsContext
|
<ViewsContext
|
||||||
v-if="views !== null"
|
v-if="views !== null"
|
||||||
|
|
|
@ -207,6 +207,22 @@ export default {
|
||||||
this.$store.dispatch('table/setLoading', false)
|
this.$store.dispatch('table/setLoading', false)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// If no view route parameter is provided, then the `asyncData` function
|
||||||
|
// automatically selects the last viewed view, or the first one. This is however
|
||||||
|
// not updated in the URL path, so to make the history navigation work, we must
|
||||||
|
// replace the existing path.
|
||||||
|
if (
|
||||||
|
this.view !== undefined &&
|
||||||
|
parseInt(this.$route.params.viewId) !== this.view.id
|
||||||
|
) {
|
||||||
|
this.$router.replace({
|
||||||
|
name: 'database-table',
|
||||||
|
params: {
|
||||||
|
viewId: this.view.id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.$realtime.subscribe('table', { table_id: this.table.id })
|
this.$realtime.subscribe('table', { table_id: this.table.id })
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
@ -218,7 +234,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$nuxt.$router.push({
|
this.$router.push({
|
||||||
name: 'database-table',
|
name: 'database-table',
|
||||||
params: {
|
params: {
|
||||||
viewId: view.id,
|
viewId: view.id,
|
||||||
|
@ -256,7 +272,7 @@ export default {
|
||||||
rowId,
|
rowId,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
this.$nuxt.$router.push(location)
|
this.$router.push(location)
|
||||||
},
|
},
|
||||||
async fetchAdjacentRow(previous, activeSearchTerm = null) {
|
async fetchAdjacentRow(previous, activeSearchTerm = null) {
|
||||||
const { row, status } = await this.$store.dispatch(
|
const { row, status } = await this.$store.dispatch(
|
||||||
|
|
|
@ -121,6 +121,9 @@ export class TestApp {
|
||||||
resolve({ name, params }) {
|
resolve({ name, params }) {
|
||||||
return new URL(`https://${name}`)
|
return new URL(`https://${name}`)
|
||||||
},
|
},
|
||||||
|
replace({ name, params }) {
|
||||||
|
return new URL(`https://${name}`)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
$route: {
|
$route: {
|
||||||
params: {},
|
params: {},
|
||||||
|
|
Loading…
Add table
Reference in a new issue