mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Filter related collections if meta is not set (#20756)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
5
.changeset/green-teachers-swim.md
Normal file
5
.changeset/green-teachers-swim.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@directus/app": patch
|
||||
---
|
||||
|
||||
Ensured unconfigured tables are not displayed/selectable as releated collection
|
||||
@@ -34,14 +34,17 @@ const currentPrimaryKey = computed(() => fieldsStore.getPrimaryKeyFieldForCollec
|
||||
|
||||
const availableCollections = computed(() => {
|
||||
return [
|
||||
...orderBy(collectionsStore.databaseCollections, ['collection'], ['asc']),
|
||||
...orderBy(
|
||||
collectionsStore.databaseCollections.filter((collection) => collection.meta),
|
||||
['meta.sort', 'collection'],
|
||||
),
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
collection: t('system'),
|
||||
selectable: false,
|
||||
children: orderBy(collectionsStore.crudSafeSystemCollections, ['collection'], ['asc']),
|
||||
children: collectionsStore.crudSafeSystemCollections,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
@@ -22,14 +22,17 @@ const oneAllowedCollections = syncFieldDetailStoreProperty('relations.m2o.meta.o
|
||||
|
||||
const availableCollections = computed(() => {
|
||||
return [
|
||||
...orderBy(collectionsStore.databaseCollections, ['collection'], ['asc']),
|
||||
...orderBy(
|
||||
collectionsStore.databaseCollections.filter((collection) => collection.meta),
|
||||
['meta.sort', 'collection'],
|
||||
),
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
collection: t('system'),
|
||||
selectable: false,
|
||||
children: orderBy(collectionsStore.crudSafeSystemCollections, ['collection'], ['asc']),
|
||||
children: collectionsStore.crudSafeSystemCollections,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
@@ -19,7 +19,10 @@ const collectionExists = computed(() => {
|
||||
});
|
||||
|
||||
const availableCollections = computed(() => {
|
||||
return orderBy(collectionsStore.databaseCollections, ['sort', 'collection'], ['asc']);
|
||||
return orderBy(
|
||||
collectionsStore.databaseCollections.filter((collection) => collection.meta),
|
||||
['meta.sort', 'collection'],
|
||||
);
|
||||
});
|
||||
|
||||
const systemCollections = collectionsStore.crudSafeSystemCollections;
|
||||
|
||||
@@ -21,7 +21,7 @@ const { t } = useI18n();
|
||||
|
||||
const collectionsStore = useCollectionsStore();
|
||||
|
||||
const regularCollections = computed(() => collectionsStore.databaseCollections);
|
||||
const regularCollections = computed(() => orderBy(collectionsStore.databaseCollections, ['meta.sort', 'collection']));
|
||||
|
||||
const systemCollections = computed(() =>
|
||||
orderBy(
|
||||
|
||||
@@ -33,8 +33,7 @@ export const useCollectionsStore = defineStore('collectionsStore', () => {
|
||||
collections.value.filter((collection) => {
|
||||
return collection.collection.startsWith('directus_') === true;
|
||||
}),
|
||||
['collection'],
|
||||
['asc'],
|
||||
'collection',
|
||||
).filter((collection) => COLLECTIONS_DENY_LIST.includes(collection.collection) === false),
|
||||
);
|
||||
|
||||
|
||||
@@ -103,3 +103,4 @@
|
||||
- mahendraHegde
|
||||
- nassan
|
||||
- emahuni
|
||||
- khako
|
||||
|
||||
Reference in New Issue
Block a user