Preserve translation strings when duplicating a field (#21648)

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
Florian C. Wachmann
2024-03-01 11:53:53 +01:00
committed by GitHub
parent 001ec2e8d5
commit 7209df3501
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Ensured that translation strings are preserved when duplicating a field

View File

@@ -1,7 +1,6 @@
<script setup lang="ts">
import { useFieldsStore } from '@/stores/fields';
import { hideDragImage } from '@/utils/hide-drag-image';
import { useCollection } from '@directus/composables';
import { Field, LocalType } from '@directus/types';
import { isNil, orderBy } from 'lodash';
import { computed, toRefs } from 'vue';
@@ -16,8 +15,10 @@ const props = defineProps<{
const { t } = useI18n();
const { collection } = toRefs(props);
const { fields } = useCollection(collection);
const fieldsStore = useFieldsStore();
fieldsStore.hydrate({ skipTranslation: true });
const fields = computed(() => fieldsStore.getFieldsForCollectionSorted(collection.value));
const parsedFields = computed(() => {
return orderBy(fields.value, [(o) => (o.meta?.sort ? Number(o.meta?.sort) : null), (o) => o.meta?.id]).filter(