diff --git a/app/src/interfaces/many-to-many/many-to-many.vue b/app/src/interfaces/many-to-many/many-to-many.vue
index a90945169a..cb0c823b9a 100644
--- a/app/src/interfaces/many-to-many/many-to-many.vue
+++ b/app/src/interfaces/many-to-many/many-to-many.vue
@@ -39,7 +39,7 @@
- {{ $t('create_new') }}
+ {{ $t('create_new') }}
{{ $t('add_existing') }}
@@ -67,11 +67,21 @@
@input="stageSelection"
multiple
/>
+
+
+
+ {{ $t('upload_file') }}
+
+
+ {{ $t('done') }}
+
+
+
diff --git a/app/src/views/private/components/drawer-item/drawer-item.vue b/app/src/views/private/components/drawer-item/drawer-item.vue
index aba513fdcc..234d7f047d 100644
--- a/app/src/views/private/components/drawer-item/drawer-item.vue
+++ b/app/src/views/private/components/drawer-item/drawer-item.vue
@@ -180,7 +180,7 @@ export default defineComponent({
null
);
- const { file } = useFile();
+ const { file, isDirectusFiles } = useFile();
return {
_active,
@@ -203,25 +203,24 @@ export default defineComponent({
templateDataLoading,
collectionInfo,
file,
+ isDirectusFiles,
};
function useFile() {
- const file = ref(null);
-
- watch([() => item.value, () => junctionRelatedCollection.value], () => {
- const junctionItem = item.value;
-
- if (junctionRelatedCollection.value === 'directus_files') {
- const item = junctionItem?.[props.junctionField];
- const src = addTokenToURL(getRootPath() + `assets/${item.id}?key=system-large-contain`);
-
- file.value = { ...item, src };
- } else {
- file.value = null;
- }
+ const isDirectusFiles = computed(() => {
+ return junctionRelatedCollection.value === 'directus_files';
});
- return { file };
+ const file = computed(() => {
+ if (isDirectusFiles.value === false || !item.value) return null;
+ const fileData = item.value?.[props.junctionField];
+ if (!fileData) return null;
+
+ const src = addTokenToURL(getRootPath() + `assets/${fileData.id}?key=system-large-contain`);
+ return { ...fileData, src };
+ });
+
+ return { file, isDirectusFiles };
}
function useActiveState() {
diff --git a/app/src/views/private/components/file-preview/file-preview.vue b/app/src/views/private/components/file-preview/file-preview.vue
index be3789eab8..1fb84e423f 100644
--- a/app/src/views/private/components/file-preview/file-preview.vue
+++ b/app/src/views/private/components/file-preview/file-preview.vue
@@ -6,15 +6,7 @@
:class="{ svg: isSVG, 'max-size': inModal === false }"
@click="$emit('click')"
>
-
+
@@ -93,7 +85,7 @@ img,
video,
audio {
width: 100%;
- max-height: 100%;
+ max-height: 500px;
object-fit: contain;
border-radius: var(--border-radius);
}
@@ -112,7 +104,6 @@ audio {
img {
z-index: 1;
display: block;
- max-height: inherit;
margin: 0 auto;
}