Fix "Show Hidden Collection" context menu in collections navigation (#8889)

* fix collection navigation for context menu hitbox

* fix "show hidden collections" in collection nav

* Fix overflow issues in large collection sets

Nothing a bit of flex-tape can't fix

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Azri Kahar
2021-10-19 00:14:24 +08:00
committed by GitHub
parent 69d9e3adfc
commit c88db66282
2 changed files with 13 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="collections-navigation">
<div class="collections-navigation-wrapper">
<div v-if="showSearch" class="search-input">
<v-input v-model="search" type="search" :placeholder="t('search_collection')" />
</div>
@@ -64,8 +64,9 @@ export default defineComponent({
const contextMenuTarget = ref<undefined | string>();
const rootItems = computed(() => {
const shownCollections = showHidden.value ? collectionsStore.allCollections : collectionsStore.visibleCollections;
return orderBy(
collectionsStore.visibleCollections.filter((collection) => {
shownCollections.filter((collection) => {
return isNil(collection?.meta?.group);
}),
['meta.sort', 'collection']
@@ -110,9 +111,17 @@ export default defineComponent({
}
}
.collections-navigation-wrapper {
display: flex;
flex-direction: column;
min-height: 100%;
}
.collections-navigation {
--v-list-min-height: calc(100% - 64px);
flex-grow: 1;
.v-detail {
:deep(.v-divider) {
margin: 0px;

View File

@@ -23,10 +23,8 @@ export const useCollectionsStore = defineStore({
.filter(({ collection }) => collection.startsWith('directus_') === false)
.filter((collection) => collection.meta?.hidden !== true);
},
hiddenCollections(): Collection[] {
return this.collections
.filter(({ collection }) => collection.startsWith('directus_') === false)
.filter((collection) => collection.meta?.hidden !== false);
allCollections(): Collection[] {
return this.collections.filter(({ collection }) => collection.startsWith('directus_') === false);
},
crudSafeSystemCollections(): Collection[] {
return orderBy(