feat: default open schema if only one present

This commit is contained in:
Fabio Di Stasio 2022-05-01 10:46:32 +02:00
parent 5e4abd3e81
commit 0fa22fbe72
2 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,7 @@
<WorkspaceExploreBarSchema
v-for="db of workspace.structure"
:key="db.name"
ref="schema"
:database="db"
:connection="connection"
@show-schema-context="openSchemaContext"
@ -259,6 +260,11 @@ export default {
window.addEventListener('mousemove', this.resize);
window.addEventListener('mouseup', this.stopResize);
});
if (this.workspace.structure.length === 1) { // Auto-open if juust one schema
this.$refs.schema[0].selectSchema(this.workspace.structure[0].name);
this.$refs.schema[0].$refs.schemaAccordion.open = true;
}
},
methods: {
async refresh () {

View File

@ -1,5 +1,5 @@
<template>
<details class="accordion workspace-explorebar-database">
<details ref="schemaAccordion" class="accordion workspace-explorebar-database">
<summary
class="accordion-header database-name"
:class="{'text-bold': breadcrumbs.schema === database.name}"