Make folders hidden by default in system collection interface (#18362)

* make folders hidden by default in system collection interface

* Create green-stingrays-shake.md

* Remove prop

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
Nitwel
2023-05-02 21:17:58 +02:00
committed by GitHub
parent 1fba5ebf94
commit 2432306fea
2 changed files with 16 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/app": patch
---
Made folders hidden by default in system collection-chooser interface

View File

@@ -9,8 +9,8 @@
</template>
<script lang="ts">
import { defineComponent, computed } from 'vue';
import { useCollectionsStore } from '@/stores/collections';
import { computed, defineComponent } from 'vue';
import { useI18n } from 'vue-i18n';
export default defineComponent({
@@ -52,10 +52,16 @@ export default defineComponent({
});
const items = computed(() => {
return collections.value.map((collection) => ({
text: collection.name,
value: collection.collection,
}));
return collections.value.reduce<{ text: string; value: string }[]>((acc, collection) => {
if (collection.type !== 'alias') {
acc.push({
text: collection.name,
value: collection.collection,
});
}
return acc;
}, []);
});
return { items, t };