mirror of
https://github.com/directus/directus.git
synced 2026-01-30 19:37:55 -05:00
Fix translations display shown in m2m (#8844)
* fix translations display shown in m2m * Update app/src/modules/settings/routes/data-model/field-detail/store.ts Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -8,4 +8,5 @@ export default defineDisplay({
|
||||
component: ({ value }) => String(value),
|
||||
options: [],
|
||||
types: TYPES,
|
||||
groups: ['file', 'files', 'group', 'm2a', 'm2m', 'm2o', 'o2m', 'presentation', 'standard', 'translations'],
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ export default defineDisplay({
|
||||
component: DisplayRelatedValues,
|
||||
options: options,
|
||||
types: ['alias', 'string', 'uuid', 'integer', 'bigInteger', 'json'],
|
||||
groups: ['m2m', 'm2o', 'o2m'],
|
||||
groups: ['m2m', 'm2o', 'o2m', 'translations', 'm2a'],
|
||||
fields: (options: Options | null, { field, collection }) => {
|
||||
const relatedCollection = getRelatedCollection(collection, field);
|
||||
const fieldsStore = useFieldsStore();
|
||||
|
||||
@@ -17,8 +17,8 @@ export default defineDisplay({
|
||||
icon: 'translate',
|
||||
component: DisplayTranslations,
|
||||
options: options,
|
||||
types: ['alias', 'string', 'uuid', 'integer', 'bigInteger', 'json'],
|
||||
groups: ['m2m'],
|
||||
types: ['alias'],
|
||||
groups: ['translations'],
|
||||
fields: (options: Options | null, { field, collection }) => {
|
||||
const fieldsStore = useFieldsStore();
|
||||
const relationsStore = useRelationsStore();
|
||||
|
||||
@@ -71,7 +71,7 @@ function initLocalStore(collection: string, field: string, type: LocalType): voi
|
||||
return displays.value
|
||||
.filter((inter: DisplayConfig) => {
|
||||
const matchesType = inter.types.includes(state.fieldData?.type || 'alias');
|
||||
const matchesLocalType = (inter.groups || ['standard']).includes(type) || true;
|
||||
const matchesLocalType = (inter.groups || ['standard']).includes(type);
|
||||
|
||||
return matchesType && matchesLocalType;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user