Merge pull request #231 from directus/m2m-fix

m2m fix option missing and junction primaryField selectable
This commit is contained in:
Rijk van Zanten
2020-09-09 13:07:02 -04:00
committed by GitHub
2 changed files with 17 additions and 2 deletions

View File

@@ -8,6 +8,19 @@ export default defineInterface(({ i18n }) => ({
component: InterfaceManyToMany,
relationship: 'm2m',
types: ['alias'],
options: [],
options: [
{
field: 'fields',
type: 'json',
name: i18n.tc('field', 0),
meta: {
interface: 'tags',
width: 'full',
options: {
placeholder: i18n.t('readable_fields_copy'),
},
},
},
],
recommendedDisplays: ['related-values'],
}));

View File

@@ -110,7 +110,9 @@ export default defineComponent({
text: field.field,
value: field.field,
disabled:
state.relations[0].many_field === field.field || state.relations[1].many_field === field.field,
state.relations[0].many_field === field.field ||
field.schema?.is_primary_key ||
state.relations[1].many_field === field.field,
}));
});