App: Do not allow to link folders to M2A relationship (#14952)

* Do not allow to link `folders` to M2A relationship

* Apply same getter to another relations
This commit is contained in:
José Varela
2022-08-08 19:11:31 +01:00
committed by GitHub
parent 2b8a2f10cc
commit 36c824e364
5 changed files with 7 additions and 14 deletions

View File

@@ -191,7 +191,7 @@ export default defineComponent({
const availableCollections = computed(() => {
return orderBy(
[
...collectionsStore.allCollections,
...collectionsStore.databaseCollections,
{
divider: true,
},

View File

@@ -97,7 +97,7 @@ export default defineComponent({
const availableCollections = computed(() => {
return orderBy(
[
...collectionsStore.allCollections,
...collectionsStore.databaseCollections,
{
divider: true,
},

View File

@@ -81,13 +81,7 @@ export default defineComponent({
});
const availableCollections = computed(() => {
return orderBy(
collectionsStore.collections.filter((collection) => {
return collection.collection.startsWith('directus_') === false && collection.schema;
}),
['sort', 'collection'],
['asc']
);
return orderBy(collectionsStore.databaseCollections, ['sort', 'collection'], ['asc']);
});
const systemCollections = collectionsStore.crudSafeSystemCollections;

View File

@@ -96,11 +96,7 @@ export default defineComponent({
const collectionsStore = useCollectionsStore();
const regularCollections = computed(() =>
collectionsStore.collections.filter(
(collection) => collection.collection.startsWith('directus_') === false && collection.schema
)
);
const regularCollections = computed(() => collectionsStore.databaseCollections);
const systemCollections = computed(() =>
orderBy(

View File

@@ -26,6 +26,9 @@ export const useCollectionsStore = defineStore({
allCollections(): Collection[] {
return this.collections.filter(({ collection }) => collection.startsWith('directus_') === false);
},
databaseCollections(): Collection[] {
return this.allCollections.filter((collection) => collection.schema);
},
crudSafeSystemCollections(): Collection[] {
return orderBy(
this.collections.filter((collection) => {