Skip to content

Commit

Permalink
updated counter bubble on archived tables nav item
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
  • Loading branch information
elzody committed Feb 26, 2024
1 parent a80794c commit ca50f4e
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions src/modules/navigation/sections/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
<NcActionButton :aria-label="t('tables', 'Create table')" icon="icon-add" @click.prevent="createTable" />
</template>
</NcAppNavigationCaption>
<NavigationTableItem v-for="table in getOwnTables"
:key="table.id"
:filter-string="filterString"
:table="table" />

<template v-for="table in getOwnTables">
<NavigationTableItem v-if="!table.archived"
:key="table.id"
:filter-string="filterString"
:table="table" />
</template>

<NcAppNavigationCaption v-if="getSharedTables.length > 0 || getSharedViews.length > 0"
:name="t('tables', 'Shared')" />
Expand All @@ -41,7 +44,9 @@
</template>

<template #counter>
{{ getArchivedTables.length }}
<NcCounterBubble>
{{ getArchivedTables.length }}
</NcCounterBubble>
</template>

<NavigationTableItem v-for="table in getArchivedTables"
Expand All @@ -66,7 +71,17 @@
</template>

<script>
import { NcAppNavigation, NcAppNavigationItem, NcAppNavigationCaption, NcActionButton, NcTextField, NcButton, NcEmptyContent } from '@nextcloud/vue'
import {
NcAppNavigation,
NcAppNavigationItem,
NcAppNavigationCaption,
NcActionButton,
NcTextField,
NcButton,
NcEmptyContent,
NcCounterBubble,
} from '@nextcloud/vue'
import NavigationViewItem from '../partials/NavigationViewItem.vue'
import NavigationTableItem from '../partials/NavigationTableItem.vue'
import { mapState } from 'vuex'
Expand All @@ -88,6 +103,7 @@ export default {
Magnify,
Archive,
NcButton,
NcCounterBubble,
NcEmptyContent,
},
data() {
Expand All @@ -103,10 +119,19 @@ export default {
return this.views.filter(item => item.isShared === true && item.ownership !== getCurrentUser().uid && !sharedTableIds.includes(item.tableId)).filter(view => view.title.toLowerCase().includes(this.filterString.toLowerCase())).sort((a, b) => a.tableId === b.tableId ? a.id - b.id : a.tableId - b.tableId)
},
getSharedTables() {
return this.getFilteredTables.filter((item) => { return item.isShared === true && item.ownership !== getCurrentUser().uid }).sort((a, b) => a.title.localeCompare(b.title))
return this.getFilteredTables.filter((item) => {
return item.isShared === true && item.ownership !== getCurrentUser().uid
}).sort((a, b) => a.title.localeCompare(b.title))
},
getOwnTables() {
return this.getFilteredTables.filter((item) => { return item.isShared === false || item.ownership === getCurrentUser().uid }).sort((a, b) => a.title.localeCompare(b.title))
return this.getFilteredTables.filter((item) => {
return item.isShared === false || item.ownership === getCurrentUser().uid
}).sort((a, b) => a.title.localeCompare(b.title))
},
getArchivedTables() {
return this.getFilteredTables.filter(item => {
return item.archived
}).sort((a, b) => a.title.localeCompare(b.title))
},
getFilteredTables() {
return this.tables.filter(table => {
Expand All @@ -118,11 +143,6 @@ export default {
}
})
},
getArchivedTables() {
return this.tables.filter(item => {
return item.archived
})
},
},
methods: {
createTable() {
Expand Down

0 comments on commit ca50f4e

Please sign in to comment.