mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* feat: redesign sidebar workspace navigation * feat: redesign the sidebar footer and account menu Match the account menu to the sidebar prototype and reuse the admin navigation in a submenu. Keep Add new above the footer while the application list scrolls. * fix: show the sortable indicator only when dragging * feat: refine workspace sidebar application navigation * feat: reorganize workspace sidebar shortcuts * fix: isolate workspace sidebar menus and actions * fix: cancel sortable drops on hidden lists * fix(enterprise): allow retrying Direct support * feat: simplify the workspace overview header * fix: prevent horizontal overflow around the sidebar Constrain animated tree groups to the width of the sidebar so long labels truncate. On narrow screens, let the sidebar expand over the content instead of reducing the usable page width. * fix: fit workspace cards and creation menus on mobile * test: keep the current table selected after reload * fix: undo and redo edits across expanded sidebar applications * fix: keep sidebar groups out of the tab order * fix: highlight the active database in the tables tour * feat: label workspace integrations in the settings menu * fix: keep the workspace sidebar and guided tour usable on phones * fix: undo sidebar row imports in the destination database * fix: keep the guided tour highlight on the current step * fix: show an empty state in the workspace picker * fix: confirm workspace deletion before moving it to trash * feat: open registered workspace settings tabs from the sidebar * fix: keep the sidebar logo the same size across workspaces --------- Co-authored-by: peter_baserow <peter@baserow.io>
78 lines
2.0 KiB
Vue
78 lines
2.0 KiB
Vue
<template>
|
|
<a
|
|
class="context__menu-item-link"
|
|
:class="{
|
|
'context__menu-item-link--loading': loading,
|
|
disabled: disabled || loading,
|
|
}"
|
|
@click="importFile()"
|
|
>
|
|
<i class="context__menu-item-icon iconoir-import"></i>
|
|
{{ $t('sidebarItem.importFile') }}
|
|
<ImportFileModal
|
|
ref="importFileModal"
|
|
:database="database"
|
|
:table="table"
|
|
:fields="fields"
|
|
:undo-in-application="table.id !== $store.getters['table/getSelectedId']"
|
|
/>
|
|
</a>
|
|
</template>
|
|
|
|
<script>
|
|
import { notifyIf } from '@baserow/modules/core/utils/error'
|
|
import FieldService from '@baserow/modules/database/services/field'
|
|
import { populateField } from '@baserow/modules/database/store/field'
|
|
import ImportFileModal from '@baserow/modules/database/components/table/ImportFileModal'
|
|
|
|
export default {
|
|
name: 'SidebarImportTableContextItem',
|
|
components: { ImportFileModal },
|
|
props: {
|
|
database: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
table: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
},
|
|
emits: ['click'],
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
fields: [],
|
|
}
|
|
},
|
|
methods: {
|
|
// Sidebar has no fields in the store, so fetch them before opening. The
|
|
// modal reads `field._.type`, so the raw fields must be populated first.
|
|
async importFile() {
|
|
if (this.loading || this.disabled) {
|
|
return
|
|
}
|
|
this.loading = true
|
|
try {
|
|
const { data } = await FieldService(this.$client).fetchAll(
|
|
this.table.id
|
|
)
|
|
this.fields = data.map((field) => populateField(field, this.$registry))
|
|
this.$refs.importFileModal.show()
|
|
} catch (error) {
|
|
notifyIf(error, 'table')
|
|
} finally {
|
|
// Always hide the context menu, even on error, like the duplicate item.
|
|
this.$emit('click')
|
|
this.loading = false
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|