Merge pull request #302 from directus/hide-alias

Hide display tab when editing alias
This commit is contained in:
Rijk van Zanten
2020-09-15 12:20:06 -04:00
committed by GitHub

View File

@@ -155,12 +155,15 @@ export default defineComponent({
value: 'interface',
disabled: interfaceDisplayDisabled(),
},
{
];
if (state.fieldData.type !== 'alias' && localType.value !== 'presentation') {
tabs.push({
text: i18n.t('display'),
value: 'display',
disabled: interfaceDisplayDisabled(),
},
];
});
}
if (['o2m', 'm2o', 'm2m', 'files'].includes(localType.value)) {
tabs.splice(1, 0, {
@@ -305,9 +308,14 @@ export default defineComponent({
}
if (relations.length === 2) {
const relationForCurrent = relations.find((relation: Relation) => (relation.many_collection === collection && relation.many_field === field) || (relation.one_collection === collection && relation.one_field === field));
const relationForCurrent = relations.find(
(relation: Relation) =>
(relation.many_collection === collection && relation.many_field === field) ||
(relation.one_collection === collection && relation.one_field === field)
);
if (relationForCurrent?.many_collection === collection && relationForCurrent?.many_field === field) return 'm2o';
if (relationForCurrent?.many_collection === collection && relationForCurrent?.many_field === field)
return 'm2o';
if (
relations[0].one_collection === 'directus_files' ||