1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-10 23:50:12 +00:00

Merge branch '484-order-not-respected-on-dashboard' into 'develop'

Resolve "Order not respected on dashboard"

Closes 

See merge request 
This commit is contained in:
Bram Wiepjes 2021-06-01 21:41:53 +00:00
commit 37e9ef37c0
3 changed files with 14 additions and 4 deletions
web-frontend/modules

View file

@ -46,7 +46,7 @@
</div>
<div v-if="groups.length > 0" class="dashboard">
<DashboardGroup
v-for="group in groups"
v-for="group in sortedGroups"
:key="group.id"
:group="group"
></DashboardGroup>
@ -62,7 +62,7 @@
</template>
<script>
import { mapState } from 'vuex'
import { mapState, mapGetters } from 'vuex'
import CreateGroupModal from '@baserow/modules/core/components/group/CreateGroupModal'
import DashboardGroup from '@baserow/modules/core/components/group/DashboardGroup'
@ -90,6 +90,9 @@ export default {
}
},
computed: {
...mapGetters({
sortedGroups: 'group/getAllSorted',
}),
...mapState({
user: (state) => state.auth.user,
groups: (state) => state.group.items,

View file

@ -232,6 +232,9 @@ export const getters = {
getAll(state) {
return state.items
},
getAllSorted(state) {
return state.items.map((g) => g).sort((a, b) => a.order - b.order)
},
hasSelected(state) {
return Object.prototype.hasOwnProperty.call(state.selected, 'id')
},

View file

@ -71,12 +71,16 @@ export class DatabaseApplicationType extends ApplicationType {
}
select(application, { $router, $store }) {
if (application.tables.length > 0) {
const tables = application.tables
.map((t) => t)
.sort((a, b) => a.order - b.order)
if (tables.length > 0) {
$router.push({
name: 'database-table',
params: {
databaseId: application.id,
tableId: application.tables[0].id,
tableId: tables[0].id,
},
})
} else {