Skip to content

Commit

Permalink
Merge pull request #1147 from nextcloud/fix-empty-view
Browse files Browse the repository at this point in the history
fix: pass view as prop to EmptyView
  • Loading branch information
juliushaertl authored Jun 18, 2024
2 parents 4c1ac0b + a4f0871 commit eb87eb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/modules/main/sections/EmptyView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<NcEmptyContent :name="t('tables', 'No columns selected')"
:description="t('tables', 'The view is empty. Edit which columns should be displayed.')">
<template #icon>
{{ activeView.emoji }}
{{ view.emoji }}
</template>
<template #action>
<NcButton :aria-label="t('table', 'Edit view')" type="primary" @click="editView()">
Expand All @@ -13,7 +13,6 @@
</template>
<script>
import { NcEmptyContent, NcButton } from '@nextcloud/vue'
import { mapGetters } from 'vuex'
import { emit } from '@nextcloud/event-bus'
export default {
Expand All @@ -22,12 +21,15 @@ export default {
NcEmptyContent,
NcButton,
},
computed: {
...mapGetters(['activeView']),
props: {
view: {
type: Object,
default: null,
},
},
methods: {
editView() {
emit('tables:view:edit', { view: this.activeView, viewSetting: {} })
emit('tables:view:edit', { view: this.view, viewSetting: {} })
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/main/sections/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<ElementTitle :active-element="view" :is-table="false" :view-setting.sync="localViewSetting" />
<div class="table-wrapper">
<EmptyView v-if="columns.length === 0" />
<EmptyView v-if="columns.length === 0" :view="view" />
<TableView v-else
:rows="rows"
:columns="columns"
Expand Down

0 comments on commit eb87eb4

Please sign in to comment.