mirror of
https://github.com/directus/directus.git
synced 2026-01-30 00:37:55 -05:00
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:
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user