mirror of
https://github.com/directus/directus.git
synced 2026-01-26 20:27:58 -05:00
Merge pull request #302 from directus/hide-alias
Hide display tab when editing alias
This commit is contained in:
@@ -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' ||
|
||||
|
||||
Reference in New Issue
Block a user